Returns the memories Resource.
Returns the operations Resource.
Close httplib2 connections.
create(parent, body=None, x__xgafv=None)
Create a Memory Bank.
delete(name, force=None, x__xgafv=None)
Delete a Memory Bank.
Get a Memory Bank.
ingestEvents(parent, body=None, x__xgafv=None)
Ingests events for a Memory Bank.
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
List Memory Banks.
list_next(previous_request, previous_response)
Retrieves the next page of results.
patch(name, body=None, updateMask=None, x__xgafv=None)
Update a Memory Bank.
retrieveScopes(parent, pageSize=None, pageToken=None, x__xgafv=None)
Retrieves the scopes stored in a Memory Bank.
retrieveScopes_next(previous_request, previous_response)
Retrieves the next page of results.
close()
Close httplib2 connections.
create(parent, body=None, x__xgafv=None)
Create a Memory Bank.
Args:
parent: string, A parameter (required)
body: object, The request body.
The object takes the form of:
{ # A Memory Bank, which generates and manages agentic memories.
"createTime": "A String", # Output only. The timestamp when this Memory Bank was created.
"description": "A String", # Optional. The description of the Memory Bank.
"displayName": "A String", # Optional. The display name of the Memory Bank.
"encryptionSpec": { # Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource. # Optional. Customer-managed encryption key spec for a MemoryBank. If set, this MemoryBank and all sub-resources of this MemoryBank will be secured by this key.
"kmsKeyName": "A String", # 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}`.
},
"labels": { # Optional. Labels for the Memory Bank. These labels are not propagated to billing usage records.
"a_key": "A String",
},
"managedSemanticMemoryConfig": { # Represents configuration for managed memories in Memory Bank. # Optional. The configuration for managed memories in Memory Bank. If not set, then the default configuration will be used.
"disableMemoryRevisions": True or False, # If true, no memory revisions will be created for any requests to Memory Bank.
"generationConfig": { # Represents configuration for LLMs calls. # Optional. Represents configuration for LLMs calls.
"generationTriggerConfig": { # Represents configuration for triggering generation. # Optional. Specifies the default trigger configuration for generating memories using `IngestEvents`.
"generationRule": { # Represents the active rule that determines when to flush the buffer. # Optional. Represents the active rule that determines when to flush the buffer. If not set, then the stream will be force flushed immediately.
"eventCount": 42, # Optional. Specifies to trigger generation when the event count reaches this limit.
"fixedInterval": "A String", # Optional. Specifies to trigger generation at a fixed interval. The duration must have a minute-level granularity.
"idleDuration": "A String", # 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.
"overlapEventCount": 42, # Optional. Re-include the last N already-processed events in the next window.
},
},
"model": "A String", # Optional. The model used to generate memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"similaritySearchConfig": { # Represents configuration for similarity search. # Optional. Configuration for how to perform similarity search on memories. If not set, Memory Bank will use the default embedding model `text-embedding-005`.
"embeddingModel": "A String", # Required. The model used to generate embeddings to look up similar memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"structuredMemoryConfigs": [ # Optional. Configuration for organizing structured memories for a particular scope.
{ # Represents configuration for organizing structured memories for a particular scope.
"schemaConfigs": [ # Optional. Represents configuration of the structured memories' schemas.
{ # Schema configuration for structured memories.
"id": "A String", # 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.
"jsonSchema": "", # Optional. Represents the JSON Schema of the structured memories.
"memoryType": "A String", # Optional. Represents the type of the structured memories associated with the schema. If not set, then `STRUCTURED_PROFILE` will be used.
"schema": { # Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object). # Required. Represents the OpenAPI schema of the structured memories. The schema `type` cannot be `ARRAY` when `memory_type` is `STRUCTURED_PROFILE`.
"additionalProperties": "", # Optional. If `type` is `OBJECT`, specifies how to handle properties not defined in `properties`. If it is a boolean `false`, no additional properties are allowed. If it is a schema, additional properties are allowed if they conform to the schema.
"anyOf": [ # Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.
# Object with schema name: GoogleCloudAiplatformV1beta1Schema
],
"default": "", # Optional. Default value to use if the field is not specified.
"defs": { # Optional. `defs` provides a map of schema definitions that can be reused by `ref` elsewhere in the schema. Only allowed at root level of the schema.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"description": "A String", # Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.
"enum": [ # Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`
"A String",
],
"example": "", # Optional. Example of an instance of this schema.
"format": "A String", # Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.
"items": # Object with schema name: GoogleCloudAiplatformV1beta1Schema # Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.
"maxItems": "A String", # Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.
"maxLength": "A String", # Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.
"maxProperties": "A String", # Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.
"maximum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.
"minItems": "A String", # Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.
"minLength": "A String", # Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.
"minProperties": "A String", # Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.
"minimum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.
"nullable": True or False, # Optional. Indicates if the value of this field can be null.
"pattern": "A String", # Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.
"properties": { # Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"propertyOrdering": [ # Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.
"A String",
],
"ref": "A String", # Optional. Allows referencing another schema definition to use in place of this schema. The value must be a valid reference to a schema in `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
"required": [ # Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.
"A String",
],
"title": "A String", # Optional. Title for the schema.
"type": "A String", # Optional. Data type of the schema field.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
"ttlConfig": { # Represents configuration for TTL. # 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.
"defaultTtl": "A String", # Optional. The default TTL duration of the memories in the Memory Bank. This applies to all operations that create or update a memory.
"granularTtlConfig": { # Configuration for TTL of the memories in the Memory Bank based on the action that created or updated the memory. # Optional. The granular TTL configuration of the memories in the Memory Bank.
"createTtl": "A String", # Optional. The TTL duration for memories uploaded via CreateMemory.
"generateCreatedTtl": "A String", # Optional. The TTL duration for memories newly generated via GenerateMemories (GenerateMemoriesResponse.GeneratedMemory.Action.CREATED).
"generateUpdatedTtl": "A String", # 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).
},
"memoryRevisionDefaultTtl": "A String", # 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.
},
"unstructuredMemoryConfigs": [ # Optional. Configuration for how to customize Memory Bank behavior for a particular scope for unstructured memories.
{ # Represents configuration for organizing natural language memories for a particular scope.
"consolidationConfig": { # Represents configuration for customizing how memories are consolidated. # Optional. Represents configuration for customizing how memories are consolidated together.
"revisionsPerCandidateCount": 42, # 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.
},
"disableNaturalLanguageMemories": True or False, # 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.
"enableThirdPersonMemories": True or False, # 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.")
"generateMemoriesExamples": [ # Optional. Provides examples of how to generate memories for a particular scope.
{ # An example of how to generate memories for a particular scope.
"conversationSource": { # A conversation source for the example. This is similar to `DirectContentsSource`. # A conversation source for the example.
"events": [ # Optional. Represents the input conversation events for the example.
{ # A single conversation event.
"content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Required. Represents the content of the event.
"parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
{ # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` must contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"audioTranscription": { # The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate `Part` with its own `AudioTranscription` carrying the `speaker_label`. # Optional. Audio (input or output) transcription. This is only set when this `Part` contains audio data.
"speakerLabel": "A String", # Optional. A label identifying the speaker of this audio segment (e.g. `spk_1`, `spk_2`). Present when `diarization` is set.
"text": "A String", # Required. The transcription text of this audio segment.
"words": [ # Optional. Detailed word-level transcriptions and timing details. Present when `word_timestamp` is set.
{ # Information about a single recognized word.
"endOffset": "A String", # Optional. End offset in time of the word relative to the start of the audio.
"startOffset": "A String", # Optional. Start offset in time of the word relative to the start of the audio.
"word": "A String", # Required. Transcript of the word.
},
],
},
"codeExecutionResult": { # Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used. # Optional. The result of executing the ExecutableCode.
"id": "A String", # Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.
"outcome": "A String", # Required. Outcome of the code execution.
"output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated. # Optional. Code generated by the model that is intended to be executed.
"code": "A String", # Required. The code to be executed.
"id": "A String", # Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
"language": "A String", # Required. Programming language of the `code`.
},
"fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
"displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"functionCall": { # A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
"args": { # Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details.
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.
"name": "A String", # Optional. The name of the function to call. Matches FunctionDeclaration.name.
"partialArgs": [ # Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally.
{ # Partial argument value of the function call.
"boolValue": True or False, # Optional. Represents a boolean value.
"jsonPath": "A String", # Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
"nullValue": "A String", # Optional. Represents a null value.
"numberValue": 3.14, # Optional. Represents a double value.
"stringValue": "A String", # Optional. Represents a string value.
"willContinue": True or False, # Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
},
],
"willContinue": True or False, # Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow.
},
"functionResponse": { # The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
"id": "A String", # Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
"name": "A String", # Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name.
"parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
{ # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"fileData": { # URI based data for function response. # URI based data.
"displayName": "A String", # Optional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"fileUri": "A String", # Required. URI.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
"data": "A String", # Required. Raw bytes.
"displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. Processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # Media resolution for the input media of a `FunctionResponsePart`. # Optional. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"videoMetadata": { # Metadata describes the input video content of a `FunctionResponsePart`. Set this in `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
"a_key": "", # Properties of the object.
},
"scheduling": "A String", # Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
},
"inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
"data": "A String", # Required. The raw bytes of the data.
"displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # per part media resolution. Media resolution for the input media. # per part media resolution. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"speechMetadata": { # Structured Metadata Sub-Message for Part # Optional. Turn-level metadata for speech generation (e.g. Daikon speaker/style). May be set alongside `text` to attach speaker and style information to a text part.
"speaker": "A String", # Optional. Identifies which speaker is speaking this turn.
"style": "A String", # Optional. Natural language description of the vocal style (e.g., "cheerful").
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"text": "A String", # Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.
"thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
"thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
"toolCall": { # A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. # Optional. Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.
"args": { # Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.
"toolType": "A String", # Optional. The type of tool that was called.
},
"toolResponse": { # The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. # Optional. The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.
"id": "A String", # Optional. The identifier of the tool call this response is for.
"response": { # Optional. The tool response.
"a_key": "", # Properties of the object.
},
"toolType": "A String", # Optional. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.
},
"videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
},
},
],
},
"generatedMemories": [ # 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.
{ # A memory generated by the operation.
"fact": "A String", # Required. Represents the fact to generate a memory from.
"topics": [ # 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`.
{ # A memory topic identifier. This will be used to label a Memory and to restrict which topics are eligible for generation or retrieval.
"customMemoryTopicLabel": "A String", # Optional. Represents the custom memory topic label.
"managedMemoryTopic": "A String", # Optional. Represents the managed memory topic.
},
],
},
],
},
],
"memoryTopics": [ # 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.
{ # A topic of information that should be extracted from conversations and stored as memories.
"customMemoryTopic": { # A custom memory topic defined by the developer. # A custom memory topic defined by the developer.
"description": "A String", # Required. Represents the description of the memory topic. This should explain what information should be extracted for this topic.
"label": "A String", # Required. Represents the label of the topic.
},
"managedMemoryTopic": { # A managed memory topic defined by the system. # A managed memory topic defined by Memory Bank.
"managedTopicEnum": "A String", # Required. Represents the managed topic.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
},
"name": "A String", # Identifier. The resource name of the Memory Bank. Format: `projects/{project}/locations/{location}/memoryBanks/{memory_bank}`
"updateTime": "A String", # Output only. The timestamp when this Memory Bank was most recently updated.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # 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.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # 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}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
delete(name, force=None, x__xgafv=None)
Delete a Memory Bank.
Args:
name: string, A parameter (required)
force: boolean, Optional. If set to `true`, child resources of this Memory Bank will also be deleted. Otherwise, the request will fail with `FAILED_PRECONDITION` error when the Memory Bank has undeleted child resources.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # 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.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # 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}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
get(name, x__xgafv=None)
Get a Memory Bank.
Args:
name: string, A parameter (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A Memory Bank, which generates and manages agentic memories.
"createTime": "A String", # Output only. The timestamp when this Memory Bank was created.
"description": "A String", # Optional. The description of the Memory Bank.
"displayName": "A String", # Optional. The display name of the Memory Bank.
"encryptionSpec": { # Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource. # Optional. Customer-managed encryption key spec for a MemoryBank. If set, this MemoryBank and all sub-resources of this MemoryBank will be secured by this key.
"kmsKeyName": "A String", # 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}`.
},
"labels": { # Optional. Labels for the Memory Bank. These labels are not propagated to billing usage records.
"a_key": "A String",
},
"managedSemanticMemoryConfig": { # Represents configuration for managed memories in Memory Bank. # Optional. The configuration for managed memories in Memory Bank. If not set, then the default configuration will be used.
"disableMemoryRevisions": True or False, # If true, no memory revisions will be created for any requests to Memory Bank.
"generationConfig": { # Represents configuration for LLMs calls. # Optional. Represents configuration for LLMs calls.
"generationTriggerConfig": { # Represents configuration for triggering generation. # Optional. Specifies the default trigger configuration for generating memories using `IngestEvents`.
"generationRule": { # Represents the active rule that determines when to flush the buffer. # Optional. Represents the active rule that determines when to flush the buffer. If not set, then the stream will be force flushed immediately.
"eventCount": 42, # Optional. Specifies to trigger generation when the event count reaches this limit.
"fixedInterval": "A String", # Optional. Specifies to trigger generation at a fixed interval. The duration must have a minute-level granularity.
"idleDuration": "A String", # 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.
"overlapEventCount": 42, # Optional. Re-include the last N already-processed events in the next window.
},
},
"model": "A String", # Optional. The model used to generate memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"similaritySearchConfig": { # Represents configuration for similarity search. # Optional. Configuration for how to perform similarity search on memories. If not set, Memory Bank will use the default embedding model `text-embedding-005`.
"embeddingModel": "A String", # Required. The model used to generate embeddings to look up similar memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"structuredMemoryConfigs": [ # Optional. Configuration for organizing structured memories for a particular scope.
{ # Represents configuration for organizing structured memories for a particular scope.
"schemaConfigs": [ # Optional. Represents configuration of the structured memories' schemas.
{ # Schema configuration for structured memories.
"id": "A String", # 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.
"jsonSchema": "", # Optional. Represents the JSON Schema of the structured memories.
"memoryType": "A String", # Optional. Represents the type of the structured memories associated with the schema. If not set, then `STRUCTURED_PROFILE` will be used.
"schema": { # Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object). # Required. Represents the OpenAPI schema of the structured memories. The schema `type` cannot be `ARRAY` when `memory_type` is `STRUCTURED_PROFILE`.
"additionalProperties": "", # Optional. If `type` is `OBJECT`, specifies how to handle properties not defined in `properties`. If it is a boolean `false`, no additional properties are allowed. If it is a schema, additional properties are allowed if they conform to the schema.
"anyOf": [ # Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.
# Object with schema name: GoogleCloudAiplatformV1beta1Schema
],
"default": "", # Optional. Default value to use if the field is not specified.
"defs": { # Optional. `defs` provides a map of schema definitions that can be reused by `ref` elsewhere in the schema. Only allowed at root level of the schema.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"description": "A String", # Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.
"enum": [ # Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`
"A String",
],
"example": "", # Optional. Example of an instance of this schema.
"format": "A String", # Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.
"items": # Object with schema name: GoogleCloudAiplatformV1beta1Schema # Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.
"maxItems": "A String", # Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.
"maxLength": "A String", # Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.
"maxProperties": "A String", # Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.
"maximum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.
"minItems": "A String", # Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.
"minLength": "A String", # Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.
"minProperties": "A String", # Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.
"minimum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.
"nullable": True or False, # Optional. Indicates if the value of this field can be null.
"pattern": "A String", # Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.
"properties": { # Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"propertyOrdering": [ # Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.
"A String",
],
"ref": "A String", # Optional. Allows referencing another schema definition to use in place of this schema. The value must be a valid reference to a schema in `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
"required": [ # Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.
"A String",
],
"title": "A String", # Optional. Title for the schema.
"type": "A String", # Optional. Data type of the schema field.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
"ttlConfig": { # Represents configuration for TTL. # 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.
"defaultTtl": "A String", # Optional. The default TTL duration of the memories in the Memory Bank. This applies to all operations that create or update a memory.
"granularTtlConfig": { # Configuration for TTL of the memories in the Memory Bank based on the action that created or updated the memory. # Optional. The granular TTL configuration of the memories in the Memory Bank.
"createTtl": "A String", # Optional. The TTL duration for memories uploaded via CreateMemory.
"generateCreatedTtl": "A String", # Optional. The TTL duration for memories newly generated via GenerateMemories (GenerateMemoriesResponse.GeneratedMemory.Action.CREATED).
"generateUpdatedTtl": "A String", # 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).
},
"memoryRevisionDefaultTtl": "A String", # 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.
},
"unstructuredMemoryConfigs": [ # Optional. Configuration for how to customize Memory Bank behavior for a particular scope for unstructured memories.
{ # Represents configuration for organizing natural language memories for a particular scope.
"consolidationConfig": { # Represents configuration for customizing how memories are consolidated. # Optional. Represents configuration for customizing how memories are consolidated together.
"revisionsPerCandidateCount": 42, # 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.
},
"disableNaturalLanguageMemories": True or False, # 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.
"enableThirdPersonMemories": True or False, # 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.")
"generateMemoriesExamples": [ # Optional. Provides examples of how to generate memories for a particular scope.
{ # An example of how to generate memories for a particular scope.
"conversationSource": { # A conversation source for the example. This is similar to `DirectContentsSource`. # A conversation source for the example.
"events": [ # Optional. Represents the input conversation events for the example.
{ # A single conversation event.
"content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Required. Represents the content of the event.
"parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
{ # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` must contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"audioTranscription": { # The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate `Part` with its own `AudioTranscription` carrying the `speaker_label`. # Optional. Audio (input or output) transcription. This is only set when this `Part` contains audio data.
"speakerLabel": "A String", # Optional. A label identifying the speaker of this audio segment (e.g. `spk_1`, `spk_2`). Present when `diarization` is set.
"text": "A String", # Required. The transcription text of this audio segment.
"words": [ # Optional. Detailed word-level transcriptions and timing details. Present when `word_timestamp` is set.
{ # Information about a single recognized word.
"endOffset": "A String", # Optional. End offset in time of the word relative to the start of the audio.
"startOffset": "A String", # Optional. Start offset in time of the word relative to the start of the audio.
"word": "A String", # Required. Transcript of the word.
},
],
},
"codeExecutionResult": { # Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used. # Optional. The result of executing the ExecutableCode.
"id": "A String", # Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.
"outcome": "A String", # Required. Outcome of the code execution.
"output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated. # Optional. Code generated by the model that is intended to be executed.
"code": "A String", # Required. The code to be executed.
"id": "A String", # Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
"language": "A String", # Required. Programming language of the `code`.
},
"fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
"displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"functionCall": { # A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
"args": { # Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details.
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.
"name": "A String", # Optional. The name of the function to call. Matches FunctionDeclaration.name.
"partialArgs": [ # Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally.
{ # Partial argument value of the function call.
"boolValue": True or False, # Optional. Represents a boolean value.
"jsonPath": "A String", # Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
"nullValue": "A String", # Optional. Represents a null value.
"numberValue": 3.14, # Optional. Represents a double value.
"stringValue": "A String", # Optional. Represents a string value.
"willContinue": True or False, # Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
},
],
"willContinue": True or False, # Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow.
},
"functionResponse": { # The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
"id": "A String", # Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
"name": "A String", # Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name.
"parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
{ # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"fileData": { # URI based data for function response. # URI based data.
"displayName": "A String", # Optional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"fileUri": "A String", # Required. URI.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
"data": "A String", # Required. Raw bytes.
"displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. Processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # Media resolution for the input media of a `FunctionResponsePart`. # Optional. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"videoMetadata": { # Metadata describes the input video content of a `FunctionResponsePart`. Set this in `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
"a_key": "", # Properties of the object.
},
"scheduling": "A String", # Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
},
"inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
"data": "A String", # Required. The raw bytes of the data.
"displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # per part media resolution. Media resolution for the input media. # per part media resolution. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"speechMetadata": { # Structured Metadata Sub-Message for Part # Optional. Turn-level metadata for speech generation (e.g. Daikon speaker/style). May be set alongside `text` to attach speaker and style information to a text part.
"speaker": "A String", # Optional. Identifies which speaker is speaking this turn.
"style": "A String", # Optional. Natural language description of the vocal style (e.g., "cheerful").
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"text": "A String", # Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.
"thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
"thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
"toolCall": { # A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. # Optional. Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.
"args": { # Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.
"toolType": "A String", # Optional. The type of tool that was called.
},
"toolResponse": { # The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. # Optional. The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.
"id": "A String", # Optional. The identifier of the tool call this response is for.
"response": { # Optional. The tool response.
"a_key": "", # Properties of the object.
},
"toolType": "A String", # Optional. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.
},
"videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
},
},
],
},
"generatedMemories": [ # 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.
{ # A memory generated by the operation.
"fact": "A String", # Required. Represents the fact to generate a memory from.
"topics": [ # 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`.
{ # A memory topic identifier. This will be used to label a Memory and to restrict which topics are eligible for generation or retrieval.
"customMemoryTopicLabel": "A String", # Optional. Represents the custom memory topic label.
"managedMemoryTopic": "A String", # Optional. Represents the managed memory topic.
},
],
},
],
},
],
"memoryTopics": [ # 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.
{ # A topic of information that should be extracted from conversations and stored as memories.
"customMemoryTopic": { # A custom memory topic defined by the developer. # A custom memory topic defined by the developer.
"description": "A String", # Required. Represents the description of the memory topic. This should explain what information should be extracted for this topic.
"label": "A String", # Required. Represents the label of the topic.
},
"managedMemoryTopic": { # A managed memory topic defined by the system. # A managed memory topic defined by Memory Bank.
"managedTopicEnum": "A String", # Required. Represents the managed topic.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
},
"name": "A String", # Identifier. The resource name of the Memory Bank. Format: `projects/{project}/locations/{location}/memoryBanks/{memory_bank}`
"updateTime": "A String", # Output only. The timestamp when this Memory Bank was most recently updated.
}
ingestEvents(parent, body=None, x__xgafv=None)
Ingests events for a Memory Bank.
Args:
parent: string, Required. The resource name of the ReasoningEngine to ingest events to. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` (required)
body: object, The request body.
The object takes the form of:
{ # Request message for MemoryBankService.IngestEvents.
"directContentsSource": { # Ingest events directly from the request. # Ingest events directly from the request.
"events": [ # Required. The events to ingest.
{ # A single event to ingest.
"content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Required. The content of the event.
"parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
{ # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` must contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"audioTranscription": { # The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate `Part` with its own `AudioTranscription` carrying the `speaker_label`. # Optional. Audio (input or output) transcription. This is only set when this `Part` contains audio data.
"speakerLabel": "A String", # Optional. A label identifying the speaker of this audio segment (e.g. `spk_1`, `spk_2`). Present when `diarization` is set.
"text": "A String", # Required. The transcription text of this audio segment.
"words": [ # Optional. Detailed word-level transcriptions and timing details. Present when `word_timestamp` is set.
{ # Information about a single recognized word.
"endOffset": "A String", # Optional. End offset in time of the word relative to the start of the audio.
"startOffset": "A String", # Optional. Start offset in time of the word relative to the start of the audio.
"word": "A String", # Required. Transcript of the word.
},
],
},
"codeExecutionResult": { # Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used. # Optional. The result of executing the ExecutableCode.
"id": "A String", # Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.
"outcome": "A String", # Required. Outcome of the code execution.
"output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated. # Optional. Code generated by the model that is intended to be executed.
"code": "A String", # Required. The code to be executed.
"id": "A String", # Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
"language": "A String", # Required. Programming language of the `code`.
},
"fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
"displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"functionCall": { # A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
"args": { # Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details.
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.
"name": "A String", # Optional. The name of the function to call. Matches FunctionDeclaration.name.
"partialArgs": [ # Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally.
{ # Partial argument value of the function call.
"boolValue": True or False, # Optional. Represents a boolean value.
"jsonPath": "A String", # Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
"nullValue": "A String", # Optional. Represents a null value.
"numberValue": 3.14, # Optional. Represents a double value.
"stringValue": "A String", # Optional. Represents a string value.
"willContinue": True or False, # Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
},
],
"willContinue": True or False, # Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow.
},
"functionResponse": { # The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
"id": "A String", # Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
"name": "A String", # Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name.
"parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
{ # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"fileData": { # URI based data for function response. # URI based data.
"displayName": "A String", # Optional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"fileUri": "A String", # Required. URI.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
"data": "A String", # Required. Raw bytes.
"displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. Processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # Media resolution for the input media of a `FunctionResponsePart`. # Optional. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"videoMetadata": { # Metadata describes the input video content of a `FunctionResponsePart`. Set this in `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
"a_key": "", # Properties of the object.
},
"scheduling": "A String", # Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
},
"inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
"data": "A String", # Required. The raw bytes of the data.
"displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # per part media resolution. Media resolution for the input media. # per part media resolution. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"speechMetadata": { # Structured Metadata Sub-Message for Part # Optional. Turn-level metadata for speech generation (e.g. Daikon speaker/style). May be set alongside `text` to attach speaker and style information to a text part.
"speaker": "A String", # Optional. Identifies which speaker is speaking this turn.
"style": "A String", # Optional. Natural language description of the vocal style (e.g., "cheerful").
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"text": "A String", # Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.
"thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
"thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
"toolCall": { # A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. # Optional. Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.
"args": { # Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.
"toolType": "A String", # Optional. The type of tool that was called.
},
"toolResponse": { # The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. # Optional. The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.
"id": "A String", # Optional. The identifier of the tool call this response is for.
"response": { # Optional. The tool response.
"a_key": "", # Properties of the object.
},
"toolType": "A String", # Optional. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.
},
"videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
},
"eventId": "A String", # Optional. A unique identifier for the event. If an event with the same event_id is ingested multiple times, it will be de-duplicated.
"eventTime": "A String", # 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.
},
],
},
"disableMemoryRevisions": True or False, # Optional. If true, no revisions will be created for this request.
"forceFlush": True or False, # 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`.
"generationTriggerConfig": { # Represents configuration for triggering generation. # Optional. Configuration for triggering memory generation from this ingestion. If not set, then the stream will be force flushed immediately.
"generationRule": { # Represents the active rule that determines when to flush the buffer. # Optional. Represents the active rule that determines when to flush the buffer. If not set, then the stream will be force flushed immediately.
"eventCount": 42, # Optional. Specifies to trigger generation when the event count reaches this limit.
"fixedInterval": "A String", # Optional. Specifies to trigger generation at a fixed interval. The duration must have a minute-level granularity.
"idleDuration": "A String", # 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.
"overlapEventCount": 42, # Optional. Re-include the last N already-processed events in the next window.
},
},
"metadata": { # Optional. User-provided metadata for the generated memories. This is not generated by Memory Bank.
"a_key": { # Memory metadata.
"boolValue": True or False, # Represents a boolean value.
"doubleValue": 3.14, # Represents a double value.
"stringValue": "A String", # Represents a string value.
"timestampValue": "A String", # Represents a timestamp value. When filtering on timestamp values, only the seconds field will be compared.
},
},
"metadataMergeStrategy": "A String", # Optional. The strategy to use when applying metadata to existing memories.
"revisionExpireTime": "A String", # Optional. Timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted.
"revisionLabels": { # Optional. Labels to be applied to the generated memory revisions. For example, you can use this to label a revision with its data source.
"a_key": "A String",
},
"revisionTtl": "A String", # Optional. The TTL for the revision. The expiration time is computed: now + TTL.
"scope": { # Required. The scope of the memories that should be generated from the stream. Memories will be consolidated across memories with the same scope. Scope values cannot contain the wildcard character '*'.
"a_key": "A String",
},
"streamId": "A String", # Optional. The ID of the stream to ingest events into. If not provided, a new one will be created.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # 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.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # 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}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
List Memory Banks.
Args:
parent: string, A parameter (required)
pageSize: integer, Optional. The maximum number of MemoryBanks to return. The service may return fewer than this value. If unspecified, at most 100 MemoryBanks will be returned. The maximum value is 100; values above 100 will be coerced to 100.
pageToken: string, Optional. The standard list page token.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for MemoryBankAdminService.ListMemoryBanks.
"memoryBanks": [
{ # A Memory Bank, which generates and manages agentic memories.
"createTime": "A String", # Output only. The timestamp when this Memory Bank was created.
"description": "A String", # Optional. The description of the Memory Bank.
"displayName": "A String", # Optional. The display name of the Memory Bank.
"encryptionSpec": { # Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource. # Optional. Customer-managed encryption key spec for a MemoryBank. If set, this MemoryBank and all sub-resources of this MemoryBank will be secured by this key.
"kmsKeyName": "A String", # 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}`.
},
"labels": { # Optional. Labels for the Memory Bank. These labels are not propagated to billing usage records.
"a_key": "A String",
},
"managedSemanticMemoryConfig": { # Represents configuration for managed memories in Memory Bank. # Optional. The configuration for managed memories in Memory Bank. If not set, then the default configuration will be used.
"disableMemoryRevisions": True or False, # If true, no memory revisions will be created for any requests to Memory Bank.
"generationConfig": { # Represents configuration for LLMs calls. # Optional. Represents configuration for LLMs calls.
"generationTriggerConfig": { # Represents configuration for triggering generation. # Optional. Specifies the default trigger configuration for generating memories using `IngestEvents`.
"generationRule": { # Represents the active rule that determines when to flush the buffer. # Optional. Represents the active rule that determines when to flush the buffer. If not set, then the stream will be force flushed immediately.
"eventCount": 42, # Optional. Specifies to trigger generation when the event count reaches this limit.
"fixedInterval": "A String", # Optional. Specifies to trigger generation at a fixed interval. The duration must have a minute-level granularity.
"idleDuration": "A String", # 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.
"overlapEventCount": 42, # Optional. Re-include the last N already-processed events in the next window.
},
},
"model": "A String", # Optional. The model used to generate memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"similaritySearchConfig": { # Represents configuration for similarity search. # Optional. Configuration for how to perform similarity search on memories. If not set, Memory Bank will use the default embedding model `text-embedding-005`.
"embeddingModel": "A String", # Required. The model used to generate embeddings to look up similar memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"structuredMemoryConfigs": [ # Optional. Configuration for organizing structured memories for a particular scope.
{ # Represents configuration for organizing structured memories for a particular scope.
"schemaConfigs": [ # Optional. Represents configuration of the structured memories' schemas.
{ # Schema configuration for structured memories.
"id": "A String", # 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.
"jsonSchema": "", # Optional. Represents the JSON Schema of the structured memories.
"memoryType": "A String", # Optional. Represents the type of the structured memories associated with the schema. If not set, then `STRUCTURED_PROFILE` will be used.
"schema": { # Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object). # Required. Represents the OpenAPI schema of the structured memories. The schema `type` cannot be `ARRAY` when `memory_type` is `STRUCTURED_PROFILE`.
"additionalProperties": "", # Optional. If `type` is `OBJECT`, specifies how to handle properties not defined in `properties`. If it is a boolean `false`, no additional properties are allowed. If it is a schema, additional properties are allowed if they conform to the schema.
"anyOf": [ # Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.
# Object with schema name: GoogleCloudAiplatformV1beta1Schema
],
"default": "", # Optional. Default value to use if the field is not specified.
"defs": { # Optional. `defs` provides a map of schema definitions that can be reused by `ref` elsewhere in the schema. Only allowed at root level of the schema.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"description": "A String", # Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.
"enum": [ # Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`
"A String",
],
"example": "", # Optional. Example of an instance of this schema.
"format": "A String", # Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.
"items": # Object with schema name: GoogleCloudAiplatformV1beta1Schema # Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.
"maxItems": "A String", # Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.
"maxLength": "A String", # Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.
"maxProperties": "A String", # Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.
"maximum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.
"minItems": "A String", # Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.
"minLength": "A String", # Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.
"minProperties": "A String", # Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.
"minimum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.
"nullable": True or False, # Optional. Indicates if the value of this field can be null.
"pattern": "A String", # Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.
"properties": { # Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"propertyOrdering": [ # Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.
"A String",
],
"ref": "A String", # Optional. Allows referencing another schema definition to use in place of this schema. The value must be a valid reference to a schema in `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
"required": [ # Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.
"A String",
],
"title": "A String", # Optional. Title for the schema.
"type": "A String", # Optional. Data type of the schema field.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
"ttlConfig": { # Represents configuration for TTL. # 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.
"defaultTtl": "A String", # Optional. The default TTL duration of the memories in the Memory Bank. This applies to all operations that create or update a memory.
"granularTtlConfig": { # Configuration for TTL of the memories in the Memory Bank based on the action that created or updated the memory. # Optional. The granular TTL configuration of the memories in the Memory Bank.
"createTtl": "A String", # Optional. The TTL duration for memories uploaded via CreateMemory.
"generateCreatedTtl": "A String", # Optional. The TTL duration for memories newly generated via GenerateMemories (GenerateMemoriesResponse.GeneratedMemory.Action.CREATED).
"generateUpdatedTtl": "A String", # 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).
},
"memoryRevisionDefaultTtl": "A String", # 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.
},
"unstructuredMemoryConfigs": [ # Optional. Configuration for how to customize Memory Bank behavior for a particular scope for unstructured memories.
{ # Represents configuration for organizing natural language memories for a particular scope.
"consolidationConfig": { # Represents configuration for customizing how memories are consolidated. # Optional. Represents configuration for customizing how memories are consolidated together.
"revisionsPerCandidateCount": 42, # 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.
},
"disableNaturalLanguageMemories": True or False, # 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.
"enableThirdPersonMemories": True or False, # 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.")
"generateMemoriesExamples": [ # Optional. Provides examples of how to generate memories for a particular scope.
{ # An example of how to generate memories for a particular scope.
"conversationSource": { # A conversation source for the example. This is similar to `DirectContentsSource`. # A conversation source for the example.
"events": [ # Optional. Represents the input conversation events for the example.
{ # A single conversation event.
"content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Required. Represents the content of the event.
"parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
{ # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` must contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"audioTranscription": { # The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate `Part` with its own `AudioTranscription` carrying the `speaker_label`. # Optional. Audio (input or output) transcription. This is only set when this `Part` contains audio data.
"speakerLabel": "A String", # Optional. A label identifying the speaker of this audio segment (e.g. `spk_1`, `spk_2`). Present when `diarization` is set.
"text": "A String", # Required. The transcription text of this audio segment.
"words": [ # Optional. Detailed word-level transcriptions and timing details. Present when `word_timestamp` is set.
{ # Information about a single recognized word.
"endOffset": "A String", # Optional. End offset in time of the word relative to the start of the audio.
"startOffset": "A String", # Optional. Start offset in time of the word relative to the start of the audio.
"word": "A String", # Required. Transcript of the word.
},
],
},
"codeExecutionResult": { # Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used. # Optional. The result of executing the ExecutableCode.
"id": "A String", # Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.
"outcome": "A String", # Required. Outcome of the code execution.
"output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated. # Optional. Code generated by the model that is intended to be executed.
"code": "A String", # Required. The code to be executed.
"id": "A String", # Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
"language": "A String", # Required. Programming language of the `code`.
},
"fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
"displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"functionCall": { # A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
"args": { # Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details.
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.
"name": "A String", # Optional. The name of the function to call. Matches FunctionDeclaration.name.
"partialArgs": [ # Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally.
{ # Partial argument value of the function call.
"boolValue": True or False, # Optional. Represents a boolean value.
"jsonPath": "A String", # Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
"nullValue": "A String", # Optional. Represents a null value.
"numberValue": 3.14, # Optional. Represents a double value.
"stringValue": "A String", # Optional. Represents a string value.
"willContinue": True or False, # Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
},
],
"willContinue": True or False, # Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow.
},
"functionResponse": { # The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
"id": "A String", # Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
"name": "A String", # Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name.
"parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
{ # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"fileData": { # URI based data for function response. # URI based data.
"displayName": "A String", # Optional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"fileUri": "A String", # Required. URI.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
"data": "A String", # Required. Raw bytes.
"displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. Processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # Media resolution for the input media of a `FunctionResponsePart`. # Optional. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"videoMetadata": { # Metadata describes the input video content of a `FunctionResponsePart`. Set this in `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
"a_key": "", # Properties of the object.
},
"scheduling": "A String", # Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
},
"inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
"data": "A String", # Required. The raw bytes of the data.
"displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # per part media resolution. Media resolution for the input media. # per part media resolution. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"speechMetadata": { # Structured Metadata Sub-Message for Part # Optional. Turn-level metadata for speech generation (e.g. Daikon speaker/style). May be set alongside `text` to attach speaker and style information to a text part.
"speaker": "A String", # Optional. Identifies which speaker is speaking this turn.
"style": "A String", # Optional. Natural language description of the vocal style (e.g., "cheerful").
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"text": "A String", # Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.
"thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
"thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
"toolCall": { # A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. # Optional. Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.
"args": { # Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.
"toolType": "A String", # Optional. The type of tool that was called.
},
"toolResponse": { # The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. # Optional. The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.
"id": "A String", # Optional. The identifier of the tool call this response is for.
"response": { # Optional. The tool response.
"a_key": "", # Properties of the object.
},
"toolType": "A String", # Optional. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.
},
"videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
},
},
],
},
"generatedMemories": [ # 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.
{ # A memory generated by the operation.
"fact": "A String", # Required. Represents the fact to generate a memory from.
"topics": [ # 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`.
{ # A memory topic identifier. This will be used to label a Memory and to restrict which topics are eligible for generation or retrieval.
"customMemoryTopicLabel": "A String", # Optional. Represents the custom memory topic label.
"managedMemoryTopic": "A String", # Optional. Represents the managed memory topic.
},
],
},
],
},
],
"memoryTopics": [ # 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.
{ # A topic of information that should be extracted from conversations and stored as memories.
"customMemoryTopic": { # A custom memory topic defined by the developer. # A custom memory topic defined by the developer.
"description": "A String", # Required. Represents the description of the memory topic. This should explain what information should be extracted for this topic.
"label": "A String", # Required. Represents the label of the topic.
},
"managedMemoryTopic": { # A managed memory topic defined by the system. # A managed memory topic defined by Memory Bank.
"managedTopicEnum": "A String", # Required. Represents the managed topic.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
},
"name": "A String", # Identifier. The resource name of the Memory Bank. Format: `projects/{project}/locations/{location}/memoryBanks/{memory_bank}`
"updateTime": "A String", # Output only. The timestamp when this Memory Bank was most recently updated.
},
],
"nextPageToken": "A String", # A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
}
list_next(previous_request, previous_response)
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.
patch(name, body=None, updateMask=None, x__xgafv=None)
Update a Memory Bank.
Args:
name: string, Identifier. The resource name of the Memory Bank. Format: `projects/{project}/locations/{location}/memoryBanks/{memory_bank}` (required)
body: object, The request body.
The object takes the form of:
{ # A Memory Bank, which generates and manages agentic memories.
"createTime": "A String", # Output only. The timestamp when this Memory Bank was created.
"description": "A String", # Optional. The description of the Memory Bank.
"displayName": "A String", # Optional. The display name of the Memory Bank.
"encryptionSpec": { # Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource. # Optional. Customer-managed encryption key spec for a MemoryBank. If set, this MemoryBank and all sub-resources of this MemoryBank will be secured by this key.
"kmsKeyName": "A String", # 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}`.
},
"labels": { # Optional. Labels for the Memory Bank. These labels are not propagated to billing usage records.
"a_key": "A String",
},
"managedSemanticMemoryConfig": { # Represents configuration for managed memories in Memory Bank. # Optional. The configuration for managed memories in Memory Bank. If not set, then the default configuration will be used.
"disableMemoryRevisions": True or False, # If true, no memory revisions will be created for any requests to Memory Bank.
"generationConfig": { # Represents configuration for LLMs calls. # Optional. Represents configuration for LLMs calls.
"generationTriggerConfig": { # Represents configuration for triggering generation. # Optional. Specifies the default trigger configuration for generating memories using `IngestEvents`.
"generationRule": { # Represents the active rule that determines when to flush the buffer. # Optional. Represents the active rule that determines when to flush the buffer. If not set, then the stream will be force flushed immediately.
"eventCount": 42, # Optional. Specifies to trigger generation when the event count reaches this limit.
"fixedInterval": "A String", # Optional. Specifies to trigger generation at a fixed interval. The duration must have a minute-level granularity.
"idleDuration": "A String", # 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.
"overlapEventCount": 42, # Optional. Re-include the last N already-processed events in the next window.
},
},
"model": "A String", # Optional. The model used to generate memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"similaritySearchConfig": { # Represents configuration for similarity search. # Optional. Configuration for how to perform similarity search on memories. If not set, Memory Bank will use the default embedding model `text-embedding-005`.
"embeddingModel": "A String", # Required. The model used to generate embeddings to look up similar memories. Format: `projects/{project}/locations/{location}/publishers/google/models/{model}`.
},
"structuredMemoryConfigs": [ # Optional. Configuration for organizing structured memories for a particular scope.
{ # Represents configuration for organizing structured memories for a particular scope.
"schemaConfigs": [ # Optional. Represents configuration of the structured memories' schemas.
{ # Schema configuration for structured memories.
"id": "A String", # 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.
"jsonSchema": "", # Optional. Represents the JSON Schema of the structured memories.
"memoryType": "A String", # Optional. Represents the type of the structured memories associated with the schema. If not set, then `STRUCTURED_PROFILE` will be used.
"schema": { # Defines the schema of input and output data. This is a subset of the [OpenAPI 3.0 Schema Object](https://spec.openapis.org/oas/v3.0.3#schema-object). # Required. Represents the OpenAPI schema of the structured memories. The schema `type` cannot be `ARRAY` when `memory_type` is `STRUCTURED_PROFILE`.
"additionalProperties": "", # Optional. If `type` is `OBJECT`, specifies how to handle properties not defined in `properties`. If it is a boolean `false`, no additional properties are allowed. If it is a schema, additional properties are allowed if they conform to the schema.
"anyOf": [ # Optional. The instance must be valid against any (one or more) of the subschemas listed in `any_of`.
# Object with schema name: GoogleCloudAiplatformV1beta1Schema
],
"default": "", # Optional. Default value to use if the field is not specified.
"defs": { # Optional. `defs` provides a map of schema definitions that can be reused by `ref` elsewhere in the schema. Only allowed at root level of the schema.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"description": "A String", # Optional. Describes the data. The model uses this field to understand the purpose of the schema and how to use it. It is a best practice to provide a clear and descriptive explanation for the schema and its properties here, rather than in the prompt.
"enum": [ # Optional. Possible values of the field. This field can be used to restrict a value to a fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list of possible values in `enum`. For example: 1. To define directions: `{type:STRING, format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers: `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`
"A String",
],
"example": "", # Optional. Example of an instance of this schema.
"format": "A String", # Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`, `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.
"items": # Object with schema name: GoogleCloudAiplatformV1beta1Schema # Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.
"maxItems": "A String", # Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.
"maxLength": "A String", # Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.
"maxProperties": "A String", # Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties that can be provided.
"maximum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.
"minItems": "A String", # Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.
"minLength": "A String", # Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.
"minProperties": "A String", # Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties that can be provided.
"minimum": 3.14, # Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.
"nullable": True or False, # Optional. Indicates if the value of this field can be null.
"pattern": "A String", # Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must match.
"properties": { # Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions for each property of the object.
"a_key": # Object with schema name: GoogleCloudAiplatformV1beta1Schema
},
"propertyOrdering": [ # Optional. Order of properties displayed or used where order matters. This is not a standard field in OpenAPI specification, but can be used to control the order of properties.
"A String",
],
"ref": "A String", # Optional. Allows referencing another schema definition to use in place of this schema. The value must be a valid reference to a schema in `defs`. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring
"required": [ # Optional. If type is `OBJECT`, `required` lists the names of properties that must be present.
"A String",
],
"title": "A String", # Optional. Title for the schema.
"type": "A String", # Optional. Data type of the schema field.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
"ttlConfig": { # Represents configuration for TTL. # 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.
"defaultTtl": "A String", # Optional. The default TTL duration of the memories in the Memory Bank. This applies to all operations that create or update a memory.
"granularTtlConfig": { # Configuration for TTL of the memories in the Memory Bank based on the action that created or updated the memory. # Optional. The granular TTL configuration of the memories in the Memory Bank.
"createTtl": "A String", # Optional. The TTL duration for memories uploaded via CreateMemory.
"generateCreatedTtl": "A String", # Optional. The TTL duration for memories newly generated via GenerateMemories (GenerateMemoriesResponse.GeneratedMemory.Action.CREATED).
"generateUpdatedTtl": "A String", # 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).
},
"memoryRevisionDefaultTtl": "A String", # 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.
},
"unstructuredMemoryConfigs": [ # Optional. Configuration for how to customize Memory Bank behavior for a particular scope for unstructured memories.
{ # Represents configuration for organizing natural language memories for a particular scope.
"consolidationConfig": { # Represents configuration for customizing how memories are consolidated. # Optional. Represents configuration for customizing how memories are consolidated together.
"revisionsPerCandidateCount": 42, # 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.
},
"disableNaturalLanguageMemories": True or False, # 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.
"enableThirdPersonMemories": True or False, # 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.")
"generateMemoriesExamples": [ # Optional. Provides examples of how to generate memories for a particular scope.
{ # An example of how to generate memories for a particular scope.
"conversationSource": { # A conversation source for the example. This is similar to `DirectContentsSource`. # A conversation source for the example.
"events": [ # Optional. Represents the input conversation events for the example.
{ # A single conversation event.
"content": { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Required. Represents the content of the event.
"parts": [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
{ # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` must contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"audioTranscription": { # The transcription of an audio part. For multi-speaker audio, each speaker segment is a separate `Part` with its own `AudioTranscription` carrying the `speaker_label`. # Optional. Audio (input or output) transcription. This is only set when this `Part` contains audio data.
"speakerLabel": "A String", # Optional. A label identifying the speaker of this audio segment (e.g. `spk_1`, `spk_2`). Present when `diarization` is set.
"text": "A String", # Required. The transcription text of this audio segment.
"words": [ # Optional. Detailed word-level transcriptions and timing details. Present when `word_timestamp` is set.
{ # Information about a single recognized word.
"endOffset": "A String", # Optional. End offset in time of the word relative to the start of the audio.
"startOffset": "A String", # Optional. Start offset in time of the word relative to the start of the audio.
"word": "A String", # Required. Transcript of the word.
},
],
},
"codeExecutionResult": { # Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used. # Optional. The result of executing the ExecutableCode.
"id": "A String", # Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id.
"outcome": "A String", # Required. Outcome of the code execution.
"output": "A String", # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated. # Optional. Code generated by the model that is intended to be executed.
"code": "A String", # Required. The code to be executed.
"id": "A String", # Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
"language": "A String", # Required. Programming language of the `code`.
},
"fileData": { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
"displayName": "A String", # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"fileUri": "A String", # Required. The URI of the file in Google Cloud Storage.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"functionCall": { # A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
"args": { # Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details.
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.
"name": "A String", # Optional. The name of the function to call. Matches FunctionDeclaration.name.
"partialArgs": [ # Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally.
{ # Partial argument value of the function call.
"boolValue": True or False, # Optional. Represents a boolean value.
"jsonPath": "A String", # Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
"nullValue": "A String", # Optional. Represents a null value.
"numberValue": 3.14, # Optional. Represents a double value.
"stringValue": "A String", # Optional. Represents a string value.
"willContinue": True or False, # Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
},
],
"willContinue": True or False, # Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow.
},
"functionResponse": { # The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
"id": "A String", # Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
"name": "A String", # Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name.
"parts": [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
{ # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
"audioMetadata": { # Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. # Optional. Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
"endOffset": "A String", # Optional. The end offset of the audio, relative to the start of the audio stream.
"startOffset": "A String", # Optional. The start offset of the audio, relative to the start of the audio stream.
},
"documentMetadata": { # Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. # Optional. Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMediaMetadata is set. When DocumentMediaMetadata is not set, default document processing is used (for example, page images for PDFs).
"A String",
],
"endPage": 42, # Optional. 1-indexed inclusive end page.
"startPage": 42, # Optional. 1-indexed inclusive start page.
},
"fileData": { # URI based data for function response. # URI based data.
"displayName": "A String", # Optional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"fileUri": "A String", # Required. URI.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"inlineData": { # Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. # Inline media bytes.
"data": "A String", # Required. Raw bytes.
"displayName": "A String", # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{"$ref": ""}`).
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. Processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # Media resolution for the input media of a `FunctionResponsePart`. # Optional. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"videoMetadata": { # Metadata describes the input video content of a `FunctionResponsePart`. Set this in `FunctionResponsePart.video_metadata` when `inline_data` or `file_data` contains video to configure static video preprocessing. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
"a_key": "", # Properties of the object.
},
"scheduling": "A String", # Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
},
"inlineData": { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
"data": "A String", # Required. The raw bytes of the data.
"displayName": "A String", # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
"mimeType": "A String", # Required. The IANA standard MIME type of the source data.
},
"mediaProcessing": "A String", # Optional. How the model processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
"mediaResolution": { # per part media resolution. Media resolution for the input media. # per part media resolution. Media resolution for the input media.
"level": "A String", # The tokenization quality used for given media.
},
"speechMetadata": { # Structured Metadata Sub-Message for Part # Optional. Turn-level metadata for speech generation (e.g. Daikon speaker/style). May be set alongside `text` to attach speaker and style information to a text part.
"speaker": "A String", # Optional. Identifies which speaker is speaking this turn.
"style": "A String", # Optional. Natural language description of the vocal style (e.g., "cheerful").
},
"spreadsheetMetadata": { # Metadata describes the input spreadsheet content. Set this in `Part.spreadsheet_metadata` or `FunctionResponsePart.spreadsheet_metadata` when `inline_data` or `file_data` contains a spreadsheet to configure static spreadsheet preprocessing. # Optional. Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [DATA, FORMULAS] when SpreadsheetMetadata is set.
"A String",
],
"sheetIndex": 42, # Optional. The 1-indexed index of the sheet to extract, in workbook order. If not set, all sheets are extracted.
"visibleCells": "A String", # Optional. The range of cells to extract, in A1 notation (e.g. "A1:D10"). If not set, the full occupied area of the sheet is used.
},
"text": "A String", # Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.
"thought": True or False, # Optional. Indicates whether the `part` represents the model's thought process or reasoning.
"thoughtSignature": "A String", # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
"toolCall": { # A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`. # Optional. Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.
"args": { # Optional. The tool call arguments. Example: {"arg1" : "value1", "arg2" : "value2" , ...}
"a_key": "", # Properties of the object.
},
"id": "A String", # Optional. Unique identifier of the tool call. The server returns the tool response with the matching `id`.
"toolType": "A String", # Optional. The type of tool that was called.
},
"toolResponse": { # The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`. # Optional. The output from a server-side `ToolCall` execution. This field is populated by the client with the results of executing the corresponding `ToolCall`.
"id": "A String", # Optional. The identifier of the tool call this response is for.
"response": { # Optional. The tool response.
"a_key": "", # Properties of the object.
},
"toolType": "A String", # Optional. The type of tool that was called, matching the `tool_type` in the corresponding `ToolCall`.
},
"videoMetadata": { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
"contentLayers": [ # Optional. Content layers to return. If empty, defaults to [FRAMES, AUDIO].
"A String",
],
"endOffset": "A String", # Optional. The end offset of the video.
"fps": 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
"startOffset": "A String", # Optional. The start offset of the video.
},
},
],
"role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
},
},
],
},
"generatedMemories": [ # 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.
{ # A memory generated by the operation.
"fact": "A String", # Required. Represents the fact to generate a memory from.
"topics": [ # 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`.
{ # A memory topic identifier. This will be used to label a Memory and to restrict which topics are eligible for generation or retrieval.
"customMemoryTopicLabel": "A String", # Optional. Represents the custom memory topic label.
"managedMemoryTopic": "A String", # Optional. Represents the managed memory topic.
},
],
},
],
},
],
"memoryTopics": [ # 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.
{ # A topic of information that should be extracted from conversations and stored as memories.
"customMemoryTopic": { # A custom memory topic defined by the developer. # A custom memory topic defined by the developer.
"description": "A String", # Required. Represents the description of the memory topic. This should explain what information should be extracted for this topic.
"label": "A String", # Required. Represents the label of the topic.
},
"managedMemoryTopic": { # A managed memory topic defined by the system. # A managed memory topic defined by Memory Bank.
"managedTopicEnum": "A String", # Required. Represents the managed topic.
},
},
],
"scopeKeys": [ # 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.
"A String",
],
},
],
},
"name": "A String", # Identifier. The resource name of the Memory Bank. Format: `projects/{project}/locations/{location}/memoryBanks/{memory_bank}`
"updateTime": "A String", # Output only. The timestamp when this Memory Bank was most recently updated.
}
updateMask: string, Optional. Mask specifying which fields to update.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # 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.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # 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}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
retrieveScopes(parent, pageSize=None, pageToken=None, x__xgafv=None)
Retrieves the scopes stored in a Memory Bank.
Args:
parent: string, Required. The parent Memory Bank to retrieve scopes from. Format: `projects/{project}/locations/{location}/memoryBanks/{memory_bank}` (required)
pageSize: integer, Optional. The maximum number of scopes to return. The service may return fewer than this value. If unspecified, at most 100 scopes will be returned. The maximum value is 100; values above 100 will be coerced to 100.
pageToken: string, Optional. The standard list page token.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for MemoryBankAdminService.RetrieveMemoryBankScopes.
"nextPageToken": "A String", # A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
"scopes": [ # The scopes stored in the Memory Bank.
{ # A scope stored in the Memory Bank.
"scope": { # The scope key-value pairs.
"a_key": "A String",
},
},
],
}
retrieveScopes_next(previous_request, previous_response)
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.