Documentation
¶
Index ¶
- type AgentEngine
- type AgentEngineConfig
- type AgentEngineOperation
- type AgentEngineSandboxOperation
- type AgentEngineSandboxSnapshotOperation
- type AgentEngineSessionOperation
- type AgentServerMode
- type AppendAgentEngineSessionEventConfig
- type AppendAgentEngineSessionEventResponse
- type CancelQueryJobAgentEngineConfig
- type CancelQueryJobResult
- type CheckQueryJobAgentEngineConfig
- type CheckQueryJobResponse
- type CheckQueryJobResult
- type Chunk
- type Citation
- type CitationMetadata
- type CreateAgentEngineConfig
- type CreateAgentEngineSandboxConfig
- type CreateAgentEngineSandboxSnapshotConfig
- type CreateAgentEngineSessionConfig
- type CreateMemoryBankConfig
- type CreateSandboxEnvironmentTemplateConfig
- type DefaultContainerCategory
- type DeleteAgentEngineConfig
- type DeleteAgentEngineOperation
- type DeleteAgentEngineSandboxConfig
- type DeleteAgentEngineSandboxOperation
- type DeleteAgentEngineSessionConfig
- type DeleteAgentEngineSessionOperation
- type DeleteMemoryBankConfig
- type DeleteMemoryBankOperation
- type DeleteMemoryConfig
- type DeleteMemoryOperation
- type DeleteSandboxEnvironmentSnapshotConfig
- type DeleteSandboxEnvironmentSnapshotOperation
- type DeleteSandboxEnvironmentTemplateConfig
- type DeleteSandboxEnvironmentTemplateOperation
- type DnsPeeringConfig
- type EncryptionSpec
- type EnvVar
- type EventActions
- type EventMetadata
- type ExecuteCodeAgentEngineSandboxConfig
- type ExecuteSandboxEnvironmentResponse
- type ExperimentConfig
- type Framework
- type GenerateMemoriesConfig
- type GenerateMemoriesOperation
- type GenerateMemoriesRequestDirectContentsSource
- type GenerateMemoriesRequestDirectContentsSourceEvent
- type GenerateMemoriesRequestDirectMemoriesSource
- type GenerateMemoriesRequestDirectMemoriesSourceDirectMemory
- type GenerateMemoriesRequestVertexSessionSource
- type GenerateMemoriesResponse
- type GenerateMemoriesResponseGeneratedMemory
- type GenerateMemoriesResponseGeneratedMemoryAction
- type GetAgentEngineConfig
- type GetAgentEngineOperationConfig
- type GetAgentEngineSandboxConfig
- type GetAgentEngineSessionConfig
- type GetMemoryBankConfig
- type GetMemoryBankOperationConfig
- type GetMemoryConfig
- type GetMemoryRevisionConfig
- type GetSandboxEnvironmentSnapshotConfig
- type GetSandboxEnvironmentTemplateConfig
- type IdentityType
- type IngestEventsConfig
- type IngestionDirectContentsSource
- type IngestionDirectContentsSourceEvent
- type IntermediateExtractedMemory
- type KeepAliveProbe
- type KeepAliveProbeHTTPGet
- type Language
- type ListAgentEngineConfig
- type ListAgentEngineSandboxesConfig
- type ListAgentEngineSandboxesResponse
- type ListAgentEngineSessionEventsConfig
- type ListAgentEngineSessionEventsResponse
- type ListAgentEngineSessionsConfig
- type ListMemoriesConfig
- type ListMemoriesResponse
- type ListMemoryBanksConfig
- type ListMemoryBanksResponse
- type ListMemoryRevisionsConfig
- type ListMemoryRevisionsResponse
- type ListReasoningEnginesResponse
- type ListReasoningEnginesSessionsResponse
- type ListSandboxEnvironmentSnapshotsConfig
- type ListSandboxEnvironmentSnapshotsResponse
- type ListSandboxEnvironmentTemplatesConfig
- type ListSandboxEnvironmentTemplatesResponse
- type MachineConfig
- type ManagedSemanticMemoryConfig
- type ManagedSemanticMemoryConfigGenerationConfig
- type ManagedSemanticMemoryConfigSimilaritySearchConfig
- type ManagedSemanticMemoryConfigTTLConfig
- type ManagedSemanticMemoryConfigTTLConfigGranularTTLConfig
- type ManagedTopicEnum
- type MediaModality
- type Memory
- type MemoryBank
- type MemoryBankCustomizationConfig
- type MemoryBankCustomizationConfigConsolidationConfig
- type MemoryBankCustomizationConfigGenerateMemoriesExample
- type MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSource
- type MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSourceEvent
- type MemoryBankCustomizationConfigGenerateMemoriesExampleGeneratedMemory
- type MemoryBankCustomizationConfigMemoryTopic
- type MemoryBankCustomizationConfigMemoryTopicCustomMemoryTopic
- type MemoryBankCustomizationConfigMemoryTopicManagedMemoryTopic
- type MemoryBankIngestEventsOperation
- type MemoryBankOperation
- type MemoryConfig
- type MemoryConjunctionFilter
- type MemoryFilter
- type MemoryGenerationTriggerConfig
- type MemoryGenerationTriggerConfigGenerationTriggerRule
- type MemoryMetadataMergeStrategy
- type MemoryMetadataValue
- type MemoryOperation
- type MemoryProfile
- type MemoryRevision
- type MemoryStructuredContent
- type MemoryTopicID
- type MemoryType
- type Metadata
- type ModalityTokenCount
- type Operator
- type PSCAutomationConfig
- type PauseAgentEngineSandboxConfig
- type PostSnapshotAction
- type PrivateServiceConnectConfig
- type Protocol
- type PscAutomationState
- type PscInterfaceConfig
- type PurgeMemoriesConfig
- type PurgeMemoriesOperation
- type PurgeMemoriesResponse
- type QueryAgentEngineConfig
- type QueryReasoningEngineResponse
- type ReasoningEngine
- type ReasoningEngineContextSpec
- type ReasoningEngineContextSpecExampleStoreConfig
- type ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig
- type ReasoningEngineContextSpecMemoryBankConfig
- type ReasoningEngineContextSpecMemoryBankConfigGenerationConfig
- type ReasoningEngineContextSpecMemoryBankConfigSimilaritySearchConfig
- type ReasoningEngineContextSpecMemoryBankConfigTTLConfig
- type ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig
- type ReasoningEngineRevisionGarbageCollectionStrategy
- type ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest
- type ReasoningEngineSpec
- type ReasoningEngineSpecContainerSpec
- type ReasoningEngineSpecDeploymentSpec
- type ReasoningEngineSpecDeploymentSpecAgentGatewayConfig
- type ReasoningEngineSpecDeploymentSpecAgentGatewayConfigAgentToAnywhereConfig
- type ReasoningEngineSpecDeploymentSpecAgentGatewayConfigClientToAgentConfig
- type ReasoningEngineSpecPackageSpec
- type ReasoningEngineSpecSourceCodeSpec
- type ReasoningEngineSpecSourceCodeSpecAgentConfigSource
- type ReasoningEngineSpecSourceCodeSpecAgentConfigSourceAdkConfig
- type ReasoningEngineSpecSourceCodeSpecDeveloperConnectConfig
- type ReasoningEngineSpecSourceCodeSpecDeveloperConnectSource
- type ReasoningEngineSpecSourceCodeSpecGitSource
- type ReasoningEngineSpecSourceCodeSpecImageSpec
- type ReasoningEngineSpecSourceCodeSpecInlineSource
- type ReasoningEngineSpecSourceCodeSpecPythonSpec
- type ReasoningEngineTrafficConfig
- type ReasoningEngineTrafficConfigTrafficSplitAlwaysLatest
- type ReasoningEngineTrafficConfigTrafficSplitManual
- type ReasoningEngineTrafficConfigTrafficSplitManualTarget
- type ResumeAgentEngineSandboxConfig
- type RetrieveMemoriesConfig
- type RetrieveMemoriesRequestSimilaritySearchParams
- type RetrieveMemoriesRequestSimpleRetrievalParams
- type RetrieveMemoriesResponse
- type RetrieveMemoriesResponseRetrievedMemory
- type RetrieveMemoryProfilesConfig
- type RetrieveProfilesResponse
- type RollbackMemoryConfig
- type RollbackMemoryOperation
- type RunQueryJobAgentEngineConfig
- type RunQueryJobResult
- type SandboxEnvironment
- type SandboxEnvironmentConnectionInfo
- type SandboxEnvironmentSnapshot
- type SandboxEnvironmentSpec
- type SandboxEnvironmentSpecCodeExecutionEnvironment
- type SandboxEnvironmentSpecComputerUseEnvironment
- type SandboxEnvironmentSpecShellEnvironment
- type SandboxEnvironmentTemplate
- type SandboxEnvironmentTemplateCustomContainerEnvironment
- type SandboxEnvironmentTemplateCustomContainerSpec
- type SandboxEnvironmentTemplateDefaultContainerEnvironment
- type SandboxEnvironmentTemplateEgressControlConfig
- type SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfig
- type SandboxEnvironmentTemplateNetworkPort
- type SandboxEnvironmentTemplateOperation
- type SandboxEnvironmentTemplatePersistentDiskConfig
- type SandboxEnvironmentTemplateResourceRequirements
- type SandboxEnvironmentTemplateState
- type SandboxState
- type SchemaPromptSpecAppBuilderData
- type SchemaPromptSpecAppBuilderDataLinkedResource
- type SchemaPromptSpecInteractionData
- type SecretEnvVar
- type SecretRef
- type Session
- type SessionEvent
- type State
- type StructuredMemoryConfig
- type StructuredMemorySchemaConfig
- type ToolCallStats
- type TrafficType
- type UpdateAgentEngineConfig
- type UpdateAgentEngineSessionConfig
- type UpdateMemoryBankConfig
- type UpdateMemoryConfig
- type UsageMetadata
- type UsageMetadataBillablleUsage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentEngine ¶
type AgentEngine struct {
// The underlying API client.
APIClient any `json:"apiClient,omitempty"`
// The underlying API client for asynchronous operations.
APIAsyncClient any `json:"apiAsyncClient,omitempty"`
// The underlying API resource (i.e. ReasoningEngine).
APIResource *ReasoningEngine `json:"apiResource,omitempty"`
}
An agent engine instance.
type AgentEngineConfig ¶
type AgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The GCS bucket to use for staging the artifacts needed.
// It must be a valid GCS bucket name, e.g. "gs://bucket-name". It is
// required if `agent_engine` is specified.
StagingBucket string `json:"stagingBucket,omitempty"`
// Optional. The set of PyPI dependencies needed.
// It can either be the path to a single file (requirements.txt), or an
// ordered list of strings corresponding to each line of the requirements
// file.
Requirements any `json:"requirements,omitempty"`
// Optional. The user-defined name of the Agent Engine.
// The name can be up to 128 characters long and can comprise any UTF-8
// character.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the Agent Engine.
Description string `json:"description,omitempty"`
// Optional. The GCS bucket directory under `staging_bucket` to use for staging
// the artifacts needed.
GCSDirName string `json:"gcsDirName,omitempty"`
// Optional. The set of extra user-provided packages (if any).
ExtraPackages []string `json:"extraPackages,omitempty"`
// Optional. The environment variables to be set when running the Agent Engine.
// If it is a dictionary, the keys are the environment variable names, and
// the values are the corresponding values.
EnvVars any `json:"envVars,omitempty"`
// Optional. The service account to be used for the Agent Engine.
// If not specified, the default Reasoning Engine P6SA service agent will be used.
ServiceAccount string `json:"serviceAccount,omitempty"`
// Optional. The identity type to use for the Agent Engine.
IdentityType IdentityType `json:"identityType,omitempty"`
// Optional. The context spec to be used for the Agent Engine.
ContextSpec *ReasoningEngineContextSpec `json:"contextSpec,omitempty"`
// Optional. The PSC interface config for PSC-I to be used for the Agent Engine.
PscInterfaceConfig *PscInterfaceConfig `json:"pscInterfaceConfig,omitempty"`
// Optional. The minimum number of instances to run for the Agent Engine.
// Defaults to 1. Range: [0, 10].
MinInstances int32 `json:"minInstances,omitempty"`
// Optional. The maximum number of instances to run for the Agent Engine.
// Defaults to 100. Range: [1, 1000].
// If VPC-SC or PSC-I is enabled, the acceptable range is [1, 100].
MaxInstances int32 `json:"maxInstances,omitempty"`
// Optional. The resource limits to be applied to the Agent Engine.
// Required keys: 'cpu' and 'memory'.
// Supported values for 'cpu': '1', '2', '4', '6', '8'.
// Supported values for 'memory': '1Gi', '2Gi', ..., '32Gi'.
ResourceLimits map[string]string `json:"resourceLimits,omitempty"`
// Optional. The container concurrency to be used for the Agent Engine.
// Recommended value: 2 * cpu + 1. Defaults to 9.
ContainerConcurrency int32 `json:"containerConcurrency,omitempty"`
// Optional. The encryption spec to be used for the Agent Engine.
EncryptionSpec *genai_types.EncryptionSpec `json:"encryptionSpec,omitempty"`
// Optional. The labels to be used for the Agent Engine.
Labels map[string]string `json:"labels,omitempty"`
// Optional. The agent server mode to use for deployment.
AgentServerMode AgentServerMode `json:"agentServerMode,omitempty"`
// Optional. The class methods to be used for the Agent Engine.
// If specified, they'll override the class methods that are autogenerated by
// default. By default, methods are generated by inspecting the agent object
// and generating a corresponding method for each method defined on the
// agent class.
ClassMethods []map[string]any `json:"classMethods,omitempty"`
// Optional. The user-provided paths to the source packages (if any).
// If specified, the files in the source packages will be packed into a
// a tarball file, uploaded to Agent Engine's API, and deployed to the
// Agent Engine.
// The following fields will be ignored:
// - agent
// - extra_packages
// - staging_bucket
// - requirements
// The following fields will be used to install and use the agent from the
// source packages:
// - entrypoint_module (required)
// - entrypoint_object (required)
// - requirements_file (optional)
// - class_methods (required)
SourcePackages []string `json:"sourcePackages,omitempty"`
// Optional. Specifies the configuration for fetching source code from a Git repository
// that is managed by Developer Connect. This includes the repository, revision, and
// directory to use.
DeveloperConnectSource *ReasoningEngineSpecSourceCodeSpecDeveloperConnectConfig `json:"developerConnectSource,omitempty"`
// Optional. The entrypoint module to be used for the Agent Engine
// This field only used when source_packages is specified.
EntrypointModule string `json:"entrypointModule,omitempty"`
// Optional. The entrypoint object to be used for the Agent Engine.
// This field only used when source_packages is specified.
EntrypointObject string `json:"entrypointObject,omitempty"`
// Optional. The user-provided path to the requirements file (if any).
// This field is only used when source_packages is specified.
// If not specified, agent engine will find and use the `requirements.txt` in
// the source package.
RequirementsFile string `json:"requirementsFile,omitempty"`
// Optional. The agent framework to be used for the Agent Engine.
// The OSS agent framework used to develop the agent.
// Currently supported values: "google-adk", "langchain", "langgraph",
// "ag2", "llama-index", "custom".
// If not specified:
// - If `agent` is specified, the agent framework will be auto-detected.
// - If `source_packages` is specified, the agent framework will
// default to "custom".
AgentFramework string `json:"agentFramework,omitempty"`
// Optional. The Python version to be used for the Agent Engine.
// If not specified, it will use the current Python version of the environment.
// Supported versions: "3.10", "3.11", "3.12", "3.13", "3.14".
PythonVersion string `json:"pythonVersion,omitempty"`
// Optional. The build options for the Agent Engine.
// The following keys are supported:
// - installation_scripts:
// Optional. The paths to the installation scripts to be
// executed in the Docker image.
// The scripts must be located in the `installation_scripts`
// subdirectory and the path must be added to `extra_packages`.
BuildOptions map[string][]string `json:"buildOptions,omitempty"`
// Optional. The image spec for the Agent Engine.
ImageSpec *ReasoningEngineSpecSourceCodeSpecImageSpec `json:"imageSpec,omitempty"`
// Optional. The agent config source for the Agent Engine.
AgentConfigSource *ReasoningEngineSpecSourceCodeSpecAgentConfigSource `json:"agentConfigSource,omitempty"`
// Optional. The container spec for the Agent Engine.
ContainerSpec *ReasoningEngineSpecContainerSpec `json:"containerSpec,omitempty"`
// Optional. Specifies the configuration for keep-alive probe.
// Contains configuration on a specified endpoint that a deployment host
// should use to keep the container alive based on the probe settings.
KeepAliveProbe *KeepAliveProbe `json:"keepAliveProbe,omitempty"`
// Optional. Agent Gateway configuration for a Reasoning Engine deployment.
AgentGatewayConfig *ReasoningEngineSpecDeploymentSpecAgentGatewayConfig `json:"agentGatewayConfig,omitempty"`
}
Config for agent engine methods.
type AgentEngineOperation ¶
type AgentEngineOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The created Agent Engine.
Response *ReasoningEngine `json:"response,omitempty"`
}
Operation that has an agent engine as a response.
type AgentEngineSandboxOperation ¶
type AgentEngineSandboxOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The Agent Engine Sandbox.
Response *SandboxEnvironment `json:"response,omitempty"`
}
Operation that has an agent engine sandbox as a response.
type AgentEngineSandboxSnapshotOperation ¶ added in v0.22.0
type AgentEngineSandboxSnapshotOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The Agent Engine Sandbox Snapshot.
Response *SandboxEnvironmentSnapshot `json:"response,omitempty"`
}
Operation that has an agent engine sandbox snapshot as a response.
type AgentEngineSessionOperation ¶
type AgentEngineSessionOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The Agent Engine Session.
Response *Session `json:"response,omitempty"`
}
Operation that has an agent engine session as a response.
type AgentServerMode ¶
type AgentServerMode string
The agent server mode.
const ( // Unspecified agent server mode. Do not use. AgentServerModeUnspecified AgentServerMode = "AGENT_SERVER_MODE_UNSPECIFIED" // Stable agent server mode. This mode has everything stable and well-tested features // agent engine offers. AgentServerModeStable AgentServerMode = "STABLE" // Experimental agent server mode. This mode contains experimental features. AgentServerModeExperimental AgentServerMode = "EXPERIMENTAL" )
type AppendAgentEngineSessionEventConfig ¶
type AppendAgentEngineSessionEventConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The content of the session event.
Content *genai_types.Content `json:"content,omitempty"`
// Optional. Actions are parts of events that are related to the session event.
Actions *EventActions `json:"actions,omitempty"`
// Optional. The error code of the session event.
ErrorCode string `json:"errorCode,omitempty"`
// Optional. The error message of the session event.
ErrorMessage string `json:"errorMessage,omitempty"`
// Optional. Metadata relating to the session event.
EventMetadata *EventMetadata `json:"eventMetadata,omitempty"`
// Optional. Weakly typed raw event data in proto struct format.
RawEvent map[string]any `json:"rawEvent,omitempty"`
}
Config for appending agent engine session event.
type AppendAgentEngineSessionEventResponse ¶
type AppendAgentEngineSessionEventResponse struct {
}
Response for appending agent engine session event.
type CancelQueryJobAgentEngineConfig ¶
type CancelQueryJobAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Name of the longrunning operation returned from run_query_job.
OperationName string `json:"operationName,omitempty"`
}
Config for canceling async querying agent engines.
type CancelQueryJobResult ¶
type CancelQueryJobResult struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Result of canceling a query job.
type CheckQueryJobAgentEngineConfig ¶
type CheckQueryJobAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Whether to retrieve the results of the query job.
RetrieveResult bool `json:"retrieveResult,omitempty"`
}
Config for async querying agent engines.
type CheckQueryJobResponse ¶
type CheckQueryJobResponse struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The GCS URI of the output file.
OutputGCSURI string `json:"outputGcsUri,omitempty"`
}
Response from LRO.
type CheckQueryJobResult ¶
type CheckQueryJobResult struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Name of the agent engine operation.
OperationName string `json:"operationName,omitempty"`
// Optional. The GCS URI of the output file.
OutputGCSURI string `json:"outputGcsUri,omitempty"`
// Optional. Status of the operation.
Status string `json:"status,omitempty"`
// Optional. JSON result of the operation.
Result string `json:"result,omitempty"`
}
Result of checking a query job.
type Chunk ¶
type Chunk struct {
// Required. The data in the chunk.
Data []byte `json:"data,omitempty"`
// Optional. Metadata that is associated with the data in the payload.
Metadata *Metadata `json:"metadata,omitempty"`
// Required. MIME type of the chunk data. See https://www.iana.org/assignments/media-types/media-types.xhtml
// for the full list.
MIMEType string `json:"mimeType,omitempty"`
}
A chunk of data.
type Citation ¶ added in v0.23.0
type Citation struct {
// Output only. The start index of the citation in the content.
StartIndex int32 `json:"startIndex,omitempty"`
// Output only. The end index of the citation in the content.
EndIndex int32 `json:"endIndex,omitempty"`
// Output only. The URI of the source of the citation.
URI string `json:"uri,omitempty"`
// Output only. The title of the source of the citation.
Title string `json:"title,omitempty"`
// Output only. The license of the source of the citation.
License string `json:"license,omitempty"`
// Output only. The publication date of the source of the citation.
PublicationDate civil.Date `json:"publicationDate,omitempty"`
}
A citation for a piece of generatedcontent.
func (*Citation) MarshalJSON ¶ added in v0.23.0
func (*Citation) UnmarshalJSON ¶ added in v0.23.0
type CitationMetadata ¶ added in v0.23.0
type CitationMetadata struct {
// Output only. A list of citations for the content.
Citations []*Citation `json:"citations,omitempty"`
}
A collection of citations that apply to a piece of generated content.
type CreateAgentEngineConfig ¶
type CreateAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The user-defined name of the Agent Engine.
// The display name can be up to 128 characters long and can comprise any
// UTF-8 characters.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the Agent Engine.
Description string `json:"description,omitempty"`
// Optional. Configurations of the Agent Engine.
Spec *ReasoningEngineSpec `json:"spec,omitempty"`
// Optional. The context spec to be used for the Agent Engine.
ContextSpec *ReasoningEngineContextSpec `json:"contextSpec,omitempty"`
// Optional. The PSC interface config for PSC-I to be used for the
// Agent Engine.
PscInterfaceConfig *PscInterfaceConfig `json:"pscInterfaceConfig,omitempty"`
// Optional. The minimum number of instances to run for the Agent Engine.
// Defaults to 1. Range: [0, 10].
MinInstances *int32 `json:"minInstances,omitempty"`
// Optional. The maximum number of instances to run for the Agent Engine.
// Defaults to 100. Range: [1, 1000].
// If VPC-SC or PSC-I is enabled, the acceptable range is [1, 100].
MaxInstances *int32 `json:"maxInstances,omitempty"`
// Optional. The resource limits to be applied to the Agent Engine.
// Required keys: 'cpu' and 'memory'.
// Supported values for 'cpu': '1', '2', '4', '6', '8'.
// Supported values for 'memory': '1Gi', '2Gi', ..., '32Gi'.
ResourceLimits map[string]string `json:"resourceLimits,omitempty"`
// Optional. The container concurrency to be used for the Agent Engine.
// Recommended value: 2 * cpu + 1. Defaults to 9.
ContainerConcurrency *int32 `json:"containerConcurrency,omitempty"`
// Optional. The encryption spec to be used for the Agent Engine.
EncryptionSpec *genai_types.EncryptionSpec `json:"encryptionSpec,omitempty"`
// Optional. The labels to be used for the Agent Engine.
Labels map[string]string `json:"labels,omitempty"`
// Optional. The class methods to be used for the Agent Engine.
// If specified, they'll override the class methods that are autogenerated by
// default. By default, methods are generated by inspecting the agent object
// and generating a corresponding method for each method defined on the
// agent class.
ClassMethods []map[string]any `json:"classMethods,omitempty"`
// Optional. The user-provided paths to the source packages (if any).
// If specified, the files in the source packages will be packed into a
// a tarball file, uploaded to Agent Engine's API, and deployed to the
// Agent Engine.
// The following fields will be ignored:
// - agent
// - extra_packages
// - staging_bucket
// - requirements
// The following fields will be used to install and use the agent from the
// source packages:
// - entrypoint_module (required)
// - entrypoint_object (required)
// - requirements_file (optional)
// - class_methods (required)
SourcePackages []string `json:"sourcePackages,omitempty"`
// Optional. Specifies the configuration for fetching source code from a Git repository
// that is managed by Developer Connect. This includes the repository, revision, and
// directory to use.
DeveloperConnectSource *ReasoningEngineSpecSourceCodeSpecDeveloperConnectConfig `json:"developerConnectSource,omitempty"`
// Optional. The entrypoint module to be used for the Agent Engine
// This field only used when source_packages is specified.
EntrypointModule string `json:"entrypointModule,omitempty"`
// Optional. The entrypoint object to be used for the Agent Engine.
// This field only used when source_packages is specified.
EntrypointObject string `json:"entrypointObject,omitempty"`
// Optional. The user-provided path to the requirements file (if any).
// This field is only used when source_packages is specified.
// If not specified, agent engine will find and use the `requirements.txt` in
// the source package.
RequirementsFile string `json:"requirementsFile,omitempty"`
// Optional. The agent framework to be used for the Agent Engine.
// The OSS agent framework used to develop the agent.
// Currently supported values: "google-adk", "langchain", "langgraph",
// "ag2", "llama-index", "custom".
// If not specified:
// - If `agent` is specified, the agent framework will be auto-detected.
// - If `source_packages` is specified, the agent framework will
// default to "custom".
AgentFramework string `json:"agentFramework,omitempty"`
// Optional. The Python version to be used for the Agent Engine.
// If not specified, it will use the current Python version of the environment.
// Supported versions: "3.10", "3.11", "3.12", "3.13", "3.14".
PythonVersion string `json:"pythonVersion,omitempty"`
// Optional. The build options for the Agent Engine.
// The following keys are supported:
// - installation_scripts:
// Optional. The paths to the installation scripts to be
// executed in the Docker image.
// The scripts must be located in the `installation_scripts`
// subdirectory and the path must be added to `extra_packages`.
BuildOptions map[string][]string `json:"buildOptions,omitempty"`
// Optional. Agent Gateway configuration for a Reasoning Engine deployment.
AgentGatewayConfig *ReasoningEngineSpecDeploymentSpecAgentGatewayConfig `json:"agentGatewayConfig,omitempty"`
// Optional. Specifies the configuration for keep-alive probe.
// Contains configuration on a specified endpoint that a deployment host
// should use to keep the container alive based on the probe settings.
KeepAliveProbe *KeepAliveProbe `json:"keepAliveProbe,omitempty"`
}
Config for create agent engine.
type CreateAgentEngineSandboxConfig ¶
type CreateAgentEngineSandboxConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The display name of the sandbox.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the sandbox.
Description string `json:"description,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. The TTL for this resource. The expiration time is computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Optional. The name of the sandbox environment template to create the sandbox from.
// The sandbox environment template should be in the format:
// projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}
SandboxEnvironmentTemplate string `json:"sandboxEnvironmentTemplate,omitempty"`
// Optional. The name of the sandbox environment snapshot to restore the sandbox from.
// The sandbox environment snapshot should be in the format:
// projects/{project}/locations/{location}/agentEngines/{agent_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}
SandboxEnvironmentSnapshot string `json:"sandboxEnvironmentSnapshot,omitempty"`
// Optional. Owner information for this sandbox environment. A sandbox can only be restored
// from a snapshot belonging to the same owner.
Owner string `json:"owner,omitempty"`
}
Config for creating a Sandbox.
func (*CreateAgentEngineSandboxConfig) MarshalJSON ¶
func (c *CreateAgentEngineSandboxConfig) MarshalJSON() ([]byte, error)
func (*CreateAgentEngineSandboxConfig) UnmarshalJSON ¶
func (c *CreateAgentEngineSandboxConfig) UnmarshalJSON(data []byte) error
type CreateAgentEngineSandboxSnapshotConfig ¶ added in v0.22.0
type CreateAgentEngineSandboxSnapshotConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The display name of the sandbox snapshot.
DisplayName string `json:"displayName,omitempty"`
// Optional. The owner of the sandbox snapshot.
Owner string `json:"owner,omitempty"`
// Optional. The TTL for this resource. The expiration time is computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
}
Config for creating a Sandbox Environment Snapshot.
func (*CreateAgentEngineSandboxSnapshotConfig) MarshalJSON ¶ added in v0.22.0
func (c *CreateAgentEngineSandboxSnapshotConfig) MarshalJSON() ([]byte, error)
func (*CreateAgentEngineSandboxSnapshotConfig) UnmarshalJSON ¶ added in v0.22.0
func (c *CreateAgentEngineSandboxSnapshotConfig) UnmarshalJSON(data []byte) error
type CreateAgentEngineSessionConfig ¶
type CreateAgentEngineSessionConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The display name of the session.
DisplayName string `json:"displayName,omitempty"`
// Optional. Session state which stores key conversation points.
SessionState map[string]any `json:"sessionState,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. Input only. The TTL for this resource.
// The expiration time is computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Optional. Timestamp of when this resource is considered expired. This is *always*
// provided on output, regardless of what `expiration` was sent on input.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Optional. The labels with user-defined metadata to organize your Sessions. Label
// keys and values can be no longer than 64 characters (Unicode codepoints), can only
// contain lowercase letters, numeric characters, underscores and dashes. International
// characters are allowed. See https://goo.gl/xmQnxf for more information and examples
// of labels.
Labels map[string]string `json:"labels,omitempty"`
// Optional. The user defined ID to use for session, which will become the final component
// of the session resource name. If not provided, Vertex AI will generate a value for
// this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`.
// The first character must be a letter, and the last character must be a letter or
// number.
SessionID string `json:"sessionId,omitempty"`
}
Config for creating a Session.
func (*CreateAgentEngineSessionConfig) MarshalJSON ¶
func (c *CreateAgentEngineSessionConfig) MarshalJSON() ([]byte, error)
func (*CreateAgentEngineSessionConfig) UnmarshalJSON ¶
func (c *CreateAgentEngineSessionConfig) UnmarshalJSON(data []byte) error
type CreateMemoryBankConfig ¶ added in v0.22.0
type CreateMemoryBankConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The user-defined name of the Memory Bank.
// The display name can be up to 128 characters long and can comprise any
// UTF-8 characters.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the Memory Bank.
Description string `json:"description,omitempty"`
// Optional. The encryption spec to be used for the Memory Bank.
EncryptionSpec *genai_types.EncryptionSpec `json:"encryptionSpec,omitempty"`
}
Config for create memory bank.
type CreateSandboxEnvironmentTemplateConfig ¶ added in v0.22.0
type CreateSandboxEnvironmentTemplateConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The custom container environment for the sandbox template.
CustomContainerEnvironment *SandboxEnvironmentTemplateCustomContainerEnvironment `json:"customContainerEnvironment,omitempty"`
// Optional. The default container environment for the sandbox template.
DefaultContainerEnvironment *SandboxEnvironmentTemplateDefaultContainerEnvironment `json:"defaultContainerEnvironment,omitempty"`
// Optional. The egress control config for the sandbox template.
EgressControlConfig *SandboxEnvironmentTemplateEgressControlConfig `json:"egressControlConfig,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. The ingress control config for the sandbox template.
IngressControlConfig *PrivateServiceConnectConfig `json:"ingressControlConfig,omitempty"`
}
Config for creating a Sandbox Template.
type DefaultContainerCategory ¶ added in v0.22.0
type DefaultContainerCategory string
The category of the default container image.
const ( // The default value. This value is unused. DefaultContainerCategoryUnspecified DefaultContainerCategory = "DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED" // The default container image for Computer Use. DefaultContainerCategoryComputerUse DefaultContainerCategory = "DEFAULT_CONTAINER_CATEGORY_COMPUTER_USE" // The default container image for Shell Sandbox. DefaultContainerCategoryShellSandbox DefaultContainerCategory = "DEFAULT_CONTAINER_CATEGORY_SHELL_SANDBOX" )
type DeleteAgentEngineConfig ¶
type DeleteAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for deleting agent engine.
type DeleteAgentEngineOperation ¶
type DeleteAgentEngineOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation for deleting agent engines.
type DeleteAgentEngineSandboxConfig ¶
type DeleteAgentEngineSandboxConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for deleting an Agent Engine Sandbox.
type DeleteAgentEngineSandboxOperation ¶
type DeleteAgentEngineSandboxOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation for deleting agent engines.
type DeleteAgentEngineSessionConfig ¶
type DeleteAgentEngineSessionConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for deleting an Agent Engine Session.
type DeleteAgentEngineSessionOperation ¶
type DeleteAgentEngineSessionOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation for deleting agent engine sessions.
type DeleteMemoryBankConfig ¶ added in v0.22.0
type DeleteMemoryBankConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for delete memory bank.
type DeleteMemoryBankOperation ¶ added in v0.22.0
type DeleteMemoryBankOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation for deleting a memory bank.
type DeleteMemoryConfig ¶ added in v0.22.0
type DeleteMemoryConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for deleting a Memory.
type DeleteMemoryOperation ¶ added in v0.22.0
type DeleteMemoryOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation for deleting memories.
type DeleteSandboxEnvironmentSnapshotConfig ¶ added in v0.22.0
type DeleteSandboxEnvironmentSnapshotConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for deleting a Sandbox Environment Snapshot.
type DeleteSandboxEnvironmentSnapshotOperation ¶ added in v0.22.0
type DeleteSandboxEnvironmentSnapshotOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation for deleting sandbox environment snapshots.
type DeleteSandboxEnvironmentTemplateConfig ¶ added in v0.22.0
type DeleteSandboxEnvironmentTemplateConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for deleting a Sandbox Template.
type DeleteSandboxEnvironmentTemplateOperation ¶ added in v0.22.0
type DeleteSandboxEnvironmentTemplateOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation for deleting sandbox templates.
type DnsPeeringConfig ¶
type DnsPeeringConfig struct {
// Required. The DNS name suffix of the zone being peered to, e.g., "my-internal-domain.corp.".
// Must end with a dot.
Domain string `json:"domain,omitempty"`
// Required. The VPC network name in the target_project where the DNS zone specified
// by 'domain' is visible.
TargetNetwork string `json:"targetNetwork,omitempty"`
// Required. The project ID hosting the Cloud DNS managed zone that contains the 'domain'.
// The Vertex AI Service Agent requires the dns.peer role on this project.
TargetProject string `json:"targetProject,omitempty"`
}
DNS peering configuration. These configurations are used to create DNS peering zones in the Vertex tenant project VPC, enabling resolution of records within the specified domain hosted in the target network's Cloud DNS.
type EncryptionSpec ¶ added in v0.23.0
type EncryptionSpec struct {
// Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud
// KMS key must be in the same region as the resource. It must have the format `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
KmsKeyName string `json:"kmsKeyName,omitempty"`
}
Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource.
type EnvVar ¶
type EnvVar struct {
// Required. Name of the environment variable. Must be a valid C identifier.
Name string `json:"name,omitempty"`
// Required. Variables that reference a $(VAR_NAME) are expanded using the previous
// defined environment variables in the container and any service environment variables.
// If a variable cannot be resolved, the reference in the input string will be unchanged.
// The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable exists or not.
Value string `json:"value,omitempty"`
}
Represents an environment variable present in a Container or Python Module.
type EventActions ¶
type EventActions struct {
// Optional. Indicates that the event is updating an artifact. key is the filename,
// value is the version.
ArtifactDelta map[string]int32 `json:"artifactDelta,omitempty"`
// Optional. The agent is escalating to a higher level agent.
Escalate *bool `json:"escalate,omitempty"`
// Optional. Will only be set by a tool response indicating tool request euc. Struct
// key is the function call ID since one function call response (from model) could correspond
// to multiple function calls. Struct value is the required auth config, which can be
// another struct.
RequestedAuthConfigs map[string]any `json:"requestedAuthConfigs,omitempty"`
// Optional. If true, it won't call model to summarize function response. Only used
// for function_response event.
SkipSummarization *bool `json:"skipSummarization,omitempty"`
// Optional. Indicates that the event is updating the state with the given delta.
StateDelta map[string]any `json:"stateDelta,omitempty"`
// Optional. If set, the event transfers to the specified agent.
TransferAgent string `json:"transferAgent,omitempty"`
// Optional. If set, the event transfers to the specified agent. This field is intended
// to replace 'transfer_agent'. Not in use pending data migration.
TransferToAgent string `json:"transferToAgent,omitempty"`
// Optional. A dict of tool confirmation requested by this event, keyed by function
// call id.
RequestedToolConfirmations map[string]any `json:"requestedToolConfirmations,omitempty"`
// Optional. If true, the current agent has finished its current run.
EndOfAgent *bool `json:"endOfAgent,omitempty"`
// Optional. The agent state at the current event.
AgentState map[string]any `json:"agentState,omitempty"`
}
Actions are parts of events that are executed by the agent.
type EventMetadata ¶
type EventMetadata struct {
// Optional. Metadata returned to client when grounding is enabled.
GroundingMetadata *genai_types.GroundingMetadata `json:"groundingMetadata,omitempty"`
// Optional. The branch of the event. The format is like agent_1.agent_2.agent_3, where
// agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3. Branch is
// used when multiple child agents shouldn't see their siblings' conversation history.
Branch string `json:"branch,omitempty"`
// The custom metadata of the LlmResponse.
CustomMetadata map[string]any `json:"customMetadata,omitempty"`
// Optional. Flag indicating that LLM was interrupted when generating the content. Usually
// it's due to user interruption during a bidi streaming.
Interrupted *bool `json:"interrupted,omitempty"`
// Optional. Set of IDs of the long running function calls. Agent client will know from
// this field about which function call is long running. Only valid for function call
// event.
LongRunningToolIDs []string `json:"longRunningToolIds,omitempty"`
// Optional. Indicates whether the text content is part of a unfinished text stream.
// Only used for streaming mode and when the content is plain text.
Partial *bool `json:"partial,omitempty"`
// Optional. Indicates whether the response from the model is complete. Only used for
// streaming mode.
TurnComplete *bool `json:"turnComplete,omitempty"`
// Optional. Audio transcription of user input.
InputTranscription *genai_types.Transcription `json:"inputTranscription,omitempty"`
// Optional. Audio transcription of model output.
OutputTranscription *genai_types.Transcription `json:"outputTranscription,omitempty"`
// Optional. Citation metadata for the response.
CitationMetadata *CitationMetadata `json:"citationMetadata,omitempty"`
// Optional. Usage metadata for the response.
UsageMetadata *UsageMetadata `json:"usageMetadata,omitempty"`
}
Metadata relating to a LLM response event.
type ExecuteCodeAgentEngineSandboxConfig ¶
type ExecuteCodeAgentEngineSandboxConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for executing code in an Agent Engine sandbox.
type ExecuteSandboxEnvironmentResponse ¶
type ExecuteSandboxEnvironmentResponse struct {
// The outputs from the sandbox environment.
Outputs []*Chunk `json:"outputs,omitempty"`
}
The response for executing a sandbox environment.
type ExperimentConfig ¶ added in v0.23.0
type ExperimentConfig struct {
}
The experiment config to control feature experiments.
type GenerateMemoriesConfig ¶ added in v0.22.0
type GenerateMemoriesConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Whether to disable consolidation of memories.
// If true, generated memories will not be consolidated with existing
// memories; all generated memories will be added as new memories regardless
// of whether they are duplicates of or contradictory to existing memories.
// By default, memory consolidation is enabled.
DisableConsolidation *bool `json:"disableConsolidation,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. Labels to apply to the memory revision. For example, you can use this to
// label a revision with its data source.
RevisionLabels map[string]string `json:"revisionLabels,omitempty"`
// Optional. Input only. Timestamp of when the revision is considered expired. If not
// set, the memory revision will be kept until manually deleted.
RevisionExpireTime time.Time `json:"revisionExpireTime,omitempty"`
// Optional. Input only. The TTL for the revision. The expiration time is computed:
// now + TTL.
RevisionTTL time.Duration `json:"revisionTtl,omitempty"`
// Optional. Input only. If true, no revisions will be created for this request.
DisableMemoryRevisions *bool `json:"disableMemoryRevisions,omitempty"`
// Optional. User-provided metadata for the generated memories. This is not generated
// by Memory Bank.
Metadata map[string]*MemoryMetadataValue `json:"metadata,omitempty"`
// Optional. The strategy to use when applying metadata to existing memories.
MetadataMergeStrategy MemoryMetadataMergeStrategy `json:"metadataMergeStrategy,omitempty"`
// Optional. Restricts memory generation to a subset of memory topics.
AllowedTopics []*MemoryTopicID `json:"allowedTopics,omitempty"`
}
Config for generating memories.
func (*GenerateMemoriesConfig) MarshalJSON ¶ added in v0.22.0
func (g *GenerateMemoriesConfig) MarshalJSON() ([]byte, error)
func (*GenerateMemoriesConfig) UnmarshalJSON ¶ added in v0.22.0
func (g *GenerateMemoriesConfig) UnmarshalJSON(data []byte) error
type GenerateMemoriesOperation ¶ added in v0.22.0
type GenerateMemoriesOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The response for generating memories.
Response *GenerateMemoriesResponse `json:"response,omitempty"`
}
Operation that generates memories with a Memory Bank.
type GenerateMemoriesRequestDirectContentsSource ¶
type GenerateMemoriesRequestDirectContentsSource struct {
// Optional. Required. The source content (i.e. chat history) to generate memories from.
Events []*GenerateMemoriesRequestDirectContentsSourceEvent `json:"events,omitempty"`
}
The direct contents source for generating memories.
type GenerateMemoriesRequestDirectContentsSourceEvent ¶
type GenerateMemoriesRequestDirectContentsSourceEvent struct {
// Optional. Required. A single piece of content from which to generate memories.
Content *genai_types.Content `json:"content,omitempty"`
// Optional. The time at which the event occurred.
EventTime time.Time `json:"eventTime,omitempty"`
}
func (*GenerateMemoriesRequestDirectContentsSourceEvent) MarshalJSON ¶ added in v0.23.0
func (g *GenerateMemoriesRequestDirectContentsSourceEvent) MarshalJSON() ([]byte, error)
func (*GenerateMemoriesRequestDirectContentsSourceEvent) UnmarshalJSON ¶ added in v0.23.0
func (g *GenerateMemoriesRequestDirectContentsSourceEvent) UnmarshalJSON(data []byte) error
type GenerateMemoriesRequestDirectMemoriesSource ¶
type GenerateMemoriesRequestDirectMemoriesSource struct {
// Required. The direct memories to upload to Memory Bank. At most 5 direct memories
// are allowed per request.
DirectMemories []*GenerateMemoriesRequestDirectMemoriesSourceDirectMemory `json:"directMemories,omitempty"`
}
The direct memories source for generating memories.
type GenerateMemoriesRequestDirectMemoriesSourceDirectMemory ¶
type GenerateMemoriesRequestDirectMemoriesSourceDirectMemory struct {
// Required. The fact to consolidate with existing memories.
Fact string `json:"fact,omitempty"`
// Optional. The topics that the consolidated memories should be associated with.
Topics []*MemoryTopicID `json:"topics,omitempty"`
}
A direct memory to upload to Memory Bank.
type GenerateMemoriesRequestVertexSessionSource ¶
type GenerateMemoriesRequestVertexSessionSource struct {
// Optional. End time (exclusive) of the time range. If not set, the end time is unbounded.
EndTime time.Time `json:"endTime,omitempty"`
// Required. The resource name of the Session to generate memories for. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
Session string `json:"session,omitempty"`
// Optional. Time range to define which session events should be used to generate memories.
// Start time (inclusive) of the time range. If not set, the start time is unbounded.
StartTime time.Time `json:"startTime,omitempty"`
}
The vertex session source for generating memories.
func (*GenerateMemoriesRequestVertexSessionSource) MarshalJSON ¶
func (g *GenerateMemoriesRequestVertexSessionSource) MarshalJSON() ([]byte, error)
func (*GenerateMemoriesRequestVertexSessionSource) UnmarshalJSON ¶
func (g *GenerateMemoriesRequestVertexSessionSource) UnmarshalJSON(data []byte) error
type GenerateMemoriesResponse ¶
type GenerateMemoriesResponse struct {
// Optional. The generated memories.
GeneratedMemories []*GenerateMemoriesResponseGeneratedMemory `json:"generatedMemories,omitempty"`
}
The response for generating memories.
type GenerateMemoriesResponseGeneratedMemory ¶
type GenerateMemoriesResponseGeneratedMemory struct {
// Optional. The generated memory.
Memory *Memory `json:"memory,omitempty"`
// Optional. The action to take.
Action GenerateMemoriesResponseGeneratedMemoryAction `json:"action,omitempty"`
// Optional. The previous revision of the Memory before the action was performed. This
// field is only set if the action is `UPDATED` or `DELETED`. You can use
// this to rollback the Memory to the previous revision, undoing the action.
// Format:
// `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{revision}`
PreviousRevision string `json:"previousRevision,omitempty"`
}
A memory that was generated.
type GenerateMemoriesResponseGeneratedMemoryAction ¶
type GenerateMemoriesResponseGeneratedMemoryAction string
The action to take.
const ( // The action is unspecified. GenerateMemoriesResponseGeneratedMemoryActionUnspecified GenerateMemoriesResponseGeneratedMemoryAction = "ACTION_UNSPECIFIED" // The memory was created. GenerateMemoriesResponseGeneratedMemoryActionCreated GenerateMemoriesResponseGeneratedMemoryAction = "CREATED" // The memory was updated. The `fact` field may not be updated if the existing fact // is still accurate. GenerateMemoriesResponseGeneratedMemoryActionUpdated GenerateMemoriesResponseGeneratedMemoryAction = "UPDATED" // The memory was deleted. GenerateMemoriesResponseGeneratedMemoryActionDeleted GenerateMemoriesResponseGeneratedMemoryAction = "DELETED" )
type GetAgentEngineConfig ¶
type GetAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for create agent engine.
type GetAgentEngineOperationConfig ¶
type GetAgentEngineOperationConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
type GetAgentEngineSandboxConfig ¶
type GetAgentEngineSandboxConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for getting an Agent Engine Memory.
type GetAgentEngineSessionConfig ¶
type GetAgentEngineSessionConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for getting an Agent Engine Session.
type GetMemoryBankConfig ¶ added in v0.23.0
type GetMemoryBankConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for getting a Memory Bank.
type GetMemoryBankOperationConfig ¶ added in v0.22.0
type GetMemoryBankOperationConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
type GetMemoryConfig ¶ added in v0.22.0
type GetMemoryConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for getting a Memory.
type GetMemoryRevisionConfig ¶ added in v0.22.0
type GetMemoryRevisionConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for getting a Memory Revision.
type GetSandboxEnvironmentSnapshotConfig ¶ added in v0.22.0
type GetSandboxEnvironmentSnapshotConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for getting a Sandbox Environment Snapshot.
type GetSandboxEnvironmentTemplateConfig ¶ added in v0.22.0
type GetSandboxEnvironmentTemplateConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for getting a Sandbox Template.
type IdentityType ¶
type IdentityType string
The identity type to use for the Reasoning Engine. If not specified, the `service_account` field will be used if set, otherwise the default Vertex AI Reasoning Engine Service Agent in the project will be used.
const ( // Default value. Use a custom service account if the `service_account` field is set, // otherwise use the default Vertex AI Reasoning Engine Service Agent in the project. // Same behavior as SERVICE_ACCOUNT. IdentityTypeUnspecified IdentityType = "IDENTITY_TYPE_UNSPECIFIED" // Use a custom service account if the `service_account` field is set, otherwise use // the default Vertex AI Reasoning Engine Service Agent in the project. IdentityTypeServiceAccount IdentityType = "SERVICE_ACCOUNT" // Use Agent Identity. The `service_account` field must not be set. IdentityTypeAgentIdentity IdentityType = "AGENT_IDENTITY" )
type IngestEventsConfig ¶
type IngestEventsConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Waits for the underlying memory generation operation to complete
// before returning. Defaults to false.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. Forces a flush of all pending events in the stream and triggers memory
// generation immediately bypassing any conditions configured in the `generation_trigger_config`.
ForceFlush *bool `json:"forceFlush,omitempty"`
// Optional. Labels to apply to the memory revision. For example, you can use this to
// label a revision with its data source.
RevisionLabels map[string]string `json:"revisionLabels,omitempty"`
// Optional. Input only. Timestamp of when the revision is considered expired. If not
// set, the memory revision will be kept until manually deleted.
RevisionExpireTime time.Time `json:"revisionExpireTime,omitempty"`
// Optional. Input only. The TTL for the revision. The expiration time is computed:
// now + TTL.
RevisionTTL time.Duration `json:"revisionTtl,omitempty"`
// Optional. Input only. If true, no revisions will be created for this request.
DisableMemoryRevisions *bool `json:"disableMemoryRevisions,omitempty"`
// Optional. User-provided metadata for the generated memories. This is not generated
// by Memory Bank.
Metadata map[string]*MemoryMetadataValue `json:"metadata,omitempty"`
// Optional. The strategy to use when applying metadata to existing memories.
MetadataMergeStrategy MemoryMetadataMergeStrategy `json:"metadataMergeStrategy,omitempty"`
}
Config for ingesting events.
func (*IngestEventsConfig) MarshalJSON ¶ added in v0.22.0
func (i *IngestEventsConfig) MarshalJSON() ([]byte, error)
func (*IngestEventsConfig) UnmarshalJSON ¶ added in v0.22.0
func (i *IngestEventsConfig) UnmarshalJSON(data []byte) error
type IngestionDirectContentsSource ¶
type IngestionDirectContentsSource struct {
// Required. The events to ingest.
Events []*IngestionDirectContentsSourceEvent `json:"events,omitempty"`
}
The direct contents source for ingesting events.
type IngestionDirectContentsSourceEvent ¶
type IngestionDirectContentsSourceEvent struct {
// Required. The content of the event.
Content *genai_types.Content `json:"content,omitempty"`
// Optional. A unique identifier for the event. If an event with the same event_id is
// ingested multiple times, it will be de-duplicated.
EventID string `json:"eventId,omitempty"`
// Optional. The time at which the event occurred. If provided, this timestamp will
// be used for ordering events within a stream. If not provided, the server-side ingestion
// time will be used.
EventTime time.Time `json:"eventTime,omitempty"`
}
The direct contents source event for ingesting events.
func (*IngestionDirectContentsSourceEvent) MarshalJSON ¶
func (i *IngestionDirectContentsSourceEvent) MarshalJSON() ([]byte, error)
func (*IngestionDirectContentsSourceEvent) UnmarshalJSON ¶
func (i *IngestionDirectContentsSourceEvent) UnmarshalJSON(data []byte) error
type IntermediateExtractedMemory ¶
type IntermediateExtractedMemory struct {
// Output only. Represents the fact of the extracted memory.
Fact string `json:"fact,omitempty"`
// Output only. Represents the explanation of why the information was extracted from
// the source content.
Context string `json:"context,omitempty"`
// Output only. Represents the structured value of the extracted memory.
StructuredData map[string]any `json:"structuredData,omitempty"`
// Output only. Indicates that the extracted memory originated from an explicit instruction
// to remember or forget information.
IsExplicit bool `json:"isExplicit,omitempty"`
}
An extracted memory that is the intermediate result before consolidation.
type KeepAliveProbe ¶
type KeepAliveProbe struct {
// Optional. Specifies the HTTP GET configuration for the probe.
HTTPGet *KeepAliveProbeHTTPGet `json:"httpGet,omitempty"`
// Optional. Specifies the maximum duration (in seconds) to keep the instance alive
// via this probe. Can be a maximum of 3600 seconds (1 hour).
MaxSeconds *int32 `json:"maxSeconds,omitempty"`
}
Represents the configuration for keep-alive probe. Contains configuration on a specified endpoint that a deployment host should use to keep the container alive based on the probe settings.
type KeepAliveProbeHTTPGet ¶
type KeepAliveProbeHTTPGet struct {
// Required. Specifies the path of the HTTP GET request (e.g., `"/is_busy"`).
Path string `json:"path,omitempty"`
// Optional. Specifies the port number on the container to which the request is sent.
Port *int32 `json:"port,omitempty"`
}
Specifies the HTTP GET configuration for the probe.
type ListAgentEngineConfig ¶
type ListAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
// For field names both snake_case and camelCase are supported.
Filter string `json:"filter,omitempty"`
}
Config for listing agent engines.
type ListAgentEngineSandboxesConfig ¶
type ListAgentEngineSandboxesConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
// For field names both snake_case and camelCase are supported.
Filter string `json:"filter,omitempty"`
}
Config for listing agent engine sandboxes.
type ListAgentEngineSandboxesResponse ¶
type ListAgentEngineSandboxesResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of agent engine sandboxes.
SandboxEnvironments []*SandboxEnvironment `json:"sandboxEnvironments,omitempty"`
}
Response for listing agent engine sandboxes.
type ListAgentEngineSessionEventsConfig ¶
type ListAgentEngineSessionEventsConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
// For field names both snake_case and camelCase are supported.
Filter string `json:"filter,omitempty"`
}
Config for listing agent engine session events.
type ListAgentEngineSessionEventsResponse ¶
type ListAgentEngineSessionEventsResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of session events.
SessionEvents []*SessionEvent `json:"sessionEvents,omitempty"`
}
Response for listing agent engine session events.
type ListAgentEngineSessionsConfig ¶
type ListAgentEngineSessionsConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
// For field names both snake_case and camelCase are supported.
Filter string `json:"filter,omitempty"`
}
Config for listing agent engine sessions.
type ListMemoriesConfig ¶ added in v0.22.0
type ListMemoriesConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
// For field names both snake_case and camelCase are supported.
Filter string `json:"filter,omitempty"`
// Optional. The standard list order by string. If not specified, the default
// order is `create_time desc`. If specified, the default sorting order of
// provided fields is ascending. More detail in
// [AIP-132](https://google.aip.dev/132).
// Supported fields:
// * `create_time`
// * `update_time`
OrderBy string `json:"orderBy,omitempty"`
}
Config for listing memories.
type ListMemoriesResponse ¶ added in v0.22.0
type ListMemoriesResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of memories.
Memories []*Memory `json:"memories,omitempty"`
}
Response for listing memories.
type ListMemoryBanksConfig ¶ added in v0.23.0
type ListMemoryBanksConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
}
Config for listing Memory Banks.
type ListMemoryBanksResponse ¶ added in v0.23.0
type ListMemoryBanksResponse struct {
// The list of Memory Banks.
MemoryBanks []*MemoryBank `json:"memoryBanks,omitempty"`
}
The response for listing Memory Banks.
type ListMemoryRevisionsConfig ¶ added in v0.22.0
type ListMemoryRevisionsConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
// For field names both snake_case and camelCase are supported.
Filter string `json:"filter,omitempty"`
}
Config for listing memory revisions.
type ListMemoryRevisionsResponse ¶ added in v0.22.0
type ListMemoryRevisionsResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of memory revisions.
MemoryRevisions []*MemoryRevision `json:"memoryRevisions,omitempty"`
}
Response for listing memory revisions.
type ListReasoningEnginesResponse ¶
type ListReasoningEnginesResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of agent engines.
ReasoningEngines []*ReasoningEngine `json:"reasoningEngines,omitempty"`
}
Response for listing agent engines.
type ListReasoningEnginesSessionsResponse ¶
type ListReasoningEnginesSessionsResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of agent engine sessions.
Sessions []*Session `json:"sessions,omitempty"`
}
Response for listing agent engine sessions.
type ListSandboxEnvironmentSnapshotsConfig ¶ added in v0.22.0
type ListSandboxEnvironmentSnapshotsConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
Filter string `json:"filter,omitempty"`
}
Config for listing sandbox environment snapshots.
type ListSandboxEnvironmentSnapshotsResponse ¶ added in v0.22.0
type ListSandboxEnvironmentSnapshotsResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of sandbox environment snapshots.
SandboxEnvironmentSnapshots []*SandboxEnvironmentSnapshot `json:"sandboxEnvironmentSnapshots,omitempty"`
}
Response for listing sandbox environment snapshots.
type ListSandboxEnvironmentTemplatesConfig ¶ added in v0.22.0
type ListSandboxEnvironmentTemplatesConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. PageSize specifies the maximum number of cached contents to return per
// API call. If zero, the server will use a default value.
PageSize int32 `json:"pageSize,omitempty"`
// Optional. PageToken represents a token used for pagination in API responses. It's
// an opaque string that should be passed to subsequent requests to retrieve the next
// page of results. An empty PageToken typically indicates that there are no further
// pages available.
PageToken string `json:"pageToken,omitempty"`
// Optional. An expression for filtering the results of the request.
Filter string `json:"filter,omitempty"`
}
Config for listing sandbox templates.
type ListSandboxEnvironmentTemplatesResponse ¶ added in v0.22.0
type ListSandboxEnvironmentTemplatesResponse struct {
// Optional. Used to retain the full HTTP response.
SDKHTTPResponse *genai_types.HTTPResponse `json:"sdkHttpResponse,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
// List of sandbox templates.
SandboxEnvironmentTemplates []*SandboxEnvironmentTemplate `json:"sandboxEnvironmentTemplates,omitempty"`
}
Response for listing sandbox templates.
type MachineConfig ¶
type MachineConfig string
The machine config of the code execution environment.
const ( // The default value: milligcu 2000, memory 1.5Gib MachineConfigUnspecified MachineConfig = "MACHINE_CONFIG_UNSPECIFIED" // The default value: milligcu 4000, memory 4 Gib MachineConfigVcpu4Ram4gib MachineConfig = "MACHINE_CONFIG_VCPU4_RAM4GIB" )
type ManagedSemanticMemoryConfig ¶ added in v0.23.0
type ManagedSemanticMemoryConfig struct {
// Optional. Represents configuration for LLMs calls.
GenerationConfig *ManagedSemanticMemoryConfigGenerationConfig `json:"generationConfig,omitempty"`
// Optional. Configuration for how to perform similarity search on memories.
SimilaritySearchConfig *ManagedSemanticMemoryConfigSimilaritySearchConfig `json:"similaritySearchConfig,omitempty"`
// Optional. Configuration for how to customize Memory Bank behavior for a
// particular scope for unstructured memories.
UnstructuredMemoryConfigs []*MemoryBankCustomizationConfig `json:"unstructuredMemoryConfigs,omitempty"`
// Optional. Configuration for organizing structured memories for a particular
// scope.
StructuredMemoryConfigs []*StructuredMemoryConfig `json:"structuredMemoryConfigs,omitempty"`
// Optional. Configuration for automatic TTL ('time-to-live') of the memories in
// the Memory Bank. If not set, TTL will not be applied automatically. The
// TTL can be explicitly set by modifying the `expire_time` of each Memory
// resource.
TTLConfig *ManagedSemanticMemoryConfigTTLConfig `json:"ttlConfig,omitempty"`
// Optional. If true, no memory revisions will be created for any requests to
// Memory Bank.
DisableMemoryRevisions bool `json:"disableMemoryRevisions,omitempty"`
}
The configuration for managed semantic memory.
type ManagedSemanticMemoryConfigGenerationConfig ¶ added in v0.23.0
type ManagedSemanticMemoryConfigGenerationConfig struct {
// Optional. The model used to generate memories.
// Format:
// `projects/{project}/locations/{location}/publishers/google/models/{model}`.
Model string `json:"model,omitempty"`
// Optional. The configuration for triggering memory generation.
GenerationTriggerConfig *MemoryGenerationTriggerConfig `json:"generationTriggerConfig,omitempty"`
}
The configuration for generating memories.
type ManagedSemanticMemoryConfigSimilaritySearchConfig ¶ added in v0.23.0
type ManagedSemanticMemoryConfigSimilaritySearchConfig struct {
// Optional. The model used to generate embeddings to look up similar memories.
// Format:
// `projects/{project}/locations/{location}/publishers/google/models/{model}`.
EmbeddingModel string `json:"embeddingModel,omitempty"`
}
The configuration for similarity search.
type ManagedSemanticMemoryConfigTTLConfig ¶ added in v0.23.0
type ManagedSemanticMemoryConfigTTLConfig struct {
// Optional. The default TTL for memories in the Memory Bank. If not set, TTL will not
// be applied automatically. The TTL can be explicitly set by modifying the `expire_time`
// of each Memory resource.
DefaultTTL string `json:"defaultTtl,omitempty"`
// Optional. The granular TTL config for memories.
GranularTTLConfig *ManagedSemanticMemoryConfigTTLConfigGranularTTLConfig `json:"granularTtlConfig,omitempty"`
// Optional. The default TTL for memory revisions in the Memory Bank. If not set, TTL
// will not be applied automatically. The TTL can be explicitly set by modifying the
// `expire_time` of each Memory resource.
MemoryRevisionDefaultTTL string `json:"memoryRevisionDefaultTtl,omitempty"`
}
The configuration for automatic TTL ('time-to-live') of the memories.
type ManagedSemanticMemoryConfigTTLConfigGranularTTLConfig ¶ added in v0.23.0
type ManagedSemanticMemoryConfigTTLConfigGranularTTLConfig struct {
// Optional. The TTL duration for memories uploaded via
// CreateMemory.
CreateTTL string `json:"createTtl,omitempty"`
// Optional. The TTL duration for memories generated via
// GenerateMemories.
GenerateCreatedTTL string `json:"generateCreatedTtl,omitempty"`
// Optional. The TTL duration for memories updated via
// GenerateMemories (GenerateMemoriesResponse.GeneratedMemory.Action.UPDATED).
// In the case of an UPDATE action, the `expire_time` of the existing memory
// will be updated to the new value (now + TTL).
GenerateUpdatedTTL string `json:"generateUpdatedTtl,omitempty"`
}
The configuration for granular TTL.
type ManagedTopicEnum ¶
type ManagedTopicEnum string
Represents the managed memory topic.
const ( // Represents an unspecified topic. This value should not be used. ManagedTopicEnumUnspecified ManagedTopicEnum = "MANAGED_TOPIC_ENUM_UNSPECIFIED" // Represents significant personal information about the User like first names, relationships, // hobbies, important dates. ManagedTopicEnumUserPersonalInfo ManagedTopicEnum = "USER_PERSONAL_INFO" // Represents stated or implied likes, dislikes, preferred styles, or patterns. ManagedTopicEnumUserPreferences ManagedTopicEnum = "USER_PREFERENCES" // Represents important milestones or conclusions within the dialogue. ManagedTopicEnumKeyConversationDetails ManagedTopicEnum = "KEY_CONVERSATION_DETAILS" // Represents information that the user explicitly requested to remember or forget. ManagedTopicEnumExplicitInstructions ManagedTopicEnum = "EXPLICIT_INSTRUCTIONS" )
type MediaModality ¶ added in v0.23.0
type MediaModality string
The modality that this token count applies to.
const ( // When a modality is not specified, it is treated as `TEXT`. MediaModalityUnspecified MediaModality = "MODALITY_UNSPECIFIED" // The `Part` contains plain text. MediaModalityText MediaModality = "TEXT" // The `Part` contains an image. MediaModalityImage MediaModality = "IMAGE" // The `Part` contains a video. MediaModalityVideo MediaModality = "VIDEO" // The `Part` contains audio. MediaModalityAudio MediaModality = "AUDIO" // The `Part` contains a document, such as a PDF. MediaModalityDocument MediaModality = "DOCUMENT" )
type Memory ¶
type Memory struct {
// Output only. Represents the timestamp when this Memory was created.
CreateTime time.Time `json:"createTime,omitempty"`
// Optional. Represents the description of the Memory.
Description string `json:"description,omitempty"`
// Optional. Input only. Indicates whether no revision will be created for this request.
DisableMemoryRevisions bool `json:"disableMemoryRevisions,omitempty"`
// Optional. Represents the display name of the Memory.
DisplayName string `json:"displayName,omitempty"`
// Optional. Represents the timestamp of when this resource is considered expired. This
// is *always* provided on output when `expiration` is set on input, regardless of whether
// `expire_time` or `ttl` was provided.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Optional. Represents semantic knowledge extracted from the source content.
Fact string `json:"fact,omitempty"`
// Optional. Represents user-provided metadata for the Memory. This information was
// provided when creating, updating, or generating the Memory. It was not generated
// by Memory Bank.
Metadata map[string]*MemoryMetadataValue `json:"metadata,omitempty"`
// Identifier. Represents the resource name of the Memory. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}`
Name string `json:"name,omitempty"`
// Optional. Input only. Represents the timestamp of when the revision is considered
// expired. If not set, the memory revision will be kept until manually deleted.
RevisionExpireTime time.Time `json:"revisionExpireTime,omitempty"`
// Optional. Input only. Represents the labels to apply to the Memory Revision created
// as a result of this request.
RevisionLabels map[string]string `json:"revisionLabels,omitempty"`
// Optional. Input only. Represents the TTL for the revision. The expiration time is
// computed: now + TTL.
RevisionTTL time.Duration `json:"revisionTtl,omitempty"`
// Required. Immutable. Represents the scope of the Memory. Memories are isolated within
// their scope. The scope is defined when creating or generating memories. Scope values
// cannot contain the wildcard character '*'.
Scope map[string]string `json:"scope,omitempty"`
// Optional. Represents the Topics of the Memory.
Topics []*MemoryTopicID `json:"topics,omitempty"`
// Optional. Input only. Represents the TTL for this resource. The expiration time is
// computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Output only. Represents the timestamp when this Memory was most recently updated.
UpdateTime time.Time `json:"updateTime,omitempty"`
// Optional. Represents the type of the memory. If not set, the `NATURAL_LANGUAGE_COLLECTION`
// type is used. If `STRUCTURED_COLLECTION` or `STRUCTURED_PROFILE` is used, then `structured_data`
// must be provided.
MemoryType MemoryType `json:"memoryType,omitempty"`
// Optional. Represents the structured content of the memory.
StructuredContent *MemoryStructuredContent `json:"structuredContent,omitempty"`
// Optional. Represents the context of the memory.
Context string `json:"context,omitempty"`
// Optional. Deprecated: Use `structured_content` instead.
StructuredData map[string]any `json:"structuredData,omitempty"`
}
A memory.
func (*Memory) MarshalJSON ¶
func (*Memory) UnmarshalJSON ¶
type MemoryBank ¶ added in v0.22.0
type MemoryBank struct {
// Required. Represents the ID of the schema. Must be 1-63 characters, start with a
// lowercase letter, and consist of lowercase letters, numbers, and hyphens.
Name string `json:"name,omitempty"`
// Represents the configuration for managed memories in Memory Bank. If not set, then
// the default configuration will be used.
ManagedSemanticMemoryConfig *ManagedSemanticMemoryConfig `json:"managedSemanticMemoryConfig,omitempty"`
// Represents the display name of the Memory Bank.
DisplayName string `json:"displayName,omitempty"`
// Represents the description of the Memory Bank.
Description string `json:"description,omitempty"`
// Timestamp when this Memory Bank was created.
CreateTime time.Time `json:"createTime,omitempty"`
// Timestamp when this Memory Bank was most recently updated.
UpdateTime time.Time `json:"updateTime,omitempty"`
// Customer-managed encryption key spec for a Memory Bank. If set, this Memory Bank
// and all sub-resources of this Memory Bank will be secured by this key.
EncryptionSpec *EncryptionSpec `json:"encryptionSpec,omitempty"`
}
A memory bank.
func (*MemoryBank) MarshalJSON ¶ added in v0.23.0
func (m *MemoryBank) MarshalJSON() ([]byte, error)
func (*MemoryBank) UnmarshalJSON ¶ added in v0.23.0
func (m *MemoryBank) UnmarshalJSON(data []byte) error
type MemoryBankCustomizationConfig ¶
type MemoryBankCustomizationConfig struct {
// Optional. Indicates whether the memories will be generated in the third person (i.e.
// "The user generates memories with Memory Bank."). By default, the memories will be
// generated in the first person (i.e. "I generate memories with Memory Bank.")
EnableThirdPersonMemories *bool `json:"enableThirdPersonMemories,omitempty"`
// Optional. Provides examples of how to generate memories for a particular scope.
GenerateMemoriesExamples []*MemoryBankCustomizationConfigGenerateMemoriesExample `json:"generateMemoriesExamples,omitempty"`
// Optional. Represents topics of information that should be extracted from conversations
// and stored as memories. If not set, then Memory Bank's default topics will be used.
MemoryTopics []*MemoryBankCustomizationConfigMemoryTopic `json:"memoryTopics,omitempty"`
// Optional. Represents the scope keys (i.e. 'user_id') for which to use this config.
// A request's scope must include all of the provided keys for the config to be used
// (order does not matter). If empty, then the config will be used for all requests
// that do not have a more specific config. Only one default config is allowed per Memory
// Bank.
ScopeKeys []string `json:"scopeKeys,omitempty"`
// Optional. Represents configuration for customizing how memories are consolidated
// together.
ConsolidationConfig *MemoryBankCustomizationConfigConsolidationConfig `json:"consolidationConfig,omitempty"`
// Optional. Indicates whether natural language memory generation should be disabled
// for all requests. By default, natural language memory generation is enabled. Set
// this to `true` when you only want to generate structured memories.
DisableNaturalLanguageMemories *bool `json:"disableNaturalLanguageMemories,omitempty"`
}
Represents configuration for organizing natural language memories.
type MemoryBankCustomizationConfigConsolidationConfig ¶
type MemoryBankCustomizationConfigConsolidationConfig struct {
// Optional. Represents the maximum number of revisions to consider for each candidate
// memory. If not set, then the default value (1) will be used, which means that only
// the latest revision will be considered.
RevisionsPerCandidateCount *int32 `json:"revisionsPerCandidateCount,omitempty"`
}
Represents configuration for customizing how memories are consolidated.
type MemoryBankCustomizationConfigGenerateMemoriesExample ¶
type MemoryBankCustomizationConfigGenerateMemoriesExample struct {
// A conversation source for the example.
ConversationSource *MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSource `json:"conversationSource,omitempty"`
// Optional. Represents the memories that are expected to be generated from the input
// conversation. An empty list indicates that no memories are expected to be generated
// for the input conversation.
GeneratedMemories []*MemoryBankCustomizationConfigGenerateMemoriesExampleGeneratedMemory `json:"generatedMemories,omitempty"`
}
An example of how to generate memories for a particular scope.
type MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSource ¶
type MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSource struct {
// Optional. Represents the input conversation events for the example.
Events []*MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSourceEvent `json:"events,omitempty"`
}
A conversation source for the example. This is similar to `DirectContentsSource`.
type MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSourceEvent ¶
type MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSourceEvent struct {
// Optional. Required. Represents the content of the event.
Content *genai_types.Content `json:"content,omitempty"`
}
The conversation source event for generating memories.
type MemoryBankCustomizationConfigGenerateMemoriesExampleGeneratedMemory ¶
type MemoryBankCustomizationConfigGenerateMemoriesExampleGeneratedMemory struct {
// Required. Represents the fact to generate a memory from.
Fact string `json:"fact,omitempty"`
// Optional. Represents the list of topics that the memory should be associated with.
// For example, use `custom_memory_topic_label = "jargon"` if the extracted memory is
// an example of memory extraction for the custom topic `jargon`.
Topics []*MemoryTopicID `json:"topics,omitempty"`
}
A memory generated by the operation.
type MemoryBankCustomizationConfigMemoryTopic ¶
type MemoryBankCustomizationConfigMemoryTopic struct {
// A custom memory topic defined by the developer.
CustomMemoryTopic *MemoryBankCustomizationConfigMemoryTopicCustomMemoryTopic `json:"customMemoryTopic,omitempty"`
// A managed memory topic defined by Memory Bank.
ManagedMemoryTopic *MemoryBankCustomizationConfigMemoryTopicManagedMemoryTopic `json:"managedMemoryTopic,omitempty"`
}
A topic of information that should be extracted from conversations and stored as memories.
type MemoryBankCustomizationConfigMemoryTopicCustomMemoryTopic ¶
type MemoryBankCustomizationConfigMemoryTopicCustomMemoryTopic struct {
// Required. Represents the label of the topic.
Label string `json:"label,omitempty"`
// Required. Represents the description of the memory topic. This should explain what
// information should be extracted for this topic.
Description string `json:"description,omitempty"`
}
A custom memory topic defined by the developer.
type MemoryBankCustomizationConfigMemoryTopicManagedMemoryTopic ¶
type MemoryBankCustomizationConfigMemoryTopicManagedMemoryTopic struct {
// Required. Represents the managed topic.
ManagedTopicEnum ManagedTopicEnum `json:"managedTopicEnum,omitempty"`
}
A managed memory topic defined by the system.
type MemoryBankIngestEventsOperation ¶
type MemoryBankIngestEventsOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation that ingests events into a memory bank.
type MemoryBankOperation ¶ added in v0.22.0
type MemoryBankOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The created Memory Bank.
Response *MemoryBank `json:"response,omitempty"`
}
Operation that has an memory bank as a response.
type MemoryConfig ¶ added in v0.22.0
type MemoryConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The display name of the memory.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the memory.
Description string `json:"description,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. Input only. The TTL for this resource.
// The expiration time is computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Optional. Timestamp of when this resource is considered expired. This is *always*
// provided on output, regardless of what `expiration` was sent on input.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Optional. Input only. Timestamp of when the revision is considered expired. If not
// set, the memory revision will be kept until manually deleted.
RevisionExpireTime time.Time `json:"revisionExpireTime,omitempty"`
// Optional. Input only. The TTL for the revision. The expiration time is computed:
// now + TTL.
RevisionTTL time.Duration `json:"revisionTtl,omitempty"`
// Optional. Input only. If true, no revision will be created for this request.
DisableMemoryRevisions *bool `json:"disableMemoryRevisions,omitempty"`
// Optional. The topics of the memory.
Topics []*MemoryTopicID `json:"topics,omitempty"`
// Optional. User-provided metadata for the Memory. This information was provided when
// creating, updating, or generating the Memory. It was not generated by Memory Bank.
Metadata map[string]*MemoryMetadataValue `json:"metadata,omitempty"`
// Optional. The user defined ID to use for memory, which will become the final component
// of the memory resource name. If not provided, Vertex AI will generate a value for
// this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`.
// The first character must be a letter, and the last character must be a letter or
// number.
MemoryID string `json:"memoryId,omitempty"`
}
Config for creating a Memory.
func (*MemoryConfig) MarshalJSON ¶ added in v0.22.0
func (m *MemoryConfig) MarshalJSON() ([]byte, error)
func (*MemoryConfig) UnmarshalJSON ¶ added in v0.22.0
func (m *MemoryConfig) UnmarshalJSON(data []byte) error
type MemoryConjunctionFilter ¶
type MemoryConjunctionFilter struct {
// Represents filters that will be combined using AND logic.
Filters []*MemoryFilter `json:"filters,omitempty"`
}
The conjunction filter for memories.
type MemoryFilter ¶
type MemoryFilter struct {
// Represents the key of the filter. For example, "author" would apply to `metadata`
// entries with the key "author".
Key string `json:"key,omitempty"`
// Indicates whether the filter will be negated.
Negate *bool `json:"negate,omitempty"`
// Represents the operator to apply to the filter. If not set, then EQUAL will be used.
Op Operator `json:"op,omitempty"`
// Represents the value to compare to.
Value *MemoryMetadataValue `json:"value,omitempty"`
}
Filter to apply when retrieving memories.
type MemoryGenerationTriggerConfig ¶
type MemoryGenerationTriggerConfig struct {
// Optional. Represents the active rule that determines when to flush the buffer. If
// not set, then the stream will be force flushed immediately.
GenerationRule *MemoryGenerationTriggerConfigGenerationTriggerRule `json:"generationRule,omitempty"`
}
The configuration for triggering memory generation for ingested events.
type MemoryGenerationTriggerConfigGenerationTriggerRule ¶
type MemoryGenerationTriggerConfigGenerationTriggerRule struct {
// Optional. Specifies to trigger generation if the stream is inactive for the specified
// duration after the most recent event. The duration must have a minute-level granularity.
IdleDuration time.Duration `json:"idleDuration,omitempty"`
// Optional. Specifies to trigger generation at a fixed interval. The duration must
// have a minute-level granularity.
FixedInterval time.Duration `json:"fixedInterval,omitempty"`
// Optional. Specifies to trigger generation when the event count reaches this limit.
EventCount *int32 `json:"eventCount,omitempty"`
// Optional. Re-include the last N already-processed events in the next window.
OverlapEventCount *int32 `json:"overlapEventCount,omitempty"`
// Optional. Specifies to trigger generation when the token count reaches this limit.
TokenLimit *int32 `json:"tokenLimit,omitempty"`
}
Represents the active rule that determines when to flush the buffer.
func (*MemoryGenerationTriggerConfigGenerationTriggerRule) MarshalJSON ¶
func (m *MemoryGenerationTriggerConfigGenerationTriggerRule) MarshalJSON() ([]byte, error)
func (*MemoryGenerationTriggerConfigGenerationTriggerRule) UnmarshalJSON ¶
func (m *MemoryGenerationTriggerConfigGenerationTriggerRule) UnmarshalJSON(data []byte) error
type MemoryMetadataMergeStrategy ¶
type MemoryMetadataMergeStrategy string
The strategy to use when applying metadata to existing memories during consolidation.
const ( // The metadata merge strategy is unspecified. MemoryMetadataMergeStrategyUnspecified MemoryMetadataMergeStrategy = "METADATA_MERGE_STRATEGY_UNSPECIFIED" // Replace the metadata of the updated memories with the new metadata. MemoryMetadataMergeStrategyOverwrite MemoryMetadataMergeStrategy = "OVERWRITE" // Append new metadata to the existing metadata. If there are duplicate keys, the existing // values will be overwritten. MemoryMetadataMergeStrategyMerge MemoryMetadataMergeStrategy = "MERGE" // Restrict consolidation to memories that have exactly the same metadata as the request. // If a memory doesn't have the same metadata, it is not eligible for consolidation. MemoryMetadataMergeStrategyRequireExactMatch MemoryMetadataMergeStrategy = "REQUIRE_EXACT_MATCH" )
type MemoryMetadataValue ¶
type MemoryMetadataValue struct {
// Represents a boolean value.
BoolValue *bool `json:"boolValue,omitempty"`
// Represents a double value.
DoubleValue *float64 `json:"doubleValue,omitempty"`
// Represents a string value.
StringValue string `json:"stringValue,omitempty"`
// Represents a timestamp value. When filtering on timestamp values, only the seconds
// field will be compared.
TimestampValue time.Time `json:"timestampValue,omitempty"`
}
The metadata values for memories.
func (*MemoryMetadataValue) MarshalJSON ¶
func (m *MemoryMetadataValue) MarshalJSON() ([]byte, error)
func (*MemoryMetadataValue) UnmarshalJSON ¶
func (m *MemoryMetadataValue) UnmarshalJSON(data []byte) error
type MemoryOperation ¶ added in v0.22.0
type MemoryOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The Memory.
Response *Memory `json:"response,omitempty"`
}
Operation that has a memory as a response.
type MemoryProfile ¶
type MemoryProfile struct {
// Represents the ID of the schema. This ID corresponds to the `schema_id` defined inside
// the SchemaConfig, under StructuredMemoryCustomizationConfig.
SchemaID string `json:"schemaId,omitempty"`
// Represents the profile data.
Profile map[string]any `json:"profile,omitempty"`
}
A memory profile.
type MemoryRevision ¶
type MemoryRevision struct {
// Output only. Represents the timestamp when this Memory Revision was created.
CreateTime time.Time `json:"createTime,omitempty"`
// Output only. Represents the timestamp of when this resource is considered expired.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Output only. Represents the extracted memories from the source content before consolidation
// when the memory was updated via GenerateMemories. This information was used to modify
// an existing Memory via Consolidation.
ExtractedMemories []*IntermediateExtractedMemory `json:"extractedMemories,omitempty"`
// Output only. Represents the fact of the Memory Revision. This corresponds to the
// `fact` field of the parent Memory at the time of revision creation.
Fact string `json:"fact,omitempty"`
// Output only. Represents the labels of the Memory Revision. These labels are applied
// to the MemoryRevision when it is created based on `GenerateMemoriesRequest.revision_labels`.
Labels map[string]string `json:"labels,omitempty"`
// Identifier. Represents the resource name of the Memory Revision. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{memory_revision}`
Name string `json:"name,omitempty"`
// Output only. Represents the structured value of the memory at the time of revision
// creation.
StructuredData map[string]any `json:"structuredData,omitempty"`
// Output only. Represents the context of the Memory Revision. The context may include
// context from both the historical revisions and the extracted content.
Context string `json:"context,omitempty"`
}
A memory revision.
func (*MemoryRevision) MarshalJSON ¶
func (m *MemoryRevision) MarshalJSON() ([]byte, error)
func (*MemoryRevision) UnmarshalJSON ¶
func (m *MemoryRevision) UnmarshalJSON(data []byte) error
type MemoryStructuredContent ¶
type MemoryStructuredContent struct {
// Required. Represents the structured value of the memory.
Data map[string]any `json:"data,omitempty"`
// Required. Represents the schema ID for which this structured memory belongs to.
SchemaID string `json:"schemaId,omitempty"`
}
Represents the structured value of the memory.
type MemoryTopicID ¶
type MemoryTopicID struct {
// Optional. Represents the custom memory topic label.
CustomMemoryTopicLabel string `json:"customMemoryTopicLabel,omitempty"`
// Optional. Represents the managed memory topic.
ManagedMemoryTopic ManagedTopicEnum `json:"managedMemoryTopic,omitempty"`
// Optional. Deprecated: Use `schema_id` in top-level protos instead.
SchemaID string `json:"schemaId,omitempty"`
}
The topic ID for a memory.
type MemoryType ¶
type MemoryType string
The type of the memory.
const ( // Represents an unspecified memory type. This value should not be used. MemoryTypeUnspecified MemoryType = "MEMORY_TYPE_UNSPECIFIED" // Indicates belonging to a collection of natural language memories. MemoryTypeNaturalLanguageCollection MemoryType = "NATURAL_LANGUAGE_COLLECTION" // Indicates belonging to a structured profile. MemoryTypeStructuredProfile MemoryType = "STRUCTURED_PROFILE" )
type Metadata ¶
type Metadata struct {
// Optional. Attributes attached to the data. The keys have semantic conventions and
// the consumers of the attributes should know how to deserialize the value bytes based
// on the keys.
Attributes map[string][]byte `json:"attributes,omitempty"`
}
Metadata for a chunk.
type ModalityTokenCount ¶ added in v0.23.0
type ModalityTokenCount struct {
// The modality that this token count applies to.
Modality MediaModality `json:"modality,omitempty"`
// The number of tokens counted for this modality.
TokenCount int32 `json:"tokenCount,omitempty"`
}
Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
type Operator ¶
type Operator string
Represents the operator to apply to the filter. If not set, then EQUAL will be used.
type PSCAutomationConfig ¶ added in v0.23.0
type PSCAutomationConfig struct {
// Output only. Error message if the PSC service automation failed.
ErrorMessage string `json:"errorMessage,omitempty"`
// Output only. Forwarding rule created by the PSC service automation.
ForwardingRule string `json:"forwardingRule,omitempty"`
// Output only. IP address rule created by the PSC service automation.
IpAddress string `json:"ipAddress,omitempty"`
// Required. The full name of the Google Compute Engine [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks).
// [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/get): `projects/{project}/global/networks/{network}`.
Network string `json:"network,omitempty"`
// Required. Project ID used to create forwarding rule.
ProjectID string `json:"projectId,omitempty"`
// Output only. The state of the PSC service automation.
State PscAutomationState `json:"state,omitempty"`
}
PSC config that is used to automatically create PSC endpoints in the user projects.
type PauseAgentEngineSandboxConfig ¶ added in v0.23.0
type PauseAgentEngineSandboxConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
}
Config for pausing an Agent Engine sandbox.
type PostSnapshotAction ¶ added in v0.22.0
type PostSnapshotAction string
Input only. Action to take on the source SandboxEnvironment after the snapshot is taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource.
const ( // The default value. This value is unused. PostSnapshotActionUnspecified PostSnapshotAction = "POST_SNAPSHOT_ACTION_UNSPECIFIED" // Sandbox environment will continue to run after snapshot is taken. PostSnapshotActionRunning PostSnapshotAction = "RUNNING" // Sandbox environment will be paused after snapshot is taken. PostSnapshotActionPause PostSnapshotAction = "PAUSE" )
type PrivateServiceConnectConfig ¶ added in v0.23.0
type PrivateServiceConnectConfig struct {
// Required. If true, expose the IndexEndpoint via private service connect.
EnablePrivateServiceConnect *bool `json:"enablePrivateServiceConnect,omitempty"`
// Optional. If set to true, enable secure private service connect with IAM authorization.
// Otherwise, private service connect will be done without authorization. Note latency
// will be slightly increased if authorization is enabled.
EnableSecurePrivateServiceConnect *bool `json:"enableSecurePrivateServiceConnect,omitempty"`
// A list of Projects from which the forwarding rule will target the service attachment.
ProjectAllowlist []string `json:"projectAllowlist,omitempty"`
// Optional. List of projects and networks where the PSC endpoints will be created.
// This field is used by Online Inference(Prediction) only.
PscAutomationConfigs []*PSCAutomationConfig `json:"pscAutomationConfigs,omitempty"`
// Output only. The name of the generated service attachment resource. This is only
// populated if the endpoint is deployed with PrivateServiceConnect.
ServiceAttachment string `json:"serviceAttachment,omitempty"`
// Optional. Configuration for PSC-I. If this field is set, enable PSC-I for the endpoint.
// Otherwise, PSC-I will not be enabled.
PscInterfaceConfig *PscInterfaceConfig `json:"pscInterfaceConfig,omitempty"`
}
Represents configuration for private service connect.
type Protocol ¶ added in v0.22.0
type Protocol string
Protocol for port. Defaults to TCP if not specified.
type PscAutomationState ¶ added in v0.23.0
type PscAutomationState string
The state of the PSC service automation.
const ( // Should not be used. PscAutomationStateUnspecified PscAutomationState = "PSC_AUTOMATION_STATE_UNSPECIFIED" // The PSC service automation is successful. PscAutomationStateSuccessful PscAutomationState = "PSC_AUTOMATION_STATE_SUCCESSFUL" // The PSC service automation has failed. PscAutomationStateFailed PscAutomationState = "PSC_AUTOMATION_STATE_FAILED" )
type PscInterfaceConfig ¶
type PscInterfaceConfig struct {
// Optional. DNS peering configurations. When specified, Vertex AI will attempt to configure
// DNS peering zones in the tenant project VPC to resolve the specified domains using
// the target network's Cloud DNS. The user must grant the dns.peer role to the Vertex
// AI Service Agent on the target project.
DnsPeeringConfigs []*DnsPeeringConfig `json:"dnsPeeringConfigs,omitempty"`
// Optional. The name of the Compute Engine [network attachment](https://cloud.google.com/vpc/docs/about-network-attachments)
// to attach to the resource within the region and user project. To specify this field,
// you must have already [created a network attachment] (https://cloud.google.com/vpc/docs/create-manage-network-attachments#create-network-attachments).
// This field is only used for resources using PSC-I.
NetworkAttachment string `json:"networkAttachment,omitempty"`
}
Configuration for PSC-I.
type PurgeMemoriesConfig ¶ added in v0.22.0
type PurgeMemoriesConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
}
Config for purging memories.
type PurgeMemoriesOperation ¶ added in v0.22.0
type PurgeMemoriesOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The response for purging memories.
Response *PurgeMemoriesResponse `json:"response,omitempty"`
}
Operation that purges memories from a Memory Bank.
type PurgeMemoriesResponse ¶
type PurgeMemoriesResponse struct {
// Optional. The number of memories that were purged.
PurgeCount int32 `json:"purgeCount,omitempty"`
}
The response for purging memories.
type QueryAgentEngineConfig ¶
type QueryAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The class method to call.
ClassMethod string `json:"classMethod,omitempty"`
// Optional. The input to the class method.
Input map[string]any `json:"input,omitempty"`
IncludeAllFields *bool `json:"includeAllFields,omitempty"`
}
Config for querying agent engines.
type QueryReasoningEngineResponse ¶
type QueryReasoningEngineResponse struct {
// Response provided by users in JSON object format.
Output any `json:"output,omitempty"`
}
The response for querying an agent engine.
type ReasoningEngine ¶
type ReasoningEngine struct {
// Customer-managed encryption key spec for a ReasoningEngine. If set, this ReasoningEngine
// and all sub-resources of this ReasoningEngine will be secured by this key.
EncryptionSpec *genai_types.EncryptionSpec `json:"encryptionSpec,omitempty"`
// Optional. Configuration for how Agent Engine sub-resources should manage context.
ContextSpec *ReasoningEngineContextSpec `json:"contextSpec,omitempty"`
// Output only. Timestamp when this ReasoningEngine was created.
CreateTime time.Time `json:"createTime,omitempty"`
// Optional. The description of the ReasoningEngine.
Description string `json:"description,omitempty"`
// Required. The display name of the ReasoningEngine.
DisplayName string `json:"displayName,omitempty"`
// Optional. Used to perform consistent read-modify-write updates. If not set, a blind
// "overwrite" update happens.
Etag string `json:"etag,omitempty"`
// Labels for the ReasoningEngine.
Labels map[string]string `json:"labels,omitempty"`
// Identifier. The resource name of the ReasoningEngine. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
Name string `json:"name,omitempty"`
// Optional. Configurations of the ReasoningEngine
Spec *ReasoningEngineSpec `json:"spec,omitempty"`
// Output only. Timestamp when this ReasoningEngine was most recently updated.
UpdateTime time.Time `json:"updateTime,omitempty"`
// Optional. Traffic distribution configuration for the Reasoning Engine.
TrafficConfig *ReasoningEngineTrafficConfig `json:"trafficConfig,omitempty"`
// Optional. Configures garbage collection of Runtime Revisions.
RevisionGarbageCollectionStrategy *ReasoningEngineRevisionGarbageCollectionStrategy `json:"revisionGarbageCollectionStrategy,omitempty"`
// Optional. The experiment config used to control which features to enable in this
// API call.
ExperimentConfig *ExperimentConfig `json:"experimentConfig,omitempty"`
// Output only. The URL of the reasoning engine.
URL string `json:"url,omitempty"`
}
An agent engine.
func (*ReasoningEngine) MarshalJSON ¶
func (r *ReasoningEngine) MarshalJSON() ([]byte, error)
func (*ReasoningEngine) UnmarshalJSON ¶
func (r *ReasoningEngine) UnmarshalJSON(data []byte) error
type ReasoningEngineContextSpec ¶
type ReasoningEngineContextSpec struct {
// Optional. Specification for a Memory Bank, which manages memories for the Agent Engine.
MemoryBankConfig *ReasoningEngineContextSpecMemoryBankConfig `json:"memoryBankConfig,omitempty"`
// Optional. Specification for an Example Store, which manages few-shot examples for
// the Agent Engine.
ExampleStoreConfig *ReasoningEngineContextSpecExampleStoreConfig `json:"exampleStoreConfig,omitempty"`
}
Configuration for how Agent Engine sub-resources should manage context.
type ReasoningEngineContextSpecExampleStoreConfig ¶ added in v0.23.0
type ReasoningEngineContextSpecExampleStoreConfig struct {
// Optional. Configuration for how to perform similarity search on examples. If not
// set, the Example Store will use the default embedding model `text-embedding-005`.
SimilaritySearchConfig *ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig `json:"similaritySearchConfig,omitempty"`
}
Specification for an Example Store.
type ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig ¶ added in v0.23.0
type ReasoningEngineContextSpecExampleStoreConfigSimilaritySearchConfig struct {
// Required. The Gemini model used to generate embeddings to lookup similar examples.
// Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
EmbeddingModel string `json:"embeddingModel,omitempty"`
}
Configuration for how to perform similarity search on examples.
type ReasoningEngineContextSpecMemoryBankConfig ¶
type ReasoningEngineContextSpecMemoryBankConfig struct {
// Optional. Configuration for how to customize Memory Bank behavior for a particular
// scope.
CustomizationConfigs []*MemoryBankCustomizationConfig `json:"customizationConfigs,omitempty"`
// If true, no memory revisions will be created for any requests to the Memory Bank.
DisableMemoryRevisions *bool `json:"disableMemoryRevisions,omitempty"`
// Optional. Configuration for how to generate memories for the Memory Bank.
GenerationConfig *ReasoningEngineContextSpecMemoryBankConfigGenerationConfig `json:"generationConfig,omitempty"`
// Optional. Configuration for how to perform similarity search on memories. If not
// set, the Memory Bank will use the default embedding model `text-embedding-005`.
SimilaritySearchConfig *ReasoningEngineContextSpecMemoryBankConfigSimilaritySearchConfig `json:"similaritySearchConfig,omitempty"`
// Optional. Configuration for automatic TTL ("time-to-live") of the memories in the
// Memory Bank. If not set, TTL will not be applied automatically. The TTL can be explicitly
// set by modifying the `expire_time` of each Memory resource.
TTLConfig *ReasoningEngineContextSpecMemoryBankConfigTTLConfig `json:"ttlConfig,omitempty"`
// Optional. Configuration for organizing structured memories for a particular scope.
StructuredMemoryConfigs []*StructuredMemoryConfig `json:"structuredMemoryConfigs,omitempty"`
}
Specification for a Memory Bank.
type ReasoningEngineContextSpecMemoryBankConfigGenerationConfig ¶
type ReasoningEngineContextSpecMemoryBankConfigGenerationConfig struct {
// Optional. The model used to generate memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
Model string `json:"model,omitempty"`
// Optional. Specifies the default trigger configuration for generating memories using
// `IngestEvents`.
GenerationTriggerConfig *MemoryGenerationTriggerConfig `json:"generationTriggerConfig,omitempty"`
// Optional. A custom prompt to use for extracting memories from conversations. If not
// set, a default prompt will be used.
MemoryExtractionInstructions string `json:"memoryExtractionInstructions,omitempty"`
}
Configuration for how to generate memories.
type ReasoningEngineContextSpecMemoryBankConfigSimilaritySearchConfig ¶
type ReasoningEngineContextSpecMemoryBankConfigSimilaritySearchConfig struct {
// Required. The model used to generate embeddings to lookup similar memories. Format:
// `projects/{project}/locations/{location}/publishers/google/models/{model}`.
EmbeddingModel string `json:"embeddingModel,omitempty"`
}
Configuration for how to perform similarity search on memories.
type ReasoningEngineContextSpecMemoryBankConfigTTLConfig ¶
type ReasoningEngineContextSpecMemoryBankConfigTTLConfig struct {
// Optional. The default TTL duration of the memories in the Memory Bank. This applies
// to all operations that create or update a memory.
DefaultTTL time.Duration `json:"defaultTtl,omitempty"`
// Optional. The granular TTL configuration of the memories in the Memory Bank.
GranularTTLConfig *ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig `json:"granularTtlConfig,omitempty"`
// Optional. The default TTL duration of the memory revisions in the Memory Bank. This
// applies to all operations that create a memory revision. If not set, a default TTL
// of 365 days will be used.
MemoryRevisionDefaultTTL time.Duration `json:"memoryRevisionDefaultTtl,omitempty"`
}
Configuration for automatically setting the TTL ("time-to-live") of the memories in the Memory Bank.
func (*ReasoningEngineContextSpecMemoryBankConfigTTLConfig) MarshalJSON ¶
func (r *ReasoningEngineContextSpecMemoryBankConfigTTLConfig) MarshalJSON() ([]byte, error)
func (*ReasoningEngineContextSpecMemoryBankConfigTTLConfig) UnmarshalJSON ¶
func (r *ReasoningEngineContextSpecMemoryBankConfigTTLConfig) UnmarshalJSON(data []byte) error
type ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig ¶
type ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig struct {
// Optional. The TTL duration for memories uploaded via CreateMemory.
CreateTTL time.Duration `json:"createTtl,omitempty"`
// Optional. The TTL duration for memories newly generated via GenerateMemories (GenerateMemoriesResponse.GeneratedMemory.Action.CREATED).
GenerateCreatedTTL time.Duration `json:"generateCreatedTtl,omitempty"`
// Optional. The TTL duration for memories updated via GenerateMemories (GenerateMemoriesResponse.GeneratedMemory.Action.UPDATED).
// In the case of an UPDATE action, the `expire_time` of the existing memory will be
// updated to the new value (now + TTL).
GenerateUpdatedTTL time.Duration `json:"generateUpdatedTtl,omitempty"`
}
Configuration for TTL of the memories in the Memory Bank based on the action that created or updated the memory.
func (*ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig) MarshalJSON ¶
func (r *ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig) MarshalJSON() ([]byte, error)
func (*ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig) UnmarshalJSON ¶
func (r *ReasoningEngineContextSpecMemoryBankConfigTTLConfigGranularTTLConfig) UnmarshalJSON(data []byte) error
type ReasoningEngineRevisionGarbageCollectionStrategy ¶ added in v0.23.0
type ReasoningEngineRevisionGarbageCollectionStrategy struct {
// Optional. Keeps only the latest N Runtime Revisions active.
KeepNLatest *ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest `json:"keepNLatest,omitempty"`
}
Configures garbage collection of Runtime Revisions.
type ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest ¶ added in v0.23.0
type ReasoningEngineRevisionGarbageCollectionStrategyKeepNLatest struct {
// Required. Specifies the maximum number of Runtime Revisions to keep active. If an
// update to Reasoning Engine would result in exceeding this number of active Runtime
// Revisions, a new Runtime Revision will be created, while the oldest Runtime Revision
// will be automatically deleted, providing it's not configured to serve traffic via
// `traffic_config`. If the oldest Runtime Revision is configured to serve traffic,
// the update will fail validation. No changes will be made to the Reasoning Engine,
// existing Runtime Revisions, and no new Runtime Revision will be created.
MaxRevisions int32 `json:"maxRevisions,omitempty"`
}
Keeps only the latest N Runtime Revisions active.
type ReasoningEngineSpec ¶
type ReasoningEngineSpec struct {
// Optional. The A2A Agent Card for the agent (if available). It follows the specification
// at https://a2a-protocol.org/latest/specification/#5-agent-discovery-the-agent-card.
AgentCard map[string]any `json:"agentCard,omitempty"`
// Optional. The OSS agent framework used to develop the agent. Currently supported
// values: "google-adk", "langchain", "langgraph", "ag2", "llama-index", "custom".
AgentFramework string `json:"agentFramework,omitempty"`
// Optional. Declarations for object class methods in OpenAPI specification format.
ClassMethods []map[string]any `json:"classMethods,omitempty"`
// Optional. The specification of a Reasoning Engine deployment.
DeploymentSpec *ReasoningEngineSpecDeploymentSpec `json:"deploymentSpec,omitempty"`
// Output only. The identity to use for the Reasoning Engine. It can contain one of
// the following values: * service-{project}@gcp-sa-aiplatform-re.googleapis.com (for
// SERVICE_AGENT identity type) * {name}@{project}.gserviceaccount.com (for SERVICE_ACCOUNT
// identity type) * agents.global.{org}.system.id.goog/resources/aiplatform/projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}
// (for AGENT_IDENTITY identity type)
EffectiveIdentity string `json:"effectiveIdentity,omitempty"`
// Optional. The identity type to use for the Reasoning Engine. If not specified, the
// `service_account` field will be used if set, otherwise the default Vertex AI Reasoning
// Engine Service Agent in the project will be used.
IdentityType IdentityType `json:"identityType,omitempty"`
// Optional. User provided package spec of the ReasoningEngine. Ignored when users directly
// specify a deployment image through `deployment_spec.first_party_image_override`,
// but keeping the field_behavior to avoid introducing breaking changes. The `deployment_source`
// field should not be set if `package_spec` is specified.
PackageSpec *ReasoningEngineSpecPackageSpec `json:"packageSpec,omitempty"`
// Optional. The service account that the Reasoning Engine artifact runs as. It should
// have "roles/storage.objectViewer" for reading the user project's Cloud Storage and
// "roles/aiplatform.user" for using Vertex extensions. If not specified, the Vertex
// AI Reasoning Engine Service Agent in the project will be used.
ServiceAccount string `json:"serviceAccount,omitempty"`
// Deploy from source code files with a defined entrypoint.
SourceCodeSpec *ReasoningEngineSpecSourceCodeSpec `json:"sourceCodeSpec,omitempty"`
// Deploy from a container image with a defined entrypoint and commands.
ContainerSpec *ReasoningEngineSpecContainerSpec `json:"containerSpec,omitempty"`
// Optional. The resource name of the linked ExampleStore. At query time, examples can
// be used to guide the performance of the agent by providing the expected response
// or demonstrating when and how tools should be called. Format: `projects/{project}/locations/{location}/exampleStores/{example_store}`
ExampleStore string `json:"exampleStore,omitempty"`
// Output only. Boolean signifying if this agent engine has a runtime currently or not.
RuntimeActive *bool `json:"runtimeActive,omitempty"`
}
The specification of an agent engine.
type ReasoningEngineSpecContainerSpec ¶
type ReasoningEngineSpecContainerSpec struct {
// Required. The Artifact Registry Docker image URI (e.g., us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag)
// of the container image that is to be run on each worker replica.
ImageURI string `json:"imageUri,omitempty"`
// Optional. The port the container listens on. Defaults to 8080 if unset.
Port *int32 `json:"port,omitempty"`
}
Specification for deploying from a container image.
type ReasoningEngineSpecDeploymentSpec ¶
type ReasoningEngineSpecDeploymentSpec struct {
// The agent server mode.
AgentServerMode AgentServerMode `json:"agentServerMode,omitempty"`
// Optional. Concurrency for each container and agent server. Recommended value: 2 *
// cpu + 1. Defaults to 9.
ContainerConcurrency *int32 `json:"containerConcurrency,omitempty"`
// Optional. Environment variables to be set with the Reasoning Engine deployment. The
// environment variables can be updated through the UpdateReasoningEngine API.
Env []*EnvVar `json:"env,omitempty"`
// Optional. The maximum number of application instances that can be launched to handle
// increased traffic. Defaults to 100. Range: [1, 1000]. If VPC-SC or PSC-I is enabled,
// the acceptable range is [1, 100].
MaxInstances *int32 `json:"maxInstances,omitempty"`
// Optional. The minimum number of application instances that will be kept running at
// all times. Defaults to 1. Range: [0, 75].
MinInstances *int32 `json:"minInstances,omitempty"`
// Optional. Configuration for PSC-I.
PscInterfaceConfig *PscInterfaceConfig `json:"pscInterfaceConfig,omitempty"`
// Optional. Resource limits for each container. Only 'cpu' and 'memory' keys are supported.
// Defaults to {"cpu": "4", "memory": "4Gi"}. * The only supported values for CPU are
// '1', '2', '4', '6' and '8'. For more information, go to https://cloud.google.com/run/docs/configuring/cpu.
// * The only supported values for memory are '1Gi', '2Gi', ... '32 Gi'. * For required
// cpu on different memory values, go to https://cloud.google.com/run/docs/configuring/memory-limits
ResourceLimits map[string]string `json:"resourceLimits,omitempty"`
// Optional. Environment variables where the value is a secret in Cloud Secret Manager.
// To use this feature, add 'Secret Manager Secret Accessor' role (roles/secretmanager.secretAccessor)
// to AI Platform Reasoning Engine Service Agent.
SecretEnv []*SecretEnvVar `json:"secretEnv,omitempty"`
// Optional. Agent Gateway configuration for the Reasoning Engine deployment.
AgentGatewayConfig *ReasoningEngineSpecDeploymentSpecAgentGatewayConfig `json:"agentGatewayConfig,omitempty"`
// Optional. Specifies the configuration for keep-alive probe. Contains configuration
// on a specified endpoint that a deployment host should use to keep the container alive
// based on the probe settings.
KeepAliveProbe *KeepAliveProbe `json:"keepAliveProbe,omitempty"`
// Optional. If true, the Reasoning Engine will be deployed with a dedicated ingress
// endpoint.
DedicatedIngressEndpointEnabled *bool `json:"dedicatedIngressEndpointEnabled,omitempty"`
}
The specification of a Reasoning Engine deployment.
type ReasoningEngineSpecDeploymentSpecAgentGatewayConfig ¶
type ReasoningEngineSpecDeploymentSpecAgentGatewayConfig struct {
// Optional. Configuration for traffic originating from the Reasoning Engine. When unset,
// outgoing traffic is not routed through an Agent Gateway.
AgentToAnywhereConfig *ReasoningEngineSpecDeploymentSpecAgentGatewayConfigAgentToAnywhereConfig `json:"agentToAnywhereConfig,omitempty"`
// Optional. Configuration for traffic targeting the Reasoning Engine. When unset, incoming
// traffic is not routed through an Agent Gateway.
ClientToAgentConfig *ReasoningEngineSpecDeploymentSpecAgentGatewayConfigClientToAgentConfig `json:"clientToAgentConfig,omitempty"`
}
Agent Gateway configuration for a Reasoning Engine deployment.
type ReasoningEngineSpecDeploymentSpecAgentGatewayConfigAgentToAnywhereConfig ¶
type ReasoningEngineSpecDeploymentSpecAgentGatewayConfigAgentToAnywhereConfig struct {
// Required. The resource name of the Agent Gateway for outbound traffic. It must be
// set to a Google-managed gateway whose `governed_access_path` is `AGENT_TO_ANYWHERE`.
// Format: `projects/{project}/locations/{location}/agentGateways/{agent_gateway}`
AgentGateway string `json:"agentGateway,omitempty"`
}
Configuration for traffic originating from a Reasoning Engine.
type ReasoningEngineSpecDeploymentSpecAgentGatewayConfigClientToAgentConfig ¶
type ReasoningEngineSpecDeploymentSpecAgentGatewayConfigClientToAgentConfig struct {
// Required. The resource name of the Agent Gateway to use for inbound traffic. It must
// be set to a Google-managed gateway whose `governed_access_path` is `CLIENT_TO_AGENT`.
// Format: `projects/{project}/locations/{location}/agentGateways/{agent_gateway}`
AgentGateway string `json:"agentGateway,omitempty"`
}
Configuration for traffic targeting a Reasoning Engine.
type ReasoningEngineSpecPackageSpec ¶
type ReasoningEngineSpecPackageSpec struct {
// Optional. The Cloud Storage URI of the dependency files in tar.gz format.
DependencyFilesGCSURI string `json:"dependencyFilesGcsUri,omitempty"`
// Optional. The Cloud Storage URI of the pickled python object.
PickleObjectGCSURI string `json:"pickleObjectGcsUri,omitempty"`
// Optional. The Python version. Supported values are 3.10, 3.11, 3.12, 3.13, 3.14.
// If not specified, the default value is 3.10.
PythonVersion string `json:"pythonVersion,omitempty"`
// Optional. The Cloud Storage URI of the `requirements.txt` file
RequirementsGCSURI string `json:"requirementsGcsUri,omitempty"`
}
User-provided package specification, containing pickled object and package requirements.
type ReasoningEngineSpecSourceCodeSpec ¶
type ReasoningEngineSpecSourceCodeSpec struct {
// Source code is generated from the agent config.
AgentConfigSource *ReasoningEngineSpecSourceCodeSpecAgentConfigSource `json:"agentConfigSource,omitempty"`
// Source code is in a Git repository managed by Developer Connect.
DeveloperConnectSource *ReasoningEngineSpecSourceCodeSpecDeveloperConnectSource `json:"developerConnectSource,omitempty"`
// Optional. Configuration for building an image with custom config file.
ImageSpec *ReasoningEngineSpecSourceCodeSpecImageSpec `json:"imageSpec,omitempty"`
// Source code is provided directly in the request.
InlineSource *ReasoningEngineSpecSourceCodeSpecInlineSource `json:"inlineSource,omitempty"`
// Configuration for a Python application.
PythonSpec *ReasoningEngineSpecSourceCodeSpecPythonSpec `json:"pythonSpec,omitempty"`
// Source code is in a public Git repository.
GitSource *ReasoningEngineSpecSourceCodeSpecGitSource `json:"gitSource,omitempty"`
}
Specification for deploying from source code.
type ReasoningEngineSpecSourceCodeSpecAgentConfigSource ¶
type ReasoningEngineSpecSourceCodeSpecAgentConfigSource struct {
// Required. The ADK configuration.
AdkConfig *ReasoningEngineSpecSourceCodeSpecAgentConfigSourceAdkConfig `json:"adkConfig,omitempty"`
// Optional. Any additional files needed to interpret the config. If a `requirements.txt`
// file is present in the `inline_source`, the corresponding packages will be installed.
// If no `requirements.txt` file is present in `inline_source`, then the latest version
// of `google-adk` will be installed for interpreting the ADK config.
InlineSource *ReasoningEngineSpecSourceCodeSpecInlineSource `json:"inlineSource,omitempty"`
}
Specification for the deploying from agent config.
type ReasoningEngineSpecSourceCodeSpecAgentConfigSourceAdkConfig ¶
type ReasoningEngineSpecSourceCodeSpecAgentConfigSourceAdkConfig struct {
// Required. The value of the ADK config in JSON format.
JsonConfig map[string]any `json:"jsonConfig,omitempty"`
}
Configuration for the Agent Development Kit (ADK).
type ReasoningEngineSpecSourceCodeSpecDeveloperConnectConfig ¶
type ReasoningEngineSpecSourceCodeSpecDeveloperConnectConfig struct {
// Optional. Required. The Developer Connect Git repository link, formatted as `projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLink/{repository_link_id}`.
GitRepositoryLink string `json:"gitRepositoryLink,omitempty"`
// Required. Directory, relative to the source root, in which to run the build.
Dir string `json:"dir,omitempty"`
// Required. The revision to fetch from the Git repository such as a branch, a tag,
// a commit SHA, or any Git ref.
Revision string `json:"revision,omitempty"`
}
Specifies the configuration for fetching source code from a Git repository that is managed by Developer Connect. This includes the repository, revision, and directory to use.
type ReasoningEngineSpecSourceCodeSpecDeveloperConnectSource ¶
type ReasoningEngineSpecSourceCodeSpecDeveloperConnectSource struct {
// Required. The Developer Connect configuration that defines the specific repository,
// revision, and directory to use as the source code root.
Config *ReasoningEngineSpecSourceCodeSpecDeveloperConnectConfig `json:"config,omitempty"`
}
Specifies source code to be fetched from a Git repository managed through the Developer Connect service.
type ReasoningEngineSpecSourceCodeSpecGitSource ¶ added in v0.23.0
type ReasoningEngineSpecSourceCodeSpecGitSource struct {
// Required. The HTTPS URL of the public Git repository to clone.
URL string `json:"url,omitempty"`
// Optional. Directory, relative to the source root, in which to run the build.
Dir string `json:"dir,omitempty"`
// Required. The revision to fetch from the Git repository such as a branch, a tag,
// a commit SHA, or any Git ref.
Revision string `json:"revision,omitempty"`
}
Specifies source code to be fetched from a public Git repository.
type ReasoningEngineSpecSourceCodeSpecImageSpec ¶
type ReasoningEngineSpecSourceCodeSpecImageSpec struct {
// Optional. Build arguments to be used. They will be passed through --build-arg flags.
BuildArgs map[string]string `json:"buildArgs,omitempty"`
}
The image spec for building an image (within a single build step), based on the config file (i.e. Dockerfile) in the source directory.
type ReasoningEngineSpecSourceCodeSpecInlineSource ¶
type ReasoningEngineSpecSourceCodeSpecInlineSource struct {
// Required. Input only. The application source code archive. It must be a compressed
// tarball (.tar.gz) file.
SourceArchive []byte `json:"sourceArchive,omitempty"`
}
Specifies source code provided as a byte stream.
type ReasoningEngineSpecSourceCodeSpecPythonSpec ¶
type ReasoningEngineSpecSourceCodeSpecPythonSpec struct {
// Optional. The Python module to load as the entrypoint, specified as a fully qualified
// module name. For example: path.to.agent. If not specified, defaults to "agent". The
// project root will be added to Python sys.path, allowing imports to be specified relative
// to the root. This field should not be set if the source is `agent_config_source`.
EntrypointModule string `json:"entrypointModule,omitempty"`
// Optional. The name of the callable object within the `entrypoint_module` to use as
// the application If not specified, defaults to "root_agent". This field should not
// be set if the source is `agent_config_source`.
EntrypointObject string `json:"entrypointObject,omitempty"`
// Optional. The path to the requirements file, relative to the source root. If not
// specified, defaults to "requirements.txt".
RequirementsFile string `json:"requirementsFile,omitempty"`
// Optional. The version of Python to use. Supported versions include 3.10, 3.11, 3.12,
// 3.13, 3.14. If not specified, default value is 3.10.
Version string `json:"version,omitempty"`
}
Specification for running a Python application from source.
type ReasoningEngineTrafficConfig ¶
type ReasoningEngineTrafficConfig struct {
// Optional. Traffic distribution configuration, where all traffic is sent to the latest
// Runtime Revision.
TrafficSplitAlwaysLatest *ReasoningEngineTrafficConfigTrafficSplitAlwaysLatest `json:"trafficSplitAlwaysLatest,omitempty"`
// Optional. Manual traffic distribution configuration, where the user specifies the
// Runtime Revision IDs and the percentage of traffic to send to each.
TrafficSplitManual *ReasoningEngineTrafficConfigTrafficSplitManual `json:"trafficSplitManual,omitempty"`
}
Traffic distribution configuration.
type ReasoningEngineTrafficConfigTrafficSplitAlwaysLatest ¶
type ReasoningEngineTrafficConfigTrafficSplitAlwaysLatest struct {
}
Traffic distribution configuration, where all traffic is sent to the latest Runtime Revision.
type ReasoningEngineTrafficConfigTrafficSplitManual ¶
type ReasoningEngineTrafficConfigTrafficSplitManual struct {
// A list of traffic targets for the Runtimes Revisions. The sum of percentages must
// equal to 100.
Targets []*ReasoningEngineTrafficConfigTrafficSplitManualTarget `json:"targets,omitempty"`
}
Manual traffic distribution configuration, where the user specifies the Runtime Revision IDs and the percentage of traffic to send to each.
type ReasoningEngineTrafficConfigTrafficSplitManualTarget ¶
type ReasoningEngineTrafficConfigTrafficSplitManualTarget struct {
// Required. Specifies percent of the traffic to this Runtime Revision.
Percent int32 `json:"percent,omitempty"`
// Required. The Runtime Revision name to which to send this portion of traffic, if
// traffic allocation is by Runtime Revision.
RuntimeRevisionName string `json:"runtimeRevisionName,omitempty"`
}
A single target for the traffic split, specifying a Runtime Revision and the percentage of traffic to send to it.
type ResumeAgentEngineSandboxConfig ¶ added in v0.23.0
type ResumeAgentEngineSandboxConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
}
Config for resuming an Agent Engine sandbox.
type RetrieveMemoriesConfig ¶ added in v0.22.0
type RetrieveMemoriesConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The standard list filter that will be applied to the retrieved
// memories. More detail in [AIP-160](https://google.aip.dev/160).
// Supported fields:
// * `fact`
// * `create_time`
// * `update_time`
Filter string `json:"filter,omitempty"`
// Optional. Metadata filters that will be applied to the retrieved memories'
// `metadata` using OR logic. Filters are defined using disjunctive normal
// form (OR of ANDs).
// For example:
// `filter_groups: [{filters: [{key: "author", value: {string_value: "agent
// `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value:
// "travel"}, op: EQUAL}, {key: "author", value: {string_value: "agent 321"},
// op: EQUAL}]}]`
// would be equivalent to the logical expression:
// `(metadata.author = "agent 123" OR (metadata.label = "travel" AND
// metadata.author = "agent 321"))`.
FilterGroups []*MemoryConjunctionFilter `json:"filterGroups,omitempty"`
// Optional. Specifies the types of memories to retrieve. If this field is empty
// or not provided, the request will default to retrieving only memories of
// type `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will
// retrieve memories matching any of the specified `MemoryType` values.
MemoryTypes []MemoryType `json:"memoryTypes,omitempty"`
}
Config for retrieving memories.
type RetrieveMemoriesRequestSimilaritySearchParams ¶
type RetrieveMemoriesRequestSimilaritySearchParams struct {
// Required. Query to use for similarity search retrieval. If provided, then the parent
// ReasoningEngine must have ReasoningEngineContextSpec.MemoryBankConfig.SimilaritySearchConfig
// set.
SearchQuery string `json:"searchQuery,omitempty"`
// Optional. The maximum number of memories to return. The service may return fewer
// than this value. If unspecified, at most 3 memories will be returned. The maximum
// value is 100; values above 100 will be coerced to 100.
TopK *int32 `json:"topK,omitempty"`
}
The parameters for semantic similarity search based retrieval.
type RetrieveMemoriesRequestSimpleRetrievalParams ¶
type RetrieveMemoriesRequestSimpleRetrievalParams struct {
// Optional. The maximum number of memories to return. The service may return fewer
// than this value. If unspecified, at most 3 memories will be returned. The maximum
// value is 100; values above 100 will be coerced to 100.
PageSize *int32 `json:"pageSize,omitempty"`
// Optional. A page token, received from a previous `RetrieveMemories` call. Provide
// this to retrieve the subsequent page.
PageToken string `json:"pageToken,omitempty"`
}
The parameters for simple (non-similarity search) retrieval.
type RetrieveMemoriesResponse ¶
type RetrieveMemoriesResponse struct {
// A token that can be sent as `page_token` to retrieve the next page. If this field
// is omitted, there are no subsequent pages. This token is not set if similarity search
// was used for retrieval.
NextPageToken string `json:"nextPageToken,omitempty"`
// The retrieved memories.
RetrievedMemories []*RetrieveMemoriesResponseRetrievedMemory `json:"retrievedMemories,omitempty"`
}
The response for retrieving memories.
type RetrieveMemoriesResponseRetrievedMemory ¶
type RetrieveMemoriesResponseRetrievedMemory struct {
// The distance between the query and the retrieved Memory. Smaller values indicate
// more similar memories. This is only set if similarity search was used for retrieval.
Distance float64 `json:"distance,omitempty"`
// The retrieved Memory.
Memory *Memory `json:"memory,omitempty"`
}
A retrieved memory.
type RetrieveMemoryProfilesConfig ¶
type RetrieveMemoryProfilesConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
}
Config for retrieving memory profiles.
type RetrieveProfilesResponse ¶
type RetrieveProfilesResponse struct {
// Optional. The retrieved structured profiles, which match the schemas under the
// requested scope. The key is the ID of the schema that the profile is
// linked with, which corresponds to the `schema_id` defined inside the
// `SchemaConfig`, under `StructuredMemoryCustomizationConfig`.
Profiles map[string]*MemoryProfile `json:"profiles,omitempty"`
}
The response for retrieving memory profiles.
type RollbackMemoryConfig ¶ added in v0.22.0
type RollbackMemoryConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
}
Config for rolling back a memory.
type RollbackMemoryOperation ¶ added in v0.22.0
type RollbackMemoryOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
}
Operation that rolls back a memory.
type RunQueryJobAgentEngineConfig ¶
type RunQueryJobAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// The query to send to the agent engine.
Query string `json:"query,omitempty"`
// The GCS URI to use for the output.
// If it is a file, the system use this file to store the response.
// If it represents a directory, the system automatically generate a file
// for the response.
// In both cases, the input query will be stored in the same directory under
// the same file name prefix as the output file.
OutputGCSURI string `json:"outputGcsUri,omitempty"`
}
Config for checking a query job on an agent engine.
type RunQueryJobResult ¶
type RunQueryJobResult struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. Name of the agent engine operation to later check for status.
JobName string `json:"jobName,omitempty"`
// Optional. The GCS URI of the input file.
InputGCSURI string `json:"inputGcsUri,omitempty"`
// Optional. The GCS URI of the output file.
OutputGCSURI string `json:"outputGcsUri,omitempty"`
}
Result of running a query job.
type SandboxEnvironment ¶
type SandboxEnvironment struct {
// Optional. Expiration time of the sandbox environment.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Output only. The connection information of the SandboxEnvironment.
ConnectionInfo *SandboxEnvironmentConnectionInfo `json:"connectionInfo,omitempty"`
// Output only. The timestamp when this SandboxEnvironment was created.
CreateTime time.Time `json:"createTime,omitempty"`
// Required. The display name of the SandboxEnvironment.
DisplayName string `json:"displayName,omitempty"`
// Identifier. The name of the SandboxEnvironment.
Name string `json:"name,omitempty"`
// Optional. The configuration of the SandboxEnvironment.
Spec *SandboxEnvironmentSpec `json:"spec,omitempty"`
// Output only. The runtime state of the SandboxEnvironment.
State SandboxState `json:"state,omitempty"`
// Optional. Input only. The TTL for the sandbox environment. The expiration time is
// computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Output only. The timestamp when this SandboxEnvironment was most recently updated.
UpdateTime time.Time `json:"updateTime,omitempty"`
// Output only. The resource name of the latest snapshot taken for this SandboxEnvironment.
LatestSandboxEnvironmentSnapshot string `json:"latestSandboxEnvironmentSnapshot,omitempty"`
// Optional. Owner information for this sandbox environment. A Sandbox can only be restored
// from a snapshot that belongs to the same owner. If not set, sandbox will be created
// as the default owner.
Owner string `json:"owner,omitempty"`
// Optional. The resource name of the SandboxEnvironmentSnapshot to use for creating
// this SandboxEnvironment. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`
SandboxEnvironmentSnapshot string `json:"sandboxEnvironmentSnapshot,omitempty"`
// Optional. The name of the SandboxEnvironmentTemplate specified in the parent Agent
// Engine resource that this SandboxEnvironment is created from.
SandboxEnvironmentTemplate string `json:"sandboxEnvironmentTemplate,omitempty"`
}
A sandbox environment.
func (*SandboxEnvironment) MarshalJSON ¶
func (s *SandboxEnvironment) MarshalJSON() ([]byte, error)
func (*SandboxEnvironment) UnmarshalJSON ¶
func (s *SandboxEnvironment) UnmarshalJSON(data []byte) error
type SandboxEnvironmentConnectionInfo ¶
type SandboxEnvironmentConnectionInfo struct {
// Output only. The hostname of the load balancer.
LoadBalancerHostname string `json:"loadBalancerHostname,omitempty"`
// Output only. The IP address of the load balancer.
LoadBalancerIp string `json:"loadBalancerIp,omitempty"`
// Output only. The internal IP address of the SandboxEnvironment.
SandboxInternalIp string `json:"sandboxInternalIp,omitempty"`
// Output only. The routing token for the SandboxEnvironment.
RoutingToken string `json:"routingToken,omitempty"`
// Output only. The name of the PSC-E service attachment created for private ingress
// to this SandboxEnvironment. Only populated when the template enables private ingress
// (see SandboxEnvironmentTemplate.ingress_control_config). VPC-SC customers use this
// to create a PSC endpoint in their VPC.
ServiceAttachment string `json:"serviceAttachment,omitempty"`
// Output only. The hostname of the SandboxEnvironment.
SandboxHostname string `json:"sandboxHostname,omitempty"`
}
The connection information of the SandboxEnvironment.
type SandboxEnvironmentSnapshot ¶ added in v0.22.0
type SandboxEnvironmentSnapshot struct {
// The display name of the sandbox environment snapshot.
DisplayName string `json:"displayName,omitempty"`
// Optional. Expiration time of the sandbox environment snapshot.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Output only. The timestamp when this SandboxEnvironmentSnapshot was created.
CreateTime time.Time `json:"createTime,omitempty"`
// Identifier. The resource name of the SandboxEnvironmentSnapshot. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentSnapshots/{sandbox_environment_snapshot}`
Name string `json:"name,omitempty"`
// Optional. Owner information for this sandbox snapshot. Different owners will have
// isolations on snapshot storage and identity. If not set, snapshot will be created
// as the default owner.
Owner string `json:"owner,omitempty"`
// Output only. The resource name of the parent SandboxEnvironmentSnapshot. Empty if
// this is a root Snapshot (the first snapshot from a newly created sandbox). Can be
// used to reconstruct the whole ancestry tree of snapshots.
ParentSnapshot string `json:"parentSnapshot,omitempty"`
// Optional. Input only. Action to take on the source SandboxEnvironment after the snapshot
// is taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and
// it is not stored in the resource.
PostSnapshotAction PostSnapshotAction `json:"postSnapshotAction,omitempty"`
// Optional. Output only. Size of the snapshot data in bytes.
SizeBytes int64 `json:"sizeBytes,omitempty,string"`
// Required. The resource name of the source SandboxEnvironment this snapshot was taken
// from.
SourceSandboxEnvironment string `json:"sourceSandboxEnvironment,omitempty"`
// Optional. Input only. The TTL for the sandbox environment snapshot. The expiration
// time is computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Output only. The timestamp when this SandboxEnvironment was most recently updated.
UpdateTime time.Time `json:"updateTime,omitempty"`
// Output only. Whether the source SandboxEnvironment uses the GKE TD pool.
UseGkeTd bool `json:"useGkeTd,omitempty"`
}
A sandbox environment snapshot.
func (*SandboxEnvironmentSnapshot) MarshalJSON ¶ added in v0.22.0
func (s *SandboxEnvironmentSnapshot) MarshalJSON() ([]byte, error)
func (*SandboxEnvironmentSnapshot) UnmarshalJSON ¶ added in v0.22.0
func (s *SandboxEnvironmentSnapshot) UnmarshalJSON(data []byte) error
type SandboxEnvironmentSpec ¶
type SandboxEnvironmentSpec struct {
// Optional. The code execution environment.
CodeExecutionEnvironment *SandboxEnvironmentSpecCodeExecutionEnvironment `json:"codeExecutionEnvironment,omitempty"`
// Optional. The computer use environment.
ComputerUseEnvironment *SandboxEnvironmentSpecComputerUseEnvironment `json:"computerUseEnvironment,omitempty"`
// Optional. The shell environment for executing shell commands and scripts.
ShellEnvironment *SandboxEnvironmentSpecShellEnvironment `json:"shellEnvironment,omitempty"`
// Optional. Immutable. Whether to provision the SandboxEnvironment via the GKE TD pool.
// Immutable.
UseGkeTd *bool `json:"useGkeTd,omitempty"`
}
The specification of a sandbox environment.
type SandboxEnvironmentSpecCodeExecutionEnvironment ¶
type SandboxEnvironmentSpecCodeExecutionEnvironment struct {
// The coding language supported in this environment.
CodeLanguage Language `json:"codeLanguage,omitempty"`
// The machine config of the code execution environment.
MachineConfig MachineConfig `json:"machineConfig,omitempty"`
}
The code execution environment with customized settings.
type SandboxEnvironmentSpecComputerUseEnvironment ¶
type SandboxEnvironmentSpecComputerUseEnvironment struct {
// Optional. The Artifact Registry Docker image URI (e.g., us-docker.dev.pkg/my-proj/my-repo/my-image:my-tag).
// When unspecified, the default Computer Use container image will be used.
ImageURI string `json:"imageUri,omitempty"`
}
The computer use environment with customized settings.
type SandboxEnvironmentSpecShellEnvironment ¶ added in v0.22.0
type SandboxEnvironmentSpecShellEnvironment struct {
}
The shell environment.
type SandboxEnvironmentTemplate ¶ added in v0.22.0
type SandboxEnvironmentTemplate struct {
// Output only. The timestamp when this SandboxEnvironmentTemplate was created.
CreateTime time.Time `json:"createTime,omitempty"`
// The sandbox environment for custom container workloads.
CustomContainerEnvironment *SandboxEnvironmentTemplateCustomContainerEnvironment `json:"customContainerEnvironment,omitempty"`
// The sandbox environment for default container workloads.
DefaultContainerEnvironment *SandboxEnvironmentTemplateDefaultContainerEnvironment `json:"defaultContainerEnvironment,omitempty"`
// Required. The display name of the SandboxEnvironmentTemplate.
DisplayName string `json:"displayName,omitempty"`
// Optional. The configuration for egress control of this template.
EgressControlConfig *SandboxEnvironmentTemplateEgressControlConfig `json:"egressControlConfig,omitempty"`
// Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`
Name string `json:"name,omitempty"`
// Output only. The state of the sandbox environment template.
State SandboxEnvironmentTemplateState `json:"state,omitempty"`
// Output only. The timestamp when this SandboxEnvironmentTemplate was most recently
// updated.
UpdateTime time.Time `json:"updateTime,omitempty"`
// Optional. The configuration for private ingress (PSC-E) of this template. When set,
// the sandbox router is exposed privately via a PSC service attachment so VPC-SC customers
// can connect from their VPC over a private endpoint instead of the public internet.
// The resulting service attachment is surfaced on `SandboxEnvironment.connection_info.service_attachment`.
// Only the PSC-E (service-attachment/ingress) portion of `PrivateServiceConnectConfig`
// applies here: `enable_private_service_connect` and `project_allowlist` (the consumer
// projects allowed to connect). The nested `psc_interface_config` (PSC-I / egress)
// is not used for sandbox ingress; sandbox egress is configured via `egress_control_config`
// instead.
IngressControlConfig *PrivateServiceConnectConfig `json:"ingressControlConfig,omitempty"`
// Optional. Configuration for attaching a persistent disk (PD) to each SandboxEnvironment
// created from this template. When unset (or when `enabled` is `false`), sandboxes
// created from this template are not backed by a persistent disk and rely on ephemeral
// storage only. See PersistentDiskConfig for details.
PersistentDiskConfig *SandboxEnvironmentTemplatePersistentDiskConfig `json:"persistentDiskConfig,omitempty"`
// Optional. Immutable. Whether to provision the SandboxEnvironmentTemplate via the
// GKE TD pool.
UseGkeTd bool `json:"useGkeTd,omitempty"`
}
A sandbox environment template.
func (*SandboxEnvironmentTemplate) MarshalJSON ¶ added in v0.22.0
func (s *SandboxEnvironmentTemplate) MarshalJSON() ([]byte, error)
func (*SandboxEnvironmentTemplate) UnmarshalJSON ¶ added in v0.22.0
func (s *SandboxEnvironmentTemplate) UnmarshalJSON(data []byte) error
type SandboxEnvironmentTemplateCustomContainerEnvironment ¶ added in v0.22.0
type SandboxEnvironmentTemplateCustomContainerEnvironment struct {
// The specification of the custom container environment.
CustomContainerSpec *SandboxEnvironmentTemplateCustomContainerSpec `json:"customContainerSpec,omitempty"`
// Ports to expose from the container.
Ports []*SandboxEnvironmentTemplateNetworkPort `json:"ports,omitempty"`
// Resource requests and limits for the container.
Resources *SandboxEnvironmentTemplateResourceRequirements `json:"resources,omitempty"`
}
The customized sandbox runtime environment for BYOC.
type SandboxEnvironmentTemplateCustomContainerSpec ¶ added in v0.22.0
type SandboxEnvironmentTemplateCustomContainerSpec struct {
// Required. The Artifact Registry Docker image URI (e.g., us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag)
// of the container image that is to be run on each worker replica.
ImageURI string `json:"imageUri,omitempty"`
}
Specification for deploying from a custom container image.
type SandboxEnvironmentTemplateDefaultContainerEnvironment ¶ added in v0.22.0
type SandboxEnvironmentTemplateDefaultContainerEnvironment struct {
// Required. The category of the default container image.
DefaultContainerCategory DefaultContainerCategory `json:"defaultContainerCategory,omitempty"`
// Optional. Resource requests and limits for the default container.
Resources *SandboxEnvironmentTemplateResourceRequirements `json:"resources,omitempty"`
}
The default sandbox runtime environment for default container workloads.
type SandboxEnvironmentTemplateEgressControlConfig ¶ added in v0.22.0
type SandboxEnvironmentTemplateEgressControlConfig struct {
// Optional. Whether to allow internet access.
InternetAccess *bool `json:"internetAccess,omitempty"`
// Optional. DNS peering configurations that allow sandbox egress to resolve customer-internal
// domains via the customer VPC.
DnsPeeringConfigs []*SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfig `json:"dnsPeeringConfigs,omitempty"`
// Optional. The name of the customer VPC `NetworkAttachment` used to draw a PSC interface
// IP into the customer VPC for sandbox egress.
NetworkAttachment string `json:"networkAttachment,omitempty"`
}
Configuration for egress control of sandbox instances.
type SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfig ¶ added in v0.22.0
type SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfig struct {
// Required. The DNS name suffix of the zone being peered to, e.g., "my-internal-domain.corp.".
// Must end with a dot.
Domain string `json:"domain,omitempty"`
// Required. The VPC network name in the target_project where the DNS zone specified
// by `domain` is visible.
TargetNetwork string `json:"targetNetwork,omitempty"`
// Required. The project ID hosting the Cloud DNS managed zone that contains the `domain`.
// The Vertex AI Service Agent requires the dns.peer role on this project.
TargetProject string `json:"targetProject,omitempty"`
}
Configuration for peering a customer's private DNS zone so that sandbox egress can resolve customer-internal domains via the customer VPC.
type SandboxEnvironmentTemplateNetworkPort ¶ added in v0.22.0
type SandboxEnvironmentTemplateNetworkPort struct {
// Optional. Port number to expose. This must be a valid port number, between 1 and
// 65535.
Port *int32 `json:"port,omitempty"`
// Optional. Protocol for port. Defaults to TCP if not specified.
Protocol Protocol `json:"protocol,omitempty"`
}
Represents a network port in a container.
type SandboxEnvironmentTemplateOperation ¶ added in v0.22.0
type SandboxEnvironmentTemplateOperation struct {
// 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"`
// Optional. 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 map[string]any `json:"metadata,omitempty"`
// 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"`
// Optional. The error result of the operation in case of failure or cancellation.
Error map[string]any `json:"error,omitempty"`
// Optional. The Agent Engine Sandbox Template.
Response *SandboxEnvironmentTemplate `json:"response,omitempty"`
}
Operation that has an agent engine sandbox as a response.
type SandboxEnvironmentTemplatePersistentDiskConfig ¶ added in v0.23.0
type SandboxEnvironmentTemplatePersistentDiskConfig struct {
// Optional. Whether a persistent disk is attached to sandboxes created from this template.
// Defaults to `false`. This flag lets a template carry (and preserve) disk configuration
// while keeping the disk detached, so it can be toggled on later without re-specifying
// the rest of the config. When `false`, the remaining fields in this message are ignored.
Enabled bool `json:"enabled,omitempty"`
// Optional. The absolute path inside the sandbox container at which the persistent
// disk is mounted. Defaults to `/workspace` when unset. Ignored when `enabled` is `false`.
// Only writes beneath this path land on the disk. Writes elsewhere go to the container's
// writable layer, which counts against the container's ephemeral storage and is lost
// when the sandbox's runtime is torn down, so this should be the directory the workload
// actually writes to. Paths that would shadow the container's system directories (for
// example `/etc`, `/proc`, or `/usr` itself) are rejected.
MountPath string `json:"mountPath,omitempty"`
// Optional. The size of the persistent disk in GB. Must be non-negative. When `enabled`
// is `true`, a positive value is required; when unset or zero while enabled, the service
// applies a default size. Ignored when `enabled` is `false`.
SizeGb int64 `json:"sizeGb,omitempty,string"`
}
Configuration for attaching a persistent disk (PD) to each SandboxEnvironment created from this template. A persistent disk provides durable, per-sandbox block storage whose contents survive across the sandbox lifecycle events that this service supports (e.g. pause/resume), unlike ephemeral local storage which is lost when the underlying runtime is torn down.
type SandboxEnvironmentTemplateResourceRequirements ¶ added in v0.22.0
type SandboxEnvironmentTemplateResourceRequirements struct {
// Optional. The maximum amounts of compute resources allowed. Keys are resource names
// (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi").
Limits map[string]string `json:"limits,omitempty"`
// Optional. The requested amounts of compute resources. Keys are resource names (e.g.,
// "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi").
Requests map[string]string `json:"requests,omitempty"`
}
Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance created from this template.
type SandboxEnvironmentTemplateState ¶ added in v0.23.0
type SandboxEnvironmentTemplateState string
The state of the sandbox environment template.
const ( // The default value. This value is unused. SandboxEnvironmentTemplateStateUnspecified SandboxEnvironmentTemplateState = "UNSPECIFIED" // Runtime resources are being allocated for the sandbox environment. SandboxEnvironmentTemplateStateProvisioning SandboxEnvironmentTemplateState = "PROVISIONING" // Sandbox runtime is ready for serving. SandboxEnvironmentTemplateStateActive SandboxEnvironmentTemplateState = "ACTIVE" // Sandbox runtime is halted, performing tear down tasks. SandboxEnvironmentTemplateStateDeprovisioning SandboxEnvironmentTemplateState = "DEPROVISIONING" // Sandbox has terminated with underlying runtime failure. SandboxEnvironmentTemplateStateDeleted SandboxEnvironmentTemplateState = "DELETED" // Sandbox has failed to provision. SandboxEnvironmentTemplateStateFailed SandboxEnvironmentTemplateState = "FAILED" )
type SandboxState ¶ added in v0.21.0
type SandboxState string
The runtime state of the SandboxEnvironment.
const ( // The default value. This value is unused. SandboxStateUnspecified SandboxState = "STATE_UNSPECIFIED" // Runtime resources are being allocated for the sandbox environment. SandboxStateProvisioning SandboxState = "STATE_PROVISIONING" // Sandbox runtime is ready for serving. SandboxStateRunning SandboxState = "STATE_RUNNING" // Sandbox runtime is halted, performing tear down tasks. SandboxStateDeprovisioning SandboxState = "STATE_DEPROVISIONING" // Sandbox has terminated with underlying runtime failure. SandboxStateTerminated SandboxState = "STATE_TERMINATED" // Sandbox runtime has been deleted. SandboxStateDeleted SandboxState = "STATE_DELETED" // Sandbox runtime is paused. SandboxStatePaused SandboxState = "STATE_PAUSED" // Sandbox runtime is pausing. SandboxStatePausing SandboxState = "STATE_PAUSING" // Sandbox runtime is resuming. SandboxStateResuming SandboxState = "STATE_RESUMING" // Sandbox runtime is stopping. SandboxStateStopping SandboxState = "STATE_STOPPING" )
type SchemaPromptSpecAppBuilderData ¶
type SchemaPromptSpecAppBuilderData struct {
// Serialized state of the code repository. This string will typically contain a JSON
// representation of the UI's CodeRepositoryService state (files, folders, content,
// and any metadata). The UI is responsible for serialization and deserialization.
CodeRepositoryState string `json:"codeRepositoryState,omitempty"`
// Optional. Framework used to build the application.
Framework Framework `json:"framework,omitempty"`
// Linked resources attached to the application by the user.
LinkedResources []*SchemaPromptSpecAppBuilderDataLinkedResource `json:"linkedResources,omitempty"`
// Optional. The Cloud Run regions in which the application is currently deployed. Used
// to rediscover and redeploy the app in the regions it already runs in, which may differ
// from the prompt's location.
DeployedRegions []string `json:"deployedRegions,omitempty"`
}
Defines data for an application builder.
type SchemaPromptSpecAppBuilderDataLinkedResource ¶
type SchemaPromptSpecAppBuilderDataLinkedResource struct {
// A user-friendly name for the data source shown in the UI.
DisplayName string `json:"displayName,omitempty"`
// The unique resource name of the data source. The format is determined by the 'type'
// field. For type "SAVED_PROMPT": projects/{project}/locations/{location}/datasets/{dataset}
// For type "AI_AGENT": projects/{project}/locations/{location}/agents/{agent}
Name string `json:"name,omitempty"`
// The type of the linked resource. e.g., "SAVED_PROMPT", "AI_AGENT" This string corresponds
// to the name of the LinkedResourceType enum member. See: google3/cloud/console/web/ai/platform/llm/prompts/build/services/specs_repository_service/linked_resources/linked_resource.ts
Type string `json:"type,omitempty"`
}
A linked resource attached to the application by the user.
type SchemaPromptSpecInteractionData ¶ added in v0.22.0
type SchemaPromptSpecInteractionData struct {
// Optional. Lists interaction IDs associated with the prompt. This maps 1:1 to PromptMessage.contents.
// If InteractionData is present, every prompt message has an interaction ID.
InteractionIDs []string `json:"interactionIds,omitempty"`
}
Defines data for an interaction prompt.
type SecretEnvVar ¶
type SecretEnvVar struct {
// Required. Name of the secret environment variable.
Name string `json:"name,omitempty"`
// Required. Reference to a secret stored in the Cloud Secret Manager that will provide
// the value for this environment variable.
SecretRef *SecretRef `json:"secretRef,omitempty"`
}
Represents an environment variable where the value is a secret in Cloud Secret Manager.
type SecretRef ¶
type SecretRef struct {
// Required. The name of the secret in Cloud Secret Manager. Format: {secret_name}.
Secret string `json:"secret,omitempty"`
// The Cloud Secret Manager secret version. Can be 'latest' for the latest version,
// an integer for a specific version, or a version alias.
Version string `json:"version,omitempty"`
}
Reference to a secret stored in the Cloud Secret Manager that will provide the value for this environment variable.
type Session ¶
type Session struct {
// Output only. Timestamp when the session was created.
CreateTime time.Time `json:"createTime,omitempty"`
// Optional. The display name of the session.
DisplayName string `json:"displayName,omitempty"`
// Optional. Timestamp of when this session is considered expired. This is *always*
// provided on output, regardless of what was sent on input. The minimum value is 24
// hours from the time of creation.
ExpireTime time.Time `json:"expireTime,omitempty"`
// The labels with user-defined metadata to organize your Sessions. Label keys and values
// can be no longer than 64 characters (Unicode codepoints), can only contain lowercase
// letters, numeric characters, underscores and dashes. International characters are
// allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
Labels map[string]string `json:"labels,omitempty"`
// Identifier. The resource name of the session. Format: 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
Name string `json:"name,omitempty"`
// Optional. Session specific memory which stores key conversation points.
SessionState map[string]any `json:"sessionState,omitempty"`
// Optional. Input only. The TTL for this session. The minimum value is 24 hours.
TTL time.Duration `json:"ttl,omitempty"`
// Output only. Timestamp when the session was updated.
UpdateTime time.Time `json:"updateTime,omitempty"`
// Required. Immutable. String ID provided by the user
UserID string `json:"userId,omitempty"`
// Output only. The resource names of the Agents that interacted within the session.
// Each resource name has the format: `projects/{project}/locations/{location}/agents/{agent}`.
Agents []string `json:"agents,omitempty"`
// The default limit of the number of steps each child Run can contain. Default to 20
// if not specified.
DefaultRunStepLimit int64 `json:"defaultRunStepLimit,omitempty,string"`
// Output only. The state of the session.
State State `json:"state,omitempty"`
// Optional. Custom metadata for the session.
CustomMetadata map[string]any `json:"customMetadata,omitempty"`
}
A session.
func (*Session) MarshalJSON ¶
func (*Session) UnmarshalJSON ¶
type SessionEvent ¶
type SessionEvent struct {
// Optional. Content of the event provided by the author.
Content *genai_types.Content `json:"content,omitempty"`
// Optional. Actions executed by the agent.
Actions *EventActions `json:"actions,omitempty"`
// Required. The name of the agent that sent the event, or user.
Author string `json:"author,omitempty"`
// Optional. Error code if the response is an error. Code varies by model.
ErrorCode string `json:"errorCode,omitempty"`
// Optional. Error message if the response is an error.
ErrorMessage string `json:"errorMessage,omitempty"`
// Optional. Metadata relating to this event.
EventMetadata *EventMetadata `json:"eventMetadata,omitempty"`
// Required. The invocation ID of the event, multiple events can have the same invocation
// id.
InvocationID string `json:"invocationId,omitempty"`
// Identifier. The resource name of the event. Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
Name string `json:"name,omitempty"`
// Required. Timestamp when the event was created on client side.
Timestamp time.Time `json:"timestamp,omitempty"`
// Optional. Weakly typed raw event data in proto struct format.
RawEvent map[string]any `json:"rawEvent,omitempty"`
}
A session event.
func (*SessionEvent) MarshalJSON ¶
func (s *SessionEvent) MarshalJSON() ([]byte, error)
func (*SessionEvent) UnmarshalJSON ¶
func (s *SessionEvent) UnmarshalJSON(data []byte) error
type StructuredMemoryConfig ¶
type StructuredMemoryConfig struct {
// Optional. Represents configuration of the structured memories' schemas.
SchemaConfigs []*StructuredMemorySchemaConfig `json:"schemaConfigs,omitempty"`
// Optional. Represents the scope keys (i.e. 'user_id') for which to use this config.
// A request's scope must include all of the provided keys for the config to be used
// (order does not matter). If empty, then the config will be used for all requests
// that do not have a more specific config. Only one default config is allowed per Memory
// Bank.
ScopeKeys []string `json:"scopeKeys,omitempty"`
}
Configuration for organizing structured memories within a scope.
type StructuredMemorySchemaConfig ¶
type StructuredMemorySchemaConfig struct {
// Required. Represents the OpenAPI schema of the structured memories.
MemorySchema *genai_types.Schema `json:"memorySchema,omitempty"`
// Required. Represents the ID of the schema. Must be 1-63 characters, start with a
// lowercase letter, and consist of lowercase letters, numbers, and hyphens.
ID string `json:"id,omitempty"`
// Optional. Represents the type of the structured memories associated with the schema.
// If not set, then `STRUCTURED_PROFILE` will be used.
MemoryType MemoryType `json:"memoryType,omitempty"`
}
Represents the OpenAPI schema of the structured memories.
type ToolCallStats ¶ added in v0.23.0
type ToolCallStats struct {
// Output only. Note: Assuming `ToolType` mapping or just standardizing on strings depending
// on Vertex's `Tool` definitions.
FunctionName string `json:"functionName,omitempty"`
// toolCallCount
ToolCallCount *int32 `json:"toolCallCount,omitempty"`
// serverExecuted
ServerExecuted *bool `json:"serverExecuted,omitempty"`
}
type TrafficType ¶ added in v0.23.0
type TrafficType string
The traffic type for this request.
const ( // Unspecified request traffic type. TrafficTypeUnspecified TrafficType = "TRAFFIC_TYPE_UNSPECIFIED" // Type for Pay-As-You-Go traffic. TrafficTypeOnDemand TrafficType = "ON_DEMAND" // Type for Priority Pay-As-You-Go traffic. TrafficTypeOnDemandPriority TrafficType = "ON_DEMAND_PRIORITY" // Type for Flex traffic. TrafficTypeOnDemandFlex TrafficType = "ON_DEMAND_FLEX" // Type for Off-Peak Pay-As-You-Go traffic. TrafficTypeOnDemandOffpeak TrafficType = "ON_DEMAND_OFFPEAK" // Type for Provisioned Throughput traffic. TrafficTypeProvisionedThroughput TrafficType = "PROVISIONED_THROUGHPUT" )
type UpdateAgentEngineConfig ¶
type UpdateAgentEngineConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The user-defined name of the Agent Engine.
// The display name can be up to 128 characters long and can comprise any
// UTF-8 characters.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the Agent Engine.
Description string `json:"description,omitempty"`
// Optional. Configurations of the Agent Engine.
Spec *ReasoningEngineSpec `json:"spec,omitempty"`
// Optional. The context spec to be used for the Agent Engine.
ContextSpec *ReasoningEngineContextSpec `json:"contextSpec,omitempty"`
// Optional. The PSC interface config for PSC-I to be used for the
// Agent Engine.
PscInterfaceConfig *PscInterfaceConfig `json:"pscInterfaceConfig,omitempty"`
// Optional. The minimum number of instances to run for the Agent Engine.
// Defaults to 1. Range: [0, 10].
MinInstances *int32 `json:"minInstances,omitempty"`
// Optional. The maximum number of instances to run for the Agent Engine.
// Defaults to 100. Range: [1, 1000].
// If VPC-SC or PSC-I is enabled, the acceptable range is [1, 100].
MaxInstances *int32 `json:"maxInstances,omitempty"`
// Optional. The resource limits to be applied to the Agent Engine.
// Required keys: 'cpu' and 'memory'.
// Supported values for 'cpu': '1', '2', '4', '6', '8'.
// Supported values for 'memory': '1Gi', '2Gi', ..., '32Gi'.
ResourceLimits map[string]string `json:"resourceLimits,omitempty"`
// Optional. The container concurrency to be used for the Agent Engine.
// Recommended value: 2 * cpu + 1. Defaults to 9.
ContainerConcurrency *int32 `json:"containerConcurrency,omitempty"`
// Optional. The encryption spec to be used for the Agent Engine.
EncryptionSpec *genai_types.EncryptionSpec `json:"encryptionSpec,omitempty"`
// Optional. The labels to be used for the Agent Engine.
Labels map[string]string `json:"labels,omitempty"`
// Optional. The class methods to be used for the Agent Engine.
// If specified, they'll override the class methods that are autogenerated by
// default. By default, methods are generated by inspecting the agent object
// and generating a corresponding method for each method defined on the
// agent class.
ClassMethods []map[string]any `json:"classMethods,omitempty"`
// Optional. The user-provided paths to the source packages (if any).
// If specified, the files in the source packages will be packed into a
// a tarball file, uploaded to Agent Engine's API, and deployed to the
// Agent Engine.
// The following fields will be ignored:
// - agent
// - extra_packages
// - staging_bucket
// - requirements
// The following fields will be used to install and use the agent from the
// source packages:
// - entrypoint_module (required)
// - entrypoint_object (required)
// - requirements_file (optional)
// - class_methods (required)
SourcePackages []string `json:"sourcePackages,omitempty"`
// Optional. Specifies the configuration for fetching source code from a Git repository
// that is managed by Developer Connect. This includes the repository, revision, and
// directory to use.
DeveloperConnectSource *ReasoningEngineSpecSourceCodeSpecDeveloperConnectConfig `json:"developerConnectSource,omitempty"`
// Optional. The entrypoint module to be used for the Agent Engine
// This field only used when source_packages is specified.
EntrypointModule string `json:"entrypointModule,omitempty"`
// Optional. The entrypoint object to be used for the Agent Engine.
// This field only used when source_packages is specified.
EntrypointObject string `json:"entrypointObject,omitempty"`
// Optional. The user-provided path to the requirements file (if any).
// This field is only used when source_packages is specified.
// If not specified, agent engine will find and use the `requirements.txt` in
// the source package.
RequirementsFile string `json:"requirementsFile,omitempty"`
// Optional. The agent framework to be used for the Agent Engine.
// The OSS agent framework used to develop the agent.
// Currently supported values: "google-adk", "langchain", "langgraph",
// "ag2", "llama-index", "custom".
// If not specified:
// - If `agent` is specified, the agent framework will be auto-detected.
// - If `source_packages` is specified, the agent framework will
// default to "custom".
AgentFramework string `json:"agentFramework,omitempty"`
// Optional. The Python version to be used for the Agent Engine.
// If not specified, it will use the current Python version of the environment.
// Supported versions: "3.10", "3.11", "3.12", "3.13", "3.14".
PythonVersion string `json:"pythonVersion,omitempty"`
// Optional. The build options for the Agent Engine.
// The following keys are supported:
// - installation_scripts:
// Optional. The paths to the installation scripts to be
// executed in the Docker image.
// The scripts must be located in the `installation_scripts`
// subdirectory and the path must be added to `extra_packages`.
BuildOptions map[string][]string `json:"buildOptions,omitempty"`
// Optional. Agent Gateway configuration for a Reasoning Engine deployment.
AgentGatewayConfig *ReasoningEngineSpecDeploymentSpecAgentGatewayConfig `json:"agentGatewayConfig,omitempty"`
// Optional. Specifies the configuration for keep-alive probe.
// Contains configuration on a specified endpoint that a deployment host
// should use to keep the container alive based on the probe settings.
KeepAliveProbe *KeepAliveProbe `json:"keepAliveProbe,omitempty"`
// Optional. The update mask to apply. For the `FieldMask` definition, see
// https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.
UpdateMask string `json:"updateMask,omitempty"`
}
Config for updating agent engine.
type UpdateAgentEngineSessionConfig ¶
type UpdateAgentEngineSessionConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The display name of the session.
DisplayName string `json:"displayName,omitempty"`
// Optional. Session state which stores key conversation points.
SessionState map[string]any `json:"sessionState,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. Input only. The TTL for this resource.
// The expiration time is computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Optional. Timestamp of when this resource is considered expired. This is *always*
// provided on output, regardless of what `expiration` was sent on input.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Optional. The labels with user-defined metadata to organize your Sessions. Label
// keys and values can be no longer than 64 characters (Unicode codepoints), can only
// contain lowercase letters, numeric characters, underscores and dashes. International
// characters are allowed. See https://goo.gl/xmQnxf for more information and examples
// of labels.
Labels map[string]string `json:"labels,omitempty"`
// Optional. The user defined ID to use for session, which will become the final component
// of the session resource name. If not provided, Vertex AI will generate a value for
// this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`.
// The first character must be a letter, and the last character must be a letter or
// number.
SessionID string `json:"sessionId,omitempty"`
// Optional. The update mask to apply. For the `FieldMask` definition, see
// https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.
UpdateMask string `json:"updateMask,omitempty"`
// User ID of the agent engine session to update.
UserID string `json:"userId,omitempty"`
}
Config for updating agent engine session.
func (*UpdateAgentEngineSessionConfig) MarshalJSON ¶
func (u *UpdateAgentEngineSessionConfig) MarshalJSON() ([]byte, error)
func (*UpdateAgentEngineSessionConfig) UnmarshalJSON ¶
func (u *UpdateAgentEngineSessionConfig) UnmarshalJSON(data []byte) error
type UpdateMemoryBankConfig ¶ added in v0.23.0
type UpdateMemoryBankConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The user-defined name of the Memory Bank.
// The display name can be up to 128 characters long and can comprise any
// UTF-8 characters.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the Memory Bank.
Description string `json:"description,omitempty"`
// Optional. The encryption spec to be used for the Memory Bank.
EncryptionSpec *genai_types.EncryptionSpec `json:"encryptionSpec,omitempty"`
}
Config for updating a memory bank.
type UpdateMemoryConfig ¶ added in v0.22.0
type UpdateMemoryConfig struct {
// Optional. Used to override HTTP request options.
HTTPOptions *genai_types.HTTPOptions `json:"httpOptions,omitempty"`
// Optional. The display name of the memory.
DisplayName string `json:"displayName,omitempty"`
// Optional. The description of the memory.
Description string `json:"description,omitempty"`
// Optional. Waits for the operation to complete before returning.
WaitForCompletion *bool `json:"waitForCompletion,omitempty"`
// Optional. Input only. The TTL for this resource.
// The expiration time is computed: now + TTL.
TTL time.Duration `json:"ttl,omitempty"`
// Optional. Timestamp of when this resource is considered expired. This is *always*
// provided on output, regardless of what `expiration` was sent on input.
ExpireTime time.Time `json:"expireTime,omitempty"`
// Optional. Input only. Timestamp of when the revision is considered expired. If not
// set, the memory revision will be kept until manually deleted.
RevisionExpireTime time.Time `json:"revisionExpireTime,omitempty"`
// Optional. Input only. The TTL for the revision. The expiration time is computed:
// now + TTL.
RevisionTTL time.Duration `json:"revisionTtl,omitempty"`
// Optional. Input only. If true, no revision will be created for this request.
DisableMemoryRevisions *bool `json:"disableMemoryRevisions,omitempty"`
// Optional. The topics of the memory.
Topics []*MemoryTopicID `json:"topics,omitempty"`
// Optional. User-provided metadata for the Memory. This information was provided when
// creating, updating, or generating the Memory. It was not generated by Memory Bank.
Metadata map[string]*MemoryMetadataValue `json:"metadata,omitempty"`
// Optional. The user defined ID to use for memory, which will become the final component
// of the memory resource name. If not provided, Vertex AI will generate a value for
// this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`.
// The first character must be a letter, and the last character must be a letter or
// number.
MemoryID string `json:"memoryId,omitempty"`
// Optional. The update mask to apply. For the `FieldMask` definition, see
// https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask.
UpdateMask string `json:"updateMask,omitempty"`
}
Config for updating a memory.
func (*UpdateMemoryConfig) MarshalJSON ¶ added in v0.22.0
func (u *UpdateMemoryConfig) MarshalJSON() ([]byte, error)
func (*UpdateMemoryConfig) UnmarshalJSON ¶ added in v0.22.0
func (u *UpdateMemoryConfig) UnmarshalJSON(data []byte) error
type UsageMetadata ¶ added in v0.23.0
type UsageMetadata struct {
// The total number of tokens in the prompt. This includes any text, images, or other
// media provided in the request. When `cached_content` is set, this also includes the
// number of tokens in the cached content.
PromptTokenCount *int32 `json:"promptTokenCount,omitempty"`
// The total number of tokens in the generated candidates.
CandidatesTokenCount *int32 `json:"candidatesTokenCount,omitempty"`
// The total number of tokens for the entire request. This is the sum of `prompt_token_count`,
// `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
TotalTokenCount *int32 `json:"totalTokenCount,omitempty"`
// Output only. The number of tokens in the results from tool executions, which are
// provided back to the model as input, if applicable.
ToolUsePromptTokenCount *int32 `json:"toolUsePromptTokenCount,omitempty"`
// Output only. The number of tokens that were part of the model's generated "thoughts"
// output, if applicable.
ThoughtsTokenCount *int32 `json:"thoughtsTokenCount,omitempty"`
// Output only. The number of tokens in the cached content that was used for this request.
CachedContentTokenCount *int32 `json:"cachedContentTokenCount,omitempty"`
// Output only. A detailed breakdown of the token count for each modality in the prompt.
PromptTokensDetails []*ModalityTokenCount `json:"promptTokensDetails,omitempty"`
// Output only. A detailed breakdown of the token count for each modality in the cached
// content.
CacheTokensDetails []*ModalityTokenCount `json:"cacheTokensDetails,omitempty"`
// Output only. A detailed breakdown of the token count for each modality in the generated
// candidates.
CandidatesTokensDetails []*ModalityTokenCount `json:"candidatesTokensDetails,omitempty"`
// Output only. A detailed breakdown by modality of the token counts from the results
// of tool executions, which are provided back to the model as input.
ToolUsePromptTokensDetails []*ModalityTokenCount `json:"toolUsePromptTokensDetails,omitempty"`
// Output only. The traffic type for this request.
TrafficType TrafficType `json:"trafficType,omitempty"`
// Output only. [Deprecated] Billable usage for the prompt.
BillablePromptUsage *UsageMetadataBillablleUsage `json:"billablePromptUsage,omitempty"`
// Output only. [Deprecated] Billable usage for the cached content.
BillableCachedContentUsage *UsageMetadataBillablleUsage `json:"billableCachedContentUsage,omitempty"`
// Output only. Statistics about function calls in this generation request.
ToolCallStats []*ToolCallStats `json:"toolCallStats,omitempty"`
}
Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics.
type UsageMetadataBillablleUsage ¶ added in v0.23.0
type UsageMetadataBillablleUsage struct {
// The number of text characters.
TextCount *int32 `json:"textCount,omitempty"`
// The number of images.
ImageCount *int32 `json:"imageCount,omitempty"`
// The duration of video in seconds.
VideoDurationSeconds *int32 `json:"videoDurationSeconds,omitempty"`
// The duration of audio in seconds.
AudioDurationSeconds *int32 `json:"audioDurationSeconds,omitempty"`
}
[Deprecated] Billable usage information.