UNPKG

googleapis

Version:
947 lines 116 kB
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common'; import { Readable } from 'stream'; export declare namespace firebaseml_v2beta { export interface Options extends GlobalOptions { version: 'v2beta'; } interface StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth; /** * V1 error format. */ '$.xgafv'?: string; /** * OAuth access token. */ access_token?: string; /** * Data format for response. */ alt?: string; /** * JSONP */ callback?: string; /** * Selector specifying which fields to include in a partial response. */ fields?: string; /** * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ key?: string; /** * OAuth 2.0 token for the current user. */ oauth_token?: string; /** * Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** * Legacy upload protocol for media (e.g. "media", "multipart"). */ uploadType?: string; /** * Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; } /** * Firebase ML API * * Access custom machine learning models hosted via Firebase ML. * * @example * ```js * const {google} = require('googleapis'); * const firebaseml = google.firebaseml('v2beta'); * ``` */ export class Firebaseml { context: APIRequestContext; projects: Resource$Projects; constructor(options: GlobalOptions, google?: GoogleConfigurable); } /** * Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp */ export interface Schema$Date { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | null; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | null; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | null; } /** * The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. */ export interface Schema$GoogleCloudAiplatformV1beta1ApiAuth { /** * The API secret. */ apiKeyConfig?: Schema$GoogleCloudAiplatformV1beta1ApiAuthApiKeyConfig; } /** * The API secret. */ export interface Schema$GoogleCloudAiplatformV1beta1ApiAuthApiKeyConfig { /** * Required. The SecretManager secret version resource name storing API key. e.g. projects/{project\}/secrets/{secret\}/versions/{version\} */ apiKeySecretVersion?: string | null; /** * The API key string. Either this or `api_key_secret_version` must be set. */ apiKeyString?: string | null; } /** * Auth configuration to run the extension. */ export interface Schema$GoogleCloudAiplatformV1beta1AuthConfig { /** * Config for API key auth. */ apiKeyConfig?: Schema$GoogleCloudAiplatformV1beta1AuthConfigApiKeyConfig; /** * Type of auth scheme. */ authType?: string | null; /** * Config for Google Service Account auth. */ googleServiceAccountConfig?: Schema$GoogleCloudAiplatformV1beta1AuthConfigGoogleServiceAccountConfig; /** * Config for HTTP Basic auth. */ httpBasicAuthConfig?: Schema$GoogleCloudAiplatformV1beta1AuthConfigHttpBasicAuthConfig; /** * Config for user oauth. */ oauthConfig?: Schema$GoogleCloudAiplatformV1beta1AuthConfigOauthConfig; /** * Config for user OIDC auth. */ oidcConfig?: Schema$GoogleCloudAiplatformV1beta1AuthConfigOidcConfig; } /** * Config for authentication with API key. */ export interface Schema$GoogleCloudAiplatformV1beta1AuthConfigApiKeyConfig { /** * Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project\}/secrets/{secrete\}/versions/{version\}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. */ apiKeySecret?: string | null; /** * Optional. The API key to be used in the request directly. */ apiKeyString?: string | null; /** * Optional. The location of the API key. */ httpElementLocation?: string | null; /** * Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name. */ name?: string | null; } /** * Config for Google Service Account Authentication. */ export interface Schema$GoogleCloudAiplatformV1beta1AuthConfigGoogleServiceAccountConfig { /** * Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension. */ serviceAccount?: string | null; } /** * Config for HTTP Basic Authentication. */ export interface Schema$GoogleCloudAiplatformV1beta1AuthConfigHttpBasicAuthConfig { /** * Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project\}/secrets/{secrete\}/versions/{version\}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. */ credentialSecret?: string | null; } /** * Config for user oauth. */ export interface Schema$GoogleCloudAiplatformV1beta1AuthConfigOauthConfig { /** * Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */ accessToken?: string | null; /** * The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account. */ serviceAccount?: string | null; } /** * Config for user OIDC auth. */ export interface Schema$GoogleCloudAiplatformV1beta1AuthConfigOidcConfig { /** * OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */ idToken?: string | null; /** * The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). */ serviceAccount?: string | null; } /** * A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. */ export interface Schema$GoogleCloudAiplatformV1beta1Blob { /** * Required. The raw bytes of the data. */ data?: string | null; /** * 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. */ displayName?: string | null; /** * Required. The IANA standard MIME type of the source data. */ mimeType?: string | null; } /** * A response candidate generated from the model. */ export interface Schema$GoogleCloudAiplatformV1beta1Candidate { /** * Output only. The average log probability of the tokens in this candidate. This is a length-normalized score that can be used to compare the quality of candidates of different lengths. A higher average log probability suggests a more confident and coherent response. */ avgLogprobs?: number | null; /** * Output only. A collection of citations that apply to the generated content. */ citationMetadata?: Schema$GoogleCloudAiplatformV1beta1CitationMetadata; /** * Output only. The content of the candidate. */ content?: Schema$GoogleCloudAiplatformV1beta1Content; /** * Output only. Describes the reason the model stopped generating tokens in more detail. This field is returned only when `finish_reason` is set. */ finishMessage?: string | null; /** * Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating. */ finishReason?: string | null; /** * Output only. Metadata returned when grounding is enabled. It contains the sources used to ground the generated content. */ groundingMetadata?: Schema$GoogleCloudAiplatformV1beta1GroundingMetadata; /** * Output only. The 0-based index of this candidate in the list of generated responses. This is useful for distinguishing between multiple candidates when `candidate_count` \> 1. */ index?: number | null; /** * Output only. The detailed log probability information for the tokens in this candidate. This is useful for debugging, understanding model uncertainty, and identifying potential "hallucinations". */ logprobsResult?: Schema$GoogleCloudAiplatformV1beta1LogprobsResult; /** * Output only. A list of ratings for the safety of a response candidate. There is at most one rating per category. */ safetyRatings?: Schema$GoogleCloudAiplatformV1beta1SafetyRating[]; /** * Output only. Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. */ urlContextMetadata?: Schema$GoogleCloudAiplatformV1beta1UrlContextMetadata; } /** * A citation for a piece of generatedcontent. */ export interface Schema$GoogleCloudAiplatformV1beta1Citation { /** * Output only. The end index of the citation in the content. */ endIndex?: number | null; /** * Output only. The license of the source of the citation. */ license?: string | null; /** * Output only. The publication date of the source of the citation. */ publicationDate?: Schema$Date; /** * Output only. The start index of the citation in the content. */ startIndex?: number | null; /** * Output only. The title of the source of the citation. */ title?: string | null; /** * Output only. The URI of the source of the citation. */ uri?: string | null; } /** * A collection of citations that apply to a piece of generated content. */ export interface Schema$GoogleCloudAiplatformV1beta1CitationMetadata { /** * Output only. A list of citations for the content. */ citations?: Schema$GoogleCloudAiplatformV1beta1Citation[]; } /** * Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. */ export interface Schema$GoogleCloudAiplatformV1beta1CodeExecutionResult { /** * Required. Outcome of the code execution. */ outcome?: string | null; /** * Optional. Contains stdout when code execution is successful, stderr or other description otherwise. */ output?: string | null; } /** * 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. */ export interface Schema$GoogleCloudAiplatformV1beta1Content { /** * 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. */ parts?: Schema$GoogleCloudAiplatformV1beta1Part[]; /** * Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'. */ role?: string | null; } /** * Request message for PredictionService.CountTokens. */ export interface Schema$GoogleCloudAiplatformV1beta1CountTokensRequest { /** * Optional. Input content. */ contents?: Schema$GoogleCloudAiplatformV1beta1Content[]; /** * Optional. Generation config that the model will use to generate the response. */ generationConfig?: Schema$GoogleCloudAiplatformV1beta1GenerationConfig; /** * Optional. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model. */ instances?: any[] | null; /** * Optional. The name of the publisher model requested to serve the prediction. Format: `projects/{project\}/locations/{location\}/publishers/x/models/x` */ model?: string | null; /** * Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph. */ systemInstruction?: Schema$GoogleCloudAiplatformV1beta1Content; /** * Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. */ tools?: Schema$GoogleCloudAiplatformV1beta1Tool[]; } /** * Response message for PredictionService.CountTokens. */ export interface Schema$GoogleCloudAiplatformV1beta1CountTokensResponse { /** * Output only. List of modalities that were processed in the request input. */ promptTokensDetails?: Schema$GoogleCloudAiplatformV1beta1ModalityTokenCount[]; /** * The total number of billable characters counted across all instances from the request. */ totalBillableCharacters?: number | null; /** * The total number of tokens counted across all instances from the request. */ totalTokens?: number | null; } /** * Describes the options to customize dynamic retrieval. */ export interface Schema$GoogleCloudAiplatformV1beta1DynamicRetrievalConfig { /** * Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used. */ dynamicThreshold?: number | null; /** * The mode of the predictor to be used in dynamic retrieval. */ mode?: string | null; } /** * Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. */ export interface Schema$GoogleCloudAiplatformV1beta1EnterpriseWebSearch { /** * Optional. Sites with confidence level chosen & above this value will be blocked from the search results. */ blockingConfidence?: string | null; /** * Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. */ excludeDomains?: string[] | null; } /** * 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. */ export interface Schema$GoogleCloudAiplatformV1beta1ExecutableCode { /** * Required. The code to be executed. */ code?: string | null; /** * Required. Programming language of the `code`. */ language?: string | null; } /** * Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. */ export interface Schema$GoogleCloudAiplatformV1beta1ExternalApi { /** * The authentication config to access the API. Deprecated. Please use auth_config instead. */ apiAuth?: Schema$GoogleCloudAiplatformV1beta1ApiAuth; /** * The API spec that the external API implements. */ apiSpec?: string | null; /** * The authentication config to access the API. */ authConfig?: Schema$GoogleCloudAiplatformV1beta1AuthConfig; /** * Parameters for the elastic search API. */ elasticSearchParams?: Schema$GoogleCloudAiplatformV1beta1ExternalApiElasticSearchParams; /** * The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search */ endpoint?: string | null; /** * Parameters for the simple search API. */ simpleSearchParams?: Schema$GoogleCloudAiplatformV1beta1ExternalApiSimpleSearchParams; } /** * The search parameters to use for the ELASTIC_SEARCH spec. */ export interface Schema$GoogleCloudAiplatformV1beta1ExternalApiElasticSearchParams { /** * The ElasticSearch index to use. */ index?: string | null; /** * Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param. */ numHits?: number | null; /** * The ElasticSearch search template to use. */ searchTemplate?: string | null; } /** * The search parameters to use for SIMPLE_SEARCH spec. */ export interface Schema$GoogleCloudAiplatformV1beta1ExternalApiSimpleSearchParams { } /** * 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. */ export interface Schema$GoogleCloudAiplatformV1beta1FileData { /** * 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. */ displayName?: string | null; /** * Required. The URI of the file in Google Cloud Storage. */ fileUri?: string | null; /** * Required. The IANA standard MIME type of the source data. */ mimeType?: string | null; } /** * 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. */ export interface Schema$GoogleCloudAiplatformV1beta1FunctionCall { /** * Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details. */ args?: { [key: string]: any; } | null; /** * 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`. */ id?: string | null; /** * Optional. The name of the function to call. Matches [FunctionDeclaration.name]. */ name?: string | null; /** * Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. */ partialArgs?: Schema$GoogleCloudAiplatformV1beta1PartialArg[]; /** * Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. */ willContinue?: boolean | null; } /** * Function calling config. */ export interface Schema$GoogleCloudAiplatformV1beta1FunctionCallingConfig { /** * Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided. */ allowedFunctionNames?: string[] | null; /** * Optional. Function calling mode. */ mode?: string | null; /** * Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the [FunctionCall.partial_args] field. */ streamFunctionCallArguments?: boolean | null; } /** * Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client. */ export interface Schema$GoogleCloudAiplatformV1beta1FunctionDeclaration { /** * Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */ description?: string | null; /** * Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots, colons and dashes, with a maximum length of 64. */ name?: string | null; /** * Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1 */ parameters?: Schema$GoogleCloudAiplatformV1beta1Schema; /** * Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" \}, "age": { "type": "integer" \} \}, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] \} ``` This field is mutually exclusive with `parameters`. */ parametersJsonSchema?: any | null; /** * Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function. */ response?: Schema$GoogleCloudAiplatformV1beta1Schema; /** * Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`. */ responseJsonSchema?: any | null; } /** * 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. */ export interface Schema$GoogleCloudAiplatformV1beta1FunctionResponse { /** * Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */ id?: string | null; /** * Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name]. */ name?: string | null; /** * Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types. */ parts?: Schema$GoogleCloudAiplatformV1beta1FunctionResponsePart[]; /** * 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. */ response?: { [key: string]: any; } | null; } /** * Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */ export interface Schema$GoogleCloudAiplatformV1beta1FunctionResponseBlob { /** * Required. Raw bytes. */ data?: string | null; /** * 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 currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. */ displayName?: string | null; /** * Required. The IANA standard MIME type of the source data. */ mimeType?: string | null; } /** * URI based data for function response. */ export interface Schema$GoogleCloudAiplatformV1beta1FunctionResponseFileData { /** * 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 currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. */ displayName?: string | null; /** * Required. URI. */ fileUri?: string | null; /** * Required. The IANA standard MIME type of the source data. */ mimeType?: string | null; } /** * 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. */ export interface Schema$GoogleCloudAiplatformV1beta1FunctionResponsePart { /** * URI based data. */ fileData?: Schema$GoogleCloudAiplatformV1beta1FunctionResponseFileData; /** * Inline media bytes. */ inlineData?: Schema$GoogleCloudAiplatformV1beta1FunctionResponseBlob; } /** * Request message for [PredictionService.GenerateContent]. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerateContentRequest { /** * Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `projects/{project\}/locations/{location\}/cachedContents/{cachedContent\}` */ cachedContent?: string | null; /** * Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request. */ contents?: Schema$GoogleCloudAiplatformV1beta1Content[]; /** * Optional. Generation config. */ generationConfig?: Schema$GoogleCloudAiplatformV1beta1GenerationConfig; /** * Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. */ labels?: { [key: string]: string; } | null; /** * Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied. */ modelArmorConfig?: Schema$GoogleCloudAiplatformV1beta1ModelArmorConfig; /** * Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates. */ safetySettings?: Schema$GoogleCloudAiplatformV1beta1SafetySetting[]; /** * Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph. */ systemInstruction?: Schema$GoogleCloudAiplatformV1beta1Content; /** * Optional. Tool config. This config is shared for all tools provided in the request. */ toolConfig?: Schema$GoogleCloudAiplatformV1beta1ToolConfig; /** * Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. */ tools?: Schema$GoogleCloudAiplatformV1beta1Tool[]; } /** * Response message for [PredictionService.GenerateContent]. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerateContentResponse { /** * Output only. Generated candidates. */ candidates?: Schema$GoogleCloudAiplatformV1beta1Candidate[]; /** * Output only. Timestamp when the request is made to the server. */ createTime?: string | null; /** * Output only. The model version used to generate the response. */ modelVersion?: string | null; /** * Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations. */ promptFeedback?: Schema$GoogleCloudAiplatformV1beta1GenerateContentResponsePromptFeedback; /** * Output only. response_id is used to identify each response. It is the encoding of the event_id. */ responseId?: string | null; /** * Usage metadata about the response(s). */ usageMetadata?: Schema$GoogleCloudAiplatformV1beta1GenerateContentResponseUsageMetadata; } /** * Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerateContentResponsePromptFeedback { /** * Output only. The reason why the prompt was blocked. */ blockReason?: string | null; /** * Output only. A readable message that explains the reason why the prompt was blocked. */ blockReasonMessage?: string | null; /** * Output only. A list of safety ratings for the prompt. There is one rating per category. */ safetyRatings?: Schema$GoogleCloudAiplatformV1beta1SafetyRating[]; } /** * Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerateContentResponseUsageMetadata { /** * Output only. The number of tokens in the cached content that was used for this request. */ cachedContentTokenCount?: number | null; /** * Output only. A detailed breakdown of the token count for each modality in the cached content. */ cacheTokensDetails?: Schema$GoogleCloudAiplatformV1beta1ModalityTokenCount[]; /** * The total number of tokens in the generated candidates. */ candidatesTokenCount?: number | null; /** * Output only. A detailed breakdown of the token count for each modality in the generated candidates. */ candidatesTokensDetails?: Schema$GoogleCloudAiplatformV1beta1ModalityTokenCount[]; /** * The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content. */ promptTokenCount?: number | null; /** * Output only. A detailed breakdown of the token count for each modality in the prompt. */ promptTokensDetails?: Schema$GoogleCloudAiplatformV1beta1ModalityTokenCount[]; /** * Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable. */ thoughtsTokenCount?: number | null; /** * Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable. */ toolUsePromptTokenCount?: number | null; /** * Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input. */ toolUsePromptTokensDetails?: Schema$GoogleCloudAiplatformV1beta1ModalityTokenCount[]; /** * The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`. */ totalTokenCount?: number | null; /** * Output only. The traffic type for this request. */ trafficType?: string | null; } /** * Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerationConfig { /** * Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response. */ audioTimestamp?: boolean | null; /** * Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one. */ candidateCount?: number | null; /** * Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response. */ enableAffectiveDialog?: boolean | null; /** * Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0]. */ frequencyPenalty?: number | null; /** * Optional. Config for image generation features. */ imageConfig?: Schema$GoogleCloudAiplatformV1beta1ImageConfig; /** * Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response. */ logprobs?: number | null; /** * Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses. */ maxOutputTokens?: number | null; /** * Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model. */ mediaResolution?: string | null; /** * Optional. Config for model selection. */ modelConfig?: Schema$GoogleCloudAiplatformV1beta1GenerationConfigModelConfig; /** * Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0]. */ presencePenalty?: number | null; /** * Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`. */ responseJsonSchema?: any | null; /** * Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging. */ responseLogprobs?: boolean | null; /** * Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. */ responseMimeType?: string | null; /** * Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image. */ responseModalities?: string[] | null; /** * Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`. */ responseSchema?: Schema$GoogleCloudAiplatformV1beta1Schema; /** * Optional. Routing configuration. */ routingConfig?: Schema$GoogleCloudAiplatformV1beta1GenerationConfigRoutingConfig; /** * Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the "random" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results. */ seed?: number | null; /** * Optional. The speech generation config. */ speechConfig?: Schema$GoogleCloudAiplatformV1beta1SpeechConfig; /** * Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use ["\n", "###"] to stop generation at a new line or a specific marker. */ stopSequences?: string[] | null; /** * Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0]. */ temperature?: number | null; /** * Optional. Configuration for thinking features. An error will be returned if this field is set for models that don't support thinking. */ thinkingConfig?: Schema$GoogleCloudAiplatformV1beta1GenerationConfigThinkingConfig; /** * Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words. */ topK?: number | null; /** * Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both. */ topP?: number | null; } /** * Config for model selection. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerationConfigModelConfig { /** * Required. Feature selection preference. */ featureSelectionPreference?: string | null; } /** * The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerationConfigRoutingConfig { /** * In this mode, the model is selected automatically based on the content of the request. */ autoMode?: Schema$GoogleCloudAiplatformV1beta1GenerationConfigRoutingConfigAutoRoutingMode; /** * In this mode, the model is specified manually. */ manualMode?: Schema$GoogleCloudAiplatformV1beta1GenerationConfigRoutingConfigManualRoutingMode; } /** * The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerationConfigRoutingConfigAutoRoutingMode { /** * The model routing preference. */ modelRoutingPreference?: string | null; } /** * The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerationConfigRoutingConfigManualRoutingMode { /** * The name of the model to use. Only public LLM models are accepted. */ modelName?: string | null; } /** * Configuration for the model's thinking features. "Thinking" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response. */ export interface Schema$GoogleCloudAiplatformV1beta1GenerationConfigThinkingConfig { /** * Optional. If true, the model will include its thoughts in the response. "Thoughts" are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model's reasoning process and help with debugging. If this is true, thoughts are returned only when available. */ includeThoughts?: boolean | null; /** * Optional. The token budget for the model's thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency. */ thinkingBudget?: number | null; /** * Optional. The number of thoughts tokens that the model should generate. */ thinkingLevel?: string | null; } /** * Tool to retrieve public maps data for grounding, powered by Google. */ export interface Schema$GoogleCloudAiplatformV1beta1GoogleMaps { /** * Optional. If true, include the widget context token in the response. */ enableWidget?: boolean | null; } /** * Tool to retrieve public web data for grounding, powered by Google. */ export interface Schema$GoogleCloudAiplatformV1beta1GoogleSearchRetrieval { /** * Specifies the dynamic retrieval configuration for the given source. */ dynamicRetrievalConfig?: Schema$GoogleCloudAiplatformV1beta1DynamicRetrievalConfig; } /** * A piece of evidence that supports a claim made by the model. This is used to show a citation for a claim made by the model. When grounding is enabled, the model returns a `GroundingChunk` that contains a reference to the source of the information. */ export interface Schema$GoogleCloudAiplatformV1beta1GroundingChunk { /** * A grounding chunk from Google Maps. See the `Maps` message for details. */ maps?: Schema$GoogleCloudAiplatformV1beta1GroundingChunkMaps; /** * A grounding chunk from a data sourc