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 ¶
- type AttributionSourceId
- type BatchCreateChunksRequest
- type BatchCreateChunksResponse
- type BatchDeleteChunksRequest
- type BatchEmbedContentsRequest
- type BatchEmbedContentsResponse
- type BatchEmbedTextRequest
- type BatchEmbedTextResponse
- type BatchUpdateChunksRequest
- type BatchUpdateChunksResponse
- type Blob
- type CachedContent
- type CachedContentUsageMetadata
- type CachedContentsCreateCall
- func (c *CachedContentsCreateCall) Context(ctx context.Context) *CachedContentsCreateCall
- func (c *CachedContentsCreateCall) Do(opts ...googleapi.CallOption) (*CachedContent, error)
- func (c *CachedContentsCreateCall) Fields(s ...googleapi.Field) *CachedContentsCreateCall
- func (c *CachedContentsCreateCall) Header() http.Header
- type CachedContentsDeleteCall
- func (c *CachedContentsDeleteCall) Context(ctx context.Context) *CachedContentsDeleteCall
- func (c *CachedContentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *CachedContentsDeleteCall) Fields(s ...googleapi.Field) *CachedContentsDeleteCall
- func (c *CachedContentsDeleteCall) Header() http.Header
- type CachedContentsGetCall
- func (c *CachedContentsGetCall) Context(ctx context.Context) *CachedContentsGetCall
- func (c *CachedContentsGetCall) Do(opts ...googleapi.CallOption) (*CachedContent, error)
- func (c *CachedContentsGetCall) Fields(s ...googleapi.Field) *CachedContentsGetCall
- func (c *CachedContentsGetCall) Header() http.Header
- func (c *CachedContentsGetCall) IfNoneMatch(entityTag string) *CachedContentsGetCall
- type CachedContentsListCall
- func (c *CachedContentsListCall) Context(ctx context.Context) *CachedContentsListCall
- func (c *CachedContentsListCall) Do(opts ...googleapi.CallOption) (*ListCachedContentsResponse, error)
- func (c *CachedContentsListCall) Fields(s ...googleapi.Field) *CachedContentsListCall
- func (c *CachedContentsListCall) Header() http.Header
- func (c *CachedContentsListCall) IfNoneMatch(entityTag string) *CachedContentsListCall
- func (c *CachedContentsListCall) PageSize(pageSize int64) *CachedContentsListCall
- func (c *CachedContentsListCall) PageToken(pageToken string) *CachedContentsListCall
- func (c *CachedContentsListCall) Pages(ctx context.Context, f func(*ListCachedContentsResponse) error) error
- type CachedContentsPatchCall
- func (c *CachedContentsPatchCall) Context(ctx context.Context) *CachedContentsPatchCall
- func (c *CachedContentsPatchCall) Do(opts ...googleapi.CallOption) (*CachedContent, error)
- func (c *CachedContentsPatchCall) Fields(s ...googleapi.Field) *CachedContentsPatchCall
- func (c *CachedContentsPatchCall) Header() http.Header
- func (c *CachedContentsPatchCall) UpdateMask(updateMask string) *CachedContentsPatchCall
- type CachedContentsService
- func (r *CachedContentsService) Create(cachedcontent *CachedContent) *CachedContentsCreateCall
- func (r *CachedContentsService) Delete(name string) *CachedContentsDeleteCall
- func (r *CachedContentsService) Get(name string) *CachedContentsGetCall
- func (r *CachedContentsService) List() *CachedContentsListCall
- func (r *CachedContentsService) Patch(name string, cachedcontent *CachedContent) *CachedContentsPatchCall
- type Candidate
- type Chunk
- type ChunkData
- type CitationMetadata
- type CitationSource
- type CodeExecution
- type CodeExecutionResult
- type Condition
- type Content
- type ContentEmbedding
- type ContentFilter
- type CorporaCreateCall
- type CorporaDeleteCall
- func (c *CorporaDeleteCall) Context(ctx context.Context) *CorporaDeleteCall
- func (c *CorporaDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *CorporaDeleteCall) Fields(s ...googleapi.Field) *CorporaDeleteCall
- func (c *CorporaDeleteCall) Force(force bool) *CorporaDeleteCall
- func (c *CorporaDeleteCall) Header() http.Header
- type CorporaDocumentsChunksBatchCreateCall
- func (c *CorporaDocumentsChunksBatchCreateCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchCreateCall
- func (c *CorporaDocumentsChunksBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateChunksResponse, error)
- func (c *CorporaDocumentsChunksBatchCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchCreateCall
- func (c *CorporaDocumentsChunksBatchCreateCall) Header() http.Header
- type CorporaDocumentsChunksBatchDeleteCall
- func (c *CorporaDocumentsChunksBatchDeleteCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchDeleteCall
- func (c *CorporaDocumentsChunksBatchDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *CorporaDocumentsChunksBatchDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchDeleteCall
- func (c *CorporaDocumentsChunksBatchDeleteCall) Header() http.Header
- type CorporaDocumentsChunksBatchUpdateCall
- func (c *CorporaDocumentsChunksBatchUpdateCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchUpdateCall
- func (c *CorporaDocumentsChunksBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateChunksResponse, error)
- func (c *CorporaDocumentsChunksBatchUpdateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchUpdateCall
- func (c *CorporaDocumentsChunksBatchUpdateCall) Header() http.Header
- type CorporaDocumentsChunksCreateCall
- func (c *CorporaDocumentsChunksCreateCall) Context(ctx context.Context) *CorporaDocumentsChunksCreateCall
- func (c *CorporaDocumentsChunksCreateCall) Do(opts ...googleapi.CallOption) (*Chunk, error)
- func (c *CorporaDocumentsChunksCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksCreateCall
- func (c *CorporaDocumentsChunksCreateCall) Header() http.Header
- type CorporaDocumentsChunksDeleteCall
- func (c *CorporaDocumentsChunksDeleteCall) Context(ctx context.Context) *CorporaDocumentsChunksDeleteCall
- func (c *CorporaDocumentsChunksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *CorporaDocumentsChunksDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksDeleteCall
- func (c *CorporaDocumentsChunksDeleteCall) Header() http.Header
- type CorporaDocumentsChunksGetCall
- func (c *CorporaDocumentsChunksGetCall) Context(ctx context.Context) *CorporaDocumentsChunksGetCall
- func (c *CorporaDocumentsChunksGetCall) Do(opts ...googleapi.CallOption) (*Chunk, error)
- func (c *CorporaDocumentsChunksGetCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksGetCall
- func (c *CorporaDocumentsChunksGetCall) Header() http.Header
- func (c *CorporaDocumentsChunksGetCall) IfNoneMatch(entityTag string) *CorporaDocumentsChunksGetCall
- type CorporaDocumentsChunksListCall
- func (c *CorporaDocumentsChunksListCall) Context(ctx context.Context) *CorporaDocumentsChunksListCall
- func (c *CorporaDocumentsChunksListCall) Do(opts ...googleapi.CallOption) (*ListChunksResponse, error)
- func (c *CorporaDocumentsChunksListCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksListCall
- func (c *CorporaDocumentsChunksListCall) Header() http.Header
- func (c *CorporaDocumentsChunksListCall) IfNoneMatch(entityTag string) *CorporaDocumentsChunksListCall
- func (c *CorporaDocumentsChunksListCall) PageSize(pageSize int64) *CorporaDocumentsChunksListCall
- func (c *CorporaDocumentsChunksListCall) PageToken(pageToken string) *CorporaDocumentsChunksListCall
- func (c *CorporaDocumentsChunksListCall) Pages(ctx context.Context, f func(*ListChunksResponse) error) error
- type CorporaDocumentsChunksPatchCall
- func (c *CorporaDocumentsChunksPatchCall) Context(ctx context.Context) *CorporaDocumentsChunksPatchCall
- func (c *CorporaDocumentsChunksPatchCall) Do(opts ...googleapi.CallOption) (*Chunk, error)
- func (c *CorporaDocumentsChunksPatchCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksPatchCall
- func (c *CorporaDocumentsChunksPatchCall) Header() http.Header
- func (c *CorporaDocumentsChunksPatchCall) UpdateMask(updateMask string) *CorporaDocumentsChunksPatchCall
- type CorporaDocumentsChunksService
- func (r *CorporaDocumentsChunksService) BatchCreate(parent string, batchcreatechunksrequest *BatchCreateChunksRequest) *CorporaDocumentsChunksBatchCreateCall
- func (r *CorporaDocumentsChunksService) BatchDelete(parent string, batchdeletechunksrequest *BatchDeleteChunksRequest) *CorporaDocumentsChunksBatchDeleteCall
- func (r *CorporaDocumentsChunksService) BatchUpdate(parent string, batchupdatechunksrequest *BatchUpdateChunksRequest) *CorporaDocumentsChunksBatchUpdateCall
- func (r *CorporaDocumentsChunksService) Create(parent string, chunk *Chunk) *CorporaDocumentsChunksCreateCall
- func (r *CorporaDocumentsChunksService) Delete(name string) *CorporaDocumentsChunksDeleteCall
- func (r *CorporaDocumentsChunksService) Get(name string) *CorporaDocumentsChunksGetCall
- func (r *CorporaDocumentsChunksService) List(parent string) *CorporaDocumentsChunksListCall
- func (r *CorporaDocumentsChunksService) Patch(name string, chunk *Chunk) *CorporaDocumentsChunksPatchCall
- type CorporaDocumentsCreateCall
- func (c *CorporaDocumentsCreateCall) Context(ctx context.Context) *CorporaDocumentsCreateCall
- func (c *CorporaDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*Document, error)
- func (c *CorporaDocumentsCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsCreateCall
- func (c *CorporaDocumentsCreateCall) Header() http.Header
- type CorporaDocumentsDeleteCall
- func (c *CorporaDocumentsDeleteCall) Context(ctx context.Context) *CorporaDocumentsDeleteCall
- func (c *CorporaDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *CorporaDocumentsDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsDeleteCall
- func (c *CorporaDocumentsDeleteCall) Force(force bool) *CorporaDocumentsDeleteCall
- func (c *CorporaDocumentsDeleteCall) Header() http.Header
- type CorporaDocumentsGetCall
- func (c *CorporaDocumentsGetCall) Context(ctx context.Context) *CorporaDocumentsGetCall
- func (c *CorporaDocumentsGetCall) Do(opts ...googleapi.CallOption) (*Document, error)
- func (c *CorporaDocumentsGetCall) Fields(s ...googleapi.Field) *CorporaDocumentsGetCall
- func (c *CorporaDocumentsGetCall) Header() http.Header
- func (c *CorporaDocumentsGetCall) IfNoneMatch(entityTag string) *CorporaDocumentsGetCall
- type CorporaDocumentsListCall
- func (c *CorporaDocumentsListCall) Context(ctx context.Context) *CorporaDocumentsListCall
- func (c *CorporaDocumentsListCall) Do(opts ...googleapi.CallOption) (*ListDocumentsResponse, error)
- func (c *CorporaDocumentsListCall) Fields(s ...googleapi.Field) *CorporaDocumentsListCall
- func (c *CorporaDocumentsListCall) Header() http.Header
- func (c *CorporaDocumentsListCall) IfNoneMatch(entityTag string) *CorporaDocumentsListCall
- func (c *CorporaDocumentsListCall) PageSize(pageSize int64) *CorporaDocumentsListCall
- func (c *CorporaDocumentsListCall) PageToken(pageToken string) *CorporaDocumentsListCall
- func (c *CorporaDocumentsListCall) Pages(ctx context.Context, f func(*ListDocumentsResponse) error) error
- type CorporaDocumentsPatchCall
- func (c *CorporaDocumentsPatchCall) Context(ctx context.Context) *CorporaDocumentsPatchCall
- func (c *CorporaDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*Document, error)
- func (c *CorporaDocumentsPatchCall) Fields(s ...googleapi.Field) *CorporaDocumentsPatchCall
- func (c *CorporaDocumentsPatchCall) Header() http.Header
- func (c *CorporaDocumentsPatchCall) UpdateMask(updateMask string) *CorporaDocumentsPatchCall
- type CorporaDocumentsQueryCall
- func (c *CorporaDocumentsQueryCall) Context(ctx context.Context) *CorporaDocumentsQueryCall
- func (c *CorporaDocumentsQueryCall) Do(opts ...googleapi.CallOption) (*QueryDocumentResponse, error)
- func (c *CorporaDocumentsQueryCall) Fields(s ...googleapi.Field) *CorporaDocumentsQueryCall
- func (c *CorporaDocumentsQueryCall) Header() http.Header
- type CorporaDocumentsService
- func (r *CorporaDocumentsService) Create(parent string, document *Document) *CorporaDocumentsCreateCall
- func (r *CorporaDocumentsService) Delete(name string) *CorporaDocumentsDeleteCall
- func (r *CorporaDocumentsService) Get(name string) *CorporaDocumentsGetCall
- func (r *CorporaDocumentsService) List(parent string) *CorporaDocumentsListCall
- func (r *CorporaDocumentsService) Patch(name string, document *Document) *CorporaDocumentsPatchCall
- func (r *CorporaDocumentsService) Query(name string, querydocumentrequest *QueryDocumentRequest) *CorporaDocumentsQueryCall
- type CorporaGetCall
- func (c *CorporaGetCall) Context(ctx context.Context) *CorporaGetCall
- func (c *CorporaGetCall) Do(opts ...googleapi.CallOption) (*Corpus, error)
- func (c *CorporaGetCall) Fields(s ...googleapi.Field) *CorporaGetCall
- func (c *CorporaGetCall) Header() http.Header
- func (c *CorporaGetCall) IfNoneMatch(entityTag string) *CorporaGetCall
- type CorporaListCall
- func (c *CorporaListCall) Context(ctx context.Context) *CorporaListCall
- func (c *CorporaListCall) Do(opts ...googleapi.CallOption) (*ListCorporaResponse, error)
- func (c *CorporaListCall) Fields(s ...googleapi.Field) *CorporaListCall
- func (c *CorporaListCall) Header() http.Header
- func (c *CorporaListCall) IfNoneMatch(entityTag string) *CorporaListCall
- func (c *CorporaListCall) PageSize(pageSize int64) *CorporaListCall
- func (c *CorporaListCall) PageToken(pageToken string) *CorporaListCall
- func (c *CorporaListCall) Pages(ctx context.Context, f func(*ListCorporaResponse) error) error
- type CorporaPatchCall
- func (c *CorporaPatchCall) Context(ctx context.Context) *CorporaPatchCall
- func (c *CorporaPatchCall) Do(opts ...googleapi.CallOption) (*Corpus, error)
- func (c *CorporaPatchCall) Fields(s ...googleapi.Field) *CorporaPatchCall
- func (c *CorporaPatchCall) Header() http.Header
- func (c *CorporaPatchCall) UpdateMask(updateMask string) *CorporaPatchCall
- type CorporaPermissionsCreateCall
- func (c *CorporaPermissionsCreateCall) Context(ctx context.Context) *CorporaPermissionsCreateCall
- func (c *CorporaPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error)
- func (c *CorporaPermissionsCreateCall) Fields(s ...googleapi.Field) *CorporaPermissionsCreateCall
- func (c *CorporaPermissionsCreateCall) Header() http.Header
- type CorporaPermissionsDeleteCall
- func (c *CorporaPermissionsDeleteCall) Context(ctx context.Context) *CorporaPermissionsDeleteCall
- func (c *CorporaPermissionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *CorporaPermissionsDeleteCall) Fields(s ...googleapi.Field) *CorporaPermissionsDeleteCall
- func (c *CorporaPermissionsDeleteCall) Header() http.Header
- type CorporaPermissionsGetCall
- func (c *CorporaPermissionsGetCall) Context(ctx context.Context) *CorporaPermissionsGetCall
- func (c *CorporaPermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error)
- func (c *CorporaPermissionsGetCall) Fields(s ...googleapi.Field) *CorporaPermissionsGetCall
- func (c *CorporaPermissionsGetCall) Header() http.Header
- func (c *CorporaPermissionsGetCall) IfNoneMatch(entityTag string) *CorporaPermissionsGetCall
- type CorporaPermissionsListCall
- func (c *CorporaPermissionsListCall) Context(ctx context.Context) *CorporaPermissionsListCall
- func (c *CorporaPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListPermissionsResponse, error)
- func (c *CorporaPermissionsListCall) Fields(s ...googleapi.Field) *CorporaPermissionsListCall
- func (c *CorporaPermissionsListCall) Header() http.Header
- func (c *CorporaPermissionsListCall) IfNoneMatch(entityTag string) *CorporaPermissionsListCall
- func (c *CorporaPermissionsListCall) PageSize(pageSize int64) *CorporaPermissionsListCall
- func (c *CorporaPermissionsListCall) PageToken(pageToken string) *CorporaPermissionsListCall
- func (c *CorporaPermissionsListCall) Pages(ctx context.Context, f func(*ListPermissionsResponse) error) error
- type CorporaPermissionsPatchCall
- func (c *CorporaPermissionsPatchCall) Context(ctx context.Context) *CorporaPermissionsPatchCall
- func (c *CorporaPermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, error)
- func (c *CorporaPermissionsPatchCall) Fields(s ...googleapi.Field) *CorporaPermissionsPatchCall
- func (c *CorporaPermissionsPatchCall) Header() http.Header
- func (c *CorporaPermissionsPatchCall) UpdateMask(updateMask string) *CorporaPermissionsPatchCall
- type CorporaPermissionsService
- func (r *CorporaPermissionsService) Create(parent string, permission *Permission) *CorporaPermissionsCreateCall
- func (r *CorporaPermissionsService) Delete(name string) *CorporaPermissionsDeleteCall
- func (r *CorporaPermissionsService) Get(name string) *CorporaPermissionsGetCall
- func (r *CorporaPermissionsService) List(parent string) *CorporaPermissionsListCall
- func (r *CorporaPermissionsService) Patch(name string, permission *Permission) *CorporaPermissionsPatchCall
- type CorporaQueryCall
- type CorporaService
- func (r *CorporaService) Create(corpus *Corpus) *CorporaCreateCall
- func (r *CorporaService) Delete(name string) *CorporaDeleteCall
- func (r *CorporaService) Get(name string) *CorporaGetCall
- func (r *CorporaService) List() *CorporaListCall
- func (r *CorporaService) Patch(name string, corpus *Corpus) *CorporaPatchCall
- func (r *CorporaService) Query(name string, querycorpusrequest *QueryCorpusRequest) *CorporaQueryCall
- type Corpus
- type CountMessageTokensRequest
- type CountMessageTokensResponse
- type CountTextTokensRequest
- type CountTextTokensResponse
- type CountTokensRequest
- type CountTokensResponse
- type CreateChunkRequest
- type CreateFileRequest
- type CreateFileResponse
- type CustomMetadata
- type Dataset
- type DeleteChunkRequest
- type Document
- type EmbedContentRequest
- type EmbedContentResponse
- type EmbedTextRequest
- type EmbedTextResponse
- type Embedding
- type Empty
- type Example
- type ExecutableCode
- type File
- type FileData
- type FilesDeleteCall
- type FilesGetCall
- func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall
- func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error)
- func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall
- func (c *FilesGetCall) Header() http.Header
- func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall
- type FilesListCall
- func (c *FilesListCall) Context(ctx context.Context) *FilesListCall
- func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*ListFilesResponse, error)
- func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall
- func (c *FilesListCall) Header() http.Header
- func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall
- func (c *FilesListCall) PageSize(pageSize int64) *FilesListCall
- func (c *FilesListCall) PageToken(pageToken string) *FilesListCall
- func (c *FilesListCall) Pages(ctx context.Context, f func(*ListFilesResponse) error) error
- type FilesService
- type FunctionCall
- type FunctionCallingConfig
- type FunctionDeclaration
- type FunctionResponse
- type GenerateAnswerRequest
- type GenerateAnswerResponse
- type GenerateContentRequest
- type GenerateContentResponse
- type GenerateMessageRequest
- type GenerateMessageResponse
- type GenerateTextRequest
- type GenerateTextResponse
- type GenerationConfig
- type GroundingAttribution
- type GroundingPassage
- type GroundingPassageId
- type GroundingPassages
- type Hyperparameters
- type InputFeedback
- type ListCachedContentsResponse
- type ListChunksResponse
- type ListCorporaResponse
- type ListDocumentsResponse
- type ListFilesResponse
- type ListModelsResponse
- type ListPermissionsResponse
- type ListTunedModelsResponse
- type MediaService
- type MediaUploadCall
- func (c *MediaUploadCall) Context(ctx context.Context) *MediaUploadCall
- func (c *MediaUploadCall) Do(opts ...googleapi.CallOption) (*CreateFileResponse, error)
- func (c *MediaUploadCall) Fields(s ...googleapi.Field) *MediaUploadCall
- func (c *MediaUploadCall) Header() http.Header
- func (c *MediaUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *MediaUploadCall
- func (c *MediaUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaUploadCall
- func (c *MediaUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaUploadCalldeprecated
- type Message
- type MessagePrompt
- type MetadataFilter
- type Model
- type ModelsBatchEmbedContentsCall
- func (c *ModelsBatchEmbedContentsCall) Context(ctx context.Context) *ModelsBatchEmbedContentsCall
- func (c *ModelsBatchEmbedContentsCall) Do(opts ...googleapi.CallOption) (*BatchEmbedContentsResponse, error)
- func (c *ModelsBatchEmbedContentsCall) Fields(s ...googleapi.Field) *ModelsBatchEmbedContentsCall
- func (c *ModelsBatchEmbedContentsCall) Header() http.Header
- type ModelsBatchEmbedTextCall
- func (c *ModelsBatchEmbedTextCall) Context(ctx context.Context) *ModelsBatchEmbedTextCall
- func (c *ModelsBatchEmbedTextCall) Do(opts ...googleapi.CallOption) (*BatchEmbedTextResponse, error)
- func (c *ModelsBatchEmbedTextCall) Fields(s ...googleapi.Field) *ModelsBatchEmbedTextCall
- func (c *ModelsBatchEmbedTextCall) Header() http.Header
- type ModelsCountMessageTokensCall
- func (c *ModelsCountMessageTokensCall) Context(ctx context.Context) *ModelsCountMessageTokensCall
- func (c *ModelsCountMessageTokensCall) Do(opts ...googleapi.CallOption) (*CountMessageTokensResponse, error)
- func (c *ModelsCountMessageTokensCall) Fields(s ...googleapi.Field) *ModelsCountMessageTokensCall
- func (c *ModelsCountMessageTokensCall) Header() http.Header
- type ModelsCountTextTokensCall
- func (c *ModelsCountTextTokensCall) Context(ctx context.Context) *ModelsCountTextTokensCall
- func (c *ModelsCountTextTokensCall) Do(opts ...googleapi.CallOption) (*CountTextTokensResponse, error)
- func (c *ModelsCountTextTokensCall) Fields(s ...googleapi.Field) *ModelsCountTextTokensCall
- func (c *ModelsCountTextTokensCall) Header() http.Header
- type ModelsCountTokensCall
- func (c *ModelsCountTokensCall) Context(ctx context.Context) *ModelsCountTokensCall
- func (c *ModelsCountTokensCall) Do(opts ...googleapi.CallOption) (*CountTokensResponse, error)
- func (c *ModelsCountTokensCall) Fields(s ...googleapi.Field) *ModelsCountTokensCall
- func (c *ModelsCountTokensCall) Header() http.Header
- type ModelsEmbedContentCall
- func (c *ModelsEmbedContentCall) Context(ctx context.Context) *ModelsEmbedContentCall
- func (c *ModelsEmbedContentCall) Do(opts ...googleapi.CallOption) (*EmbedContentResponse, error)
- func (c *ModelsEmbedContentCall) Fields(s ...googleapi.Field) *ModelsEmbedContentCall
- func (c *ModelsEmbedContentCall) Header() http.Header
- type ModelsEmbedTextCall
- func (c *ModelsEmbedTextCall) Context(ctx context.Context) *ModelsEmbedTextCall
- func (c *ModelsEmbedTextCall) Do(opts ...googleapi.CallOption) (*EmbedTextResponse, error)
- func (c *ModelsEmbedTextCall) Fields(s ...googleapi.Field) *ModelsEmbedTextCall
- func (c *ModelsEmbedTextCall) Header() http.Header
- type ModelsGenerateAnswerCall
- func (c *ModelsGenerateAnswerCall) Context(ctx context.Context) *ModelsGenerateAnswerCall
- func (c *ModelsGenerateAnswerCall) Do(opts ...googleapi.CallOption) (*GenerateAnswerResponse, error)
- func (c *ModelsGenerateAnswerCall) Fields(s ...googleapi.Field) *ModelsGenerateAnswerCall
- func (c *ModelsGenerateAnswerCall) Header() http.Header
- type ModelsGenerateContentCall
- func (c *ModelsGenerateContentCall) Context(ctx context.Context) *ModelsGenerateContentCall
- func (c *ModelsGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, error)
- func (c *ModelsGenerateContentCall) Fields(s ...googleapi.Field) *ModelsGenerateContentCall
- func (c *ModelsGenerateContentCall) Header() http.Header
- type ModelsGenerateMessageCall
- func (c *ModelsGenerateMessageCall) Context(ctx context.Context) *ModelsGenerateMessageCall
- func (c *ModelsGenerateMessageCall) Do(opts ...googleapi.CallOption) (*GenerateMessageResponse, error)
- func (c *ModelsGenerateMessageCall) Fields(s ...googleapi.Field) *ModelsGenerateMessageCall
- func (c *ModelsGenerateMessageCall) Header() http.Header
- type ModelsGenerateTextCall
- func (c *ModelsGenerateTextCall) Context(ctx context.Context) *ModelsGenerateTextCall
- func (c *ModelsGenerateTextCall) Do(opts ...googleapi.CallOption) (*GenerateTextResponse, error)
- func (c *ModelsGenerateTextCall) Fields(s ...googleapi.Field) *ModelsGenerateTextCall
- func (c *ModelsGenerateTextCall) Header() http.Header
- type ModelsGetCall
- func (c *ModelsGetCall) Context(ctx context.Context) *ModelsGetCall
- func (c *ModelsGetCall) Do(opts ...googleapi.CallOption) (*Model, error)
- func (c *ModelsGetCall) Fields(s ...googleapi.Field) *ModelsGetCall
- func (c *ModelsGetCall) Header() http.Header
- func (c *ModelsGetCall) IfNoneMatch(entityTag string) *ModelsGetCall
- type ModelsListCall
- func (c *ModelsListCall) Context(ctx context.Context) *ModelsListCall
- func (c *ModelsListCall) Do(opts ...googleapi.CallOption) (*ListModelsResponse, error)
- func (c *ModelsListCall) Fields(s ...googleapi.Field) *ModelsListCall
- func (c *ModelsListCall) Header() http.Header
- func (c *ModelsListCall) IfNoneMatch(entityTag string) *ModelsListCall
- func (c *ModelsListCall) PageSize(pageSize int64) *ModelsListCall
- func (c *ModelsListCall) PageToken(pageToken string) *ModelsListCall
- func (c *ModelsListCall) Pages(ctx context.Context, f func(*ListModelsResponse) error) error
- type ModelsService
- func (r *ModelsService) BatchEmbedContents(model string, batchembedcontentsrequest *BatchEmbedContentsRequest) *ModelsBatchEmbedContentsCall
- func (r *ModelsService) BatchEmbedText(model string, batchembedtextrequest *BatchEmbedTextRequest) *ModelsBatchEmbedTextCall
- func (r *ModelsService) CountMessageTokens(model string, countmessagetokensrequest *CountMessageTokensRequest) *ModelsCountMessageTokensCall
- func (r *ModelsService) CountTextTokens(model string, counttexttokensrequest *CountTextTokensRequest) *ModelsCountTextTokensCall
- func (r *ModelsService) CountTokens(model string, counttokensrequest *CountTokensRequest) *ModelsCountTokensCall
- func (r *ModelsService) EmbedContent(model string, embedcontentrequest *EmbedContentRequest) *ModelsEmbedContentCall
- func (r *ModelsService) EmbedText(model string, embedtextrequest *EmbedTextRequest) *ModelsEmbedTextCall
- func (r *ModelsService) GenerateAnswer(model string, generateanswerrequest *GenerateAnswerRequest) *ModelsGenerateAnswerCall
- func (r *ModelsService) GenerateContent(model string, generatecontentrequest *GenerateContentRequest) *ModelsGenerateContentCall
- func (r *ModelsService) GenerateMessage(model string, generatemessagerequest *GenerateMessageRequest) *ModelsGenerateMessageCall
- func (r *ModelsService) GenerateText(model string, generatetextrequest *GenerateTextRequest) *ModelsGenerateTextCall
- func (r *ModelsService) Get(name string) *ModelsGetCall
- func (r *ModelsService) List() *ModelsListCall
- func (r *ModelsService) StreamGenerateContent(model string, generatecontentrequest *GenerateContentRequest) *ModelsStreamGenerateContentCall
- type ModelsStreamGenerateContentCall
- func (c *ModelsStreamGenerateContentCall) Context(ctx context.Context) *ModelsStreamGenerateContentCall
- func (c *ModelsStreamGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, error)
- func (c *ModelsStreamGenerateContentCall) Fields(s ...googleapi.Field) *ModelsStreamGenerateContentCall
- func (c *ModelsStreamGenerateContentCall) Header() http.Header
- type Operation
- type Part
- type Permission
- type PromptFeedback
- type QueryCorpusRequest
- type QueryCorpusResponse
- type QueryDocumentRequest
- type QueryDocumentResponse
- type RelevantChunk
- type SafetyFeedback
- type SafetyRating
- type SafetySetting
- type Schema
- type SemanticRetrieverChunk
- type SemanticRetrieverConfig
- type Service
- type Status
- type StringList
- type TextCompletion
- type TextPrompt
- type Tool
- type ToolConfig
- type TransferOwnershipRequest
- type TransferOwnershipResponse
- type TunedModel
- type TunedModelSource
- type TunedModelsCreateCall
- func (c *TunedModelsCreateCall) Context(ctx context.Context) *TunedModelsCreateCall
- func (c *TunedModelsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error)
- func (c *TunedModelsCreateCall) Fields(s ...googleapi.Field) *TunedModelsCreateCall
- func (c *TunedModelsCreateCall) Header() http.Header
- func (c *TunedModelsCreateCall) TunedModelId(tunedModelId string) *TunedModelsCreateCall
- type TunedModelsDeleteCall
- func (c *TunedModelsDeleteCall) Context(ctx context.Context) *TunedModelsDeleteCall
- func (c *TunedModelsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *TunedModelsDeleteCall) Fields(s ...googleapi.Field) *TunedModelsDeleteCall
- func (c *TunedModelsDeleteCall) Header() http.Header
- type TunedModelsGenerateContentCall
- func (c *TunedModelsGenerateContentCall) Context(ctx context.Context) *TunedModelsGenerateContentCall
- func (c *TunedModelsGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, error)
- func (c *TunedModelsGenerateContentCall) Fields(s ...googleapi.Field) *TunedModelsGenerateContentCall
- func (c *TunedModelsGenerateContentCall) Header() http.Header
- type TunedModelsGenerateTextCall
- func (c *TunedModelsGenerateTextCall) Context(ctx context.Context) *TunedModelsGenerateTextCall
- func (c *TunedModelsGenerateTextCall) Do(opts ...googleapi.CallOption) (*GenerateTextResponse, error)
- func (c *TunedModelsGenerateTextCall) Fields(s ...googleapi.Field) *TunedModelsGenerateTextCall
- func (c *TunedModelsGenerateTextCall) Header() http.Header
- type TunedModelsGetCall
- func (c *TunedModelsGetCall) Context(ctx context.Context) *TunedModelsGetCall
- func (c *TunedModelsGetCall) Do(opts ...googleapi.CallOption) (*TunedModel, error)
- func (c *TunedModelsGetCall) Fields(s ...googleapi.Field) *TunedModelsGetCall
- func (c *TunedModelsGetCall) Header() http.Header
- func (c *TunedModelsGetCall) IfNoneMatch(entityTag string) *TunedModelsGetCall
- type TunedModelsListCall
- func (c *TunedModelsListCall) Context(ctx context.Context) *TunedModelsListCall
- func (c *TunedModelsListCall) Do(opts ...googleapi.CallOption) (*ListTunedModelsResponse, error)
- func (c *TunedModelsListCall) Fields(s ...googleapi.Field) *TunedModelsListCall
- func (c *TunedModelsListCall) Filter(filter string) *TunedModelsListCall
- func (c *TunedModelsListCall) Header() http.Header
- func (c *TunedModelsListCall) IfNoneMatch(entityTag string) *TunedModelsListCall
- func (c *TunedModelsListCall) PageSize(pageSize int64) *TunedModelsListCall
- func (c *TunedModelsListCall) PageToken(pageToken string) *TunedModelsListCall
- func (c *TunedModelsListCall) Pages(ctx context.Context, f func(*ListTunedModelsResponse) error) error
- type TunedModelsPatchCall
- func (c *TunedModelsPatchCall) Context(ctx context.Context) *TunedModelsPatchCall
- func (c *TunedModelsPatchCall) Do(opts ...googleapi.CallOption) (*TunedModel, error)
- func (c *TunedModelsPatchCall) Fields(s ...googleapi.Field) *TunedModelsPatchCall
- func (c *TunedModelsPatchCall) Header() http.Header
- func (c *TunedModelsPatchCall) UpdateMask(updateMask string) *TunedModelsPatchCall
- type TunedModelsPermissionsCreateCall
- func (c *TunedModelsPermissionsCreateCall) Context(ctx context.Context) *TunedModelsPermissionsCreateCall
- func (c *TunedModelsPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error)
- func (c *TunedModelsPermissionsCreateCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsCreateCall
- func (c *TunedModelsPermissionsCreateCall) Header() http.Header
- type TunedModelsPermissionsDeleteCall
- func (c *TunedModelsPermissionsDeleteCall) Context(ctx context.Context) *TunedModelsPermissionsDeleteCall
- func (c *TunedModelsPermissionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *TunedModelsPermissionsDeleteCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsDeleteCall
- func (c *TunedModelsPermissionsDeleteCall) Header() http.Header
- type TunedModelsPermissionsGetCall
- func (c *TunedModelsPermissionsGetCall) Context(ctx context.Context) *TunedModelsPermissionsGetCall
- func (c *TunedModelsPermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error)
- func (c *TunedModelsPermissionsGetCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsGetCall
- func (c *TunedModelsPermissionsGetCall) Header() http.Header
- func (c *TunedModelsPermissionsGetCall) IfNoneMatch(entityTag string) *TunedModelsPermissionsGetCall
- type TunedModelsPermissionsListCall
- func (c *TunedModelsPermissionsListCall) Context(ctx context.Context) *TunedModelsPermissionsListCall
- func (c *TunedModelsPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListPermissionsResponse, error)
- func (c *TunedModelsPermissionsListCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsListCall
- func (c *TunedModelsPermissionsListCall) Header() http.Header
- func (c *TunedModelsPermissionsListCall) IfNoneMatch(entityTag string) *TunedModelsPermissionsListCall
- func (c *TunedModelsPermissionsListCall) PageSize(pageSize int64) *TunedModelsPermissionsListCall
- func (c *TunedModelsPermissionsListCall) PageToken(pageToken string) *TunedModelsPermissionsListCall
- func (c *TunedModelsPermissionsListCall) Pages(ctx context.Context, f func(*ListPermissionsResponse) error) error
- type TunedModelsPermissionsPatchCall
- func (c *TunedModelsPermissionsPatchCall) Context(ctx context.Context) *TunedModelsPermissionsPatchCall
- func (c *TunedModelsPermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, error)
- func (c *TunedModelsPermissionsPatchCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsPatchCall
- func (c *TunedModelsPermissionsPatchCall) Header() http.Header
- func (c *TunedModelsPermissionsPatchCall) UpdateMask(updateMask string) *TunedModelsPermissionsPatchCall
- type TunedModelsPermissionsService
- func (r *TunedModelsPermissionsService) Create(parent string, permission *Permission) *TunedModelsPermissionsCreateCall
- func (r *TunedModelsPermissionsService) Delete(name string) *TunedModelsPermissionsDeleteCall
- func (r *TunedModelsPermissionsService) Get(name string) *TunedModelsPermissionsGetCall
- func (r *TunedModelsPermissionsService) List(parent string) *TunedModelsPermissionsListCall
- func (r *TunedModelsPermissionsService) Patch(name string, permission *Permission) *TunedModelsPermissionsPatchCall
- type TunedModelsService
- func (r *TunedModelsService) Create(tunedmodel *TunedModel) *TunedModelsCreateCall
- func (r *TunedModelsService) Delete(name string) *TunedModelsDeleteCall
- func (r *TunedModelsService) GenerateContent(model string, generatecontentrequest *GenerateContentRequest) *TunedModelsGenerateContentCall
- func (r *TunedModelsService) GenerateText(model string, generatetextrequest *GenerateTextRequest) *TunedModelsGenerateTextCall
- func (r *TunedModelsService) Get(name string) *TunedModelsGetCall
- func (r *TunedModelsService) List() *TunedModelsListCall
- func (r *TunedModelsService) Patch(name string, tunedmodel *TunedModel) *TunedModelsPatchCall
- func (r *TunedModelsService) TransferOwnership(name string, transferownershiprequest *TransferOwnershipRequest) *TunedModelsTransferOwnershipCall
- type TunedModelsTransferOwnershipCall
- func (c *TunedModelsTransferOwnershipCall) Context(ctx context.Context) *TunedModelsTransferOwnershipCall
- func (c *TunedModelsTransferOwnershipCall) Do(opts ...googleapi.CallOption) (*TransferOwnershipResponse, error)
- func (c *TunedModelsTransferOwnershipCall) Fields(s ...googleapi.Field) *TunedModelsTransferOwnershipCall
- func (c *TunedModelsTransferOwnershipCall) Header() http.Header
- type TuningExample
- type TuningExamples
- type TuningSnapshot
- type TuningTask
- type UpdateChunkRequest
- type UsageMetadata
- type VideoMetadata
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. Examples: - // image/png - image/jpeg If an unsupported MIME type is provided, an error // will be returned. For a complete list of supported types, see Supported file // formats // (https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats). 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Blob: Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.
func (Blob) MarshalJSON ¶
type CachedContent ¶ added in v0.15.0
type CachedContent struct { // Contents: Optional. Input only. Immutable. The content to cache. Contents []*Content `json:"contents,omitempty"` // CreateTime: Output only. Creation time of the cache entry. CreateTime string `json:"createTime,omitempty"` // DisplayName: Optional. Immutable. The user-generated meaningful display name // of the cached content. Maximum 128 Unicode characters. DisplayName string `json:"displayName,omitempty"` // ExpireTime: Timestamp in UTC of when this resource is considered expired. // This is *always* provided on output, regardless of what was sent on input. ExpireTime string `json:"expireTime,omitempty"` // Model: Required. Immutable. The name of the `Model` to use for cached // content Format: `models/{model}` Model string `json:"model,omitempty"` // Name: Optional. Identifier. The resource name referring to the cached // content. Format: `cachedContents/{id}` Name string `json:"name,omitempty"` // SystemInstruction: Optional. Input only. Immutable. Developer set system // instruction. Currently text only. SystemInstruction *Content `json:"systemInstruction,omitempty"` // ToolConfig: Optional. Input only. Immutable. Tool config. This config is // shared for all tools. ToolConfig *ToolConfig `json:"toolConfig,omitempty"` // Tools: Optional. Input only. Immutable. A list of `Tools` the model may use // to generate the next response Tools []*Tool `json:"tools,omitempty"` // Ttl: Input only. New TTL for this resource, input only. Ttl string `json:"ttl,omitempty"` // UpdateTime: Output only. When the cache entry was last updated in UTC time. UpdateTime string `json:"updateTime,omitempty"` // UsageMetadata: Output only. Metadata on the usage of the cached content. UsageMetadata *CachedContentUsageMetadata `json:"usageMetadata,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
CachedContent: Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for.
func (CachedContent) MarshalJSON ¶ added in v0.15.0
func (s CachedContent) MarshalJSON() ([]byte, error)
type CachedContentUsageMetadata ¶ added in v0.15.0
type CachedContentUsageMetadata struct { // TotalTokenCount: Total number of tokens that the cached content consumes. TotalTokenCount int64 `json:"totalTokenCount,omitempty"` // ForceSendFields is a list of field names (e.g. "TotalTokenCount") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "TotalTokenCount") to include in // API requests with the JSON null value. By default, fields with empty values // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
CachedContentUsageMetadata: Metadata on the usage of the cached content.
func (CachedContentUsageMetadata) MarshalJSON ¶ added in v0.15.0
func (s CachedContentUsageMetadata) MarshalJSON() ([]byte, error)
type CachedContentsCreateCall ¶ added in v0.15.0
type CachedContentsCreateCall struct {
// contains filtered or unexported fields
}
func (*CachedContentsCreateCall) Context ¶ added in v0.15.0
func (c *CachedContentsCreateCall) Context(ctx context.Context) *CachedContentsCreateCall
Context sets the context to be used in this call's Do method.
func (*CachedContentsCreateCall) Do ¶ added in v0.15.0
func (c *CachedContentsCreateCall) Do(opts ...googleapi.CallOption) (*CachedContent, error)
Do executes the "generativelanguage.cachedContents.create" call. Any non-2xx status code is an error. Response headers are in either *CachedContent.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 (*CachedContentsCreateCall) Fields ¶ added in v0.15.0
func (c *CachedContentsCreateCall) Fields(s ...googleapi.Field) *CachedContentsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CachedContentsCreateCall) Header ¶ added in v0.15.0
func (c *CachedContentsCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CachedContentsDeleteCall ¶ added in v0.15.0
type CachedContentsDeleteCall struct {
// contains filtered or unexported fields
}
func (*CachedContentsDeleteCall) Context ¶ added in v0.15.0
func (c *CachedContentsDeleteCall) Context(ctx context.Context) *CachedContentsDeleteCall
Context sets the context to be used in this call's Do method.
func (*CachedContentsDeleteCall) Do ¶ added in v0.15.0
func (c *CachedContentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.cachedContents.delete" call. 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 (*CachedContentsDeleteCall) Fields ¶ added in v0.15.0
func (c *CachedContentsDeleteCall) Fields(s ...googleapi.Field) *CachedContentsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CachedContentsDeleteCall) Header ¶ added in v0.15.0
func (c *CachedContentsDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CachedContentsGetCall ¶ added in v0.15.0
type CachedContentsGetCall struct {
// contains filtered or unexported fields
}
func (*CachedContentsGetCall) Context ¶ added in v0.15.0
func (c *CachedContentsGetCall) Context(ctx context.Context) *CachedContentsGetCall
Context sets the context to be used in this call's Do method.
func (*CachedContentsGetCall) Do ¶ added in v0.15.0
func (c *CachedContentsGetCall) Do(opts ...googleapi.CallOption) (*CachedContent, error)
Do executes the "generativelanguage.cachedContents.get" call. Any non-2xx status code is an error. Response headers are in either *CachedContent.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 (*CachedContentsGetCall) Fields ¶ added in v0.15.0
func (c *CachedContentsGetCall) Fields(s ...googleapi.Field) *CachedContentsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CachedContentsGetCall) Header ¶ added in v0.15.0
func (c *CachedContentsGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CachedContentsGetCall) IfNoneMatch ¶ added in v0.15.0
func (c *CachedContentsGetCall) IfNoneMatch(entityTag string) *CachedContentsGetCall
IfNoneMatch sets an 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.
type CachedContentsListCall ¶ added in v0.15.0
type CachedContentsListCall struct {
// contains filtered or unexported fields
}
func (*CachedContentsListCall) Context ¶ added in v0.15.0
func (c *CachedContentsListCall) Context(ctx context.Context) *CachedContentsListCall
Context sets the context to be used in this call's Do method.
func (*CachedContentsListCall) Do ¶ added in v0.15.0
func (c *CachedContentsListCall) Do(opts ...googleapi.CallOption) (*ListCachedContentsResponse, error)
Do executes the "generativelanguage.cachedContents.list" call. Any non-2xx status code is an error. Response headers are in either *ListCachedContentsResponse.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 (*CachedContentsListCall) Fields ¶ added in v0.15.0
func (c *CachedContentsListCall) Fields(s ...googleapi.Field) *CachedContentsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CachedContentsListCall) Header ¶ added in v0.15.0
func (c *CachedContentsListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CachedContentsListCall) IfNoneMatch ¶ added in v0.15.0
func (c *CachedContentsListCall) IfNoneMatch(entityTag string) *CachedContentsListCall
IfNoneMatch sets an 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.
func (*CachedContentsListCall) PageSize ¶ added in v0.15.0
func (c *CachedContentsListCall) PageSize(pageSize int64) *CachedContentsListCall
PageSize sets the optional parameter "pageSize": The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
func (*CachedContentsListCall) PageToken ¶ added in v0.15.0
func (c *CachedContentsListCall) PageToken(pageToken string) *CachedContentsListCall
PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.
func (*CachedContentsListCall) Pages ¶ added in v0.15.0
func (c *CachedContentsListCall) Pages(ctx context.Context, f func(*ListCachedContentsResponse) 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 CachedContentsPatchCall ¶ added in v0.15.0
type CachedContentsPatchCall struct {
// contains filtered or unexported fields
}
func (*CachedContentsPatchCall) Context ¶ added in v0.15.0
func (c *CachedContentsPatchCall) Context(ctx context.Context) *CachedContentsPatchCall
Context sets the context to be used in this call's Do method.
func (*CachedContentsPatchCall) Do ¶ added in v0.15.0
func (c *CachedContentsPatchCall) Do(opts ...googleapi.CallOption) (*CachedContent, error)
Do executes the "generativelanguage.cachedContents.patch" call. Any non-2xx status code is an error. Response headers are in either *CachedContent.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 (*CachedContentsPatchCall) Fields ¶ added in v0.15.0
func (c *CachedContentsPatchCall) Fields(s ...googleapi.Field) *CachedContentsPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CachedContentsPatchCall) Header ¶ added in v0.15.0
func (c *CachedContentsPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CachedContentsPatchCall) UpdateMask ¶ added in v0.15.0
func (c *CachedContentsPatchCall) UpdateMask(updateMask string) *CachedContentsPatchCall
UpdateMask sets the optional parameter "updateMask": The list of fields to update.
type CachedContentsService ¶ added in v0.15.0
type CachedContentsService struct {
// contains filtered or unexported fields
}
func NewCachedContentsService ¶ added in v0.15.0
func NewCachedContentsService(s *Service) *CachedContentsService
func (*CachedContentsService) Create ¶ added in v0.15.0
func (r *CachedContentsService) Create(cachedcontent *CachedContent) *CachedContentsCreateCall
Create: Creates CachedContent resource.
func (*CachedContentsService) Delete ¶ added in v0.15.0
func (r *CachedContentsService) Delete(name string) *CachedContentsDeleteCall
Delete: Deletes CachedContent resource.
- name: The resource name referring to the content cache entry Format: `cachedContents/{id}`.
func (*CachedContentsService) Get ¶ added in v0.15.0
func (r *CachedContentsService) Get(name string) *CachedContentsGetCall
Get: Reads CachedContent resource.
- name: The resource name referring to the content cache entry. Format: `cachedContents/{id}`.
func (*CachedContentsService) List ¶ added in v0.15.0
func (r *CachedContentsService) List() *CachedContentsListCall
List: Lists CachedContents.
func (*CachedContentsService) Patch ¶ added in v0.15.0
func (r *CachedContentsService) Patch(name string, cachedcontent *CachedContent) *CachedContentsPatchCall
Patch: Updates CachedContent resource (only expiration is updatable).
- name: Optional. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`.
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. // "LANGUAGE" - The candidate content was flagged for using an unsupported // language. // "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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Candidate: A response candidate generated from the model.
func (Candidate) MarshalJSON ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
ChunkData: Extracted data that represents the `Chunk` content.
func (ChunkData) MarshalJSON ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 CodeExecution ¶ added in v0.17.0
type CodeExecution struct { }
CodeExecution: Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.
type CodeExecutionResult ¶ added in v0.17.0
type CodeExecutionResult struct { // Outcome: Required. Outcome of the code execution. // // Possible values: // "OUTCOME_UNSPECIFIED" - Unspecified status. This value should not be used. // "OUTCOME_OK" - Code execution completed successfully. // "OUTCOME_FAILED" - Code execution finished but with a failure. `stderr` // should contain the reason. // "OUTCOME_DEADLINE_EXCEEDED" - Code execution ran for too long, and was // cancelled. There may or may not be a partial output present. Outcome string `json:"outcome,omitempty"` // Output: Optional. Contains stdout when code execution is successful, stderr // or other description otherwise. Output string `json:"output,omitempty"` // ForceSendFields is a list of field names (e.g. "Outcome") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Outcome") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
CodeExecutionResult: Result of executing the `ExecutableCode`. Only generated when using the `CodeExecution`, and always follows a `part` containing the `ExecutableCode`.
func (CodeExecutionResult) MarshalJSON ¶ added in v0.17.0
func (s CodeExecutionResult) 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Condition: Filter condition applicable to a single key.
func (Condition) MarshalJSON ¶
func (*Condition) UnmarshalJSON ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
func (c *CorporaCreateCall) Context(ctx context.Context) *CorporaCreateCall
Context sets the context to be used in this call's Do method.
func (*CorporaCreateCall) Do ¶
func (c *CorporaCreateCall) Do(opts ...googleapi.CallOption) (*Corpus, error)
Do executes the "generativelanguage.corpora.create" call. 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 ¶
func (c *CorporaCreateCall) Fields(s ...googleapi.Field) *CorporaCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaCreateCall) Header ¶
func (c *CorporaCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDeleteCall ¶
type CorporaDeleteCall struct {
// contains filtered or unexported fields
}
func (*CorporaDeleteCall) Context ¶
func (c *CorporaDeleteCall) Context(ctx context.Context) *CorporaDeleteCall
Context sets the context to be used in this call's Do method.
func (*CorporaDeleteCall) Do ¶
func (c *CorporaDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.corpora.delete" call. 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 ¶
func (c *CorporaDeleteCall) Fields(s ...googleapi.Field) *CorporaDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
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 a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsChunksBatchCreateCall ¶
type CorporaDocumentsChunksBatchCreateCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksBatchCreateCall) Context ¶
func (c *CorporaDocumentsChunksBatchCreateCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchCreateCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksBatchCreateCall) Do ¶
func (c *CorporaDocumentsChunksBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateChunksResponse, error)
Do executes the "generativelanguage.corpora.documents.chunks.batchCreate" call. 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 ¶
func (c *CorporaDocumentsChunksBatchCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksBatchCreateCall) Header ¶
func (c *CorporaDocumentsChunksBatchCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsChunksBatchDeleteCall ¶
type CorporaDocumentsChunksBatchDeleteCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksBatchDeleteCall) Context ¶
func (c *CorporaDocumentsChunksBatchDeleteCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchDeleteCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksBatchDeleteCall) Do ¶
func (c *CorporaDocumentsChunksBatchDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.corpora.documents.chunks.batchDelete" call. 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 ¶
func (c *CorporaDocumentsChunksBatchDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksBatchDeleteCall) Header ¶
func (c *CorporaDocumentsChunksBatchDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsChunksBatchUpdateCall ¶
type CorporaDocumentsChunksBatchUpdateCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksBatchUpdateCall) Context ¶
func (c *CorporaDocumentsChunksBatchUpdateCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchUpdateCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksBatchUpdateCall) Do ¶
func (c *CorporaDocumentsChunksBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateChunksResponse, error)
Do executes the "generativelanguage.corpora.documents.chunks.batchUpdate" call. 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 ¶
func (c *CorporaDocumentsChunksBatchUpdateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchUpdateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksBatchUpdateCall) Header ¶
func (c *CorporaDocumentsChunksBatchUpdateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsChunksCreateCall ¶
type CorporaDocumentsChunksCreateCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksCreateCall) Context ¶
func (c *CorporaDocumentsChunksCreateCall) Context(ctx context.Context) *CorporaDocumentsChunksCreateCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksCreateCall) Do ¶
func (c *CorporaDocumentsChunksCreateCall) Do(opts ...googleapi.CallOption) (*Chunk, error)
Do executes the "generativelanguage.corpora.documents.chunks.create" call. 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 ¶
func (c *CorporaDocumentsChunksCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksCreateCall) Header ¶
func (c *CorporaDocumentsChunksCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsChunksDeleteCall ¶
type CorporaDocumentsChunksDeleteCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksDeleteCall) Context ¶
func (c *CorporaDocumentsChunksDeleteCall) Context(ctx context.Context) *CorporaDocumentsChunksDeleteCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksDeleteCall) Do ¶
func (c *CorporaDocumentsChunksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.corpora.documents.chunks.delete" call. 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 ¶
func (c *CorporaDocumentsChunksDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksDeleteCall) Header ¶
func (c *CorporaDocumentsChunksDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsChunksGetCall ¶
type CorporaDocumentsChunksGetCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksGetCall) Context ¶
func (c *CorporaDocumentsChunksGetCall) Context(ctx context.Context) *CorporaDocumentsChunksGetCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksGetCall) Do ¶
func (c *CorporaDocumentsChunksGetCall) Do(opts ...googleapi.CallOption) (*Chunk, error)
Do executes the "generativelanguage.corpora.documents.chunks.get" call. 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 ¶
func (c *CorporaDocumentsChunksGetCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksGetCall) Header ¶
func (c *CorporaDocumentsChunksGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaDocumentsChunksGetCall) IfNoneMatch ¶
func (c *CorporaDocumentsChunksGetCall) IfNoneMatch(entityTag string) *CorporaDocumentsChunksGetCall
IfNoneMatch sets an 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.
type CorporaDocumentsChunksListCall ¶
type CorporaDocumentsChunksListCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksListCall) Context ¶
func (c *CorporaDocumentsChunksListCall) Context(ctx context.Context) *CorporaDocumentsChunksListCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksListCall) Do ¶
func (c *CorporaDocumentsChunksListCall) Do(opts ...googleapi.CallOption) (*ListChunksResponse, error)
Do executes the "generativelanguage.corpora.documents.chunks.list" call. 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 ¶
func (c *CorporaDocumentsChunksListCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksListCall) Header ¶
func (c *CorporaDocumentsChunksListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaDocumentsChunksListCall) IfNoneMatch ¶
func (c *CorporaDocumentsChunksListCall) IfNoneMatch(entityTag string) *CorporaDocumentsChunksListCall
IfNoneMatch sets an 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.
func (*CorporaDocumentsChunksListCall) PageSize ¶
func (c *CorporaDocumentsChunksListCall) PageSize(pageSize int64) *CorporaDocumentsChunksListCall
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 ¶
func (c *CorporaDocumentsChunksListCall) PageToken(pageToken string) *CorporaDocumentsChunksListCall
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 ¶
func (c *CorporaDocumentsChunksListCall) Pages(ctx context.Context, f func(*ListChunksResponse) 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 CorporaDocumentsChunksPatchCall ¶
type CorporaDocumentsChunksPatchCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsChunksPatchCall) Context ¶
func (c *CorporaDocumentsChunksPatchCall) Context(ctx context.Context) *CorporaDocumentsChunksPatchCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsChunksPatchCall) Do ¶
func (c *CorporaDocumentsChunksPatchCall) Do(opts ...googleapi.CallOption) (*Chunk, error)
Do executes the "generativelanguage.corpora.documents.chunks.patch" call. 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 ¶
func (c *CorporaDocumentsChunksPatchCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsChunksPatchCall) Header ¶
func (c *CorporaDocumentsChunksPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaDocumentsChunksPatchCall) UpdateMask ¶
func (c *CorporaDocumentsChunksPatchCall) UpdateMask(updateMask string) *CorporaDocumentsChunksPatchCall
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 ¶
func (r *CorporaDocumentsChunksService) BatchCreate(parent string, batchcreatechunksrequest *BatchCreateChunksRequest) *CorporaDocumentsChunksBatchCreateCall
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 ¶
func (r *CorporaDocumentsChunksService) BatchDelete(parent string, batchdeletechunksrequest *BatchDeleteChunksRequest) *CorporaDocumentsChunksBatchDeleteCall
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 ¶
func (r *CorporaDocumentsChunksService) BatchUpdate(parent string, batchupdatechunksrequest *BatchUpdateChunksRequest) *CorporaDocumentsChunksBatchUpdateCall
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 ¶
func (r *CorporaDocumentsChunksService) Create(parent string, chunk *Chunk) *CorporaDocumentsChunksCreateCall
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 ¶
func (r *CorporaDocumentsChunksService) Delete(name string) *CorporaDocumentsChunksDeleteCall
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 ¶
func (r *CorporaDocumentsChunksService) Get(name string) *CorporaDocumentsChunksGetCall
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 ¶
func (r *CorporaDocumentsChunksService) List(parent string) *CorporaDocumentsChunksListCall
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 ¶
func (r *CorporaDocumentsChunksService) Patch(name string, chunk *Chunk) *CorporaDocumentsChunksPatchCall
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 ¶
func (c *CorporaDocumentsCreateCall) Context(ctx context.Context) *CorporaDocumentsCreateCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsCreateCall) Do ¶
func (c *CorporaDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*Document, error)
Do executes the "generativelanguage.corpora.documents.create" call. 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 ¶
func (c *CorporaDocumentsCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsCreateCall) Header ¶
func (c *CorporaDocumentsCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsDeleteCall ¶
type CorporaDocumentsDeleteCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsDeleteCall) Context ¶
func (c *CorporaDocumentsDeleteCall) Context(ctx context.Context) *CorporaDocumentsDeleteCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsDeleteCall) Do ¶
func (c *CorporaDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.corpora.documents.delete" call. 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 ¶
func (c *CorporaDocumentsDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsDeleteCall) Force ¶
func (c *CorporaDocumentsDeleteCall) Force(force bool) *CorporaDocumentsDeleteCall
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 ¶
func (c *CorporaDocumentsDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaDocumentsGetCall ¶
type CorporaDocumentsGetCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsGetCall) Context ¶
func (c *CorporaDocumentsGetCall) Context(ctx context.Context) *CorporaDocumentsGetCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsGetCall) Do ¶
func (c *CorporaDocumentsGetCall) Do(opts ...googleapi.CallOption) (*Document, error)
Do executes the "generativelanguage.corpora.documents.get" call. 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 ¶
func (c *CorporaDocumentsGetCall) Fields(s ...googleapi.Field) *CorporaDocumentsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsGetCall) Header ¶
func (c *CorporaDocumentsGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaDocumentsGetCall) IfNoneMatch ¶
func (c *CorporaDocumentsGetCall) IfNoneMatch(entityTag string) *CorporaDocumentsGetCall
IfNoneMatch sets an 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.
type CorporaDocumentsListCall ¶
type CorporaDocumentsListCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsListCall) Context ¶
func (c *CorporaDocumentsListCall) Context(ctx context.Context) *CorporaDocumentsListCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsListCall) Do ¶
func (c *CorporaDocumentsListCall) Do(opts ...googleapi.CallOption) (*ListDocumentsResponse, error)
Do executes the "generativelanguage.corpora.documents.list" call. 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 ¶
func (c *CorporaDocumentsListCall) Fields(s ...googleapi.Field) *CorporaDocumentsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsListCall) Header ¶
func (c *CorporaDocumentsListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaDocumentsListCall) IfNoneMatch ¶
func (c *CorporaDocumentsListCall) IfNoneMatch(entityTag string) *CorporaDocumentsListCall
IfNoneMatch sets an 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.
func (*CorporaDocumentsListCall) PageSize ¶
func (c *CorporaDocumentsListCall) PageSize(pageSize int64) *CorporaDocumentsListCall
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 ¶
func (c *CorporaDocumentsListCall) Pages(ctx context.Context, f func(*ListDocumentsResponse) 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 CorporaDocumentsPatchCall ¶
type CorporaDocumentsPatchCall struct {
// contains filtered or unexported fields
}
func (*CorporaDocumentsPatchCall) Context ¶
func (c *CorporaDocumentsPatchCall) Context(ctx context.Context) *CorporaDocumentsPatchCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsPatchCall) Do ¶
func (c *CorporaDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*Document, error)
Do executes the "generativelanguage.corpora.documents.patch" call. 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 ¶
func (c *CorporaDocumentsPatchCall) Fields(s ...googleapi.Field) *CorporaDocumentsPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsPatchCall) Header ¶
func (c *CorporaDocumentsPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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 ¶
func (c *CorporaDocumentsQueryCall) Context(ctx context.Context) *CorporaDocumentsQueryCall
Context sets the context to be used in this call's Do method.
func (*CorporaDocumentsQueryCall) Do ¶
func (c *CorporaDocumentsQueryCall) Do(opts ...googleapi.CallOption) (*QueryDocumentResponse, error)
Do executes the "generativelanguage.corpora.documents.query" call. 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 ¶
func (c *CorporaDocumentsQueryCall) Fields(s ...googleapi.Field) *CorporaDocumentsQueryCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaDocumentsQueryCall) Header ¶
func (c *CorporaDocumentsQueryCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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 ¶
func (r *CorporaDocumentsService) Delete(name string) *CorporaDocumentsDeleteCall
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 ¶
func (r *CorporaDocumentsService) Get(name string) *CorporaDocumentsGetCall
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 ¶
func (r *CorporaDocumentsService) List(parent string) *CorporaDocumentsListCall
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 ¶
func (r *CorporaDocumentsService) Patch(name string, document *Document) *CorporaDocumentsPatchCall
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.
func (*CorporaGetCall) Do ¶
func (c *CorporaGetCall) Do(opts ...googleapi.CallOption) (*Corpus, error)
Do executes the "generativelanguage.corpora.get" call. 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 details.
func (*CorporaGetCall) Header ¶
func (c *CorporaGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaGetCall) IfNoneMatch ¶
func (c *CorporaGetCall) IfNoneMatch(entityTag string) *CorporaGetCall
IfNoneMatch sets an 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.
type CorporaListCall ¶
type CorporaListCall struct {
// contains filtered or unexported fields
}
func (*CorporaListCall) Context ¶
func (c *CorporaListCall) Context(ctx context.Context) *CorporaListCall
Context sets the context to be used in this call's Do method.
func (*CorporaListCall) Do ¶
func (c *CorporaListCall) Do(opts ...googleapi.CallOption) (*ListCorporaResponse, error)
Do executes the "generativelanguage.corpora.list" call. 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 ¶
func (c *CorporaListCall) Fields(s ...googleapi.Field) *CorporaListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaListCall) Header ¶
func (c *CorporaListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaListCall) IfNoneMatch ¶
func (c *CorporaListCall) IfNoneMatch(entityTag string) *CorporaListCall
IfNoneMatch sets an 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.
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 ¶
func (c *CorporaListCall) Pages(ctx context.Context, f func(*ListCorporaResponse) 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 CorporaPatchCall ¶
type CorporaPatchCall struct {
// contains filtered or unexported fields
}
func (*CorporaPatchCall) Context ¶
func (c *CorporaPatchCall) Context(ctx context.Context) *CorporaPatchCall
Context sets the context to be used in this call's Do method.
func (*CorporaPatchCall) Do ¶
func (c *CorporaPatchCall) Do(opts ...googleapi.CallOption) (*Corpus, error)
Do executes the "generativelanguage.corpora.patch" call. 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 ¶
func (c *CorporaPatchCall) Fields(s ...googleapi.Field) *CorporaPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaPatchCall) Header ¶
func (c *CorporaPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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 ¶
func (c *CorporaPermissionsCreateCall) Context(ctx context.Context) *CorporaPermissionsCreateCall
Context sets the context to be used in this call's Do method.
func (*CorporaPermissionsCreateCall) Do ¶
func (c *CorporaPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error)
Do executes the "generativelanguage.corpora.permissions.create" call. 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 ¶
func (c *CorporaPermissionsCreateCall) Fields(s ...googleapi.Field) *CorporaPermissionsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaPermissionsCreateCall) Header ¶
func (c *CorporaPermissionsCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaPermissionsDeleteCall ¶
type CorporaPermissionsDeleteCall struct {
// contains filtered or unexported fields
}
func (*CorporaPermissionsDeleteCall) Context ¶
func (c *CorporaPermissionsDeleteCall) Context(ctx context.Context) *CorporaPermissionsDeleteCall
Context sets the context to be used in this call's Do method.
func (*CorporaPermissionsDeleteCall) Do ¶
func (c *CorporaPermissionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.corpora.permissions.delete" call. 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 ¶
func (c *CorporaPermissionsDeleteCall) Fields(s ...googleapi.Field) *CorporaPermissionsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaPermissionsDeleteCall) Header ¶
func (c *CorporaPermissionsDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type CorporaPermissionsGetCall ¶
type CorporaPermissionsGetCall struct {
// contains filtered or unexported fields
}
func (*CorporaPermissionsGetCall) Context ¶
func (c *CorporaPermissionsGetCall) Context(ctx context.Context) *CorporaPermissionsGetCall
Context sets the context to be used in this call's Do method.
func (*CorporaPermissionsGetCall) Do ¶
func (c *CorporaPermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error)
Do executes the "generativelanguage.corpora.permissions.get" call. 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 ¶
func (c *CorporaPermissionsGetCall) Fields(s ...googleapi.Field) *CorporaPermissionsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaPermissionsGetCall) Header ¶
func (c *CorporaPermissionsGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaPermissionsGetCall) IfNoneMatch ¶
func (c *CorporaPermissionsGetCall) IfNoneMatch(entityTag string) *CorporaPermissionsGetCall
IfNoneMatch sets an 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.
type CorporaPermissionsListCall ¶
type CorporaPermissionsListCall struct {
// contains filtered or unexported fields
}
func (*CorporaPermissionsListCall) Context ¶
func (c *CorporaPermissionsListCall) Context(ctx context.Context) *CorporaPermissionsListCall
Context sets the context to be used in this call's Do method.
func (*CorporaPermissionsListCall) Do ¶
func (c *CorporaPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListPermissionsResponse, error)
Do executes the "generativelanguage.corpora.permissions.list" call. 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 ¶
func (c *CorporaPermissionsListCall) Fields(s ...googleapi.Field) *CorporaPermissionsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaPermissionsListCall) Header ¶
func (c *CorporaPermissionsListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaPermissionsListCall) IfNoneMatch ¶
func (c *CorporaPermissionsListCall) IfNoneMatch(entityTag string) *CorporaPermissionsListCall
IfNoneMatch sets an 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.
func (*CorporaPermissionsListCall) PageSize ¶
func (c *CorporaPermissionsListCall) PageSize(pageSize int64) *CorporaPermissionsListCall
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 ¶
func (c *CorporaPermissionsListCall) PageToken(pageToken string) *CorporaPermissionsListCall
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 ¶
func (c *CorporaPermissionsListCall) Pages(ctx context.Context, f func(*ListPermissionsResponse) 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 CorporaPermissionsPatchCall ¶
type CorporaPermissionsPatchCall struct {
// contains filtered or unexported fields
}
func (*CorporaPermissionsPatchCall) Context ¶
func (c *CorporaPermissionsPatchCall) Context(ctx context.Context) *CorporaPermissionsPatchCall
Context sets the context to be used in this call's Do method.
func (*CorporaPermissionsPatchCall) Do ¶
func (c *CorporaPermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, error)
Do executes the "generativelanguage.corpora.permissions.patch" call. 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 ¶
func (c *CorporaPermissionsPatchCall) Fields(s ...googleapi.Field) *CorporaPermissionsPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaPermissionsPatchCall) Header ¶
func (c *CorporaPermissionsPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*CorporaPermissionsPatchCall) UpdateMask ¶
func (c *CorporaPermissionsPatchCall) UpdateMask(updateMask string) *CorporaPermissionsPatchCall
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 ¶
func (r *CorporaPermissionsService) Create(parent string, permission *Permission) *CorporaPermissionsCreateCall
Create: Create a permission to a specific resource.
- parent: The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.
func (*CorporaPermissionsService) Delete ¶
func (r *CorporaPermissionsService) Delete(name string) *CorporaPermissionsDeleteCall
Delete: Deletes the permission.
- name: The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`.
func (*CorporaPermissionsService) Get ¶
func (r *CorporaPermissionsService) Get(name string) *CorporaPermissionsGetCall
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 ¶
func (r *CorporaPermissionsService) List(parent string) *CorporaPermissionsListCall
List: Lists permissions for the specific resource.
- parent: The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.
func (*CorporaPermissionsService) Patch ¶
func (r *CorporaPermissionsService) Patch(name string, permission *Permission) *CorporaPermissionsPatchCall
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 ¶
func (c *CorporaQueryCall) Context(ctx context.Context) *CorporaQueryCall
Context sets the context to be used in this call's Do method.
func (*CorporaQueryCall) Do ¶
func (c *CorporaQueryCall) Do(opts ...googleapi.CallOption) (*QueryCorpusResponse, error)
Do executes the "generativelanguage.corpora.query" call. 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 ¶
func (c *CorporaQueryCall) Fields(s ...googleapi.Field) *CorporaQueryCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*CorporaQueryCall) Header ¶
func (c *CorporaQueryCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Corpus: A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.
func (Corpus) MarshalJSON ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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: Optional. The input given to the model as a prompt. This field is // ignored when `generate_content_request` is set. Contents []*Content `json:"contents,omitempty"` // GenerateContentRequest: Optional. The overall input given to the model. // CountTokens will count prompt, function calling, etc. GenerateContentRequest *GenerateContentRequest `json:"generateContentRequest,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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. When cached_content is set, this is still the // total effective prompt size. I.e. this includes the number of tokens in the // cached content. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Dataset: Dataset for training or validation.
func (Dataset) MarshalJSON ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Embedding: A list of floats representing the embedding.
func (Embedding) MarshalJSON ¶
func (*Embedding) UnmarshalJSON ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
type ExecutableCode ¶ added in v0.17.0
type ExecutableCode struct { // Code: Required. The code to be executed. Code string `json:"code,omitempty"` // Language: Required. Programming language of the `code`. // // Possible values: // "LANGUAGE_UNSPECIFIED" - Unspecified language. This value should not be // used. // "PYTHON" - Python >= 3.10, with numpy and simpy available. Language string `json:"language,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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
ExecutableCode: Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.
func (ExecutableCode) MarshalJSON ¶ added in v0.17.0
func (s ExecutableCode) 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"` // Error: Output only. Error status if File processing failed. Error *Status `json:"error,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"` // State: Output only. Processing state of the File. // // Possible values: // "STATE_UNSPECIFIED" - The default value. This value is used if the state // is omitted. // "PROCESSING" - File is being processed and cannot be used for inference // yet. // "ACTIVE" - File is processed and available for inference. // "FAILED" - File failed processing. State string `json:"state,omitempty"` // 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"` // VideoMetadata: Output only. Metadata for a video. VideoMetadata *VideoMetadata `json:"videoMetadata,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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
File: A file uploaded to the API.
func (File) MarshalJSON ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
FileData: URI based data.
func (FileData) MarshalJSON ¶
type FilesDeleteCall ¶
type FilesDeleteCall struct {
// contains filtered or unexported fields
}
func (*FilesDeleteCall) Context ¶
func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall
Context sets the context to be used in this call's Do method.
func (*FilesDeleteCall) Do ¶
func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.files.delete" call. 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 ¶
func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*FilesDeleteCall) Header ¶
func (c *FilesDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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.
func (*FilesGetCall) Do ¶
func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error)
Do executes the "generativelanguage.files.get" call. 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 details.
func (*FilesGetCall) Header ¶
func (c *FilesGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*FilesGetCall) IfNoneMatch ¶
func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall
IfNoneMatch sets an 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.
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.
func (*FilesListCall) Do ¶
func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*ListFilesResponse, error)
Do executes the "generativelanguage.files.list" call. 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 details.
func (*FilesListCall) Header ¶
func (c *FilesListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*FilesListCall) IfNoneMatch ¶
func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall
IfNoneMatch sets an 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.
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 response. // "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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 { // CachedContent: Optional. The name of the cached content used as context to // serve the prediction. Note: only used in explicit caching, where users can // have control over caching (e.g. what content to cache) and enjoy guaranteed // cost savings. Format: `cachedContents/{cachedContent}` CachedContent string `json:"cachedContent,omitempty"` // 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"` // Model: Required. The name of the `Model` to use for generating the // completion. Format: `name=models/{model}`. Model string `json:"model,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. "CachedContent") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CachedContent") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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"` // UsageMetadata: Output only. Metadata on the generation requests' token // usage. UsageMetadata *UsageMetadata `json:"usageMetadata,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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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"` // ResponseSchema: Optional. Output response schema of the generated candidate // text when response mime type can have schema. Schema can be objects, // primitives or arrays and is a subset of OpenAPI schema // (https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible // response_mime_type must also be set. Compatible mimetypes: // `application/json`: Schema for JSON response. ResponseSchema *Schema `json:"responseSchema,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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ListCachedContentsResponse ¶ added in v0.15.0
type ListCachedContentsResponse struct { // CachedContents: List of cached contents. CachedContents []*CachedContent `json:"cachedContents,omitempty"` // NextPageToken: A token, which can be sent as `page_token` to retrieve the // next page. If this field is omitted, there are no subsequent 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. "CachedContents") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CachedContents") to include in // API requests with the JSON null value. By default, fields with empty values // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
ListCachedContentsResponse: Response with CachedContents list.
func (ListCachedContentsResponse) MarshalJSON ¶ added in v0.15.0
func (s ListCachedContentsResponse) 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
func (c *MediaUploadCall) Context(ctx context.Context) *MediaUploadCall
Context sets the context to be used in this call's Do method. This context will supersede any context previously provided to the ResumableMedia method.
func (*MediaUploadCall) Do ¶
func (c *MediaUploadCall) Do(opts ...googleapi.CallOption) (*CreateFileResponse, error)
Do executes the "generativelanguage.media.upload" call. 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 ¶
func (c *MediaUploadCall) Fields(s ...googleapi.Field) *MediaUploadCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*MediaUploadCall) Header ¶
func (c *MediaUploadCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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"` // MaxTemperature: The maximum temperature this model can use. MaxTemperature float64 `json:"maxTemperature,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,max_temperature]`, inclusive. A higher value 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Model: Information about a Generative Language Model.
func (Model) MarshalJSON ¶
func (*Model) UnmarshalJSON ¶
type ModelsBatchEmbedContentsCall ¶
type ModelsBatchEmbedContentsCall struct {
// contains filtered or unexported fields
}
func (*ModelsBatchEmbedContentsCall) Context ¶
func (c *ModelsBatchEmbedContentsCall) Context(ctx context.Context) *ModelsBatchEmbedContentsCall
Context sets the context to be used in this call's Do method.
func (*ModelsBatchEmbedContentsCall) Do ¶
func (c *ModelsBatchEmbedContentsCall) Do(opts ...googleapi.CallOption) (*BatchEmbedContentsResponse, error)
Do executes the "generativelanguage.models.batchEmbedContents" call. 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 ¶
func (c *ModelsBatchEmbedContentsCall) Fields(s ...googleapi.Field) *ModelsBatchEmbedContentsCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsBatchEmbedContentsCall) Header ¶
func (c *ModelsBatchEmbedContentsCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsBatchEmbedTextCall ¶
type ModelsBatchEmbedTextCall struct {
// contains filtered or unexported fields
}
func (*ModelsBatchEmbedTextCall) Context ¶
func (c *ModelsBatchEmbedTextCall) Context(ctx context.Context) *ModelsBatchEmbedTextCall
Context sets the context to be used in this call's Do method.
func (*ModelsBatchEmbedTextCall) Do ¶
func (c *ModelsBatchEmbedTextCall) Do(opts ...googleapi.CallOption) (*BatchEmbedTextResponse, error)
Do executes the "generativelanguage.models.batchEmbedText" call. 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 ¶
func (c *ModelsBatchEmbedTextCall) Fields(s ...googleapi.Field) *ModelsBatchEmbedTextCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsBatchEmbedTextCall) Header ¶
func (c *ModelsBatchEmbedTextCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsCountMessageTokensCall ¶
type ModelsCountMessageTokensCall struct {
// contains filtered or unexported fields
}
func (*ModelsCountMessageTokensCall) Context ¶
func (c *ModelsCountMessageTokensCall) Context(ctx context.Context) *ModelsCountMessageTokensCall
Context sets the context to be used in this call's Do method.
func (*ModelsCountMessageTokensCall) Do ¶
func (c *ModelsCountMessageTokensCall) Do(opts ...googleapi.CallOption) (*CountMessageTokensResponse, error)
Do executes the "generativelanguage.models.countMessageTokens" call. 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 ¶
func (c *ModelsCountMessageTokensCall) Fields(s ...googleapi.Field) *ModelsCountMessageTokensCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsCountMessageTokensCall) Header ¶
func (c *ModelsCountMessageTokensCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsCountTextTokensCall ¶
type ModelsCountTextTokensCall struct {
// contains filtered or unexported fields
}
func (*ModelsCountTextTokensCall) Context ¶
func (c *ModelsCountTextTokensCall) Context(ctx context.Context) *ModelsCountTextTokensCall
Context sets the context to be used in this call's Do method.
func (*ModelsCountTextTokensCall) Do ¶
func (c *ModelsCountTextTokensCall) Do(opts ...googleapi.CallOption) (*CountTextTokensResponse, error)
Do executes the "generativelanguage.models.countTextTokens" call. 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 ¶
func (c *ModelsCountTextTokensCall) Fields(s ...googleapi.Field) *ModelsCountTextTokensCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsCountTextTokensCall) Header ¶
func (c *ModelsCountTextTokensCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsCountTokensCall ¶
type ModelsCountTokensCall struct {
// contains filtered or unexported fields
}
func (*ModelsCountTokensCall) Context ¶
func (c *ModelsCountTokensCall) Context(ctx context.Context) *ModelsCountTokensCall
Context sets the context to be used in this call's Do method.
func (*ModelsCountTokensCall) Do ¶
func (c *ModelsCountTokensCall) Do(opts ...googleapi.CallOption) (*CountTokensResponse, error)
Do executes the "generativelanguage.models.countTokens" call. 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 ¶
func (c *ModelsCountTokensCall) Fields(s ...googleapi.Field) *ModelsCountTokensCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsCountTokensCall) Header ¶
func (c *ModelsCountTokensCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsEmbedContentCall ¶
type ModelsEmbedContentCall struct {
// contains filtered or unexported fields
}
func (*ModelsEmbedContentCall) Context ¶
func (c *ModelsEmbedContentCall) Context(ctx context.Context) *ModelsEmbedContentCall
Context sets the context to be used in this call's Do method.
func (*ModelsEmbedContentCall) Do ¶
func (c *ModelsEmbedContentCall) Do(opts ...googleapi.CallOption) (*EmbedContentResponse, error)
Do executes the "generativelanguage.models.embedContent" call. 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 ¶
func (c *ModelsEmbedContentCall) Fields(s ...googleapi.Field) *ModelsEmbedContentCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsEmbedContentCall) Header ¶
func (c *ModelsEmbedContentCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsEmbedTextCall ¶
type ModelsEmbedTextCall struct {
// contains filtered or unexported fields
}
func (*ModelsEmbedTextCall) Context ¶
func (c *ModelsEmbedTextCall) Context(ctx context.Context) *ModelsEmbedTextCall
Context sets the context to be used in this call's Do method.
func (*ModelsEmbedTextCall) Do ¶
func (c *ModelsEmbedTextCall) Do(opts ...googleapi.CallOption) (*EmbedTextResponse, error)
Do executes the "generativelanguage.models.embedText" call. 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 ¶
func (c *ModelsEmbedTextCall) Fields(s ...googleapi.Field) *ModelsEmbedTextCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsEmbedTextCall) Header ¶
func (c *ModelsEmbedTextCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsGenerateAnswerCall ¶
type ModelsGenerateAnswerCall struct {
// contains filtered or unexported fields
}
func (*ModelsGenerateAnswerCall) Context ¶
func (c *ModelsGenerateAnswerCall) Context(ctx context.Context) *ModelsGenerateAnswerCall
Context sets the context to be used in this call's Do method.
func (*ModelsGenerateAnswerCall) Do ¶
func (c *ModelsGenerateAnswerCall) Do(opts ...googleapi.CallOption) (*GenerateAnswerResponse, error)
Do executes the "generativelanguage.models.generateAnswer" call. 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 ¶
func (c *ModelsGenerateAnswerCall) Fields(s ...googleapi.Field) *ModelsGenerateAnswerCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsGenerateAnswerCall) Header ¶
func (c *ModelsGenerateAnswerCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsGenerateContentCall ¶
type ModelsGenerateContentCall struct {
// contains filtered or unexported fields
}
func (*ModelsGenerateContentCall) Context ¶
func (c *ModelsGenerateContentCall) Context(ctx context.Context) *ModelsGenerateContentCall
Context sets the context to be used in this call's Do method.
func (*ModelsGenerateContentCall) Do ¶
func (c *ModelsGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, error)
Do executes the "generativelanguage.models.generateContent" call. 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 ¶
func (c *ModelsGenerateContentCall) Fields(s ...googleapi.Field) *ModelsGenerateContentCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsGenerateContentCall) Header ¶
func (c *ModelsGenerateContentCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsGenerateMessageCall ¶
type ModelsGenerateMessageCall struct {
// contains filtered or unexported fields
}
func (*ModelsGenerateMessageCall) Context ¶
func (c *ModelsGenerateMessageCall) Context(ctx context.Context) *ModelsGenerateMessageCall
Context sets the context to be used in this call's Do method.
func (*ModelsGenerateMessageCall) Do ¶
func (c *ModelsGenerateMessageCall) Do(opts ...googleapi.CallOption) (*GenerateMessageResponse, error)
Do executes the "generativelanguage.models.generateMessage" call. 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 ¶
func (c *ModelsGenerateMessageCall) Fields(s ...googleapi.Field) *ModelsGenerateMessageCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsGenerateMessageCall) Header ¶
func (c *ModelsGenerateMessageCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type ModelsGenerateTextCall ¶
type ModelsGenerateTextCall struct {
// contains filtered or unexported fields
}
func (*ModelsGenerateTextCall) Context ¶
func (c *ModelsGenerateTextCall) Context(ctx context.Context) *ModelsGenerateTextCall
Context sets the context to be used in this call's Do method.
func (*ModelsGenerateTextCall) Do ¶
func (c *ModelsGenerateTextCall) Do(opts ...googleapi.CallOption) (*GenerateTextResponse, error)
Do executes the "generativelanguage.models.generateText" call. 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 ¶
func (c *ModelsGenerateTextCall) Fields(s ...googleapi.Field) *ModelsGenerateTextCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsGenerateTextCall) Header ¶
func (c *ModelsGenerateTextCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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.
func (*ModelsGetCall) Do ¶
func (c *ModelsGetCall) Do(opts ...googleapi.CallOption) (*Model, error)
Do executes the "generativelanguage.models.get" call. 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 details.
func (*ModelsGetCall) Header ¶
func (c *ModelsGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*ModelsGetCall) IfNoneMatch ¶
func (c *ModelsGetCall) IfNoneMatch(entityTag string) *ModelsGetCall
IfNoneMatch sets an 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.
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.
func (*ModelsListCall) Do ¶
func (c *ModelsListCall) Do(opts ...googleapi.CallOption) (*ListModelsResponse, error)
Do executes the "generativelanguage.models.list" call. 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 details.
func (*ModelsListCall) Header ¶
func (c *ModelsListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*ModelsListCall) IfNoneMatch ¶
func (c *ModelsListCall) IfNoneMatch(entityTag string) *ModelsListCall
IfNoneMatch sets an 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.
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`. Input capabilities differ between models, including tuned models. See the model guide (https://ai.google.dev/models/gemini) and tuning guide (https://ai.google.dev/docs/model_tuning_guidance) for details.
- 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 ¶
func (c *ModelsStreamGenerateContentCall) Context(ctx context.Context) *ModelsStreamGenerateContentCall
Context sets the context to be used in this call's Do method.
func (*ModelsStreamGenerateContentCall) Do ¶
func (c *ModelsStreamGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, error)
Do executes the "generativelanguage.models.streamGenerateContent" call. 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 ¶
func (c *ModelsStreamGenerateContentCall) Fields(s ...googleapi.Field) *ModelsStreamGenerateContentCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*ModelsStreamGenerateContentCall) Header ¶
func (c *ModelsStreamGenerateContentCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Operation: This resource represents a long-running operation that is the result of a network API call.
func (Operation) MarshalJSON ¶
type Part ¶
type Part struct { // CodeExecutionResult: Result of executing the `ExecutableCode`. CodeExecutionResult *CodeExecutionResult `json:"codeExecutionResult,omitempty"` // ExecutableCode: Code generated by the model that is meant to be executed. ExecutableCode *ExecutableCode `json:"executableCode,omitempty"` // 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. "CodeExecutionResult") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CodeExecutionResult") to include // in API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 reasons. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
SafetySetting: Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability 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 for STRING type: enum 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 CachedContents *CachedContentsService Corpora *CorporaService Files *FilesService Media *MediaService Models *ModelsService TunedModels *TunedModelsService // contains filtered or unexported fields }
func New
deprecated
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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 { // CodeExecution: Optional. Enables the model to execute code as part of // generation. CodeExecution *CodeExecution `json:"codeExecution,omitempty"` // 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. "CodeExecution") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CodeExecution") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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 ¶
func (c *TunedModelsCreateCall) Context(ctx context.Context) *TunedModelsCreateCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsCreateCall) Do ¶
func (c *TunedModelsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error)
Do executes the "generativelanguage.tunedModels.create" call. 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 ¶
func (c *TunedModelsCreateCall) Fields(s ...googleapi.Field) *TunedModelsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsCreateCall) Header ¶
func (c *TunedModelsCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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 ¶
func (c *TunedModelsDeleteCall) Context(ctx context.Context) *TunedModelsDeleteCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsDeleteCall) Do ¶
func (c *TunedModelsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.tunedModels.delete" call. 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 ¶
func (c *TunedModelsDeleteCall) Fields(s ...googleapi.Field) *TunedModelsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsDeleteCall) Header ¶
func (c *TunedModelsDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type TunedModelsGenerateContentCall ¶
type TunedModelsGenerateContentCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsGenerateContentCall) Context ¶
func (c *TunedModelsGenerateContentCall) Context(ctx context.Context) *TunedModelsGenerateContentCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsGenerateContentCall) Do ¶
func (c *TunedModelsGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, error)
Do executes the "generativelanguage.tunedModels.generateContent" call. 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 ¶
func (c *TunedModelsGenerateContentCall) Fields(s ...googleapi.Field) *TunedModelsGenerateContentCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsGenerateContentCall) Header ¶
func (c *TunedModelsGenerateContentCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type TunedModelsGenerateTextCall ¶
type TunedModelsGenerateTextCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsGenerateTextCall) Context ¶
func (c *TunedModelsGenerateTextCall) Context(ctx context.Context) *TunedModelsGenerateTextCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsGenerateTextCall) Do ¶
func (c *TunedModelsGenerateTextCall) Do(opts ...googleapi.CallOption) (*GenerateTextResponse, error)
Do executes the "generativelanguage.tunedModels.generateText" call. 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 ¶
func (c *TunedModelsGenerateTextCall) Fields(s ...googleapi.Field) *TunedModelsGenerateTextCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsGenerateTextCall) Header ¶
func (c *TunedModelsGenerateTextCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type TunedModelsGetCall ¶
type TunedModelsGetCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsGetCall) Context ¶
func (c *TunedModelsGetCall) Context(ctx context.Context) *TunedModelsGetCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsGetCall) Do ¶
func (c *TunedModelsGetCall) Do(opts ...googleapi.CallOption) (*TunedModel, error)
Do executes the "generativelanguage.tunedModels.get" call. 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 ¶
func (c *TunedModelsGetCall) Fields(s ...googleapi.Field) *TunedModelsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsGetCall) Header ¶
func (c *TunedModelsGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*TunedModelsGetCall) IfNoneMatch ¶
func (c *TunedModelsGetCall) IfNoneMatch(entityTag string) *TunedModelsGetCall
IfNoneMatch sets an 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.
type TunedModelsListCall ¶
type TunedModelsListCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsListCall) Context ¶
func (c *TunedModelsListCall) Context(ctx context.Context) *TunedModelsListCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsListCall) Do ¶
func (c *TunedModelsListCall) Do(opts ...googleapi.CallOption) (*ListTunedModelsResponse, error)
Do executes the "generativelanguage.tunedModels.list" call. 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 ¶
func (c *TunedModelsListCall) Fields(s ...googleapi.Field) *TunedModelsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
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 a http.Header that can be modified by the caller to add headers to the request.
func (*TunedModelsListCall) IfNoneMatch ¶
func (c *TunedModelsListCall) IfNoneMatch(entityTag string) *TunedModelsListCall
IfNoneMatch sets an 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.
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 ¶
func (c *TunedModelsListCall) Pages(ctx context.Context, f func(*ListTunedModelsResponse) 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 TunedModelsPatchCall ¶
type TunedModelsPatchCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsPatchCall) Context ¶
func (c *TunedModelsPatchCall) Context(ctx context.Context) *TunedModelsPatchCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsPatchCall) Do ¶
func (c *TunedModelsPatchCall) Do(opts ...googleapi.CallOption) (*TunedModel, error)
Do executes the "generativelanguage.tunedModels.patch" call. 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 ¶
func (c *TunedModelsPatchCall) Fields(s ...googleapi.Field) *TunedModelsPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsPatchCall) Header ¶
func (c *TunedModelsPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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 ¶
func (c *TunedModelsPermissionsCreateCall) Context(ctx context.Context) *TunedModelsPermissionsCreateCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsPermissionsCreateCall) Do ¶
func (c *TunedModelsPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error)
Do executes the "generativelanguage.tunedModels.permissions.create" call. 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 ¶
func (c *TunedModelsPermissionsCreateCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsPermissionsCreateCall) Header ¶
func (c *TunedModelsPermissionsCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type TunedModelsPermissionsDeleteCall ¶
type TunedModelsPermissionsDeleteCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsPermissionsDeleteCall) Context ¶
func (c *TunedModelsPermissionsDeleteCall) Context(ctx context.Context) *TunedModelsPermissionsDeleteCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsPermissionsDeleteCall) Do ¶
func (c *TunedModelsPermissionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "generativelanguage.tunedModels.permissions.delete" call. 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 ¶
func (c *TunedModelsPermissionsDeleteCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsPermissionsDeleteCall) Header ¶
func (c *TunedModelsPermissionsDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type TunedModelsPermissionsGetCall ¶
type TunedModelsPermissionsGetCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsPermissionsGetCall) Context ¶
func (c *TunedModelsPermissionsGetCall) Context(ctx context.Context) *TunedModelsPermissionsGetCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsPermissionsGetCall) Do ¶
func (c *TunedModelsPermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error)
Do executes the "generativelanguage.tunedModels.permissions.get" call. 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 ¶
func (c *TunedModelsPermissionsGetCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsPermissionsGetCall) Header ¶
func (c *TunedModelsPermissionsGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*TunedModelsPermissionsGetCall) IfNoneMatch ¶
func (c *TunedModelsPermissionsGetCall) IfNoneMatch(entityTag string) *TunedModelsPermissionsGetCall
IfNoneMatch sets an 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.
type TunedModelsPermissionsListCall ¶
type TunedModelsPermissionsListCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsPermissionsListCall) Context ¶
func (c *TunedModelsPermissionsListCall) Context(ctx context.Context) *TunedModelsPermissionsListCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsPermissionsListCall) Do ¶
func (c *TunedModelsPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListPermissionsResponse, error)
Do executes the "generativelanguage.tunedModels.permissions.list" call. 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 ¶
func (c *TunedModelsPermissionsListCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsPermissionsListCall) Header ¶
func (c *TunedModelsPermissionsListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*TunedModelsPermissionsListCall) IfNoneMatch ¶
func (c *TunedModelsPermissionsListCall) IfNoneMatch(entityTag string) *TunedModelsPermissionsListCall
IfNoneMatch sets an 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.
func (*TunedModelsPermissionsListCall) PageSize ¶
func (c *TunedModelsPermissionsListCall) PageSize(pageSize int64) *TunedModelsPermissionsListCall
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 ¶
func (c *TunedModelsPermissionsListCall) PageToken(pageToken string) *TunedModelsPermissionsListCall
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 ¶
func (c *TunedModelsPermissionsListCall) Pages(ctx context.Context, f func(*ListPermissionsResponse) 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 TunedModelsPermissionsPatchCall ¶
type TunedModelsPermissionsPatchCall struct {
// contains filtered or unexported fields
}
func (*TunedModelsPermissionsPatchCall) Context ¶
func (c *TunedModelsPermissionsPatchCall) Context(ctx context.Context) *TunedModelsPermissionsPatchCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsPermissionsPatchCall) Do ¶
func (c *TunedModelsPermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, error)
Do executes the "generativelanguage.tunedModels.permissions.patch" call. 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 ¶
func (c *TunedModelsPermissionsPatchCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsPermissionsPatchCall) Header ¶
func (c *TunedModelsPermissionsPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*TunedModelsPermissionsPatchCall) UpdateMask ¶
func (c *TunedModelsPermissionsPatchCall) UpdateMask(updateMask string) *TunedModelsPermissionsPatchCall
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 ¶
func (r *TunedModelsPermissionsService) Create(parent string, permission *Permission) *TunedModelsPermissionsCreateCall
Create: Create a permission to a specific resource.
- parent: The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.
func (*TunedModelsPermissionsService) Delete ¶
func (r *TunedModelsPermissionsService) Delete(name string) *TunedModelsPermissionsDeleteCall
Delete: Deletes the permission.
- name: The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`.
func (*TunedModelsPermissionsService) Get ¶
func (r *TunedModelsPermissionsService) Get(name string) *TunedModelsPermissionsGetCall
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 ¶
func (r *TunedModelsPermissionsService) List(parent string) *TunedModelsPermissionsListCall
List: Lists permissions for the specific resource.
- parent: The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`.
func (*TunedModelsPermissionsService) Patch ¶
func (r *TunedModelsPermissionsService) Patch(name string, permission *Permission) *TunedModelsPermissionsPatchCall
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 ¶
func (r *TunedModelsService) Delete(name string) *TunedModelsDeleteCall
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`. Input capabilities differ between models, including tuned models. See the model guide (https://ai.google.dev/models/gemini) and tuning guide (https://ai.google.dev/docs/model_tuning_guidance) for details.
- 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 ¶
func (r *TunedModelsService) Get(name string) *TunedModelsGetCall
Get: Gets information about a specific TunedModel.
- name: The resource name of the model. Format: `tunedModels/my-model-id`.
func (*TunedModelsService) List ¶
func (r *TunedModelsService) List() *TunedModelsListCall
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 ¶
func (c *TunedModelsTransferOwnershipCall) Context(ctx context.Context) *TunedModelsTransferOwnershipCall
Context sets the context to be used in this call's Do method.
func (*TunedModelsTransferOwnershipCall) Do ¶
func (c *TunedModelsTransferOwnershipCall) Do(opts ...googleapi.CallOption) (*TransferOwnershipResponse, error)
Do executes the "generativelanguage.tunedModels.transferOwnership" call. 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 ¶
func (c *TunedModelsTransferOwnershipCall) Fields(s ...googleapi.Field) *TunedModelsTransferOwnershipCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*TunedModelsTransferOwnershipCall) Header ¶
func (c *TunedModelsTransferOwnershipCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. 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. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
UpdateChunkRequest: Request to update a `Chunk`.
func (UpdateChunkRequest) MarshalJSON ¶
func (s UpdateChunkRequest) MarshalJSON() ([]byte, error)
type UsageMetadata ¶ added in v0.12.0
type UsageMetadata struct { // CachedContentTokenCount: Number of tokens in the cached part of the prompt, // i.e. in the cached content. CachedContentTokenCount int64 `json:"cachedContentTokenCount,omitempty"` // CandidatesTokenCount: Total number of tokens across the generated // candidates. CandidatesTokenCount int64 `json:"candidatesTokenCount,omitempty"` // PromptTokenCount: Number of tokens in the prompt. When cached_content is // set, this is still the total effective prompt size. I.e. this includes the // number of tokens in the cached content. PromptTokenCount int64 `json:"promptTokenCount,omitempty"` // TotalTokenCount: Total token count for the generation request (prompt + // candidates). TotalTokenCount int64 `json:"totalTokenCount,omitempty"` // ForceSendFields is a list of field names (e.g. "CachedContentTokenCount") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CachedContentTokenCount") to // include in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
UsageMetadata: Metadata on the generation request's token usage.
func (UsageMetadata) MarshalJSON ¶ added in v0.12.0
func (s UsageMetadata) MarshalJSON() ([]byte, error)
type VideoMetadata ¶ added in v0.13.0
type VideoMetadata struct { // VideoDuration: Duration of the video. VideoDuration string `json:"videoDuration,omitempty"` // ForceSendFields is a list of field names (e.g. "VideoDuration") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "VideoDuration") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
VideoMetadata: Metadata for a video `File`.
func (VideoMetadata) MarshalJSON ¶ added in v0.13.0
func (s VideoMetadata) MarshalJSON() ([]byte, error)