Vertex AI API . projects . locations . exampleStores

Instance Methods

operations()

Returns the operations Resource.

close()

Close httplib2 connections.

create(parent, exampleStore_createTime=None, exampleStore_description=None, exampleStore_displayName=None, exampleStore_exampleStoreConfig_vertexEmbeddingModel=None, exampleStore_name=None, exampleStore_updateTime=None, x__xgafv=None)

Create an ExampleStore.

delete(name, x__xgafv=None)

Delete an ExampleStore.

fetchExamples(exampleStore, body=None, x__xgafv=None)

Get Examples from the Example Store.

fetchExamples_next()

Retrieves the next page of results.

get(name, x__xgafv=None)

Get an ExampleStore.

list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)

List ExampleStores in a Location.

list_next()

Retrieves the next page of results.

patch(name, body=None, updateMask=None, x__xgafv=None)

Update an ExampleStore.

removeExamples(exampleStore, body=None, x__xgafv=None)

Remove Examples from the Example Store.

searchExamples(exampleStore, body=None, x__xgafv=None)

Search for similar Examples for given selection criteria.

upsertExamples(exampleStore, body=None, x__xgafv=None)

Create or update Examples in the Example Store.

Method Details

close()
Close httplib2 connections.
create(parent, exampleStore_createTime=None, exampleStore_description=None, exampleStore_displayName=None, exampleStore_exampleStoreConfig_vertexEmbeddingModel=None, exampleStore_name=None, exampleStore_updateTime=None, x__xgafv=None)
Create an ExampleStore.

Args:
  parent: string, Required. The resource name of the Location to create the ExampleStore in. Format: `projects/{project}/locations/{location}` (required)
  exampleStore_createTime: string, Output only. Timestamp when this ExampleStore was created.
  exampleStore_description: string, Optional. Description of the ExampleStore.
  exampleStore_displayName: string, Required. Display name of the ExampleStore.
  exampleStore_exampleStoreConfig_vertexEmbeddingModel: string, Required. The embedding model to be used for vector embedding. Immutable. Supported models: * "textembedding-gecko@003" * "text-embedding-004" * "text-embedding-005" * "text-multilingual-embedding-002"
  exampleStore_name: string, Identifier. The resource name of the ExampleStore. This is a unique identifier. Format: projects/{project}/locations/{location}/exampleStores/{example_store}
  exampleStore_updateTime: string, Output only. Timestamp when this ExampleStore 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, x__xgafv=None)
Delete an ExampleStore.

Args:
  name: string, Required. The resource name of the ExampleStore to be deleted. Format: `projects/{project}/locations/{location}/exampleStores/{example_store}` (required)
  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.
  },
}
fetchExamples(exampleStore, body=None, x__xgafv=None)
Get Examples from the Example Store.

Args:
  exampleStore: string, Required. The name of the ExampleStore resource that the examples should be fetched from. Format: `projects/{project}/locations/{location}/exampleStores/{example_store}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ExampleStoreService.FetchExamples.
  "exampleIds": [ # Optional. Example IDs to fetch. If both metadata filters and Example IDs are specified, then both ID and metadata filtering will be applied.
    "A String",
  ],
  "pageSize": 42, # Optional. The maximum number of examples to return. The service may return fewer than this value. If unspecified, at most 100 examples will be returned.
  "pageToken": "A String", # Optional. The next_page_token value returned from a previous list ExampleStoreService.FetchExamplesResponse call.
  "storedContentsExampleFilter": { # The metadata filters that will be used to remove or fetch StoredContentsExamples. If a field is unspecified, then no filtering for that field will be applied. # The metadata filters for StoredContentsExamples.
    "functionNames": { # Filters for examples' array metadata fields. An array field is example metadata where multiple values are attributed to a single example. # Optional. The function names for filtering.
      "arrayOperator": "A String", # Required. The operator logic to use for filtering.
      "values": [ # Required. The values by which to filter examples.
        "A String",
      ],
    },
    "searchKeys": [ # Optional. The search keys for filtering. Only examples with one of the specified search keys (StoredContentsExample.search_key) are eligible to be returned.
      "A String",
    ],
  },
}

  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 ExampleStoreService.FetchExamples.
  "examples": [ # The examples in the Example Store that satisfy the metadata filters.
    { # A single example to upload or read from the Example Store.
      "createTime": "A String", # Output only. Timestamp when this Example was created.
      "displayName": "A String", # Optional. The display name for Example.
      "exampleId": "A String", # Optional. Immutable. Unique identifier of an example. If not specified when upserting new examples, the example_id will be generated.
      "storedContentsExample": { # A ContentsExample to be used with GenerateContent alongside information required for storage and retrieval with Example Store. # An example of chat history and its expected outcome to be used with GenerateContent.
        "contentsExample": { # A single example of a conversation with the model. # Required. The example to be used with GenerateContent.
          "contents": [ # Required. The content of the conversation with the model that resulted in the expected output.
            { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
              "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                  "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                    "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.
                  },
                  "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                    "code": "A String", # Required. The code to be executed.
                    "language": "A String", # Required. Programming language of the `code`.
                  },
                  "fileData": { # URI based data. # Optional. URI based data.
                    "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                    "fileUri": "A String", # Required. URI.
                    "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                    "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                  },
                  "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                    "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].
                    "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.
                    },
                  },
                  "inlineData": { # Content blob. # Optional. Inlined bytes data.
                    "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                  "text": "A String", # Optional. Text part (can be code).
                  "thought": True or False, # Output only. Indicates if the part is thought from the model.
                  "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                    "endOffset": "A String", # Optional. The end offset of the video.
                    "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
            },
          ],
          "expectedContents": [ # Required. The expected output for the given `contents`. To represent multi-step reasoning, this is a repeated field that contains the iterative steps of the expected output.
            { # A single step of the expected output.
              "content": { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. # Required. A single step's content.
                "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                  { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                    "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                      "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.
                    },
                    "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                      "code": "A String", # Required. The code to be executed.
                      "language": "A String", # Required. Programming language of the `code`.
                    },
                    "fileData": { # URI based data. # Optional. URI based data.
                      "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "fileUri": "A String", # Required. URI.
                      "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                      "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                    },
                    "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                      "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].
                      "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.
                      },
                    },
                    "inlineData": { # Content blob. # Optional. Inlined bytes data.
                      "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                    },
                    "text": "A String", # Optional. Text part (can be code).
                    "thought": True or False, # Output only. Indicates if the part is thought from the model.
                    "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                      "endOffset": "A String", # Optional. The end offset of the video.
                      "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
              },
            },
          ],
        },
        "searchKey": "A String", # Optional. (Optional) the search key used for retrieval. If not provided at upload-time, the search key will be generated from `contents_example.contents` using the method provided by `search_key_generation_method`. The generated search key will be included in retrieved examples.
        "searchKeyGenerationMethod": { # Options for generating the search key from the conversation history. # Optional. The method used to generate the search key from `contents_example.contents`. This is ignored when uploading an example if `search_key` is provided.
          "lastEntry": { # Configuration for using only the last entry of the conversation history as the search key. # Use only the last entry of the conversation history (`contents_example.contents`) as the search key.
          },
        },
      },
    },
  ],
  "nextPageToken": "A String", # A token, which can be sent as ListExamplesRequest.page_token to retrieve the next page. Absence of this field indicates there are no subsequent pages.
}
fetchExamples_next()
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.
        
get(name, x__xgafv=None)
Get an ExampleStore.

Args:
  name: string, Required. The resource name of the ExampleStore. Format: `projects/{project}/locations/{location}/exampleStores/{example_store}` (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents an executable service to manage and retrieve examples.
  "createTime": "A String", # Output only. Timestamp when this ExampleStore was created.
  "description": "A String", # Optional. Description of the ExampleStore.
  "displayName": "A String", # Required. Display name of the ExampleStore.
  "exampleStoreConfig": { # Configuration for the Example Store. # Required. Example Store config.
    "vertexEmbeddingModel": "A String", # Required. The embedding model to be used for vector embedding. Immutable. Supported models: * "textembedding-gecko@003" * "text-embedding-004" * "text-embedding-005" * "text-multilingual-embedding-002"
  },
  "name": "A String", # Identifier. The resource name of the ExampleStore. This is a unique identifier. Format: projects/{project}/locations/{location}/exampleStores/{example_store}
  "updateTime": "A String", # Output only. Timestamp when this ExampleStore was most recently updated.
}
list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)
List ExampleStores in a Location.

Args:
  parent: string, Required. The resource name of the Location to list the ExampleStores from. Format: `projects/{project}/locations/{location}` (required)
  filter: string, Optional. The standard list filter. More detail in [AIP-160](https://google.aip.dev/160).
  pageSize: integer, Optional. The standard list page size.
  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 ExampleStoreService.ListExampleStores.
  "exampleStores": [ # List of ExampleStore in the requested page.
    { # Represents an executable service to manage and retrieve examples.
      "createTime": "A String", # Output only. Timestamp when this ExampleStore was created.
      "description": "A String", # Optional. Description of the ExampleStore.
      "displayName": "A String", # Required. Display name of the ExampleStore.
      "exampleStoreConfig": { # Configuration for the Example Store. # Required. Example Store config.
        "vertexEmbeddingModel": "A String", # Required. The embedding model to be used for vector embedding. Immutable. Supported models: * "textembedding-gecko@003" * "text-embedding-004" * "text-embedding-005" * "text-multilingual-embedding-002"
      },
      "name": "A String", # Identifier. The resource name of the ExampleStore. This is a unique identifier. Format: projects/{project}/locations/{location}/exampleStores/{example_store}
      "updateTime": "A String", # Output only. Timestamp when this ExampleStore was most recently updated.
    },
  ],
  "nextPageToken": "A String", # A token to retrieve the next page of results. Pass to ListExampleStoresRequest.page_token to obtain that page.
}
list_next()
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 an ExampleStore.

Args:
  name: string, Identifier. The resource name of the ExampleStore. This is a unique identifier. Format: projects/{project}/locations/{location}/exampleStores/{example_store} (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents an executable service to manage and retrieve examples.
  "createTime": "A String", # Output only. Timestamp when this ExampleStore was created.
  "description": "A String", # Optional. Description of the ExampleStore.
  "displayName": "A String", # Required. Display name of the ExampleStore.
  "exampleStoreConfig": { # Configuration for the Example Store. # Required. Example Store config.
    "vertexEmbeddingModel": "A String", # Required. The embedding model to be used for vector embedding. Immutable. Supported models: * "textembedding-gecko@003" * "text-embedding-004" * "text-embedding-005" * "text-multilingual-embedding-002"
  },
  "name": "A String", # Identifier. The resource name of the ExampleStore. This is a unique identifier. Format: projects/{project}/locations/{location}/exampleStores/{example_store}
  "updateTime": "A String", # Output only. Timestamp when this ExampleStore was most recently updated.
}

  updateMask: string, Optional. Mask specifying which fields to update. Supported fields: * `display_name` * `description`
  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.
  },
}
removeExamples(exampleStore, body=None, x__xgafv=None)
Remove Examples from the Example Store.

Args:
  exampleStore: string, Required. The name of the ExampleStore resource that the examples should be removed from. Format: `projects/{project}/locations/{location}/exampleStores/{example_store}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ExampleStoreService.RemoveExamples.
  "exampleIds": [ # Optional. Example IDs to remove. If both metadata filters and Example IDs are specified, the metadata filters will be applied to the specified examples in order to identify which should be removed.
    "A String",
  ],
  "storedContentsExampleFilter": { # The metadata filters that will be used to remove or fetch StoredContentsExamples. If a field is unspecified, then no filtering for that field will be applied. # The metadata filters for StoredContentsExamples.
    "functionNames": { # Filters for examples' array metadata fields. An array field is example metadata where multiple values are attributed to a single example. # Optional. The function names for filtering.
      "arrayOperator": "A String", # Required. The operator logic to use for filtering.
      "values": [ # Required. The values by which to filter examples.
        "A String",
      ],
    },
    "searchKeys": [ # Optional. The search keys for filtering. Only examples with one of the specified search keys (StoredContentsExample.search_key) are eligible to be returned.
      "A String",
    ],
  },
}

  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 ExampleStoreService.RemoveExamples.
  "exampleIds": [ # The IDs for the removed examples.
    "A String",
  ],
}
searchExamples(exampleStore, body=None, x__xgafv=None)
Search for similar Examples for given selection criteria.

Args:
  exampleStore: string, Required. The name of the ExampleStore resource that examples are retrieved from. Format: `projects/{project}/locations/{location}/exampleStores/{example_store}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ExampleStoreService.SearchExamples.
  "storedContentsExampleParameters": { # The metadata filters that will be used to search StoredContentsExamples. If a field is unspecified, then no filtering for that field will be applied # The parameters of StoredContentsExamples to be searched.
    "contentSearchKey": { # The chat history to use to generate the search key for retrieval. # The chat history to use to generate the search key for retrieval.
      "contents": [ # Required. The conversation for generating a search key.
        { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
          "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
              "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                "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.
              },
              "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                "code": "A String", # Required. The code to be executed.
                "language": "A String", # Required. Programming language of the `code`.
              },
              "fileData": { # URI based data. # Optional. URI based data.
                "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                "fileUri": "A String", # Required. URI.
                "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
              },
              "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                "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].
                "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.
                },
              },
              "inlineData": { # Content blob. # Optional. Inlined bytes data.
                "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "text": "A String", # Optional. Text part (can be code).
              "thought": True or False, # Output only. Indicates if the part is thought from the model.
              "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                "endOffset": "A String", # Optional. The end offset of the video.
                "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
        },
      ],
      "searchKeyGenerationMethod": { # Options for generating the search key from the conversation history. # Required. The method of generating a search key.
        "lastEntry": { # Configuration for using only the last entry of the conversation history as the search key. # Use only the last entry of the conversation history (`contents_example.contents`) as the search key.
        },
      },
    },
    "functionNames": { # Filters for examples' array metadata fields. An array field is example metadata where multiple values are attributed to a single example. # Optional. The function names for filtering.
      "arrayOperator": "A String", # Required. The operator logic to use for filtering.
      "values": [ # Required. The values by which to filter examples.
        "A String",
      ],
    },
    "searchKey": "A String", # The exact search key to use for retrieval.
  },
  "topK": "A String", # Optional. The number of similar examples to return.
}

  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 ExampleStoreService.SearchExamples.
  "results": [ # The results of searching for similar examples.
    { # The result of the similar example.
      "example": { # A single example to upload or read from the Example Store. # The example that is similar to the searched query.
        "createTime": "A String", # Output only. Timestamp when this Example was created.
        "displayName": "A String", # Optional. The display name for Example.
        "exampleId": "A String", # Optional. Immutable. Unique identifier of an example. If not specified when upserting new examples, the example_id will be generated.
        "storedContentsExample": { # A ContentsExample to be used with GenerateContent alongside information required for storage and retrieval with Example Store. # An example of chat history and its expected outcome to be used with GenerateContent.
          "contentsExample": { # A single example of a conversation with the model. # Required. The example to be used with GenerateContent.
            "contents": [ # Required. The content of the conversation with the model that resulted in the expected output.
              { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
                "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                  { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                    "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                      "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.
                    },
                    "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                      "code": "A String", # Required. The code to be executed.
                      "language": "A String", # Required. Programming language of the `code`.
                    },
                    "fileData": { # URI based data. # Optional. URI based data.
                      "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "fileUri": "A String", # Required. URI.
                      "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                      "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                    },
                    "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                      "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].
                      "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.
                      },
                    },
                    "inlineData": { # Content blob. # Optional. Inlined bytes data.
                      "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                    },
                    "text": "A String", # Optional. Text part (can be code).
                    "thought": True or False, # Output only. Indicates if the part is thought from the model.
                    "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                      "endOffset": "A String", # Optional. The end offset of the video.
                      "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
              },
            ],
            "expectedContents": [ # Required. The expected output for the given `contents`. To represent multi-step reasoning, this is a repeated field that contains the iterative steps of the expected output.
              { # A single step of the expected output.
                "content": { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. # Required. A single step's content.
                  "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                    { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                      "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                        "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.
                      },
                      "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                        "code": "A String", # Required. The code to be executed.
                        "language": "A String", # Required. Programming language of the `code`.
                      },
                      "fileData": { # URI based data. # Optional. URI based data.
                        "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                        "fileUri": "A String", # Required. URI.
                        "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                        "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                      },
                      "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                        "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].
                        "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.
                        },
                      },
                      "inlineData": { # Content blob. # Optional. Inlined bytes data.
                        "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                        "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                      },
                      "text": "A String", # Optional. Text part (can be code).
                      "thought": True or False, # Output only. Indicates if the part is thought from the model.
                      "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                        "endOffset": "A String", # Optional. The end offset of the video.
                        "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
                },
              },
            ],
          },
          "searchKey": "A String", # Optional. (Optional) the search key used for retrieval. If not provided at upload-time, the search key will be generated from `contents_example.contents` using the method provided by `search_key_generation_method`. The generated search key will be included in retrieved examples.
          "searchKeyGenerationMethod": { # Options for generating the search key from the conversation history. # Optional. The method used to generate the search key from `contents_example.contents`. This is ignored when uploading an example if `search_key` is provided.
            "lastEntry": { # Configuration for using only the last entry of the conversation history as the search key. # Use only the last entry of the conversation history (`contents_example.contents`) as the search key.
            },
          },
        },
      },
      "similarityScore": 3.14, # The similarity score of this example.
    },
  ],
}
upsertExamples(exampleStore, body=None, x__xgafv=None)
Create or update Examples in the Example Store.

Args:
  exampleStore: string, Required. The name of the ExampleStore resource that examples are added to or updated in. Format: `projects/{project}/locations/{location}/exampleStores/{example_store}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ExampleStoreService.UpsertExamples.
  "examples": [ # Required. A list of examples to be created/updated.
    { # A single example to upload or read from the Example Store.
      "createTime": "A String", # Output only. Timestamp when this Example was created.
      "displayName": "A String", # Optional. The display name for Example.
      "exampleId": "A String", # Optional. Immutable. Unique identifier of an example. If not specified when upserting new examples, the example_id will be generated.
      "storedContentsExample": { # A ContentsExample to be used with GenerateContent alongside information required for storage and retrieval with Example Store. # An example of chat history and its expected outcome to be used with GenerateContent.
        "contentsExample": { # A single example of a conversation with the model. # Required. The example to be used with GenerateContent.
          "contents": [ # Required. The content of the conversation with the model that resulted in the expected output.
            { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
              "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                  "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                    "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.
                  },
                  "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                    "code": "A String", # Required. The code to be executed.
                    "language": "A String", # Required. Programming language of the `code`.
                  },
                  "fileData": { # URI based data. # Optional. URI based data.
                    "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                    "fileUri": "A String", # Required. URI.
                    "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                    "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                  },
                  "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                    "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].
                    "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.
                    },
                  },
                  "inlineData": { # Content blob. # Optional. Inlined bytes data.
                    "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                  "text": "A String", # Optional. Text part (can be code).
                  "thought": True or False, # Output only. Indicates if the part is thought from the model.
                  "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                    "endOffset": "A String", # Optional. The end offset of the video.
                    "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
            },
          ],
          "expectedContents": [ # Required. The expected output for the given `contents`. To represent multi-step reasoning, this is a repeated field that contains the iterative steps of the expected output.
            { # A single step of the expected output.
              "content": { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. # Required. A single step's content.
                "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                  { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                    "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                      "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.
                    },
                    "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                      "code": "A String", # Required. The code to be executed.
                      "language": "A String", # Required. Programming language of the `code`.
                    },
                    "fileData": { # URI based data. # Optional. URI based data.
                      "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "fileUri": "A String", # Required. URI.
                      "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                      "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                    },
                    "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                      "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].
                      "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.
                      },
                    },
                    "inlineData": { # Content blob. # Optional. Inlined bytes data.
                      "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                    },
                    "text": "A String", # Optional. Text part (can be code).
                    "thought": True or False, # Output only. Indicates if the part is thought from the model.
                    "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                      "endOffset": "A String", # Optional. The end offset of the video.
                      "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
              },
            },
          ],
        },
        "searchKey": "A String", # Optional. (Optional) the search key used for retrieval. If not provided at upload-time, the search key will be generated from `contents_example.contents` using the method provided by `search_key_generation_method`. The generated search key will be included in retrieved examples.
        "searchKeyGenerationMethod": { # Options for generating the search key from the conversation history. # Optional. The method used to generate the search key from `contents_example.contents`. This is ignored when uploading an example if `search_key` is provided.
          "lastEntry": { # Configuration for using only the last entry of the conversation history as the search key. # Use only the last entry of the conversation history (`contents_example.contents`) as the search key.
          },
        },
      },
    },
  ],
  "overwrite": True or False, # Optional. A flag indicating whether an example can be overwritten if it already exists. If False (default) and the example already exists, the example will not be updated. This does not affect behavior if the example does not exist already.
}

  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 ExampleStoreService.UpsertExamples.
  "results": [ # A list of results for creating/updating. It's either a successfully created/updated example or a status with an error message.
    { # The result for creating/updating a single example.
      "example": { # A single example to upload or read from the Example Store. # The example created/updated successfully.
        "createTime": "A String", # Output only. Timestamp when this Example was created.
        "displayName": "A String", # Optional. The display name for Example.
        "exampleId": "A String", # Optional. Immutable. Unique identifier of an example. If not specified when upserting new examples, the example_id will be generated.
        "storedContentsExample": { # A ContentsExample to be used with GenerateContent alongside information required for storage and retrieval with Example Store. # An example of chat history and its expected outcome to be used with GenerateContent.
          "contentsExample": { # A single example of a conversation with the model. # Required. The example to be used with GenerateContent.
            "contents": [ # Required. The content of the conversation with the model that resulted in the expected output.
              { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
                "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                  { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                    "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                      "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.
                    },
                    "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                      "code": "A String", # Required. The code to be executed.
                      "language": "A String", # Required. Programming language of the `code`.
                    },
                    "fileData": { # URI based data. # Optional. URI based data.
                      "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "fileUri": "A String", # Required. URI.
                      "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                      "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                    },
                    "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                      "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].
                      "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.
                      },
                    },
                    "inlineData": { # Content blob. # Optional. Inlined bytes data.
                      "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                      "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                    },
                    "text": "A String", # Optional. Text part (can be code).
                    "thought": True or False, # Output only. Indicates if the part is thought from the model.
                    "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                      "endOffset": "A String", # Optional. The end offset of the video.
                      "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
              },
            ],
            "expectedContents": [ # Required. The expected output for the given `contents`. To represent multi-step reasoning, this is a repeated field that contains the iterative steps of the expected output.
              { # A single step of the expected output.
                "content": { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn. # Required. A single step's content.
                  "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                    { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                      "codeExecutionResult": { # Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. # Optional. Result of executing the [ExecutableCode].
                        "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.
                      },
                      "executableCode": { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. # Optional. Code generated by the model that is meant to be executed.
                        "code": "A String", # Required. The code to be executed.
                        "language": "A String", # Required. Programming language of the `code`.
                      },
                      "fileData": { # URI based data. # Optional. URI based data.
                        "displayName": "A String", # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                        "fileUri": "A String", # Required. URI.
                        "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 [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                        "args": { # Optional. Required. 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", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                      },
                      "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 output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                        "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].
                        "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.
                        },
                      },
                      "inlineData": { # Content blob. # Optional. Inlined bytes data.
                        "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. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
                        "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                      },
                      "text": "A String", # Optional. Text part (can be code).
                      "thought": True or False, # Output only. Indicates if the part is thought from the model.
                      "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                        "endOffset": "A String", # Optional. The end offset of the video.
                        "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'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
                },
              },
            ],
          },
          "searchKey": "A String", # Optional. (Optional) the search key used for retrieval. If not provided at upload-time, the search key will be generated from `contents_example.contents` using the method provided by `search_key_generation_method`. The generated search key will be included in retrieved examples.
          "searchKeyGenerationMethod": { # Options for generating the search key from the conversation history. # Optional. The method used to generate the search key from `contents_example.contents`. This is ignored when uploading an example if `search_key` is provided.
            "lastEntry": { # Configuration for using only the last entry of the conversation history as the search key. # Use only the last entry of the conversation history (`contents_example.contents`) as the search key.
            },
          },
        },
      },
      "status": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error message of the example that was not created/updated successfully.
        "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.
      },
    },
  ],
}