generativelanguage

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package generativelanguage provides access to the Generative Language API.

For product documentation, see: https://developers.generativeai.google/api

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

Creating a client

Usage example:

import "google.golang.org/api/generativelanguage/v1beta"
...
ctx := context.Background()
generativelanguageService, err := generativelanguage.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication. For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:

generativelanguageService, err := generativelanguage.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
generativelanguageService, err := generativelanguage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributionSourceId

type AttributionSourceId struct {
	// GroundingPassage: Identifier for an inline passage.
	GroundingPassage *GroundingPassageId `json:"groundingPassage,omitempty"`

	// SemanticRetrieverChunk: Identifier for a `Chunk` fetched via Semantic
	// Retriever.
	SemanticRetrieverChunk *SemanticRetrieverChunk `json:"semanticRetrieverChunk,omitempty"`

	// ForceSendFields is a list of field names (e.g. "GroundingPassage") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "GroundingPassage") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

AttributionSourceId: Identifier for the source contributing to this attribution.

func (*AttributionSourceId) MarshalJSON

func (s *AttributionSourceId) MarshalJSON() ([]byte, error)

type BatchCreateChunksRequest

type BatchCreateChunksRequest struct {
	// Requests: Required. The request messages specifying the `Chunk`s to
	// create. A maximum of 100 `Chunk`s can be created in a batch.
	Requests []*CreateChunkRequest `json:"requests,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Requests") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Requests") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchCreateChunksRequest: Request to batch create `Chunk`s.

func (*BatchCreateChunksRequest) MarshalJSON

func (s *BatchCreateChunksRequest) MarshalJSON() ([]byte, error)

type BatchCreateChunksResponse

type BatchCreateChunksResponse struct {
	// Chunks: `Chunk`s created.
	Chunks []*Chunk `json:"chunks,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Chunks") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Chunks") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchCreateChunksResponse: Response from `BatchCreateChunks` containing a list of created `Chunk`s.

func (*BatchCreateChunksResponse) MarshalJSON

func (s *BatchCreateChunksResponse) MarshalJSON() ([]byte, error)

type BatchDeleteChunksRequest

type BatchDeleteChunksRequest struct {
	// Requests: Required. The request messages specifying the `Chunk`s to
	// delete.
	Requests []*DeleteChunkRequest `json:"requests,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Requests") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Requests") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchDeleteChunksRequest: Request to batch delete `Chunk`s.

func (*BatchDeleteChunksRequest) MarshalJSON

func (s *BatchDeleteChunksRequest) MarshalJSON() ([]byte, error)

type BatchEmbedContentsRequest

type BatchEmbedContentsRequest struct {
	// Requests: Required. Embed requests for the batch. The model in each
	// of these requests must match the model specified
	// `BatchEmbedContentsRequest.model`.
	Requests []*EmbedContentRequest `json:"requests,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Requests") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Requests") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchEmbedContentsRequest: Batch request to get embeddings from the model for a list of prompts.

func (*BatchEmbedContentsRequest) MarshalJSON

func (s *BatchEmbedContentsRequest) MarshalJSON() ([]byte, error)

type BatchEmbedContentsResponse

type BatchEmbedContentsResponse struct {
	// Embeddings: Output only. The embeddings for each request, in the same
	// order as provided in the batch request.
	Embeddings []*ContentEmbedding `json:"embeddings,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Embeddings") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Embeddings") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchEmbedContentsResponse: The response to a `BatchEmbedContentsRequest`.

func (*BatchEmbedContentsResponse) MarshalJSON

func (s *BatchEmbedContentsResponse) MarshalJSON() ([]byte, error)

type BatchEmbedTextRequest

type BatchEmbedTextRequest struct {
	// Requests: Optional. Embed requests for the batch. Only one of `texts`
	// or `requests` can be set.
	Requests []*EmbedTextRequest `json:"requests,omitempty"`

	// Texts: Optional. The free-form input texts that the model will turn
	// into an embedding. The current limit is 100 texts, over which an
	// error will be thrown.
	Texts []string `json:"texts,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Requests") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Requests") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchEmbedTextRequest: Batch request to get a text embedding from the model.

func (*BatchEmbedTextRequest) MarshalJSON

func (s *BatchEmbedTextRequest) MarshalJSON() ([]byte, error)

type BatchEmbedTextResponse

type BatchEmbedTextResponse struct {
	// Embeddings: Output only. The embeddings generated from the input
	// text.
	Embeddings []*Embedding `json:"embeddings,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Embeddings") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Embeddings") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchEmbedTextResponse: The response to a EmbedTextRequest.

func (*BatchEmbedTextResponse) MarshalJSON

func (s *BatchEmbedTextResponse) MarshalJSON() ([]byte, error)

type BatchUpdateChunksRequest

type BatchUpdateChunksRequest struct {
	// Requests: Required. The request messages specifying the `Chunk`s to
	// update. A maximum of 100 `Chunk`s can be updated in a batch.
	Requests []*UpdateChunkRequest `json:"requests,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Requests") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Requests") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchUpdateChunksRequest: Request to batch update `Chunk`s.

func (*BatchUpdateChunksRequest) MarshalJSON

func (s *BatchUpdateChunksRequest) MarshalJSON() ([]byte, error)

type BatchUpdateChunksResponse

type BatchUpdateChunksResponse struct {
	// Chunks: `Chunk`s updated.
	Chunks []*Chunk `json:"chunks,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Chunks") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Chunks") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BatchUpdateChunksResponse: Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.

func (*BatchUpdateChunksResponse) MarshalJSON

func (s *BatchUpdateChunksResponse) MarshalJSON() ([]byte, error)

type Blob

type Blob struct {
	// Data: Raw bytes for media formats.
	Data string `json:"data,omitempty"`

	// MimeType: The IANA standard MIME type of the source data. Accepted
	// types include: "image/png", "image/jpeg", "image/heic", "image/heif",
	// "image/webp".
	MimeType string `json:"mimeType,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Data") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Data") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Blob: Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.

func (*Blob) MarshalJSON

func (s *Blob) MarshalJSON() ([]byte, error)

type Candidate

type Candidate struct {
	// CitationMetadata: Output only. Citation information for
	// model-generated candidate. This field may be populated with
	// recitation information for any text included in the `content`. These
	// are passages that are "recited" from copyrighted material in the
	// foundational LLM's training data.
	CitationMetadata *CitationMetadata `json:"citationMetadata,omitempty"`

	// Content: Output only. Generated content returned from the model.
	Content *Content `json:"content,omitempty"`

	// FinishReason: Optional. Output only. The reason why the model stopped
	// generating tokens. If empty, the model has not stopped generating the
	// tokens.
	//
	// Possible values:
	//   "FINISH_REASON_UNSPECIFIED" - Default value. This value is unused.
	//   "STOP" - Natural stop point of the model or provided stop sequence.
	//   "MAX_TOKENS" - The maximum number of tokens as specified in the
	// request was reached.
	//   "SAFETY" - The candidate content was flagged for safety reasons.
	//   "RECITATION" - The candidate content was flagged for recitation
	// reasons.
	//   "OTHER" - Unknown reason.
	FinishReason string `json:"finishReason,omitempty"`

	// GroundingAttributions: Output only. Attribution information for
	// sources that contributed to a grounded answer. This field is
	// populated for `GenerateAnswer` calls.
	GroundingAttributions []*GroundingAttribution `json:"groundingAttributions,omitempty"`

	// Index: Output only. Index of the candidate in the list of candidates.
	Index int64 `json:"index,omitempty"`

	// SafetyRatings: List of ratings for the safety of a response
	// candidate. There is at most one rating per category.
	SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`

	// TokenCount: Output only. Token count for this candidate.
	TokenCount int64 `json:"tokenCount,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CitationMetadata") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CitationMetadata") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

Candidate: A response candidate generated from the model.

func (*Candidate) MarshalJSON

func (s *Candidate) MarshalJSON() ([]byte, error)

type Chunk

type Chunk struct {
	// CreateTime: Output only. The Timestamp of when the `Chunk` was
	// created.
	CreateTime string `json:"createTime,omitempty"`

	// CustomMetadata: Optional. User provided custom metadata stored as
	// key-value pairs. The maximum number of `CustomMetadata` per chunk is
	// 20.
	CustomMetadata []*CustomMetadata `json:"customMetadata,omitempty"`

	// Data: Required. The content for the `Chunk`, such as the text string.
	// The maximum number of tokens per chunk is 2043.
	Data *ChunkData `json:"data,omitempty"`

	// Name: Immutable. Identifier. The `Chunk` resource name. The ID (name
	// excluding the "corpora/*/documents/*/chunks/" prefix) can contain up
	// to 40 characters that are lowercase alphanumeric or dashes (-). The
	// ID cannot start or end with a dash. If the name is empty on create, a
	// random 12-character unique ID will be generated. Example:
	// `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`
	Name string `json:"name,omitempty"`

	// State: Output only. Current state of the `Chunk`.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - The default value. This value is used if the
	// state is omitted.
	//   "STATE_PENDING_PROCESSING" - `Chunk` is being processed (embedding
	// and vector storage).
	//   "STATE_ACTIVE" - `Chunk` is processed and available for querying.
	//   "STATE_FAILED" - `Chunk` failed processing.
	State string `json:"state,omitempty"`

	// UpdateTime: Output only. The Timestamp of when the `Chunk` was last
	// updated.
	UpdateTime string `json:"updateTime,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CreateTime") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Chunk: A `Chunk` is a subpart of a `Document` that is treated as an independent unit for the purposes of vector representation and storage. A `Corpus` can have a maximum of 1 million `Chunk`s.

func (*Chunk) MarshalJSON

func (s *Chunk) MarshalJSON() ([]byte, error)

type ChunkData

type ChunkData struct {
	// StringValue: The `Chunk` content as a string. The maximum number of
	// tokens per chunk is 2043.
	StringValue string `json:"stringValue,omitempty"`

	// ForceSendFields is a list of field names (e.g. "StringValue") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "StringValue") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ChunkData: Extracted data that represents the `Chunk` content.

func (*ChunkData) MarshalJSON

func (s *ChunkData) MarshalJSON() ([]byte, error)

type CitationMetadata

type CitationMetadata struct {
	// CitationSources: Citations to sources for a specific response.
	CitationSources []*CitationSource `json:"citationSources,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CitationSources") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CitationSources") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

CitationMetadata: A collection of source attributions for a piece of content.

func (*CitationMetadata) MarshalJSON

func (s *CitationMetadata) MarshalJSON() ([]byte, error)

type CitationSource

type CitationSource struct {
	// EndIndex: Optional. End of the attributed segment, exclusive.
	EndIndex int64 `json:"endIndex,omitempty"`

	// License: Optional. License for the GitHub project that is attributed
	// as a source for segment. License info is required for code citations.
	License string `json:"license,omitempty"`

	// StartIndex: Optional. Start of segment of the response that is
	// attributed to this source. Index indicates the start of the segment,
	// measured in bytes.
	StartIndex int64 `json:"startIndex,omitempty"`

	// Uri: Optional. URI that is attributed as a source for a portion of
	// the text.
	Uri string `json:"uri,omitempty"`

	// ForceSendFields is a list of field names (e.g. "EndIndex") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "EndIndex") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CitationSource: A citation to a source for a portion of a specific response.

func (*CitationSource) MarshalJSON

func (s *CitationSource) MarshalJSON() ([]byte, error)

type Condition

type Condition struct {
	// NumericValue: The numeric value to filter the metadata on.
	NumericValue float64 `json:"numericValue,omitempty"`

	// Operation: Required. Operator applied to the given key-value pair to
	// trigger the condition.
	//
	// Possible values:
	//   "OPERATOR_UNSPECIFIED" - The default value. This value is unused.
	//   "LESS" - Supported by numeric.
	//   "LESS_EQUAL" - Supported by numeric.
	//   "EQUAL" - Supported by numeric & string.
	//   "GREATER_EQUAL" - Supported by numeric.
	//   "GREATER" - Supported by numeric.
	//   "NOT_EQUAL" - Supported by numeric & string.
	//   "INCLUDES" - Supported by string only when `CustomMetadata` value
	// type for the given key has a `string_list_value`.
	//   "EXCLUDES" - Supported by string only when `CustomMetadata` value
	// type for the given key has a `string_list_value`.
	Operation string `json:"operation,omitempty"`

	// StringValue: The string value to filter the metadata on.
	StringValue string `json:"stringValue,omitempty"`

	// ForceSendFields is a list of field names (e.g. "NumericValue") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NumericValue") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Condition: Filter condition applicable to a single key.

func (*Condition) MarshalJSON

func (s *Condition) MarshalJSON() ([]byte, error)

func (*Condition) UnmarshalJSON

func (s *Condition) UnmarshalJSON(data []byte) error

type Content

type Content struct {
	// Parts: Ordered `Parts` that constitute a single message. Parts may
	// have different MIME types.
	Parts []*Part `json:"parts,omitempty"`

	// Role: Optional. The producer of the content. Must be either 'user' or
	// 'model'. Useful to set for multi-turn conversations, otherwise can be
	// left blank or unset.
	Role string `json:"role,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Parts") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Parts") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Content: The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.

func (*Content) MarshalJSON

func (s *Content) MarshalJSON() ([]byte, error)

type ContentEmbedding

type ContentEmbedding struct {
	// Values: The embedding values.
	Values []float64 `json:"values,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Values") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Values") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ContentEmbedding: A list of floats representing an embedding.

func (*ContentEmbedding) MarshalJSON

func (s *ContentEmbedding) MarshalJSON() ([]byte, error)

func (*ContentEmbedding) UnmarshalJSON

func (s *ContentEmbedding) UnmarshalJSON(data []byte) error

type ContentFilter

type ContentFilter struct {
	// Message: A string that describes the filtering behavior in more
	// detail.
	Message string `json:"message,omitempty"`

	// Reason: The reason content was blocked during request processing.
	//
	// Possible values:
	//   "BLOCKED_REASON_UNSPECIFIED" - A blocked reason was not specified.
	//   "SAFETY" - Content was blocked by safety settings.
	//   "OTHER" - Content was blocked, but the reason is uncategorized.
	Reason string `json:"reason,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Message") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Message") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ContentFilter: Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.

func (*ContentFilter) MarshalJSON

func (s *ContentFilter) MarshalJSON() ([]byte, error)

type CorporaCreateCall

type CorporaCreateCall struct {
	// contains filtered or unexported fields
}

func (*CorporaCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaCreateCall) Do

func (c *CorporaCreateCall) Do(opts ...googleapi.CallOption) (*Corpus, error)

Do executes the "generativelanguage.corpora.create" call. Exactly one of *Corpus or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Corpus.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaCreateCall) Header

func (c *CorporaCreateCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDeleteCall

type CorporaDeleteCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDeleteCall) Do

func (c *CorporaDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)

Do executes the "generativelanguage.corpora.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDeleteCall) Force

func (c *CorporaDeleteCall) Force(force bool) *CorporaDeleteCall

Force sets the optional parameter "force": If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.

func (*CorporaDeleteCall) Header

func (c *CorporaDeleteCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsChunksBatchCreateCall

type CorporaDocumentsChunksBatchCreateCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksBatchCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksBatchCreateCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.batchCreate" call. Exactly one of *BatchCreateChunksResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *BatchCreateChunksResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksBatchCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksBatchCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsChunksBatchDeleteCall

type CorporaDocumentsChunksBatchDeleteCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksBatchDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksBatchDeleteCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.batchDelete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksBatchDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksBatchDeleteCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsChunksBatchUpdateCall

type CorporaDocumentsChunksBatchUpdateCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksBatchUpdateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksBatchUpdateCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.batchUpdate" call. Exactly one of *BatchUpdateChunksResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *BatchUpdateChunksResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksBatchUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksBatchUpdateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsChunksCreateCall

type CorporaDocumentsChunksCreateCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksCreateCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.create" call. Exactly one of *Chunk or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Chunk.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsChunksDeleteCall

type CorporaDocumentsChunksDeleteCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksDeleteCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksDeleteCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsChunksGetCall

type CorporaDocumentsChunksGetCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksGetCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.get" call. Exactly one of *Chunk or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Chunk.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksGetCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaDocumentsChunksGetCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type CorporaDocumentsChunksListCall

type CorporaDocumentsChunksListCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksListCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.list" call. Exactly one of *ListChunksResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListChunksResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksListCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaDocumentsChunksListCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*CorporaDocumentsChunksListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `Chunk`s to return (per page). The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum size limit is 100 `Chunk`s per page.

func (*CorporaDocumentsChunksListCall) PageToken

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListChunks` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListChunks` must match the call that provided the page token.

func (*CorporaDocumentsChunksListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type CorporaDocumentsChunksPatchCall

type CorporaDocumentsChunksPatchCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsChunksPatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsChunksPatchCall) Do

Do executes the "generativelanguage.corpora.documents.chunks.patch" call. Exactly one of *Chunk or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Chunk.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsChunksPatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsChunksPatchCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaDocumentsChunksPatchCall) UpdateMask

UpdateMask sets the optional parameter "updateMask": Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.

type CorporaDocumentsChunksService

type CorporaDocumentsChunksService struct {
	// contains filtered or unexported fields
}

func NewCorporaDocumentsChunksService

func NewCorporaDocumentsChunksService(s *Service) *CorporaDocumentsChunksService

func (*CorporaDocumentsChunksService) BatchCreate

BatchCreate: Batch create `Chunk`s.

  • parent: Optional. The name of the `Document` where this batch of `Chunk`s will be created. The parent field in every `CreateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

func (*CorporaDocumentsChunksService) BatchDelete

BatchDelete: Batch delete `Chunk`s.

  • parent: Optional. The name of the `Document` containing the `Chunk`s to delete. The parent field in every `DeleteChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

func (*CorporaDocumentsChunksService) BatchUpdate

BatchUpdate: Batch update `Chunk`s.

  • parent: Optional. The name of the `Document` containing the `Chunk`s to update. The parent field in every `UpdateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

func (*CorporaDocumentsChunksService) Create

Create: Creates a `Chunk`.

  • parent: The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

func (*CorporaDocumentsChunksService) Delete

Delete: Deletes a `Chunk`.

  • name: The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`.

func (*CorporaDocumentsChunksService) Get

Get: Gets information about a specific `Chunk`.

  • name: The name of the `Chunk` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`.

func (*CorporaDocumentsChunksService) List

List: Lists all `Chunk`s in a `Document`.

  • parent: The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

func (*CorporaDocumentsChunksService) Patch

Patch: Updates a `Chunk`.

  • name: Immutable. Identifier. The `Chunk` resource name. The ID (name excluding the "corpora/*/documents/*/chunks/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`.

type CorporaDocumentsCreateCall

type CorporaDocumentsCreateCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsCreateCall) Do

Do executes the "generativelanguage.corpora.documents.create" call. Exactly one of *Document or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Document.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsDeleteCall

type CorporaDocumentsDeleteCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsDeleteCall) Do

Do executes the "generativelanguage.corpora.documents.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsDeleteCall) Force

Force sets the optional parameter "force": If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.

func (*CorporaDocumentsDeleteCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsGetCall

type CorporaDocumentsGetCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsGetCall) Do

Do executes the "generativelanguage.corpora.documents.get" call. Exactly one of *Document or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Document.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsGetCall) Header

func (c *CorporaDocumentsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaDocumentsGetCall) IfNoneMatch

func (c *CorporaDocumentsGetCall) IfNoneMatch(entityTag string) *CorporaDocumentsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type CorporaDocumentsListCall

type CorporaDocumentsListCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsListCall) Do

Do executes the "generativelanguage.corpora.documents.list" call. Exactly one of *ListDocumentsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListDocumentsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsListCall) Header

func (c *CorporaDocumentsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaDocumentsListCall) IfNoneMatch

func (c *CorporaDocumentsListCall) IfNoneMatch(entityTag string) *CorporaDocumentsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*CorporaDocumentsListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.

func (*CorporaDocumentsListCall) PageToken

func (c *CorporaDocumentsListCall) PageToken(pageToken string) *CorporaDocumentsListCall

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.

func (*CorporaDocumentsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type CorporaDocumentsPatchCall

type CorporaDocumentsPatchCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsPatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsPatchCall) Do

Do executes the "generativelanguage.corpora.documents.patch" call. Exactly one of *Document or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Document.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsPatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsPatchCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaDocumentsPatchCall) UpdateMask

func (c *CorporaDocumentsPatchCall) UpdateMask(updateMask string) *CorporaDocumentsPatchCall

UpdateMask sets the optional parameter "updateMask": Required. The list of fields to update. Currently, this only supports updating `display_name` and `custom_metadata`.

type CorporaDocumentsQueryCall

type CorporaDocumentsQueryCall struct {
	// contains filtered or unexported fields
}

func (*CorporaDocumentsQueryCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaDocumentsQueryCall) Do

Do executes the "generativelanguage.corpora.documents.query" call. Exactly one of *QueryDocumentResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *QueryDocumentResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaDocumentsQueryCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaDocumentsQueryCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaDocumentsService

type CorporaDocumentsService struct {
	Chunks *CorporaDocumentsChunksService
	// contains filtered or unexported fields
}

func NewCorporaDocumentsService

func NewCorporaDocumentsService(s *Service) *CorporaDocumentsService

func (*CorporaDocumentsService) Create

func (r *CorporaDocumentsService) Create(parent string, document *Document) *CorporaDocumentsCreateCall

Create: Creates an empty `Document`.

  • parent: The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`.

func (*CorporaDocumentsService) Delete

Delete: Deletes a `Document`.

  • name: The resource name of the `Document` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

func (*CorporaDocumentsService) Get

Get: Gets information about a specific `Document`.

  • name: The name of the `Document` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

func (*CorporaDocumentsService) List

List: Lists all `Document`s in a `Corpus`.

  • parent: The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`.

func (*CorporaDocumentsService) Patch

Patch: Updates a `Document`.

  • name: Immutable. Identifier. The `Document` resource name. The ID (name excluding the "corpora/*/documents/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`.

func (*CorporaDocumentsService) Query

func (r *CorporaDocumentsService) Query(name string, querydocumentrequest *QueryDocumentRequest) *CorporaDocumentsQueryCall

Query: Performs semantic search over a `Document`.

  • name: The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`.

type CorporaGetCall

type CorporaGetCall struct {
	// contains filtered or unexported fields
}

func (*CorporaGetCall) Context

func (c *CorporaGetCall) Context(ctx context.Context) *CorporaGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaGetCall) Do

func (c *CorporaGetCall) Do(opts ...googleapi.CallOption) (*Corpus, error)

Do executes the "generativelanguage.corpora.get" call. Exactly one of *Corpus or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Corpus.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaGetCall) Fields

func (c *CorporaGetCall) Fields(s ...googleapi.Field) *CorporaGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaGetCall) Header

func (c *CorporaGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaGetCall) IfNoneMatch

func (c *CorporaGetCall) IfNoneMatch(entityTag string) *CorporaGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type CorporaListCall

type CorporaListCall struct {
	// contains filtered or unexported fields
}

func (*CorporaListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaListCall) Do

Do executes the "generativelanguage.corpora.list" call. Exactly one of *ListCorporaResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListCorporaResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaListCall) Header

func (c *CorporaListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaListCall) IfNoneMatch

func (c *CorporaListCall) IfNoneMatch(entityTag string) *CorporaListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*CorporaListCall) PageSize

func (c *CorporaListCall) PageSize(pageSize int64) *CorporaListCall

PageSize sets the optional parameter "pageSize": The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.

func (*CorporaListCall) PageToken

func (c *CorporaListCall) PageToken(pageToken string) *CorporaListCall

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.

func (*CorporaListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type CorporaPatchCall

type CorporaPatchCall struct {
	// contains filtered or unexported fields
}

func (*CorporaPatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaPatchCall) Do

func (c *CorporaPatchCall) Do(opts ...googleapi.CallOption) (*Corpus, error)

Do executes the "generativelanguage.corpora.patch" call. Exactly one of *Corpus or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Corpus.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaPatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaPatchCall) Header

func (c *CorporaPatchCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaPatchCall) UpdateMask

func (c *CorporaPatchCall) UpdateMask(updateMask string) *CorporaPatchCall

UpdateMask sets the optional parameter "updateMask": Required. The list of fields to update. Currently, this only supports updating `display_name`.

type CorporaPermissionsCreateCall

type CorporaPermissionsCreateCall struct {
	// contains filtered or unexported fields
}

func (*CorporaPermissionsCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaPermissionsCreateCall) Do

Do executes the "generativelanguage.corpora.permissions.create" call. Exactly one of *Permission or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Permission.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaPermissionsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaPermissionsCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaPermissionsDeleteCall

type CorporaPermissionsDeleteCall struct {
	// contains filtered or unexported fields
}

func (*CorporaPermissionsDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaPermissionsDeleteCall) Do

Do executes the "generativelanguage.corpora.permissions.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaPermissionsDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaPermissionsDeleteCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaPermissionsGetCall

type CorporaPermissionsGetCall struct {
	// contains filtered or unexported fields
}

func (*CorporaPermissionsGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaPermissionsGetCall) Do

Do executes the "generativelanguage.corpora.permissions.get" call. Exactly one of *Permission or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Permission.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaPermissionsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaPermissionsGetCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaPermissionsGetCall) IfNoneMatch

func (c *CorporaPermissionsGetCall) IfNoneMatch(entityTag string) *CorporaPermissionsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type CorporaPermissionsListCall

type CorporaPermissionsListCall struct {
	// contains filtered or unexported fields
}

func (*CorporaPermissionsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaPermissionsListCall) Do

Do executes the "generativelanguage.corpora.permissions.list" call. Exactly one of *ListPermissionsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListPermissionsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaPermissionsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaPermissionsListCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaPermissionsListCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*CorporaPermissionsListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.

func (*CorporaPermissionsListCall) PageToken

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.

func (*CorporaPermissionsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type CorporaPermissionsPatchCall

type CorporaPermissionsPatchCall struct {
	// contains filtered or unexported fields
}

func (*CorporaPermissionsPatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaPermissionsPatchCall) Do

Do executes the "generativelanguage.corpora.permissions.patch" call. Exactly one of *Permission or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Permission.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaPermissionsPatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaPermissionsPatchCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*CorporaPermissionsPatchCall) UpdateMask

UpdateMask sets the optional parameter "updateMask": Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)

type CorporaPermissionsService

type CorporaPermissionsService struct {
	// contains filtered or unexported fields
}

func NewCorporaPermissionsService

func NewCorporaPermissionsService(s *Service) *CorporaPermissionsService

func (*CorporaPermissionsService) Create

Create: Create a permission to a specific resource.

  • parent: The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.

func (*CorporaPermissionsService) Delete

Delete: Deletes the permission.

  • name: The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`.

func (*CorporaPermissionsService) Get

Get: Gets information about a specific Permission.

  • name: The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`.

func (*CorporaPermissionsService) List

List: Lists permissions for the specific resource.

  • parent: The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.

func (*CorporaPermissionsService) Patch

Patch: Updates the permission.

  • name: Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.

type CorporaQueryCall

type CorporaQueryCall struct {
	// contains filtered or unexported fields
}

func (*CorporaQueryCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*CorporaQueryCall) Do

Do executes the "generativelanguage.corpora.query" call. Exactly one of *QueryCorpusResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *QueryCorpusResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*CorporaQueryCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*CorporaQueryCall) Header

func (c *CorporaQueryCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type CorporaService

type CorporaService struct {
	Documents *CorporaDocumentsService

	Permissions *CorporaPermissionsService
	// contains filtered or unexported fields
}

func NewCorporaService

func NewCorporaService(s *Service) *CorporaService

func (*CorporaService) Create

func (r *CorporaService) Create(corpus *Corpus) *CorporaCreateCall

Create: Creates an empty `Corpus`.

func (*CorporaService) Delete

func (r *CorporaService) Delete(name string) *CorporaDeleteCall

Delete: Deletes a `Corpus`.

  • name: The resource name of the `Corpus`. Example: `corpora/my-corpus-123`.

func (*CorporaService) Get

func (r *CorporaService) Get(name string) *CorporaGetCall

Get: Gets information about a specific `Corpus`.

- name: The name of the `Corpus`. Example: `corpora/my-corpus-123`.

func (*CorporaService) List

func (r *CorporaService) List() *CorporaListCall

List: Lists all `Corpora` owned by the user.

func (*CorporaService) Patch

func (r *CorporaService) Patch(name string, corpus *Corpus) *CorporaPatchCall

Patch: Updates a `Corpus`.

  • name: Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the "corpora/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`.

func (*CorporaService) Query

func (r *CorporaService) Query(name string, querycorpusrequest *QueryCorpusRequest) *CorporaQueryCall

Query: Performs semantic search over a `Corpus`.

  • name: The name of the `Corpus` to query. Example: `corpora/my-corpus-123`.

type Corpus

type Corpus struct {
	// CreateTime: Output only. The Timestamp of when the `Corpus` was
	// created.
	CreateTime string `json:"createTime,omitempty"`

	// DisplayName: Optional. The human-readable display name for the
	// `Corpus`. The display name must be no more than 512 characters in
	// length, including spaces. Example: "Docs on Semantic Retriever"
	DisplayName string `json:"displayName,omitempty"`

	// Name: Immutable. Identifier. The `Corpus` resource name. The ID (name
	// excluding the "corpora/" prefix) can contain up to 40 characters that
	// are lowercase alphanumeric or dashes (-). The ID cannot start or end
	// with a dash. If the name is empty on create, a unique name will be
	// derived from `display_name` along with a 12 character random suffix.
	// Example: `corpora/my-awesome-corpora-123a456b789c`
	Name string `json:"name,omitempty"`

	// UpdateTime: Output only. The Timestamp of when the `Corpus` was last
	// updated.
	UpdateTime string `json:"updateTime,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CreateTime") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Corpus: A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.

func (*Corpus) MarshalJSON

func (s *Corpus) MarshalJSON() ([]byte, error)

type CountMessageTokensRequest

type CountMessageTokensRequest struct {
	// Prompt: Required. The prompt, whose token count is to be returned.
	Prompt *MessagePrompt `json:"prompt,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Prompt") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Prompt") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CountMessageTokensRequest: Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.

func (*CountMessageTokensRequest) MarshalJSON

func (s *CountMessageTokensRequest) MarshalJSON() ([]byte, error)

type CountMessageTokensResponse

type CountMessageTokensResponse struct {
	// TokenCount: The number of tokens that the `model` tokenizes the
	// `prompt` into. Always non-negative.
	TokenCount int64 `json:"tokenCount,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "TokenCount") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "TokenCount") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CountMessageTokensResponse: A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.

func (*CountMessageTokensResponse) MarshalJSON

func (s *CountMessageTokensResponse) MarshalJSON() ([]byte, error)

type CountTextTokensRequest

type CountTextTokensRequest struct {
	// Prompt: Required. The free-form input text given to the model as a
	// prompt.
	Prompt *TextPrompt `json:"prompt,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Prompt") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Prompt") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CountTextTokensRequest: Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.

func (*CountTextTokensRequest) MarshalJSON

func (s *CountTextTokensRequest) MarshalJSON() ([]byte, error)

type CountTextTokensResponse

type CountTextTokensResponse struct {
	// TokenCount: The number of tokens that the `model` tokenizes the
	// `prompt` into. Always non-negative.
	TokenCount int64 `json:"tokenCount,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "TokenCount") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "TokenCount") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CountTextTokensResponse: A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.

func (*CountTextTokensResponse) MarshalJSON

func (s *CountTextTokensResponse) MarshalJSON() ([]byte, error)

type CountTokensRequest

type CountTokensRequest struct {
	// Contents: Required. The input given to the model as a prompt.
	Contents []*Content `json:"contents,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Contents") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Contents") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CountTokensRequest: Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.

func (*CountTokensRequest) MarshalJSON

func (s *CountTokensRequest) MarshalJSON() ([]byte, error)

type CountTokensResponse

type CountTokensResponse struct {
	// TotalTokens: The number of tokens that the `model` tokenizes the
	// `prompt` into. Always non-negative.
	TotalTokens int64 `json:"totalTokens,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "TotalTokens") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "TotalTokens") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CountTokensResponse: A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.

func (*CountTokensResponse) MarshalJSON

func (s *CountTokensResponse) MarshalJSON() ([]byte, error)

type CreateChunkRequest

type CreateChunkRequest struct {
	// Chunk: Required. The `Chunk` to create.
	Chunk *Chunk `json:"chunk,omitempty"`

	// Parent: Required. The name of the `Document` where this `Chunk` will
	// be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`
	Parent string `json:"parent,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Chunk") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Chunk") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CreateChunkRequest: Request to create a `Chunk`.

func (*CreateChunkRequest) MarshalJSON

func (s *CreateChunkRequest) MarshalJSON() ([]byte, error)

type CreateFileRequest

type CreateFileRequest struct {
	// File: Optional. Metadata for the file to create.
	File *File `json:"file,omitempty"`

	// ForceSendFields is a list of field names (e.g. "File") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "File") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CreateFileRequest: Request for `CreateFile`.

func (*CreateFileRequest) MarshalJSON

func (s *CreateFileRequest) MarshalJSON() ([]byte, error)

type CreateFileResponse

type CreateFileResponse struct {
	// File: Metadata for the created file.
	File *File `json:"file,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "File") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "File") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CreateFileResponse: Response for `CreateFile`.

func (*CreateFileResponse) MarshalJSON

func (s *CreateFileResponse) MarshalJSON() ([]byte, error)

type CustomMetadata

type CustomMetadata struct {
	// Key: Required. The key of the metadata to store.
	Key string `json:"key,omitempty"`

	// NumericValue: The numeric value of the metadata to store.
	NumericValue float64 `json:"numericValue,omitempty"`

	// StringListValue: The StringList value of the metadata to store.
	StringListValue *StringList `json:"stringListValue,omitempty"`

	// StringValue: The string value of the metadata to store.
	StringValue string `json:"stringValue,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Key") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Key") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

CustomMetadata: User provided metadata stored as key-value pairs.

func (*CustomMetadata) MarshalJSON

func (s *CustomMetadata) MarshalJSON() ([]byte, error)

func (*CustomMetadata) UnmarshalJSON

func (s *CustomMetadata) UnmarshalJSON(data []byte) error

type Dataset

type Dataset struct {
	// Examples: Optional. Inline examples.
	Examples *TuningExamples `json:"examples,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Examples") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Examples") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Dataset: Dataset for training or validation.

func (*Dataset) MarshalJSON

func (s *Dataset) MarshalJSON() ([]byte, error)

type DeleteChunkRequest

type DeleteChunkRequest struct {
	// Name: Required. The resource name of the `Chunk` to delete. Example:
	// `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`
	Name string `json:"name,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Name") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Name") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

DeleteChunkRequest: Request to delete a `Chunk`.

func (*DeleteChunkRequest) MarshalJSON

func (s *DeleteChunkRequest) MarshalJSON() ([]byte, error)

type Document

type Document struct {
	// CreateTime: Output only. The Timestamp of when the `Document` was
	// created.
	CreateTime string `json:"createTime,omitempty"`

	// CustomMetadata: Optional. User provided custom metadata stored as
	// key-value pairs used for querying. A `Document` can have a maximum of
	// 20 `CustomMetadata`.
	CustomMetadata []*CustomMetadata `json:"customMetadata,omitempty"`

	// DisplayName: Optional. The human-readable display name for the
	// `Document`. The display name must be no more than 512 characters in
	// length, including spaces. Example: "Semantic Retriever Documentation"
	DisplayName string `json:"displayName,omitempty"`

	// Name: Immutable. Identifier. The `Document` resource name. The ID
	// (name excluding the "corpora/*/documents/" prefix) can contain up to
	// 40 characters that are lowercase alphanumeric or dashes (-). The ID
	// cannot start or end with a dash. If the name is empty on create, a
	// unique name will be derived from `display_name` along with a 12
	// character random suffix. Example:
	// `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`
	Name string `json:"name,omitempty"`

	// UpdateTime: Output only. The Timestamp of when the `Document` was
	// last updated.
	UpdateTime string `json:"updateTime,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CreateTime") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Document: A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.

func (*Document) MarshalJSON

func (s *Document) MarshalJSON() ([]byte, error)

type EmbedContentRequest

type EmbedContentRequest struct {
	// Content: Required. The content to embed. Only the `parts.text` fields
	// will be counted.
	Content *Content `json:"content,omitempty"`

	// Model: Required. The model's resource name. This serves as an ID for
	// the Model to use. This name should match a model name returned by the
	// `ListModels` method. Format: `models/{model}`
	Model string `json:"model,omitempty"`

	// OutputDimensionality: Optional. Optional reduced dimension for the
	// output embedding. If set, excessive values in the output embedding
	// are truncated from the end. Supported by newer models since 2024, and
	// the earlier model (`models/embedding-001`) cannot specify this value.
	OutputDimensionality int64 `json:"outputDimensionality,omitempty"`

	// TaskType: Optional. Optional task type for which the embeddings will
	// be used. Can only be set for `models/embedding-001`.
	//
	// Possible values:
	//   "TASK_TYPE_UNSPECIFIED" - Unset value, which will default to one of
	// the other enum values.
	//   "RETRIEVAL_QUERY" - Specifies the given text is a query in a
	// search/retrieval setting.
	//   "RETRIEVAL_DOCUMENT" - Specifies the given text is a document from
	// the corpus being searched.
	//   "SEMANTIC_SIMILARITY" - Specifies the given text will be used for
	// STS.
	//   "CLASSIFICATION" - Specifies that the given text will be
	// classified.
	//   "CLUSTERING" - Specifies that the embeddings will be used for
	// clustering.
	//   "QUESTION_ANSWERING" - Specifies that the given text will be used
	// for question answering.
	//   "FACT_VERIFICATION" - Specifies that the given text will be used
	// for fact verification.
	TaskType string `json:"taskType,omitempty"`

	// Title: Optional. An optional title for the text. Only applicable when
	// TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for
	// `RETRIEVAL_DOCUMENT` provides better quality embeddings for
	// retrieval.
	Title string `json:"title,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Content") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Content") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

EmbedContentRequest: Request containing the `Content` for the model to embed.

func (*EmbedContentRequest) MarshalJSON

func (s *EmbedContentRequest) MarshalJSON() ([]byte, error)

type EmbedContentResponse

type EmbedContentResponse struct {
	// Embedding: Output only. The embedding generated from the input
	// content.
	Embedding *ContentEmbedding `json:"embedding,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Embedding") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Embedding") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

EmbedContentResponse: The response to an `EmbedContentRequest`.

func (*EmbedContentResponse) MarshalJSON

func (s *EmbedContentResponse) MarshalJSON() ([]byte, error)

type EmbedTextRequest

type EmbedTextRequest struct {
	// Model: Required. The model name to use with the format
	// model=models/{model}.
	Model string `json:"model,omitempty"`

	// Text: Optional. The free-form input text that the model will turn
	// into an embedding.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Model") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Model") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

EmbedTextRequest: Request to get a text embedding from the model.

func (*EmbedTextRequest) MarshalJSON

func (s *EmbedTextRequest) MarshalJSON() ([]byte, error)

type EmbedTextResponse

type EmbedTextResponse struct {
	// Embedding: Output only. The embedding generated from the input text.
	Embedding *Embedding `json:"embedding,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Embedding") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Embedding") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

EmbedTextResponse: The response to a EmbedTextRequest.

func (*EmbedTextResponse) MarshalJSON

func (s *EmbedTextResponse) MarshalJSON() ([]byte, error)

type Embedding

type Embedding struct {
	// Value: The embedding values.
	Value []float64 `json:"value,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Value") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Value") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Embedding: A list of floats representing the embedding.

func (*Embedding) MarshalJSON

func (s *Embedding) MarshalJSON() ([]byte, error)

func (*Embedding) UnmarshalJSON

func (s *Embedding) UnmarshalJSON(data []byte) error

type Empty

type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`
}

Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

type Example

type Example struct {
	// Input: Required. An example of an input `Message` from the user.
	Input *Message `json:"input,omitempty"`

	// Output: Required. An example of what the model should output given
	// the input.
	Output *Message `json:"output,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Input") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Input") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Example: An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.

func (*Example) MarshalJSON

func (s *Example) MarshalJSON() ([]byte, error)

type File

type File struct {
	// CreateTime: Output only. The timestamp of when the `File` was
	// created.
	CreateTime string `json:"createTime,omitempty"`

	// DisplayName: Optional. The human-readable display name for the
	// `File`. The display name must be no more than 512 characters in
	// length, including spaces. Example: "Welcome Image"
	DisplayName string `json:"displayName,omitempty"`

	// ExpirationTime: Output only. The timestamp of when the `File` will be
	// deleted. Only set if the `File` is scheduled to expire.
	ExpirationTime string `json:"expirationTime,omitempty"`

	// MimeType: Output only. MIME type of the file.
	MimeType string `json:"mimeType,omitempty"`

	// Name: Immutable. Identifier. The `File` resource name. The ID (name
	// excluding the "files/" prefix) can contain up to 40 characters that
	// are lowercase alphanumeric or dashes (-). The ID cannot start or end
	// with a dash. If the name is empty on create, a unique name will be
	// generated. Example: `files/123-456`
	Name string `json:"name,omitempty"`

	// Sha256Hash: Output only. SHA-256 hash of the uploaded bytes.
	Sha256Hash string `json:"sha256Hash,omitempty"`

	// SizeBytes: Output only. Size of the file in bytes.
	SizeBytes int64 `json:"sizeBytes,omitempty,string"`

	// UpdateTime: Output only. The timestamp of when the `File` was last
	// updated.
	UpdateTime string `json:"updateTime,omitempty"`

	// Uri: Output only. The uri of the `File`.
	Uri string `json:"uri,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CreateTime") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

File: A file uploaded to the API.

func (*File) MarshalJSON

func (s *File) MarshalJSON() ([]byte, error)

type FileData

type FileData struct {
	// FileUri: Required. URI.
	FileUri string `json:"fileUri,omitempty"`

	// MimeType: Optional. The IANA standard MIME type of the source data.
	MimeType string `json:"mimeType,omitempty"`

	// ForceSendFields is a list of field names (e.g. "FileUri") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "FileUri") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

FileData: URI based data.

func (*FileData) MarshalJSON

func (s *FileData) MarshalJSON() ([]byte, error)

type FilesDeleteCall

type FilesDeleteCall struct {
	// contains filtered or unexported fields
}

func (*FilesDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*FilesDeleteCall) Do

func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)

Do executes the "generativelanguage.files.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FilesDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*FilesDeleteCall) Header

func (c *FilesDeleteCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type FilesGetCall

type FilesGetCall struct {
	// contains filtered or unexported fields
}

func (*FilesGetCall) Context

func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*FilesGetCall) Do

func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error)

Do executes the "generativelanguage.files.get" call. Exactly one of *File or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *File.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FilesGetCall) Fields

func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*FilesGetCall) Header

func (c *FilesGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*FilesGetCall) IfNoneMatch

func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type FilesListCall

type FilesListCall struct {
	// contains filtered or unexported fields
}

func (*FilesListCall) Context

func (c *FilesListCall) Context(ctx context.Context) *FilesListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*FilesListCall) Do

Do executes the "generativelanguage.files.list" call. Exactly one of *ListFilesResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListFilesResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FilesListCall) Fields

func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*FilesListCall) Header

func (c *FilesListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*FilesListCall) IfNoneMatch

func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*FilesListCall) PageSize

func (c *FilesListCall) PageSize(pageSize int64) *FilesListCall

PageSize sets the optional parameter "pageSize": Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.

func (*FilesListCall) PageToken

func (c *FilesListCall) PageToken(pageToken string) *FilesListCall

PageToken sets the optional parameter "pageToken": A page token from a previous `ListFiles` call.

func (*FilesListCall) Pages

func (c *FilesListCall) Pages(ctx context.Context, f func(*ListFilesResponse) error) error

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type FilesService

type FilesService struct {
	// contains filtered or unexported fields
}

func NewFilesService

func NewFilesService(s *Service) *FilesService

func (*FilesService) Delete

func (r *FilesService) Delete(name string) *FilesDeleteCall

Delete: Deletes the `File`.

- name: The name of the `File` to delete. Example: `files/abc-123`.

func (*FilesService) Get

func (r *FilesService) Get(name string) *FilesGetCall

Get: Gets the metadata for the given `File`.

- name: The name of the `File` to get. Example: `files/abc-123`.

func (*FilesService) List

func (r *FilesService) List() *FilesListCall

List: Lists the metadata for `File`s owned by the requesting project.

type FunctionCall

type FunctionCall struct {
	// Args: Optional. The function parameters and values in JSON object
	// format.
	Args googleapi.RawMessage `json:"args,omitempty"`

	// Name: Required. The name of the function to call. Must be a-z, A-Z,
	// 0-9, or contain underscores and dashes, with a maximum length of 63.
	Name string `json:"name,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Args") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Args") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

FunctionCall: A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.

func (*FunctionCall) MarshalJSON

func (s *FunctionCall) MarshalJSON() ([]byte, error)

type FunctionCallingConfig

type FunctionCallingConfig struct {
	// AllowedFunctionNames: Optional. A set of function names that, when
	// provided, limits the functions the model will call. This should only
	// be set when the Mode is ANY. Function names should match
	// [FunctionDeclaration.name]. With mode set to ANY, model will predict
	// a function call from the set of function names provided.
	AllowedFunctionNames []string `json:"allowedFunctionNames,omitempty"`

	// Mode: Optional. Specifies the mode in which function calling should
	// execute. If unspecified, the default value will be set to AUTO.
	//
	// Possible values:
	//   "MODE_UNSPECIFIED" - Unspecified function calling mode. This value
	// should not be used.
	//   "AUTO" - Default model behavior, model decides to predict either a
	// function call or a natural language repspose.
	//   "ANY" - Model is constrained to always predicting a function call
	// only. If "allowed_function_names" are set, the predicted function
	// call will be limited to any one of "allowed_function_names", else the
	// predicted function call will be any one of the provided
	// "function_declarations".
	//   "NONE" - Model will not predict any function call. Model behavior
	// is same as when not passing any function declarations.
	Mode string `json:"mode,omitempty"`

	// ForceSendFields is a list of field names (e.g.
	// "AllowedFunctionNames") to unconditionally include in API requests.
	// By default, fields with empty or default values are omitted from API
	// requests. However, any non-pointer, non-interface field appearing in
	// ForceSendFields will be sent to the server regardless of whether the
	// field is empty or not. This may be used to include empty fields in
	// Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AllowedFunctionNames") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

FunctionCallingConfig: Configuration for specifying function calling behavior.

func (*FunctionCallingConfig) MarshalJSON

func (s *FunctionCallingConfig) MarshalJSON() ([]byte, error)

type FunctionDeclaration

type FunctionDeclaration struct {
	// Description: Required. A brief description of the function.
	Description string `json:"description,omitempty"`

	// Name: Required. The name of the function. Must be a-z, A-Z, 0-9, or
	// contain underscores and dashes, with a maximum length of 63.
	Name string `json:"name,omitempty"`

	// Parameters: Optional. Describes the parameters to this function.
	// Reflects the Open API 3.03 Parameter Object string Key: the name of
	// the parameter. Parameter names are case sensitive. Schema Value: the
	// Schema defining the type used for the parameter.
	Parameters *Schema `json:"parameters,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Description") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Description") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

FunctionDeclaration: Structured representation of a function declaration as defined by the OpenAPI 3.03 specification (https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.

func (*FunctionDeclaration) MarshalJSON

func (s *FunctionDeclaration) MarshalJSON() ([]byte, error)

type FunctionResponse

type FunctionResponse struct {
	// Name: Required. The name of the function to call. Must be a-z, A-Z,
	// 0-9, or contain underscores and dashes, with a maximum length of 63.
	Name string `json:"name,omitempty"`

	// Response: Required. The function response in JSON object format.
	Response googleapi.RawMessage `json:"response,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Name") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Name") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

FunctionResponse: The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.

func (*FunctionResponse) MarshalJSON

func (s *FunctionResponse) MarshalJSON() ([]byte, error)

type GenerateAnswerRequest

type GenerateAnswerRequest struct {
	// AnswerStyle: Required. Style in which answers should be returned.
	//
	// Possible values:
	//   "ANSWER_STYLE_UNSPECIFIED" - Unspecified answer style.
	//   "ABSTRACTIVE" - Succint but abstract style.
	//   "EXTRACTIVE" - Very brief and extractive style.
	//   "VERBOSE" - Verbose style including extra details. The response may
	// be formatted as a sentence, paragraph, multiple paragraphs, or bullet
	// points, etc.
	AnswerStyle string `json:"answerStyle,omitempty"`

	// Contents: Required. The content of the current conversation with the
	// model. For single-turn queries, this is a single question to answer.
	// For multi-turn queries, this is a repeated field that contains
	// conversation history and the last `Content` in the list containing
	// the question. Note: GenerateAnswer currently only supports queries in
	// English.
	Contents []*Content `json:"contents,omitempty"`

	// InlinePassages: Passages provided inline with the request.
	InlinePassages *GroundingPassages `json:"inlinePassages,omitempty"`

	// SafetySettings: Optional. A list of unique `SafetySetting` instances
	// for blocking unsafe content. This will be enforced on the
	// `GenerateAnswerRequest.contents` and
	// `GenerateAnswerResponse.candidate`. There should not be more than one
	// setting for each `SafetyCategory` type. The API will block any
	// contents and responses that fail to meet the thresholds set by these
	// settings. This list overrides the default settings for each
	// `SafetyCategory` specified in the safety_settings. If there is no
	// `SafetySetting` for a given `SafetyCategory` provided in the list,
	// the API will use the default safety setting for that category. Harm
	// categories HARM_CATEGORY_HATE_SPEECH,
	// HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,
	// HARM_CATEGORY_HARASSMENT are supported.
	SafetySettings []*SafetySetting `json:"safetySettings,omitempty"`

	// SemanticRetriever: Content retrieved from resources created via the
	// Semantic Retriever API.
	SemanticRetriever *SemanticRetrieverConfig `json:"semanticRetriever,omitempty"`

	// Temperature: Optional. Controls the randomness of the output. Values
	// can range from [0.0,1.0], inclusive. A value closer to 1.0 will
	// produce responses that are more varied and creative, while a value
	// closer to 0.0 will typically result in more straightforward responses
	// from the model. A low temperature (~0.2) is usually recommended for
	// Attributed-Question-Answering use cases.
	Temperature float64 `json:"temperature,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AnswerStyle") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AnswerStyle") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GenerateAnswerRequest: Request to generate a grounded answer from the model.

func (*GenerateAnswerRequest) MarshalJSON

func (s *GenerateAnswerRequest) MarshalJSON() ([]byte, error)

func (*GenerateAnswerRequest) UnmarshalJSON

func (s *GenerateAnswerRequest) UnmarshalJSON(data []byte) error

type GenerateAnswerResponse

type GenerateAnswerResponse struct {
	// Answer: Candidate answer from the model. Note: The model *always*
	// attempts to provide a grounded answer, even when the answer is
	// unlikely to be answerable from the given passages. In that case, a
	// low-quality or ungrounded answer may be provided, along with a low
	// `answerable_probability`.
	Answer *Candidate `json:"answer,omitempty"`

	// AnswerableProbability: Output only. The model's estimate of the
	// probability that its answer is correct and grounded in the input
	// passages. A low answerable_probability indicates that the answer
	// might not be grounded in the sources. When `answerable_probability`
	// is low, some clients may wish to: * Display a message to the effect
	// of "We couldn’t answer that question" to the user. * Fall back to a
	// general-purpose LLM that answers the question from world knowledge.
	// The threshold and nature of such fallbacks will depend on individual
	// clients’ use cases. 0.5 is a good starting threshold.
	AnswerableProbability float64 `json:"answerableProbability,omitempty"`

	// InputFeedback: Output only. Feedback related to the input data used
	// to answer the question, as opposed to model-generated response to the
	// question. "Input data" can be one or more of the following: -
	// Question specified by the last entry in
	// `GenerateAnswerRequest.content` - Conversation history specified by
	// the other entries in `GenerateAnswerRequest.content` - Grounding
	// sources (`GenerateAnswerRequest.semantic_retriever` or
	// `GenerateAnswerRequest.inline_passages`)
	InputFeedback *InputFeedback `json:"inputFeedback,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Answer") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Answer") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GenerateAnswerResponse: Response from the model for a grounded answer.

func (*GenerateAnswerResponse) MarshalJSON

func (s *GenerateAnswerResponse) MarshalJSON() ([]byte, error)

func (*GenerateAnswerResponse) UnmarshalJSON

func (s *GenerateAnswerResponse) UnmarshalJSON(data []byte) error

type GenerateContentRequest

type GenerateContentRequest struct {
	// Contents: Required. The content of the current conversation with the
	// model. For single-turn queries, this is a single instance. For
	// multi-turn queries, this is a repeated field that contains
	// conversation history + latest request.
	Contents []*Content `json:"contents,omitempty"`

	// GenerationConfig: Optional. Configuration options for model
	// generation and outputs.
	GenerationConfig *GenerationConfig `json:"generationConfig,omitempty"`

	// SafetySettings: Optional. A list of unique `SafetySetting` instances
	// for blocking unsafe content. This will be enforced on the
	// `GenerateContentRequest.contents` and
	// `GenerateContentResponse.candidates`. There should not be more than
	// one setting for each `SafetyCategory` type. The API will block any
	// contents and responses that fail to meet the thresholds set by these
	// settings. This list overrides the default settings for each
	// `SafetyCategory` specified in the safety_settings. If there is no
	// `SafetySetting` for a given `SafetyCategory` provided in the list,
	// the API will use the default safety setting for that category. Harm
	// categories HARM_CATEGORY_HATE_SPEECH,
	// HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,
	// HARM_CATEGORY_HARASSMENT are supported.
	SafetySettings []*SafetySetting `json:"safetySettings,omitempty"`

	// SystemInstruction: Optional. Developer set system instruction.
	// Currently, text only.
	SystemInstruction *Content `json:"systemInstruction,omitempty"`

	// ToolConfig: Optional. Tool configuration for any `Tool` specified in
	// the request.
	ToolConfig *ToolConfig `json:"toolConfig,omitempty"`

	// Tools: Optional. A list of `Tools` the model may use to generate the
	// next response. A `Tool` is a piece of code that enables the system to
	// interact with external systems to perform an action, or set of
	// actions, outside of knowledge and scope of the model. The only
	// supported tool is currently `Function`.
	Tools []*Tool `json:"tools,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Contents") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Contents") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GenerateContentRequest: Request to generate a completion from the model.

func (*GenerateContentRequest) MarshalJSON

func (s *GenerateContentRequest) MarshalJSON() ([]byte, error)

type GenerateContentResponse

type GenerateContentResponse struct {
	// Candidates: Candidate responses from the model.
	Candidates []*Candidate `json:"candidates,omitempty"`

	// PromptFeedback: Returns the prompt's feedback related to the content
	// filters.
	PromptFeedback *PromptFeedback `json:"promptFeedback,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Candidates") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Candidates") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GenerateContentResponse: Response from the model supporting multiple candidates. Note on safety ratings and content filtering. They are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API contract is that: - either all requested candidates are returned or no candidates at all - no candidates are returned only if there was something wrong with the prompt (see `prompt_feedback`) - feedback on each candidate is reported on `finish_reason` and `safety_ratings`.

func (*GenerateContentResponse) MarshalJSON

func (s *GenerateContentResponse) MarshalJSON() ([]byte, error)

type GenerateMessageRequest

type GenerateMessageRequest struct {
	// CandidateCount: Optional. The number of generated response messages
	// to return. This value must be between `[1, 8]`, inclusive. If unset,
	// this will default to `1`.
	CandidateCount int64 `json:"candidateCount,omitempty"`

	// Prompt: Required. The structured textual input given to the model as
	// a prompt. Given a prompt, the model will return what it predicts is
	// the next message in the discussion.
	Prompt *MessagePrompt `json:"prompt,omitempty"`

	// Temperature: Optional. Controls the randomness of the output. Values
	// can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will
	// produce responses that are more varied, while a value closer to `0.0`
	// will typically result in less surprising responses from the model.
	Temperature float64 `json:"temperature,omitempty"`

	// TopK: Optional. The maximum number of tokens to consider when
	// sampling. The model uses combined Top-k and nucleus sampling. Top-k
	// sampling considers the set of `top_k` most probable tokens.
	TopK int64 `json:"topK,omitempty"`

	// TopP: Optional. The maximum cumulative probability of tokens to
	// consider when sampling. The model uses combined Top-k and nucleus
	// sampling. Nucleus sampling considers the smallest set of tokens whose
	// probability sum is at least `top_p`.
	TopP float64 `json:"topP,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CandidateCount") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CandidateCount") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

GenerateMessageRequest: Request to generate a message response from the model.

func (*GenerateMessageRequest) MarshalJSON

func (s *GenerateMessageRequest) MarshalJSON() ([]byte, error)

func (*GenerateMessageRequest) UnmarshalJSON

func (s *GenerateMessageRequest) UnmarshalJSON(data []byte) error

type GenerateMessageResponse

type GenerateMessageResponse struct {
	// Candidates: Candidate response messages from the model.
	Candidates []*Message `json:"candidates,omitempty"`

	// Filters: A set of content filtering metadata for the prompt and
	// response text. This indicates which `SafetyCategory`(s) blocked a
	// candidate from this response, the lowest `HarmProbability` that
	// triggered a block, and the HarmThreshold setting for that category.
	Filters []*ContentFilter `json:"filters,omitempty"`

	// Messages: The conversation history used by the model.
	Messages []*Message `json:"messages,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Candidates") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Candidates") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GenerateMessageResponse: The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.

func (*GenerateMessageResponse) MarshalJSON

func (s *GenerateMessageResponse) MarshalJSON() ([]byte, error)

type GenerateTextRequest

type GenerateTextRequest struct {
	// CandidateCount: Optional. Number of generated responses to return.
	// This value must be between [1, 8], inclusive. If unset, this will
	// default to 1.
	CandidateCount int64 `json:"candidateCount,omitempty"`

	// MaxOutputTokens: Optional. The maximum number of tokens to include in
	// a candidate. If unset, this will default to output_token_limit
	// specified in the `Model` specification.
	MaxOutputTokens int64 `json:"maxOutputTokens,omitempty"`

	// Prompt: Required. The free-form input text given to the model as a
	// prompt. Given a prompt, the model will generate a TextCompletion
	// response it predicts as the completion of the input text.
	Prompt *TextPrompt `json:"prompt,omitempty"`

	// SafetySettings: Optional. A list of unique `SafetySetting` instances
	// for blocking unsafe content. that will be enforced on the
	// `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`.
	// There should not be more than one setting for each `SafetyCategory`
	// type. The API will block any prompts and responses that fail to meet
	// the thresholds set by these settings. This list overrides the default
	// settings for each `SafetyCategory` specified in the safety_settings.
	// If there is no `SafetySetting` for a given `SafetyCategory` provided
	// in the list, the API will use the default safety setting for that
	// category. Harm categories HARM_CATEGORY_DEROGATORY,
	// HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL,
	// HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text
	// service.
	SafetySettings []*SafetySetting `json:"safetySettings,omitempty"`

	// StopSequences: The set of character sequences (up to 5) that will
	// stop output generation. If specified, the API will stop at the first
	// appearance of a stop sequence. The stop sequence will not be included
	// as part of the response.
	StopSequences []string `json:"stopSequences,omitempty"`

	// Temperature: Optional. Controls the randomness of the output. Note:
	// The default value varies by model, see the `Model.temperature`
	// attribute of the `Model` returned the `getModel` function. Values can
	// range from [0.0,1.0], inclusive. A value closer to 1.0 will produce
	// responses that are more varied and creative, while a value closer to
	// 0.0 will typically result in more straightforward responses from the
	// model.
	Temperature float64 `json:"temperature,omitempty"`

	// TopK: Optional. The maximum number of tokens to consider when
	// sampling. The model uses combined Top-k and nucleus sampling. Top-k
	// sampling considers the set of `top_k` most probable tokens. Defaults
	// to 40. Note: The default value varies by model, see the `Model.top_k`
	// attribute of the `Model` returned the `getModel` function.
	TopK int64 `json:"topK,omitempty"`

	// TopP: Optional. The maximum cumulative probability of tokens to
	// consider when sampling. The model uses combined Top-k and nucleus
	// sampling. Tokens are sorted based on their assigned probabilities so
	// that only the most likely tokens are considered. Top-k sampling
	// directly limits the maximum number of tokens to consider, while
	// Nucleus sampling limits number of tokens based on the cumulative
	// probability. Note: The default value varies by model, see the
	// `Model.top_p` attribute of the `Model` returned the `getModel`
	// function.
	TopP float64 `json:"topP,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CandidateCount") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CandidateCount") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

GenerateTextRequest: Request to generate a text completion response from the model.

func (*GenerateTextRequest) MarshalJSON

func (s *GenerateTextRequest) MarshalJSON() ([]byte, error)

func (*GenerateTextRequest) UnmarshalJSON

func (s *GenerateTextRequest) UnmarshalJSON(data []byte) error

type GenerateTextResponse

type GenerateTextResponse struct {
	// Candidates: Candidate responses from the model.
	Candidates []*TextCompletion `json:"candidates,omitempty"`

	// Filters: A set of content filtering metadata for the prompt and
	// response text. This indicates which `SafetyCategory`(s) blocked a
	// candidate from this response, the lowest `HarmProbability` that
	// triggered a block, and the HarmThreshold setting for that category.
	// This indicates the smallest change to the `SafetySettings` that would
	// be necessary to unblock at least 1 response. The blocking is
	// configured by the `SafetySettings` in the request (or the default
	// `SafetySettings` of the API).
	Filters []*ContentFilter `json:"filters,omitempty"`

	// SafetyFeedback: Returns any safety feedback related to content
	// filtering.
	SafetyFeedback []*SafetyFeedback `json:"safetyFeedback,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Candidates") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Candidates") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GenerateTextResponse: The response from the model, including candidate completions.

func (*GenerateTextResponse) MarshalJSON

func (s *GenerateTextResponse) MarshalJSON() ([]byte, error)

type GenerationConfig

type GenerationConfig struct {
	// CandidateCount: Optional. Number of generated responses to return.
	// Currently, this value can only be set to 1. If unset, this will
	// default to 1.
	CandidateCount int64 `json:"candidateCount,omitempty"`

	// MaxOutputTokens: Optional. The maximum number of tokens to include in
	// a candidate. Note: The default value varies by model, see the
	// `Model.output_token_limit` attribute of the `Model` returned from the
	// `getModel` function.
	MaxOutputTokens int64 `json:"maxOutputTokens,omitempty"`

	// ResponseMimeType: Optional. Output response mimetype of the generated
	// candidate text. Supported mimetype: `text/plain`: (default) Text
	// output. `application/json`: JSON response in the candidates.
	ResponseMimeType string `json:"responseMimeType,omitempty"`

	// StopSequences: Optional. The set of character sequences (up to 5)
	// that will stop output generation. If specified, the API will stop at
	// the first appearance of a stop sequence. The stop sequence will not
	// be included as part of the response.
	StopSequences []string `json:"stopSequences,omitempty"`

	// Temperature: Optional. Controls the randomness of the output. Note:
	// The default value varies by model, see the `Model.temperature`
	// attribute of the `Model` returned from the `getModel` function.
	// Values can range from [0.0, 2.0].
	Temperature float64 `json:"temperature,omitempty"`

	// TopK: Optional. The maximum number of tokens to consider when
	// sampling. Models use nucleus sampling or combined Top-k and nucleus
	// sampling. Top-k sampling considers the set of `top_k` most probable
	// tokens. Models running with nucleus sampling don't allow top_k
	// setting. Note: The default value varies by model, see the
	// `Model.top_k` attribute of the `Model` returned from the `getModel`
	// function. Empty `top_k` field in `Model` indicates the model doesn't
	// apply top-k sampling and doesn't allow setting `top_k` on requests.
	TopK int64 `json:"topK,omitempty"`

	// TopP: Optional. The maximum cumulative probability of tokens to
	// consider when sampling. The model uses combined Top-k and nucleus
	// sampling. Tokens are sorted based on their assigned probabilities so
	// that only the most likely tokens are considered. Top-k sampling
	// directly limits the maximum number of tokens to consider, while
	// Nucleus sampling limits number of tokens based on the cumulative
	// probability. Note: The default value varies by model, see the
	// `Model.top_p` attribute of the `Model` returned from the `getModel`
	// function.
	TopP float64 `json:"topP,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CandidateCount") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CandidateCount") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

GenerationConfig: Configuration options for model generation and outputs. Not all parameters may be configurable for every model.

func (*GenerationConfig) MarshalJSON

func (s *GenerationConfig) MarshalJSON() ([]byte, error)

func (*GenerationConfig) UnmarshalJSON

func (s *GenerationConfig) UnmarshalJSON(data []byte) error

type GroundingAttribution

type GroundingAttribution struct {
	// Content: Grounding source content that makes up this attribution.
	Content *Content `json:"content,omitempty"`

	// SourceId: Output only. Identifier for the source contributing to this
	// attribution.
	SourceId *AttributionSourceId `json:"sourceId,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Content") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Content") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GroundingAttribution: Attribution for a source that contributed to an answer.

func (*GroundingAttribution) MarshalJSON

func (s *GroundingAttribution) MarshalJSON() ([]byte, error)

type GroundingPassage

type GroundingPassage struct {
	// Content: Content of the passage.
	Content *Content `json:"content,omitempty"`

	// Id: Identifier for the passage for attributing this passage in
	// grounded answers.
	Id string `json:"id,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Content") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Content") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GroundingPassage: Passage included inline with a grounding configuration.

func (*GroundingPassage) MarshalJSON

func (s *GroundingPassage) MarshalJSON() ([]byte, error)

type GroundingPassageId

type GroundingPassageId struct {
	// PartIndex: Output only. Index of the part within the
	// `GenerateAnswerRequest`'s `GroundingPassage.content`.
	PartIndex int64 `json:"partIndex,omitempty"`

	// PassageId: Output only. ID of the passage matching the
	// `GenerateAnswerRequest`'s `GroundingPassage.id`.
	PassageId string `json:"passageId,omitempty"`

	// ForceSendFields is a list of field names (e.g. "PartIndex") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "PartIndex") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GroundingPassageId: Identifier for a part within a `GroundingPassage`.

func (*GroundingPassageId) MarshalJSON

func (s *GroundingPassageId) MarshalJSON() ([]byte, error)

type GroundingPassages

type GroundingPassages struct {
	// Passages: List of passages.
	Passages []*GroundingPassage `json:"passages,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Passages") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Passages") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

GroundingPassages: A repeated list of passages.

func (*GroundingPassages) MarshalJSON

func (s *GroundingPassages) MarshalJSON() ([]byte, error)

type Hyperparameters

type Hyperparameters struct {
	// BatchSize: Immutable. The batch size hyperparameter for tuning. If
	// not set, a default of 4 or 16 will be used based on the number of
	// training examples.
	BatchSize int64 `json:"batchSize,omitempty"`

	// EpochCount: Immutable. The number of training epochs. An epoch is one
	// pass through the training data. If not set, a default of 5 will be
	// used.
	EpochCount int64 `json:"epochCount,omitempty"`

	// LearningRate: Optional. Immutable. The learning rate hyperparameter
	// for tuning. If not set, a default of 0.001 or 0.0002 will be
	// calculated based on the number of training examples.
	LearningRate float64 `json:"learningRate,omitempty"`

	// LearningRateMultiplier: Optional. Immutable. The learning rate
	// multiplier is used to calculate a final learning_rate based on the
	// default (recommended) value. Actual learning rate :=
	// learning_rate_multiplier * default learning rate Default learning
	// rate is dependent on base model and dataset size. If not set, a
	// default of 1.0 will be used.
	LearningRateMultiplier float64 `json:"learningRateMultiplier,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BatchSize") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BatchSize") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Hyperparameters: Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance

func (*Hyperparameters) MarshalJSON

func (s *Hyperparameters) MarshalJSON() ([]byte, error)

func (*Hyperparameters) UnmarshalJSON

func (s *Hyperparameters) UnmarshalJSON(data []byte) error

type InputFeedback

type InputFeedback struct {
	// BlockReason: Optional. If set, the input was blocked and no
	// candidates are returned. Rephrase your input.
	//
	// Possible values:
	//   "BLOCK_REASON_UNSPECIFIED" - Default value. This value is unused.
	//   "SAFETY" - Input was blocked due to safety reasons. You can inspect
	// `safety_ratings` to understand which safety category blocked it.
	//   "OTHER" - Input was blocked due to other reasons.
	BlockReason string `json:"blockReason,omitempty"`

	// SafetyRatings: Ratings for safety of the input. There is at most one
	// rating per category.
	SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BlockReason") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BlockReason") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

InputFeedback: Feedback related to the input data used to answer the question, as opposed to model-generated response to the question.

func (*InputFeedback) MarshalJSON

func (s *InputFeedback) MarshalJSON() ([]byte, error)

type ListChunksResponse

type ListChunksResponse struct {
	// Chunks: The returned `Chunk`s.
	Chunks []*Chunk `json:"chunks,omitempty"`

	// NextPageToken: A token, which can be sent as `page_token` to retrieve
	// the next page. If this field is omitted, there are no more pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Chunks") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Chunks") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListChunksResponse: Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`.

func (*ListChunksResponse) MarshalJSON

func (s *ListChunksResponse) MarshalJSON() ([]byte, error)

type ListCorporaResponse

type ListCorporaResponse struct {
	// Corpora: The returned corpora.
	Corpora []*Corpus `json:"corpora,omitempty"`

	// NextPageToken: A token, which can be sent as `page_token` to retrieve
	// the next page. If this field is omitted, there are no more pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Corpora") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Corpora") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListCorporaResponse: Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.

func (*ListCorporaResponse) MarshalJSON

func (s *ListCorporaResponse) MarshalJSON() ([]byte, error)

type ListDocumentsResponse

type ListDocumentsResponse struct {
	// Documents: The returned `Document`s.
	Documents []*Document `json:"documents,omitempty"`

	// NextPageToken: A token, which can be sent as `page_token` to retrieve
	// the next page. If this field is omitted, there are no more pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Documents") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Documents") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListDocumentsResponse: Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.

func (*ListDocumentsResponse) MarshalJSON

func (s *ListDocumentsResponse) MarshalJSON() ([]byte, error)

type ListFilesResponse

type ListFilesResponse struct {
	// Files: The list of `File`s.
	Files []*File `json:"files,omitempty"`

	// NextPageToken: A token that can be sent as a `page_token` into a
	// subsequent `ListFiles` call.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Files") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Files") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListFilesResponse: Response for `ListFiles`.

func (*ListFilesResponse) MarshalJSON

func (s *ListFilesResponse) MarshalJSON() ([]byte, error)

type ListModelsResponse

type ListModelsResponse struct {
	// Models: The returned Models.
	Models []*Model `json:"models,omitempty"`

	// NextPageToken: A token, which can be sent as `page_token` to retrieve
	// the next page. If this field is omitted, there are no more pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Models") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Models") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListModelsResponse: Response from `ListModel` containing a paginated list of Models.

func (*ListModelsResponse) MarshalJSON

func (s *ListModelsResponse) MarshalJSON() ([]byte, error)

type ListPermissionsResponse

type ListPermissionsResponse struct {
	// NextPageToken: A token, which can be sent as `page_token` to retrieve
	// the next page. If this field is omitted, there are no more pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// Permissions: Returned permissions.
	Permissions []*Permission `json:"permissions,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListPermissionsResponse: Response from `ListPermissions` containing a paginated list of permissions.

func (*ListPermissionsResponse) MarshalJSON

func (s *ListPermissionsResponse) MarshalJSON() ([]byte, error)

type ListTunedModelsResponse

type ListTunedModelsResponse struct {
	// NextPageToken: A token, which can be sent as `page_token` to retrieve
	// the next page. If this field is omitted, there are no more pages.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// TunedModels: The returned Models.
	TunedModels []*TunedModel `json:"tunedModels,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListTunedModelsResponse: Response from `ListTunedModels` containing a paginated list of Models.

func (*ListTunedModelsResponse) MarshalJSON

func (s *ListTunedModelsResponse) MarshalJSON() ([]byte, error)

type MediaService

type MediaService struct {
	// contains filtered or unexported fields
}

func NewMediaService

func NewMediaService(s *Service) *MediaService

func (*MediaService) Upload

func (r *MediaService) Upload(createfilerequest *CreateFileRequest) *MediaUploadCall

Upload: Creates a `File`.

type MediaUploadCall

type MediaUploadCall struct {
	// contains filtered or unexported fields
}

func (*MediaUploadCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled. This context will supersede any context previously provided to the ResumableMedia method.

func (*MediaUploadCall) Do

Do executes the "generativelanguage.media.upload" call. Exactly one of *CreateFileResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *CreateFileResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*MediaUploadCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaUploadCall) Header

func (c *MediaUploadCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*MediaUploadCall) Media

func (c *MediaUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *MediaUploadCall

Media specifies the media to upload in one or more chunks. The chunk size may be controlled by supplying a MediaOption generated by googleapi.ChunkSize. The chunk size defaults to googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload request will be determined by sniffing the contents of r, unless a MediaOption generated by googleapi.ContentType is supplied. At most one of Media and ResumableMedia may be set.

func (*MediaUploadCall) ProgressUpdater

func (c *MediaUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaUploadCall

ProgressUpdater provides a callback function that will be called after every chunk. It should be a low-latency function in order to not slow down the upload operation. This should only be called when using ResumableMedia (as opposed to Media).

func (*MediaUploadCall) ResumableMedia deprecated

func (c *MediaUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaUploadCall

ResumableMedia specifies the media to upload in chunks and can be canceled with ctx.

Deprecated: use Media instead.

At most one of Media and ResumableMedia may be set. mediaType identifies the MIME media type of the upload, such as "image/png". If mediaType is "", it will be auto-detected. The provided ctx will supersede any context previously provided to the Context method.

type Message

type Message struct {
	// Author: Optional. The author of this Message. This serves as a key
	// for tagging the content of this Message when it is fed to the model
	// as text. The author can be any alphanumeric string.
	Author string `json:"author,omitempty"`

	// CitationMetadata: Output only. Citation information for
	// model-generated `content` in this `Message`. If this `Message` was
	// generated as output from the model, this field may be populated with
	// attribution information for any text included in the `content`. This
	// field is used only on output.
	CitationMetadata *CitationMetadata `json:"citationMetadata,omitempty"`

	// Content: Required. The text content of the structured `Message`.
	Content string `json:"content,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Author") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Author") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Message: The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text.

func (*Message) MarshalJSON

func (s *Message) MarshalJSON() ([]byte, error)

type MessagePrompt

type MessagePrompt struct {
	// Context: Optional. Text that should be provided to the model first to
	// ground the response. If not empty, this `context` will be given to
	// the model first before the `examples` and `messages`. When using a
	// `context` be sure to provide it with every request to maintain
	// continuity. This field can be a description of your prompt to the
	// model to help provide context and guide the responses. Examples:
	// "Translate the phrase from English to French." or "Given a statement,
	// classify the sentiment as happy, sad or neutral." Anything included
	// in this field will take precedence over message history if the total
	// input size exceeds the model's `input_token_limit` and the input
	// request is truncated.
	Context string `json:"context,omitempty"`

	// Examples: Optional. Examples of what the model should generate. This
	// includes both user input and the response that the model should
	// emulate. These `examples` are treated identically to conversation
	// messages except that they take precedence over the history in
	// `messages`: If the total input size exceeds the model's
	// `input_token_limit` the input will be truncated. Items will be
	// dropped from `messages` before `examples`.
	Examples []*Example `json:"examples,omitempty"`

	// Messages: Required. A snapshot of the recent conversation history
	// sorted chronologically. Turns alternate between two authors. If the
	// total input size exceeds the model's `input_token_limit` the input
	// will be truncated: The oldest items will be dropped from `messages`.
	Messages []*Message `json:"messages,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Context") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Context") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

MessagePrompt: All of the structured input text passed to the model as a prompt. A `MessagePrompt` contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model.

func (*MessagePrompt) MarshalJSON

func (s *MessagePrompt) MarshalJSON() ([]byte, error)

type MetadataFilter

type MetadataFilter struct {
	// Conditions: Required. The `Condition`s for the given key that will
	// trigger this filter. Multiple `Condition`s are joined by logical ORs.
	Conditions []*Condition `json:"conditions,omitempty"`

	// Key: Required. The key of the metadata to filter on.
	Key string `json:"key,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Conditions") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Conditions") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

MetadataFilter: User provided filter to limit retrieval based on `Chunk` or `Document` level metadata values. Example (genre = drama OR genre = action): key = "document.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}]

func (*MetadataFilter) MarshalJSON

func (s *MetadataFilter) MarshalJSON() ([]byte, error)

type Model

type Model struct {
	// BaseModelId: Required. The name of the base model, pass this to the
	// generation request. Examples: * `chat-bison`
	BaseModelId string `json:"baseModelId,omitempty"`

	// Description: A short description of the model.
	Description string `json:"description,omitempty"`

	// DisplayName: The human-readable name of the model. E.g. "Chat Bison".
	// The name can be up to 128 characters long and can consist of any
	// UTF-8 characters.
	DisplayName string `json:"displayName,omitempty"`

	// InputTokenLimit: Maximum number of input tokens allowed for this
	// model.
	InputTokenLimit int64 `json:"inputTokenLimit,omitempty"`

	// Name: Required. The resource name of the `Model`. Format:
	// `models/{model}` with a `{model}` naming convention of: *
	// "{base_model_id}-{version}" Examples: * `models/chat-bison-001`
	Name string `json:"name,omitempty"`

	// OutputTokenLimit: Maximum number of output tokens available for this
	// model.
	OutputTokenLimit int64 `json:"outputTokenLimit,omitempty"`

	// SupportedGenerationMethods: The model's supported generation methods.
	// The method names are defined as Pascal case strings, such as
	// `generateMessage` which correspond to API methods.
	SupportedGenerationMethods []string `json:"supportedGenerationMethods,omitempty"`

	// Temperature: Controls the randomness of the output. Values can range
	// over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce
	// responses that are more varied, while a value closer to `0.0` will
	// typically result in less surprising responses from the model. This
	// value specifies default to be used by the backend while making the
	// call to the model.
	Temperature float64 `json:"temperature,omitempty"`

	// TopK: For Top-k sampling. Top-k sampling considers the set of `top_k`
	// most probable tokens. This value specifies default to be used by the
	// backend while making the call to the model. If empty, indicates the
	// model doesn't use top-k sampling, and `top_k` isn't allowed as a
	// generation parameter.
	TopK int64 `json:"topK,omitempty"`

	// TopP: For Nucleus sampling. Nucleus sampling considers the smallest
	// set of tokens whose probability sum is at least `top_p`. This value
	// specifies default to be used by the backend while making the call to
	// the model.
	TopP float64 `json:"topP,omitempty"`

	// Version: Required. The version number of the model. This represents
	// the major version
	Version string `json:"version,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "BaseModelId") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BaseModelId") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Model: Information about a Generative Language Model.

func (*Model) MarshalJSON

func (s *Model) MarshalJSON() ([]byte, error)

func (*Model) UnmarshalJSON

func (s *Model) UnmarshalJSON(data []byte) error

type ModelsBatchEmbedContentsCall

type ModelsBatchEmbedContentsCall struct {
	// contains filtered or unexported fields
}

func (*ModelsBatchEmbedContentsCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsBatchEmbedContentsCall) Do

Do executes the "generativelanguage.models.batchEmbedContents" call. Exactly one of *BatchEmbedContentsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *BatchEmbedContentsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsBatchEmbedContentsCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsBatchEmbedContentsCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsBatchEmbedTextCall

type ModelsBatchEmbedTextCall struct {
	// contains filtered or unexported fields
}

func (*ModelsBatchEmbedTextCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsBatchEmbedTextCall) Do

Do executes the "generativelanguage.models.batchEmbedText" call. Exactly one of *BatchEmbedTextResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *BatchEmbedTextResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsBatchEmbedTextCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsBatchEmbedTextCall) Header

func (c *ModelsBatchEmbedTextCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsCountMessageTokensCall

type ModelsCountMessageTokensCall struct {
	// contains filtered or unexported fields
}

func (*ModelsCountMessageTokensCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsCountMessageTokensCall) Do

Do executes the "generativelanguage.models.countMessageTokens" call. Exactly one of *CountMessageTokensResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *CountMessageTokensResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsCountMessageTokensCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsCountMessageTokensCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsCountTextTokensCall

type ModelsCountTextTokensCall struct {
	// contains filtered or unexported fields
}

func (*ModelsCountTextTokensCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsCountTextTokensCall) Do

Do executes the "generativelanguage.models.countTextTokens" call. Exactly one of *CountTextTokensResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *CountTextTokensResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsCountTextTokensCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsCountTextTokensCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsCountTokensCall

type ModelsCountTokensCall struct {
	// contains filtered or unexported fields
}

func (*ModelsCountTokensCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsCountTokensCall) Do

Do executes the "generativelanguage.models.countTokens" call. Exactly one of *CountTokensResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *CountTokensResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsCountTokensCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsCountTokensCall) Header

func (c *ModelsCountTokensCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsEmbedContentCall

type ModelsEmbedContentCall struct {
	// contains filtered or unexported fields
}

func (*ModelsEmbedContentCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsEmbedContentCall) Do

Do executes the "generativelanguage.models.embedContent" call. Exactly one of *EmbedContentResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *EmbedContentResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsEmbedContentCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsEmbedContentCall) Header

func (c *ModelsEmbedContentCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsEmbedTextCall

type ModelsEmbedTextCall struct {
	// contains filtered or unexported fields
}

func (*ModelsEmbedTextCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsEmbedTextCall) Do

Do executes the "generativelanguage.models.embedText" call. Exactly one of *EmbedTextResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *EmbedTextResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsEmbedTextCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsEmbedTextCall) Header

func (c *ModelsEmbedTextCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsGenerateAnswerCall

type ModelsGenerateAnswerCall struct {
	// contains filtered or unexported fields
}

func (*ModelsGenerateAnswerCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsGenerateAnswerCall) Do

Do executes the "generativelanguage.models.generateAnswer" call. Exactly one of *GenerateAnswerResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GenerateAnswerResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsGenerateAnswerCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsGenerateAnswerCall) Header

func (c *ModelsGenerateAnswerCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsGenerateContentCall

type ModelsGenerateContentCall struct {
	// contains filtered or unexported fields
}

func (*ModelsGenerateContentCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsGenerateContentCall) Do

Do executes the "generativelanguage.models.generateContent" call. Exactly one of *GenerateContentResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GenerateContentResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsGenerateContentCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsGenerateContentCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsGenerateMessageCall

type ModelsGenerateMessageCall struct {
	// contains filtered or unexported fields
}

func (*ModelsGenerateMessageCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsGenerateMessageCall) Do

Do executes the "generativelanguage.models.generateMessage" call. Exactly one of *GenerateMessageResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GenerateMessageResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsGenerateMessageCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsGenerateMessageCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsGenerateTextCall

type ModelsGenerateTextCall struct {
	// contains filtered or unexported fields
}

func (*ModelsGenerateTextCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsGenerateTextCall) Do

Do executes the "generativelanguage.models.generateText" call. Exactly one of *GenerateTextResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GenerateTextResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsGenerateTextCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsGenerateTextCall) Header

func (c *ModelsGenerateTextCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type ModelsGetCall

type ModelsGetCall struct {
	// contains filtered or unexported fields
}

func (*ModelsGetCall) Context

func (c *ModelsGetCall) Context(ctx context.Context) *ModelsGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsGetCall) Do

func (c *ModelsGetCall) Do(opts ...googleapi.CallOption) (*Model, error)

Do executes the "generativelanguage.models.get" call. Exactly one of *Model or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Model.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsGetCall) Fields

func (c *ModelsGetCall) Fields(s ...googleapi.Field) *ModelsGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsGetCall) Header

func (c *ModelsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ModelsGetCall) IfNoneMatch

func (c *ModelsGetCall) IfNoneMatch(entityTag string) *ModelsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type ModelsListCall

type ModelsListCall struct {
	// contains filtered or unexported fields
}

func (*ModelsListCall) Context

func (c *ModelsListCall) Context(ctx context.Context) *ModelsListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsListCall) Do

Do executes the "generativelanguage.models.list" call. Exactly one of *ListModelsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListModelsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsListCall) Fields

func (c *ModelsListCall) Fields(s ...googleapi.Field) *ModelsListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsListCall) Header

func (c *ModelsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ModelsListCall) IfNoneMatch

func (c *ModelsListCall) IfNoneMatch(entityTag string) *ModelsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ModelsListCall) PageSize

func (c *ModelsListCall) PageSize(pageSize int64) *ModelsListCall

PageSize sets the optional parameter "pageSize": The maximum number of `Models` to return (per page). The service may return fewer models. If unspecified, at most 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.

func (*ModelsListCall) PageToken

func (c *ModelsListCall) PageToken(pageToken string) *ModelsListCall

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.

func (*ModelsListCall) Pages

func (c *ModelsListCall) Pages(ctx context.Context, f func(*ListModelsResponse) error) error

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type ModelsService

type ModelsService struct {
	// contains filtered or unexported fields
}

func NewModelsService

func NewModelsService(s *Service) *ModelsService

func (*ModelsService) BatchEmbedContents

func (r *ModelsService) BatchEmbedContents(model string, batchembedcontentsrequest *BatchEmbedContentsRequest) *ModelsBatchEmbedContentsCall

BatchEmbedContents: Generates multiple embeddings from the model given input text in a synchronous call.

  • model: The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`.

func (*ModelsService) BatchEmbedText

func (r *ModelsService) BatchEmbedText(model string, batchembedtextrequest *BatchEmbedTextRequest) *ModelsBatchEmbedTextCall

BatchEmbedText: Generates multiple embeddings from the model given input text in a synchronous call.

  • model: The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001.

func (*ModelsService) CountMessageTokens

func (r *ModelsService) CountMessageTokens(model string, countmessagetokensrequest *CountMessageTokensRequest) *ModelsCountMessageTokensCall

CountMessageTokens: Runs a model's tokenizer on a string and returns the token count.

  • model: The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`.

func (*ModelsService) CountTextTokens

func (r *ModelsService) CountTextTokens(model string, counttexttokensrequest *CountTextTokensRequest) *ModelsCountTextTokensCall

CountTextTokens: Runs a model's tokenizer on a text and returns the token count.

  • model: The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`.

func (*ModelsService) CountTokens

func (r *ModelsService) CountTokens(model string, counttokensrequest *CountTokensRequest) *ModelsCountTokensCall

CountTokens: Runs a model's tokenizer on input content and returns the token count.

  • model: The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`.

func (*ModelsService) EmbedContent

func (r *ModelsService) EmbedContent(model string, embedcontentrequest *EmbedContentRequest) *ModelsEmbedContentCall

EmbedContent: Generates an embedding from the model given an input `Content`.

  • model: The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`.

func (*ModelsService) EmbedText

func (r *ModelsService) EmbedText(model string, embedtextrequest *EmbedTextRequest) *ModelsEmbedTextCall

EmbedText: Generates an embedding from the model given an input message.

- model: The model name to use with the format model=models/{model}.

func (*ModelsService) GenerateAnswer

func (r *ModelsService) GenerateAnswer(model string, generateanswerrequest *GenerateAnswerRequest) *ModelsGenerateAnswerCall

GenerateAnswer: Generates a grounded answer from the model given an input `GenerateAnswerRequest`.

  • model: The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.

func (*ModelsService) GenerateContent

func (r *ModelsService) GenerateContent(model string, generatecontentrequest *GenerateContentRequest) *ModelsGenerateContentCall

GenerateContent: Generates a response from the model given an input `GenerateContentRequest`.

  • model: The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.

func (*ModelsService) GenerateMessage

func (r *ModelsService) GenerateMessage(model string, generatemessagerequest *GenerateMessageRequest) *ModelsGenerateMessageCall

GenerateMessage: Generates a response from the model given an input `MessagePrompt`.

- model: The name of the model to use. Format: `name=models/{model}`.

func (*ModelsService) GenerateText

func (r *ModelsService) GenerateText(model string, generatetextrequest *GenerateTextRequest) *ModelsGenerateTextCall

GenerateText: Generates a response from the model given an input message.

  • model: The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m.

func (*ModelsService) Get

func (r *ModelsService) Get(name string) *ModelsGetCall

Get: Gets information about a specific Model.

  • name: The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`.

func (*ModelsService) List

func (r *ModelsService) List() *ModelsListCall

List: Lists models available through the API.

func (*ModelsService) StreamGenerateContent

func (r *ModelsService) StreamGenerateContent(model string, generatecontentrequest *GenerateContentRequest) *ModelsStreamGenerateContentCall

StreamGenerateContent: Generates a streamed response from the model given an input `GenerateContentRequest`.

  • model: The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.

type ModelsStreamGenerateContentCall

type ModelsStreamGenerateContentCall struct {
	// contains filtered or unexported fields
}

func (*ModelsStreamGenerateContentCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ModelsStreamGenerateContentCall) Do

Do executes the "generativelanguage.models.streamGenerateContent" call. Exactly one of *GenerateContentResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GenerateContentResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ModelsStreamGenerateContentCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ModelsStreamGenerateContentCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type Operation

type Operation struct {
	// Done: If the value is `false`, it means the operation is still in
	// progress. If `true`, the operation is completed, and either `error`
	// or `response` is available.
	Done bool `json:"done,omitempty"`

	// Error: The error result of the operation in case of failure or
	// cancellation.
	Error *Status `json:"error,omitempty"`

	// Metadata: Service-specific metadata associated with the operation. It
	// typically contains progress information and common metadata such as
	// create time. Some services might not provide such metadata. Any
	// method that returns a long-running operation should document the
	// metadata type, if any.
	Metadata googleapi.RawMessage `json:"metadata,omitempty"`

	// Name: The server-assigned name, which is only unique within the same
	// service that originally returns it. If you use the default HTTP
	// mapping, the `name` should be a resource name ending with
	// `operations/{unique_id}`.
	Name string `json:"name,omitempty"`

	// Response: The normal, successful response of the operation. If the
	// original method returns no data on success, such as `Delete`, the
	// response is `google.protobuf.Empty`. If the original method is
	// standard `Get`/`Create`/`Update`, the response should be the
	// resource. For other methods, the response should have the type
	// `XxxResponse`, where `Xxx` is the original method name. For example,
	// if the original method name is `TakeSnapshot()`, the inferred
	// response type is `TakeSnapshotResponse`.
	Response googleapi.RawMessage `json:"response,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Done") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Done") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Operation: This resource represents a long-running operation that is the result of a network API call.

func (*Operation) MarshalJSON

func (s *Operation) MarshalJSON() ([]byte, error)

type Part

type Part struct {
	// FileData: URI based data.
	FileData *FileData `json:"fileData,omitempty"`

	// FunctionCall: A predicted `FunctionCall` returned from the model that
	// contains a string representing the `FunctionDeclaration.name` with
	// the arguments and their values.
	FunctionCall *FunctionCall `json:"functionCall,omitempty"`

	// FunctionResponse: The result output of a `FunctionCall` that contains
	// a string representing the `FunctionDeclaration.name` and a structured
	// JSON object containing any output from the function is used as
	// context to the model.
	FunctionResponse *FunctionResponse `json:"functionResponse,omitempty"`

	// InlineData: Inline media bytes.
	InlineData *Blob `json:"inlineData,omitempty"`

	// Text: Inline text.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "FileData") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "FileData") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Part: A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.

func (*Part) MarshalJSON

func (s *Part) MarshalJSON() ([]byte, error)

type Permission

type Permission struct {
	// EmailAddress: Optional. Immutable. The email address of the user of
	// group which this permission refers. Field is not set when
	// permission's grantee type is EVERYONE.
	EmailAddress string `json:"emailAddress,omitempty"`

	// GranteeType: Optional. Immutable. The type of the grantee.
	//
	// Possible values:
	//   "GRANTEE_TYPE_UNSPECIFIED" - The default value. This value is
	// unused.
	//   "USER" - Represents a user. When set, you must provide
	// email_address for the user.
	//   "GROUP" - Represents a group. When set, you must provide
	// email_address for the group.
	//   "EVERYONE" - Represents access to everyone. No extra information is
	// required.
	GranteeType string `json:"granteeType,omitempty"`

	// Name: Output only. Identifier. The permission name. A unique name
	// will be generated on create. Examples:
	// tunedModels/{tuned_model}/permissions/{permission}
	// corpora/{corpus}/permissions/{permission} Output only.
	Name string `json:"name,omitempty"`

	// Role: Required. The role granted by this permission.
	//
	// Possible values:
	//   "ROLE_UNSPECIFIED" - The default value. This value is unused.
	//   "OWNER" - Owner can use, update, share and delete the resource.
	//   "WRITER" - Writer can use, update and share the resource.
	//   "READER" - Reader can use the resource.
	Role string `json:"role,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "EmailAddress") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Permission: Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete

func (*Permission) MarshalJSON

func (s *Permission) MarshalJSON() ([]byte, error)

type PromptFeedback

type PromptFeedback struct {
	// BlockReason: Optional. If set, the prompt was blocked and no
	// candidates are returned. Rephrase your prompt.
	//
	// Possible values:
	//   "BLOCK_REASON_UNSPECIFIED" - Default value. This value is unused.
	//   "SAFETY" - Prompt was blocked due to safety reasons. You can
	// inspect `safety_ratings` to understand which safety category blocked
	// it.
	//   "OTHER" - Prompt was blocked due to unknown reaasons.
	BlockReason string `json:"blockReason,omitempty"`

	// SafetyRatings: Ratings for safety of the prompt. There is at most one
	// rating per category.
	SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BlockReason") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BlockReason") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

PromptFeedback: A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.

func (*PromptFeedback) MarshalJSON

func (s *PromptFeedback) MarshalJSON() ([]byte, error)

type QueryCorpusRequest

type QueryCorpusRequest struct {
	// MetadataFilters: Optional. Filter for `Chunk` and `Document`
	// metadata. Each `MetadataFilter` object should correspond to a unique
	// key. Multiple `MetadataFilter` objects are joined by logical "AND"s.
	// Example query at document level: (year >= 2020 OR year < 2010) AND
	// (genre = drama OR genre = action) `MetadataFilter` object list:
	// metadata_filters = [ {key = "document.custom_metadata.year"
	// conditions = [{int_value = 2020, operation = GREATER_EQUAL},
	// {int_value = 2010, operation = LESS}]}, {key =
	// "document.custom_metadata.year" conditions = [{int_value = 2020,
	// operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]},
	// {key = "document.custom_metadata.genre" conditions = [{string_value =
	// "drama", operation = EQUAL}, {string_value = "action", operation =
	// EQUAL}]}] Example query at chunk level for a numeric range of values:
	// (year > 2015 AND year <= 2020) `MetadataFilter` object list:
	// metadata_filters = [ {key = "chunk.custom_metadata.year" conditions =
	// [{int_value = 2015, operation = GREATER}]}, {key =
	// "chunk.custom_metadata.year" conditions = [{int_value = 2020,
	// operation = LESS_EQUAL}]}] Note: "AND"s for the same key are only
	// supported for numeric values. String values only support "OR"s for
	// the same key.
	MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`

	// Query: Required. Query string to perform semantic search.
	Query string `json:"query,omitempty"`

	// ResultsCount: Optional. The maximum number of `Chunk`s to return. The
	// service may return fewer `Chunk`s. If unspecified, at most 10
	// `Chunk`s will be returned. The maximum specified result count is 100.
	ResultsCount int64 `json:"resultsCount,omitempty"`

	// ForceSendFields is a list of field names (e.g. "MetadataFilters") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "MetadataFilters") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

QueryCorpusRequest: Request for querying a `Corpus`.

func (*QueryCorpusRequest) MarshalJSON

func (s *QueryCorpusRequest) MarshalJSON() ([]byte, error)

type QueryCorpusResponse

type QueryCorpusResponse struct {
	// RelevantChunks: The relevant chunks.
	RelevantChunks []*RelevantChunk `json:"relevantChunks,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "RelevantChunks") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "RelevantChunks") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

QueryCorpusResponse: Response from `QueryCorpus` containing a list of relevant chunks.

func (*QueryCorpusResponse) MarshalJSON

func (s *QueryCorpusResponse) MarshalJSON() ([]byte, error)

type QueryDocumentRequest

type QueryDocumentRequest struct {
	// MetadataFilters: Optional. Filter for `Chunk` metadata. Each
	// `MetadataFilter` object should correspond to a unique key. Multiple
	// `MetadataFilter` objects are joined by logical "AND"s. Note:
	// `Document`-level filtering is not supported for this request because
	// a `Document` name is already specified. Example query: (year >= 2020
	// OR year < 2010) AND (genre = drama OR genre = action)
	// `MetadataFilter` object list: metadata_filters = [ {key =
	// "chunk.custom_metadata.year" conditions = [{int_value = 2020,
	// operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}},
	// {key = "chunk.custom_metadata.genre" conditions = [{string_value =
	// "drama", operation = EQUAL}, {string_value = "action", operation =
	// EQUAL}}] Example query for a numeric range of values: (year > 2015
	// AND year <= 2020) `MetadataFilter` object list: metadata_filters = [
	// {key = "chunk.custom_metadata.year" conditions = [{int_value = 2015,
	// operation = GREATER}]}, {key = "chunk.custom_metadata.year"
	// conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note:
	// "AND"s for the same key are only supported for numeric values. String
	// values only support "OR"s for the same key.
	MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`

	// Query: Required. Query string to perform semantic search.
	Query string `json:"query,omitempty"`

	// ResultsCount: Optional. The maximum number of `Chunk`s to return. The
	// service may return fewer `Chunk`s. If unspecified, at most 10
	// `Chunk`s will be returned. The maximum specified result count is 100.
	ResultsCount int64 `json:"resultsCount,omitempty"`

	// ForceSendFields is a list of field names (e.g. "MetadataFilters") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "MetadataFilters") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

QueryDocumentRequest: Request for querying a `Document`.

func (*QueryDocumentRequest) MarshalJSON

func (s *QueryDocumentRequest) MarshalJSON() ([]byte, error)

type QueryDocumentResponse

type QueryDocumentResponse struct {
	// RelevantChunks: The returned relevant chunks.
	RelevantChunks []*RelevantChunk `json:"relevantChunks,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "RelevantChunks") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "RelevantChunks") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

QueryDocumentResponse: Response from `QueryDocument` containing a list of relevant chunks.

func (*QueryDocumentResponse) MarshalJSON

func (s *QueryDocumentResponse) MarshalJSON() ([]byte, error)

type RelevantChunk

type RelevantChunk struct {
	// Chunk: `Chunk` associated with the query.
	Chunk *Chunk `json:"chunk,omitempty"`

	// ChunkRelevanceScore: `Chunk` relevance to the query.
	ChunkRelevanceScore float64 `json:"chunkRelevanceScore,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Chunk") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Chunk") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

RelevantChunk: The information for a chunk relevant to a query.

func (*RelevantChunk) MarshalJSON

func (s *RelevantChunk) MarshalJSON() ([]byte, error)

func (*RelevantChunk) UnmarshalJSON

func (s *RelevantChunk) UnmarshalJSON(data []byte) error

type SafetyFeedback

type SafetyFeedback struct {
	// Rating: Safety rating evaluated from content.
	Rating *SafetyRating `json:"rating,omitempty"`

	// Setting: Safety settings applied to the request.
	Setting *SafetySetting `json:"setting,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Rating") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Rating") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

SafetyFeedback: Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.

func (*SafetyFeedback) MarshalJSON

func (s *SafetyFeedback) MarshalJSON() ([]byte, error)

type SafetyRating

type SafetyRating struct {
	// Blocked: Was this content blocked because of this rating?
	Blocked bool `json:"blocked,omitempty"`

	// Category: Required. The category for this rating.
	//
	// Possible values:
	//   "HARM_CATEGORY_UNSPECIFIED" - Category is unspecified.
	//   "HARM_CATEGORY_DEROGATORY" - Negative or harmful comments targeting
	// identity and/or protected attribute.
	//   "HARM_CATEGORY_TOXICITY" - Content that is rude, disrespectful, or
	// profane.
	//   "HARM_CATEGORY_VIOLENCE" - Describes scenarios depicting violence
	// against an individual or group, or general descriptions of gore.
	//   "HARM_CATEGORY_SEXUAL" - Contains references to sexual acts or
	// other lewd content.
	//   "HARM_CATEGORY_MEDICAL" - Promotes unchecked medical advice.
	//   "HARM_CATEGORY_DANGEROUS" - Dangerous content that promotes,
	// facilitates, or encourages harmful acts.
	//   "HARM_CATEGORY_HARASSMENT" - Harasment content.
	//   "HARM_CATEGORY_HATE_SPEECH" - Hate speech and content.
	//   "HARM_CATEGORY_SEXUALLY_EXPLICIT" - Sexually explicit content.
	//   "HARM_CATEGORY_DANGEROUS_CONTENT" - Dangerous content.
	Category string `json:"category,omitempty"`

	// Probability: Required. The probability of harm for this content.
	//
	// Possible values:
	//   "HARM_PROBABILITY_UNSPECIFIED" - Probability is unspecified.
	//   "NEGLIGIBLE" - Content has a negligible chance of being unsafe.
	//   "LOW" - Content has a low chance of being unsafe.
	//   "MEDIUM" - Content has a medium chance of being unsafe.
	//   "HIGH" - Content has a high chance of being unsafe.
	Probability string `json:"probability,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Blocked") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Blocked") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

SafetyRating: Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.

func (*SafetyRating) MarshalJSON

func (s *SafetyRating) MarshalJSON() ([]byte, error)

type SafetySetting

type SafetySetting struct {
	// Category: Required. The category for this setting.
	//
	// Possible values:
	//   "HARM_CATEGORY_UNSPECIFIED" - Category is unspecified.
	//   "HARM_CATEGORY_DEROGATORY" - Negative or harmful comments targeting
	// identity and/or protected attribute.
	//   "HARM_CATEGORY_TOXICITY" - Content that is rude, disrespectful, or
	// profane.
	//   "HARM_CATEGORY_VIOLENCE" - Describes scenarios depicting violence
	// against an individual or group, or general descriptions of gore.
	//   "HARM_CATEGORY_SEXUAL" - Contains references to sexual acts or
	// other lewd content.
	//   "HARM_CATEGORY_MEDICAL" - Promotes unchecked medical advice.
	//   "HARM_CATEGORY_DANGEROUS" - Dangerous content that promotes,
	// facilitates, or encourages harmful acts.
	//   "HARM_CATEGORY_HARASSMENT" - Harasment content.
	//   "HARM_CATEGORY_HATE_SPEECH" - Hate speech and content.
	//   "HARM_CATEGORY_SEXUALLY_EXPLICIT" - Sexually explicit content.
	//   "HARM_CATEGORY_DANGEROUS_CONTENT" - Dangerous content.
	Category string `json:"category,omitempty"`

	// Threshold: Required. Controls the probability threshold at which harm
	// is blocked.
	//
	// Possible values:
	//   "HARM_BLOCK_THRESHOLD_UNSPECIFIED" - Threshold is unspecified.
	//   "BLOCK_LOW_AND_ABOVE" - Content with NEGLIGIBLE will be allowed.
	//   "BLOCK_MEDIUM_AND_ABOVE" - Content with NEGLIGIBLE and LOW will be
	// allowed.
	//   "BLOCK_ONLY_HIGH" - Content with NEGLIGIBLE, LOW, and MEDIUM will
	// be allowed.
	//   "BLOCK_NONE" - All content will be allowed.
	Threshold string `json:"threshold,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Category") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Category") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

SafetySetting: Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed proability that content is blocked.

func (*SafetySetting) MarshalJSON

func (s *SafetySetting) MarshalJSON() ([]byte, error)

type Schema

type Schema struct {
	// Description: Optional. A brief description of the parameter. This
	// could contain examples of use. Parameter description may be formatted
	// as Markdown.
	Description string `json:"description,omitempty"`

	// Enum: Optional. Possible values of the element of Type.STRING with
	// enum format. For example we can define an Enum Direction as :
	// {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
	Enum []string `json:"enum,omitempty"`

	// Format: Optional. The format of the data. This is used only for
	// primitive datatypes. Supported formats: for NUMBER type: float,
	// double for INTEGER type: int32, int64
	Format string `json:"format,omitempty"`

	// Items: Optional. Schema of the elements of Type.ARRAY.
	Items *Schema `json:"items,omitempty"`

	// Nullable: Optional. Indicates if the value may be null.
	Nullable bool `json:"nullable,omitempty"`

	// Properties: Optional. Properties of Type.OBJECT.
	Properties map[string]Schema `json:"properties,omitempty"`

	// Required: Optional. Required properties of Type.OBJECT.
	Required []string `json:"required,omitempty"`

	// Type: Required. Data type.
	//
	// Possible values:
	//   "TYPE_UNSPECIFIED" - Not specified, should not be used.
	//   "STRING" - String type.
	//   "NUMBER" - Number type.
	//   "INTEGER" - Integer type.
	//   "BOOLEAN" - Boolean type.
	//   "ARRAY" - Array type.
	//   "OBJECT" - Object type.
	Type string `json:"type,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Description") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Description") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Schema: The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object (https://spec.openapis.org/oas/v3.0.3#schema).

func (*Schema) MarshalJSON

func (s *Schema) MarshalJSON() ([]byte, error)

type SemanticRetrieverChunk

type SemanticRetrieverChunk struct {
	// Chunk: Output only. Name of the `Chunk` containing the attributed
	// text. Example: `corpora/123/documents/abc/chunks/xyz`
	Chunk string `json:"chunk,omitempty"`

	// Source: Output only. Name of the source matching the request's
	// `SemanticRetrieverConfig.source`. Example: `corpora/123` or
	// `corpora/123/documents/abc`
	Source string `json:"source,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Chunk") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Chunk") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

SemanticRetrieverChunk: Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.

func (*SemanticRetrieverChunk) MarshalJSON

func (s *SemanticRetrieverChunk) MarshalJSON() ([]byte, error)

type SemanticRetrieverConfig

type SemanticRetrieverConfig struct {
	// MaxChunksCount: Optional. Maximum number of relevant `Chunk`s to
	// retrieve.
	MaxChunksCount int64 `json:"maxChunksCount,omitempty"`

	// MetadataFilters: Optional. Filters for selecting `Document`s and/or
	// `Chunk`s from the resource.
	MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`

	// MinimumRelevanceScore: Optional. Minimum relevance score for
	// retrieved relevant `Chunk`s.
	MinimumRelevanceScore float64 `json:"minimumRelevanceScore,omitempty"`

	// Query: Required. Query to use for similarity matching `Chunk`s in the
	// given resource.
	Query *Content `json:"query,omitempty"`

	// Source: Required. Name of the resource for retrieval, e.g.
	// corpora/123 or corpora/123/documents/abc.
	Source string `json:"source,omitempty"`

	// ForceSendFields is a list of field names (e.g. "MaxChunksCount") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "MaxChunksCount") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

SemanticRetrieverConfig: Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.

func (*SemanticRetrieverConfig) MarshalJSON

func (s *SemanticRetrieverConfig) MarshalJSON() ([]byte, error)

func (*SemanticRetrieverConfig) UnmarshalJSON

func (s *SemanticRetrieverConfig) UnmarshalJSON(data []byte) error

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Corpora *CorporaService

	Files *FilesService

	Media *MediaService

	Models *ModelsService

	TunedModels *TunedModelsService
	// contains filtered or unexported fields
}

func New deprecated

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type Status

type Status struct {
	// Code: The status code, which should be an enum value of
	// google.rpc.Code.
	Code int64 `json:"code,omitempty"`

	// Details: A list of messages that carry the error details. There is a
	// common set of message types for APIs to use.
	Details []googleapi.RawMessage `json:"details,omitempty"`

	// Message: A developer-facing error message, which should be in
	// English. Any user-facing error message should be localized and sent
	// in the google.rpc.Status.details field, or localized by the client.
	Message string `json:"message,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Code") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Code") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).

func (*Status) MarshalJSON

func (s *Status) MarshalJSON() ([]byte, error)

type StringList

type StringList struct {
	// Values: The string values of the metadata to store.
	Values []string `json:"values,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Values") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Values") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

StringList: User provided string values assigned to a single metadata key.

func (*StringList) MarshalJSON

func (s *StringList) MarshalJSON() ([]byte, error)

type TextCompletion

type TextCompletion struct {
	// CitationMetadata: Output only. Citation information for
	// model-generated `output` in this `TextCompletion`. This field may be
	// populated with attribution information for any text included in the
	// `output`.
	CitationMetadata *CitationMetadata `json:"citationMetadata,omitempty"`

	// Output: Output only. The generated text returned from the model.
	Output string `json:"output,omitempty"`

	// SafetyRatings: Ratings for the safety of a response. There is at most
	// one rating per category.
	SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CitationMetadata") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CitationMetadata") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

TextCompletion: Output text returned from a model.

func (*TextCompletion) MarshalJSON

func (s *TextCompletion) MarshalJSON() ([]byte, error)

type TextPrompt

type TextPrompt struct {
	// Text: Required. The prompt text.
	Text string `json:"text,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Text") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Text") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TextPrompt: Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.

func (*TextPrompt) MarshalJSON

func (s *TextPrompt) MarshalJSON() ([]byte, error)

type Tool

type Tool struct {
	// FunctionDeclarations: Optional. A list of `FunctionDeclarations`
	// available to the model that can be used for function calling. The
	// model or system does not execute the function. Instead the defined
	// function may be returned as a FunctionCall with arguments to the
	// client side for execution. The model may decide to call a subset of
	// these functions by populating FunctionCall in the response. The next
	// conversation turn may contain a FunctionResponse with the
	// [content.role] "function" generation context for the next model turn.
	FunctionDeclarations []*FunctionDeclaration `json:"functionDeclarations,omitempty"`

	// ForceSendFields is a list of field names (e.g.
	// "FunctionDeclarations") to unconditionally include in API requests.
	// By default, fields with empty or default values are omitted from API
	// requests. However, any non-pointer, non-interface field appearing in
	// ForceSendFields will be sent to the server regardless of whether the
	// field is empty or not. This may be used to include empty fields in
	// Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "FunctionDeclarations") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

Tool: Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

func (*Tool) MarshalJSON

func (s *Tool) MarshalJSON() ([]byte, error)

type ToolConfig

type ToolConfig struct {
	// FunctionCallingConfig: Optional. Function calling config.
	FunctionCallingConfig *FunctionCallingConfig `json:"functionCallingConfig,omitempty"`

	// ForceSendFields is a list of field names (e.g.
	// "FunctionCallingConfig") to unconditionally include in API requests.
	// By default, fields with empty or default values are omitted from API
	// requests. However, any non-pointer, non-interface field appearing in
	// ForceSendFields will be sent to the server regardless of whether the
	// field is empty or not. This may be used to include empty fields in
	// Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "FunctionCallingConfig") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

ToolConfig: The Tool configuration containing parameters for specifying `Tool` use in the request.

func (*ToolConfig) MarshalJSON

func (s *ToolConfig) MarshalJSON() ([]byte, error)

type TransferOwnershipRequest

type TransferOwnershipRequest struct {
	// EmailAddress: Required. The email address of the user to whom the
	// tuned model is being transferred to.
	EmailAddress string `json:"emailAddress,omitempty"`

	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "EmailAddress") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TransferOwnershipRequest: Request to transfer the ownership of the tuned model.

func (*TransferOwnershipRequest) MarshalJSON

func (s *TransferOwnershipRequest) MarshalJSON() ([]byte, error)

type TransferOwnershipResponse

type TransferOwnershipResponse struct {
	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`
}

TransferOwnershipResponse: Response from `TransferOwnership`.

type TunedModel

type TunedModel struct {
	// BaseModel: Immutable. The name of the `Model` to tune. Example:
	// `models/text-bison-001`
	BaseModel string `json:"baseModel,omitempty"`

	// CreateTime: Output only. The timestamp when this model was created.
	CreateTime string `json:"createTime,omitempty"`

	// Description: Optional. A short description of this model.
	Description string `json:"description,omitempty"`

	// DisplayName: Optional. The name to display for this model in user
	// interfaces. The display name must be up to 40 characters including
	// spaces.
	DisplayName string `json:"displayName,omitempty"`

	// Name: Output only. The tuned model name. A unique name will be
	// generated on create. Example: `tunedModels/az2mb0bpw6i` If
	// display_name is set on create, the id portion of the name will be set
	// by concatenating the words of the display_name with hyphens and
	// adding a random portion for uniqueness. Example: display_name =
	// "Sentence Translator" name = "tunedModels/sentence-translator-u3b7m"
	Name string `json:"name,omitempty"`

	// State: Output only. The state of the tuned model.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - The default value. This value is unused.
	//   "CREATING" - The model is being created.
	//   "ACTIVE" - The model is ready to be used.
	//   "FAILED" - The model failed to be created.
	State string `json:"state,omitempty"`

	// Temperature: Optional. Controls the randomness of the output. Values
	// can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will
	// produce responses that are more varied, while a value closer to `0.0`
	// will typically result in less surprising responses from the model.
	// This value specifies default to be the one used by the base model
	// while creating the model.
	Temperature float64 `json:"temperature,omitempty"`

	// TopK: Optional. For Top-k sampling. Top-k sampling considers the set
	// of `top_k` most probable tokens. This value specifies default to be
	// used by the backend while making the call to the model. This value
	// specifies default to be the one used by the base model while creating
	// the model.
	TopK int64 `json:"topK,omitempty"`

	// TopP: Optional. For Nucleus sampling. Nucleus sampling considers the
	// smallest set of tokens whose probability sum is at least `top_p`.
	// This value specifies default to be the one used by the base model
	// while creating the model.
	TopP float64 `json:"topP,omitempty"`

	// TunedModelSource: Optional. TunedModel to use as the starting point
	// for training the new model.
	TunedModelSource *TunedModelSource `json:"tunedModelSource,omitempty"`

	// TuningTask: Required. The tuning task that creates the tuned model.
	TuningTask *TuningTask `json:"tuningTask,omitempty"`

	// UpdateTime: Output only. The timestamp when this model was updated.
	UpdateTime string `json:"updateTime,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "BaseModel") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BaseModel") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TunedModel: A fine-tuned model created using ModelService.CreateTunedModel.

func (*TunedModel) MarshalJSON

func (s *TunedModel) MarshalJSON() ([]byte, error)

func (*TunedModel) UnmarshalJSON

func (s *TunedModel) UnmarshalJSON(data []byte) error

type TunedModelSource

type TunedModelSource struct {
	// BaseModel: Output only. The name of the base `Model` this
	// `TunedModel` was tuned from. Example: `models/text-bison-001`
	BaseModel string `json:"baseModel,omitempty"`

	// TunedModel: Immutable. The name of the `TunedModel` to use as the
	// starting point for training the new model. Example:
	// `tunedModels/my-tuned-model`
	TunedModel string `json:"tunedModel,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BaseModel") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BaseModel") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TunedModelSource: Tuned model as a source for training a new model.

func (*TunedModelSource) MarshalJSON

func (s *TunedModelSource) MarshalJSON() ([]byte, error)

type TunedModelsCreateCall

type TunedModelsCreateCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsCreateCall) Do

Do executes the "generativelanguage.tunedModels.create" call. Exactly one of *Operation or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Operation.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsCreateCall) Header

func (c *TunedModelsCreateCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TunedModelsCreateCall) TunedModelId

func (c *TunedModelsCreateCall) TunedModelId(tunedModelId string) *TunedModelsCreateCall

TunedModelId sets the optional parameter "tunedModelId": The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: a-z ([a-z0-9-]{0,38}[a-z0-9])?.

type TunedModelsDeleteCall

type TunedModelsDeleteCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsDeleteCall) Do

Do executes the "generativelanguage.tunedModels.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsDeleteCall) Header

func (c *TunedModelsDeleteCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type TunedModelsGenerateContentCall

type TunedModelsGenerateContentCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsGenerateContentCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsGenerateContentCall) Do

Do executes the "generativelanguage.tunedModels.generateContent" call. Exactly one of *GenerateContentResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GenerateContentResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsGenerateContentCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsGenerateContentCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type TunedModelsGenerateTextCall

type TunedModelsGenerateTextCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsGenerateTextCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsGenerateTextCall) Do

Do executes the "generativelanguage.tunedModels.generateText" call. Exactly one of *GenerateTextResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GenerateTextResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsGenerateTextCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsGenerateTextCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type TunedModelsGetCall

type TunedModelsGetCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsGetCall) Do

Do executes the "generativelanguage.tunedModels.get" call. Exactly one of *TunedModel or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *TunedModel.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsGetCall) Header

func (c *TunedModelsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TunedModelsGetCall) IfNoneMatch

func (c *TunedModelsGetCall) IfNoneMatch(entityTag string) *TunedModelsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type TunedModelsListCall

type TunedModelsListCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsListCall) Do

Do executes the "generativelanguage.tunedModels.list" call. Exactly one of *ListTunedModelsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListTunedModelsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsListCall) Filter

func (c *TunedModelsListCall) Filter(filter string) *TunedModelsListCall

Filter sets the optional parameter "filter": A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: "owner:me" returns all tuned models to which caller has owner role "readers:me" returns all tuned models to which caller has reader role "readers:everyone" returns all tuned models that are shared with everyone

func (*TunedModelsListCall) Header

func (c *TunedModelsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TunedModelsListCall) IfNoneMatch

func (c *TunedModelsListCall) IfNoneMatch(entityTag string) *TunedModelsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*TunedModelsListCall) PageSize

func (c *TunedModelsListCall) PageSize(pageSize int64) *TunedModelsListCall

PageSize sets the optional parameter "pageSize": The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.

func (*TunedModelsListCall) PageToken

func (c *TunedModelsListCall) PageToken(pageToken string) *TunedModelsListCall

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.

func (*TunedModelsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type TunedModelsPatchCall

type TunedModelsPatchCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsPatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsPatchCall) Do

Do executes the "generativelanguage.tunedModels.patch" call. Exactly one of *TunedModel or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *TunedModel.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsPatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsPatchCall) Header

func (c *TunedModelsPatchCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TunedModelsPatchCall) UpdateMask

func (c *TunedModelsPatchCall) UpdateMask(updateMask string) *TunedModelsPatchCall

UpdateMask sets the optional parameter "updateMask": Required. The list of fields to update.

type TunedModelsPermissionsCreateCall

type TunedModelsPermissionsCreateCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsPermissionsCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsPermissionsCreateCall) Do

Do executes the "generativelanguage.tunedModels.permissions.create" call. Exactly one of *Permission or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Permission.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsPermissionsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsPermissionsCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type TunedModelsPermissionsDeleteCall

type TunedModelsPermissionsDeleteCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsPermissionsDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsPermissionsDeleteCall) Do

Do executes the "generativelanguage.tunedModels.permissions.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsPermissionsDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsPermissionsDeleteCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type TunedModelsPermissionsGetCall

type TunedModelsPermissionsGetCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsPermissionsGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsPermissionsGetCall) Do

Do executes the "generativelanguage.tunedModels.permissions.get" call. Exactly one of *Permission or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Permission.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsPermissionsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsPermissionsGetCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TunedModelsPermissionsGetCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type TunedModelsPermissionsListCall

type TunedModelsPermissionsListCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsPermissionsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsPermissionsListCall) Do

Do executes the "generativelanguage.tunedModels.permissions.list" call. Exactly one of *ListPermissionsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListPermissionsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsPermissionsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsPermissionsListCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TunedModelsPermissionsListCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*TunedModelsPermissionsListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.

func (*TunedModelsPermissionsListCall) PageToken

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.

func (*TunedModelsPermissionsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type TunedModelsPermissionsPatchCall

type TunedModelsPermissionsPatchCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsPermissionsPatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsPermissionsPatchCall) Do

Do executes the "generativelanguage.tunedModels.permissions.patch" call. Exactly one of *Permission or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Permission.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsPermissionsPatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsPermissionsPatchCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TunedModelsPermissionsPatchCall) UpdateMask

UpdateMask sets the optional parameter "updateMask": Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)

type TunedModelsPermissionsService

type TunedModelsPermissionsService struct {
	// contains filtered or unexported fields
}

func NewTunedModelsPermissionsService

func NewTunedModelsPermissionsService(s *Service) *TunedModelsPermissionsService

func (*TunedModelsPermissionsService) Create

Create: Create a permission to a specific resource.

  • parent: The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.

func (*TunedModelsPermissionsService) Delete

Delete: Deletes the permission.

  • name: The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`.

func (*TunedModelsPermissionsService) Get

Get: Gets information about a specific Permission.

  • name: The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`.

func (*TunedModelsPermissionsService) List

List: Lists permissions for the specific resource.

  • parent: The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.

func (*TunedModelsPermissionsService) Patch

Patch: Updates the permission.

  • name: Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.

type TunedModelsService

type TunedModelsService struct {
	Permissions *TunedModelsPermissionsService
	// contains filtered or unexported fields
}

func NewTunedModelsService

func NewTunedModelsService(s *Service) *TunedModelsService

func (*TunedModelsService) Create

func (r *TunedModelsService) Create(tunedmodel *TunedModel) *TunedModelsCreateCall

Create: Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222

func (*TunedModelsService) Delete

Delete: Deletes a tuned model.

  • name: The resource name of the model. Format: `tunedModels/my-model-id`.

func (*TunedModelsService) GenerateContent

func (r *TunedModelsService) GenerateContent(model string, generatecontentrequest *GenerateContentRequest) *TunedModelsGenerateContentCall

GenerateContent: Generates a response from the model given an input `GenerateContentRequest`.

  • model: The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.

func (*TunedModelsService) GenerateText

func (r *TunedModelsService) GenerateText(model string, generatetextrequest *GenerateTextRequest) *TunedModelsGenerateTextCall

GenerateText: Generates a response from the model given an input message.

  • model: The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m.

func (*TunedModelsService) Get

Get: Gets information about a specific TunedModel.

  • name: The resource name of the model. Format: `tunedModels/my-model-id`.

func (*TunedModelsService) List

List: Lists tuned models owned by the user.

func (*TunedModelsService) Patch

func (r *TunedModelsService) Patch(name string, tunedmodel *TunedModel) *TunedModelsPatchCall

Patch: Updates a tuned model.

  • name: Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: display_name = "Sentence Translator" name = "tunedModels/sentence-translator-u3b7m".

func (*TunedModelsService) TransferOwnership

func (r *TunedModelsService) TransferOwnership(name string, transferownershiprequest *TransferOwnershipRequest) *TunedModelsTransferOwnershipCall

TransferOwnership: Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.

  • name: The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`.

type TunedModelsTransferOwnershipCall

type TunedModelsTransferOwnershipCall struct {
	// contains filtered or unexported fields
}

func (*TunedModelsTransferOwnershipCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TunedModelsTransferOwnershipCall) Do

Do executes the "generativelanguage.tunedModels.transferOwnership" call. Exactly one of *TransferOwnershipResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *TransferOwnershipResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TunedModelsTransferOwnershipCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TunedModelsTransferOwnershipCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type TuningExample

type TuningExample struct {
	// Output: Required. The expected model output.
	Output string `json:"output,omitempty"`

	// TextInput: Optional. Text model input.
	TextInput string `json:"textInput,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Output") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Output") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TuningExample: A single example for tuning.

func (*TuningExample) MarshalJSON

func (s *TuningExample) MarshalJSON() ([]byte, error)

type TuningExamples

type TuningExamples struct {
	// Examples: Required. The examples. Example input can be for text or
	// discuss, but all examples in a set must be of the same type.
	Examples []*TuningExample `json:"examples,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Examples") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Examples") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TuningExamples: A set of tuning examples. Can be training or validation data.

func (*TuningExamples) MarshalJSON

func (s *TuningExamples) MarshalJSON() ([]byte, error)

type TuningSnapshot

type TuningSnapshot struct {
	// ComputeTime: Output only. The timestamp when this metric was
	// computed.
	ComputeTime string `json:"computeTime,omitempty"`

	// Epoch: Output only. The epoch this step was part of.
	Epoch int64 `json:"epoch,omitempty"`

	// MeanLoss: Output only. The mean loss of the training examples for
	// this step.
	MeanLoss float64 `json:"meanLoss,omitempty"`

	// Step: Output only. The tuning step.
	Step int64 `json:"step,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ComputeTime") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ComputeTime") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TuningSnapshot: Record for a single tuning step.

func (*TuningSnapshot) MarshalJSON

func (s *TuningSnapshot) MarshalJSON() ([]byte, error)

func (*TuningSnapshot) UnmarshalJSON

func (s *TuningSnapshot) UnmarshalJSON(data []byte) error

type TuningTask

type TuningTask struct {
	// CompleteTime: Output only. The timestamp when tuning this model
	// completed.
	CompleteTime string `json:"completeTime,omitempty"`

	// Hyperparameters: Immutable. Hyperparameters controlling the tuning
	// process. If not provided, default values will be used.
	Hyperparameters *Hyperparameters `json:"hyperparameters,omitempty"`

	// Snapshots: Output only. Metrics collected during tuning.
	Snapshots []*TuningSnapshot `json:"snapshots,omitempty"`

	// StartTime: Output only. The timestamp when tuning this model started.
	StartTime string `json:"startTime,omitempty"`

	// TrainingData: Required. Input only. Immutable. The model training
	// data.
	TrainingData *Dataset `json:"trainingData,omitempty"`

	// ForceSendFields is a list of field names (e.g. "CompleteTime") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CompleteTime") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

TuningTask: Tuning tasks that create tuned models.

func (*TuningTask) MarshalJSON

func (s *TuningTask) MarshalJSON() ([]byte, error)

type UpdateChunkRequest

type UpdateChunkRequest struct {
	// Chunk: Required. The `Chunk` to update.
	Chunk *Chunk `json:"chunk,omitempty"`

	// UpdateMask: Required. The list of fields to update. Currently, this
	// only supports updating `custom_metadata` and `data`.
	UpdateMask string `json:"updateMask,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Chunk") to
	// unconditionally include in API requests. By default, fields with
	// empty or default values are omitted from API requests. However, any
	// non-pointer, non-interface field appearing in ForceSendFields will be
	// sent to the server regardless of whether the field is empty or not.
	// This may be used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Chunk") to include in API
	// requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

UpdateChunkRequest: Request to update a `Chunk`.

func (*UpdateChunkRequest) MarshalJSON

func (s *UpdateChunkRequest) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL