// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Gemini Enterprise for Customer Experience API Client for Deno * ============================================================= * * * * Docs: https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps * Source: https://googleapis.deno.dev/v1/ces:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; export class ces { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://ces.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Creates a new agent in the given app. * * @param parent Required. The resource name of the app to create an agent in. */ async projectsLocationsAppsAgentsCreate(parent: string, req: Agent, opts: ProjectsLocationsAppsAgentsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/agents`); if (opts.agentId !== undefined) { url.searchParams.append("agentId", String(opts.agentId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Agent; } /** * Deletes the specified agent. * * @param name Required. The resource name of the agent to delete. */ async projectsLocationsAppsAgentsDelete(name: string, opts: ProjectsLocationsAppsAgentsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets details of the specified agent. * * @param name Required. The resource name of the agent to retrieve. */ async projectsLocationsAppsAgentsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Agent; } /** * Lists agents in the given app. * * @param parent Required. The resource name of the app to list agents from. */ async projectsLocationsAppsAgentsList(parent: string, opts: ProjectsLocationsAppsAgentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/agents`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListAgentsResponse; } /** * Updates the specified agent. * * @param name Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ async projectsLocationsAppsAgentsPatch(name: string, req: Agent, opts: ProjectsLocationsAppsAgentsPatchOptions = {}): Promise { opts = serializeProjectsLocationsAppsAgentsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Agent; } /** * Gets the specified changelog. * * @param name Required. The resource name of the changelog to retrieve. */ async projectsLocationsAppsChangelogsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Changelog; } /** * Lists the changelogs of the specified app. * * @param parent Required. The resource name of the app to list changelogs from. */ async projectsLocationsAppsChangelogsList(parent: string, opts: ProjectsLocationsAppsChangelogsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/changelogs`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListChangelogsResponse; } /** * Batch deletes the specified conversations. * * @param parent Required. The resource name of the app to delete conversations from. Format: `projects/{project}/locations/{location}/apps/{app}` */ async projectsLocationsAppsConversationsBatchDelete(parent: string, req: BatchDeleteConversationsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations:batchDelete`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes the specified conversation. * * @param name Required. The resource name of the conversation to delete. */ async projectsLocationsAppsConversationsDelete(name: string, opts: ProjectsLocationsAppsConversationsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.source !== undefined) { url.searchParams.append("source", String(opts.source)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets details of the specified conversation. * * @param name Required. The resource name of the conversation to retrieve. */ async projectsLocationsAppsConversationsGet(name: string, opts: ProjectsLocationsAppsConversationsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.source !== undefined) { url.searchParams.append("source", String(opts.source)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeConversation(data); } /** * Lists conversations in the given app. * * @param parent Required. The resource name of the app to list conversations from. */ async projectsLocationsAppsConversationsList(parent: string, opts: ProjectsLocationsAppsConversationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.source !== undefined) { url.searchParams.append("source", String(opts.source)); } if (opts.sources !== undefined) { url.searchParams.append("sources", String(opts.sources)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListConversationsResponse(data); } /** * Creates a new app in the given project and location. * * @param parent Required. The resource name of the location to create an app in. */ async projectsLocationsAppsCreate(parent: string, req: App, opts: ProjectsLocationsAppsCreateOptions = {}): Promise { req = serializeApp(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/apps`); if (opts.appId !== undefined) { url.searchParams.append("appId", String(opts.appId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes the specified app. * * @param name Required. The resource name of the app to delete. */ async projectsLocationsAppsDelete(name: string, opts: ProjectsLocationsAppsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Creates a new deployment in the given app. * * @param parent Required. The parent app. Format: `projects/{project}/locations/{location}/apps/{app}` */ async projectsLocationsAppsDeploymentsCreate(parent: string, req: Deployment, opts: ProjectsLocationsAppsDeploymentsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/deployments`); if (opts.deploymentId !== undefined) { url.searchParams.append("deploymentId", String(opts.deploymentId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Deployment; } /** * Deletes the specified deployment. * * @param name Required. The name of the deployment to delete. Format: `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` */ async projectsLocationsAppsDeploymentsDelete(name: string, opts: ProjectsLocationsAppsDeploymentsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets details of the specified deployment. * * @param name Required. The name of the deployment. Format: `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` */ async projectsLocationsAppsDeploymentsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Deployment; } /** * Lists deployments in the given app. * * @param parent Required. The parent app. Format: `projects/{project}/locations/{location}/apps/{app}` */ async projectsLocationsAppsDeploymentsList(parent: string, opts: ProjectsLocationsAppsDeploymentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/deployments`); if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListDeploymentsResponse; } /** * Updates the specified deployment. * * @param name Identifier. The resource name of the deployment. Format: `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` */ async projectsLocationsAppsDeploymentsPatch(name: string, req: Deployment, opts: ProjectsLocationsAppsDeploymentsPatchOptions = {}): Promise { opts = serializeProjectsLocationsAppsDeploymentsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Deployment; } /** * Creates a new example in the given app. * * @param parent Required. The resource name of the app to create an example in. */ async projectsLocationsAppsExamplesCreate(parent: string, req: Example, opts: ProjectsLocationsAppsExamplesCreateOptions = {}): Promise { req = serializeExample(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/examples`); if (opts.exampleId !== undefined) { url.searchParams.append("exampleId", String(opts.exampleId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeExample(data); } /** * Deletes the specified example. * * @param name Required. The resource name of the example to delete. */ async projectsLocationsAppsExamplesDelete(name: string, opts: ProjectsLocationsAppsExamplesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets details of the specified example. * * @param name Required. The resource name of the example to retrieve. */ async projectsLocationsAppsExamplesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeExample(data); } /** * Lists examples in the given app. * * @param parent Required. The resource name of the app to list examples from. */ async projectsLocationsAppsExamplesList(parent: string, opts: ProjectsLocationsAppsExamplesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/examples`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListExamplesResponse(data); } /** * Updates the specified example. * * @param name Identifier. The unique identifier of the example. Format: `projects/{project}/locations/{location}/apps/{app}/examples/{example}` */ async projectsLocationsAppsExamplesPatch(name: string, req: Example, opts: ProjectsLocationsAppsExamplesPatchOptions = {}): Promise { req = serializeExample(req); opts = serializeProjectsLocationsAppsExamplesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeExample(data); } /** * Executes the given tool with the given arguments. * * @param parent Required. The resource name of the app which the tool/toolset belongs to. Format: `projects/{project}/locations/{location}/apps/{app}` */ async projectsLocationsAppsExecuteTool(parent: string, req: ExecuteToolRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }:executeTool`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as ExecuteToolResponse; } /** * Exports the specified app. * * @param name Required. The resource name of the app to export. */ async projectsLocationsAppsExportApp(name: string, req: ExportAppRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:exportApp`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Gets details of the specified app. * * @param name Required. The resource name of the app to retrieve. */ async projectsLocationsAppsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeApp(data); } /** * Creates a new guardrail in the given app. * * @param parent Required. The resource name of the app to create a guardrail in. */ async projectsLocationsAppsGuardrailsCreate(parent: string, req: Guardrail, opts: ProjectsLocationsAppsGuardrailsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/guardrails`); if (opts.guardrailId !== undefined) { url.searchParams.append("guardrailId", String(opts.guardrailId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Guardrail; } /** * Deletes the specified guardrail. * * @param name Required. The resource name of the guardrail to delete. */ async projectsLocationsAppsGuardrailsDelete(name: string, opts: ProjectsLocationsAppsGuardrailsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets details of the specified guardrail. * * @param name Required. The resource name of the guardrail to retrieve. */ async projectsLocationsAppsGuardrailsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Guardrail; } /** * Lists guardrails in the given app. * * @param parent Required. The resource name of the app to list guardrails from. */ async projectsLocationsAppsGuardrailsList(parent: string, opts: ProjectsLocationsAppsGuardrailsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/guardrails`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListGuardrailsResponse; } /** * Updates the specified guardrail. * * @param name Identifier. The unique identifier of the guardrail. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` */ async projectsLocationsAppsGuardrailsPatch(name: string, req: Guardrail, opts: ProjectsLocationsAppsGuardrailsPatchOptions = {}): Promise { opts = serializeProjectsLocationsAppsGuardrailsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Guardrail; } /** * Imports the specified app. * * @param parent Required. The parent resource name with the location of the app to import. */ async projectsLocationsAppsImportApp(parent: string, req: ImportAppRequest): Promise { req = serializeImportAppRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/apps:importApp`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Lists apps in the given project and location. * * @param parent Required. The resource name of the location to list apps from. */ async projectsLocationsAppsList(parent: string, opts: ProjectsLocationsAppsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/apps`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListAppsResponse(data); } /** * Updates the specified app. * * @param name Identifier. The unique identifier of the app. Format: `projects/{project}/locations/{location}/apps/{app}` */ async projectsLocationsAppsPatch(name: string, req: App, opts: ProjectsLocationsAppsPatchOptions = {}): Promise { req = serializeApp(req); opts = serializeProjectsLocationsAppsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeApp(data); } /** * Retrieve the schema of the given tool. The schema is computed on the fly * for the given instance of the tool. * * @param parent Required. The resource name of the app which the tool/toolset belongs to. Format: `projects/{project}/locations/{location}/apps/{app}` */ async projectsLocationsAppsRetrieveToolSchema(parent: string, req: RetrieveToolSchemaRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }:retrieveToolSchema`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeRetrieveToolSchemaResponse(data); } /** * Generates a session scoped token for chat widget to authenticate with * Session APIs. * * @param name Required. The session name to generate the chat token for. Format: projects/{project}/locations/{location}/apps/{app}/sessions/{session} */ async projectsLocationsAppsSessionsGenerateChatToken(name: string, req: GenerateChatTokenRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:generateChatToken`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGenerateChatTokenResponse(data); } /** * Initiates a single-turn interaction with the CES agent within a session. * * @param session Required. The unique identifier of the session. Format: `projects/{project}/locations/{location}/apps/{app}/sessions/{session}` */ async projectsLocationsAppsSessionsRunSession(session: string, req: RunSessionRequest): Promise { req = serializeRunSessionRequest(req); const url = new URL(`${this.#baseUrl}v1/${ session }:runSession`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeRunSessionResponse(data); } /** * Initiates a single-turn interaction with the CES agent. Uses server-side * streaming to deliver incremental results and partial responses as they are * generated. By default, complete responses (e.g., messages from callbacks or * full LLM responses) are sent to the client as soon as they are available. * To enable streaming individual text chunks directly from the model, set * enable_text_streaming to true. * * @param session Required. The unique identifier of the session. Format: `projects/{project}/locations/{location}/apps/{app}/sessions/{session}` */ async projectsLocationsAppsSessionsStreamRunSession(session: string, req: RunSessionRequest): Promise { req = serializeRunSessionRequest(req); const url = new URL(`${this.#baseUrl}v1/${ session }:streamRunSession`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeRunSessionResponse(data); } /** * Creates a new tool in the given app. * * @param parent Required. The resource name of the app to create a tool in. */ async projectsLocationsAppsToolsCreate(parent: string, req: Tool, opts: ProjectsLocationsAppsToolsCreateOptions = {}): Promise { req = serializeTool(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/tools`); if (opts.toolId !== undefined) { url.searchParams.append("toolId", String(opts.toolId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeTool(data); } /** * Deletes the specified tool. * * @param name Required. The resource name of the tool to delete. */ async projectsLocationsAppsToolsDelete(name: string, opts: ProjectsLocationsAppsToolsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Creates a new toolset in the given app. * * @param parent Required. The resource name of the app to create a toolset in. */ async projectsLocationsAppsToolsetsCreate(parent: string, req: Toolset, opts: ProjectsLocationsAppsToolsetsCreateOptions = {}): Promise { req = serializeToolset(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/toolsets`); if (opts.toolsetId !== undefined) { url.searchParams.append("toolsetId", String(opts.toolsetId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeToolset(data); } /** * Deletes the specified toolset. * * @param name Required. The resource name of the toolset to delete. */ async projectsLocationsAppsToolsetsDelete(name: string, opts: ProjectsLocationsAppsToolsetsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets details of the specified toolset. * * @param name Required. The resource name of the toolset to retrieve. */ async projectsLocationsAppsToolsetsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeToolset(data); } /** * Lists toolsets in the given app. * * @param parent Required. The resource name of the app to list toolsets from. */ async projectsLocationsAppsToolsetsList(parent: string, opts: ProjectsLocationsAppsToolsetsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/toolsets`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListToolsetsResponse(data); } /** * Updates the specified toolset. * * @param name Identifier. The unique identifier of the toolset. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` */ async projectsLocationsAppsToolsetsPatch(name: string, req: Toolset, opts: ProjectsLocationsAppsToolsetsPatchOptions = {}): Promise { req = serializeToolset(req); opts = serializeProjectsLocationsAppsToolsetsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeToolset(data); } /** * Retrieve the list of tools included in the specified toolset. * * @param toolset Required. The name of the toolset to retrieve the tools for. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` */ async projectsLocationsAppsToolsetsRetrieveTools(toolset: string, req: RetrieveToolsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ toolset }:retrieveTools`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeRetrieveToolsResponse(data); } /** * Gets details of the specified tool. * * @param name Required. The resource name of the tool to retrieve. */ async projectsLocationsAppsToolsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTool(data); } /** * Lists tools in the given app. * * @param parent Required. The resource name of the app to list tools from. */ async projectsLocationsAppsToolsList(parent: string, opts: ProjectsLocationsAppsToolsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/tools`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListToolsResponse(data); } /** * Updates the specified tool. * * @param name Identifier. The resource name of the tool. Format: * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` for standalone tools. * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}/tools/{tool}` for tools retrieved from a toolset. These tools are dynamic and output-only; they cannot be referenced directly where a tool is expected. */ async projectsLocationsAppsToolsPatch(name: string, req: Tool, opts: ProjectsLocationsAppsToolsPatchOptions = {}): Promise { req = serializeTool(req); opts = serializeProjectsLocationsAppsToolsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeTool(data); } /** * Creates a new app version in the given app. * * @param parent Required. The resource name of the app to create an app version in. */ async projectsLocationsAppsVersionsCreate(parent: string, req: AppVersion, opts: ProjectsLocationsAppsVersionsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); if (opts.appVersionId !== undefined) { url.searchParams.append("appVersionId", String(opts.appVersionId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as AppVersion; } /** * Deletes the specified app version. * * @param name Required. The resource name of the app version to delete. */ async projectsLocationsAppsVersionsDelete(name: string, opts: ProjectsLocationsAppsVersionsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets details of the specified app version. * * @param name Required. The resource name of the app version to retrieve. */ async projectsLocationsAppsVersionsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as AppVersion; } /** * Lists all app versions in the given app. * * @param parent Required. The resource name of the app to list app versions from. */ async projectsLocationsAppsVersionsList(parent: string, opts: ProjectsLocationsAppsVersionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListAppVersionsResponse; } /** * Restores the specified app version. This will create a new app version * from the current draft app and overwrite the current draft with the * specified app version. * * @param name Required. The resource name of the app version to restore. */ async projectsLocationsAppsVersionsRestore(name: string, req: RestoreAppVersionRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:restore`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Gets information about a location. * * @param name Resource name for the location. */ async projectsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Lists information about the supported locations for this service. This * method lists locations based on the resource scope provided in the * [ListLocationsRequest.name] field: * **Global locations**: If `name` is * empty, the method lists the public locations available to all projects. * * **Project-specific locations**: If `name` follows the format * `projects/{project}`, the method lists locations visible to that specific * project. This includes public, private, or other project-specific locations * enabled for the project. For gRPC and client library implementations, the * resource name is passed as the `name` field. For direct service calls, the * resource name is incorporated into the request path based on the specific * service implementation and version. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.extraLocationTypes !== undefined) { url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async projectsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async projectsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async projectsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async projectsLocationsOperationsList(name: string, opts: ProjectsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } } /** * Configuration of an Action for the tool to use. Note: This can be either an * Action or an Operation. See * https://cloud.google.com/integration-connectors/docs/entities-operation-action * for details. */ export interface Action { /** * ID of a Connection action for the tool to use. */ connectionActionId?: string; /** * Entity operation configuration for the tool to use. */ entityOperation?: ActionEntityOperation; /** * Optional. Entity fields to use as inputs for the operation. If no fields * are specified, all fields of the Entity will be used. */ inputFields?: string[]; /** * Optional. Entity fields to return from the operation. If no fields are * specified, all fields of the Entity will be returned. */ outputFields?: string[]; } /** * Entity CRUD operation specification. */ export interface ActionEntityOperation { /** * Required. ID of the entity. */ entityId?: string; /** * Required. Operation to perform on the entity. */ operation?: | "OPERATION_TYPE_UNSPECIFIED" | "LIST" | "GET" | "CREATE" | "UPDATE" | "DELETE"; } /** * An agent acts as the fundamental building block that provides instructions * to the Large Language Model (LLM) for executing specific tasks. */ export interface Agent { /** * Optional. The callbacks to execute after the agent is called. The provided * callbacks are executed sequentially in the exact order they are given in * the list. If a callback returns an overridden response, execution stops and * any remaining callbacks are skipped. */ afterAgentCallbacks?: Callback[]; /** * Optional. The callbacks to execute after the model is called. If there are * multiple calls to the model, the callback will be executed multiple times. * The provided callbacks are executed sequentially in the exact order they * are given in the list. If a callback returns an overridden response, * execution stops and any remaining callbacks are skipped. */ afterModelCallbacks?: Callback[]; /** * Optional. The callbacks to execute after the tool is invoked. If there are * multiple tool invocations, the callback will be executed multiple times. * The provided callbacks are executed sequentially in the exact order they * are given in the list. If a callback returns an overridden response, * execution stops and any remaining callbacks are skipped. */ afterToolCallbacks?: Callback[]; /** * Optional. The callbacks to execute before the agent is called. The * provided callbacks are executed sequentially in the exact order they are * given in the list. If a callback returns an overridden response, execution * stops and any remaining callbacks are skipped. */ beforeAgentCallbacks?: Callback[]; /** * Optional. The callbacks to execute before the model is called. If there * are multiple calls to the model, the callback will be executed multiple * times. The provided callbacks are executed sequentially in the exact order * they are given in the list. If a callback returns an overridden response, * execution stops and any remaining callbacks are skipped. */ beforeModelCallbacks?: Callback[]; /** * Optional. The callbacks to execute before the tool is invoked. If there * are multiple tool invocations, the callback will be executed multiple * times. The provided callbacks are executed sequentially in the exact order * they are given in the list. If a callback returns an overridden response, * execution stops and any remaining callbacks are skipped. */ beforeToolCallbacks?: Callback[]; /** * Optional. List of child agents in the agent tree. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ childAgents?: string[]; /** * Output only. Timestamp when the agent was created. */ readonly createTime?: Date; /** * Optional. Human-readable description of the agent. */ description?: string; /** * Required. Display name of the agent. */ displayName?: string; /** * Etag used to ensure the object hasn't changed during a read-modify-write * operation. If the etag is empty, the update will overwrite any concurrent * changes. */ etag?: string; /** * Output only. If the agent is generated by the LLM assistant, this field * contains a descriptive summary of the generation. */ readonly generatedSummary?: string; /** * Optional. List of guardrails for the agent. Format: * `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` */ guardrails?: string[]; /** * Optional. Instructions for the LLM model to guide the agent's behavior. */ instruction?: string; /** * Optional. The default agent type. */ llmAgent?: AgentLlmAgent; /** * Optional. Configurations for the LLM model. */ modelSettings?: ModelSettings; /** * Identifier. The unique identifier of the agent. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ name?: string; /** * Optional. The remote * [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) * agent to be used for the agent execution. If this field is set, all other * agent level properties will be ignored. Note: If the Dialogflow agent is in * a different project from the app, you should grant * `roles/dialogflow.client` to the CES service agent * `service-@gcp-sa-ces.iam.gserviceaccount.com`. */ remoteDialogflowAgent?: AgentRemoteDialogflowAgent; /** * Optional. List of available tools for the agent. Format: * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` */ tools?: string[]; /** * Optional. List of toolsets for the agent. */ toolsets?: AgentAgentToolset[]; /** * Optional. Agent transfer rules. If multiple rules match, the first one in * the list will be used. */ transferRules?: TransferRule[]; /** * Output only. Timestamp when the agent was last updated. */ readonly updateTime?: Date; } /** * A toolset with a selection of its tools. */ export interface AgentAgentToolset { /** * Optional. The tools IDs to filter the toolset. */ toolIds?: string[]; /** * Required. The resource name of the toolset. Format: * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` */ toolset?: string; } /** * Default agent type. The agent uses instructions and callbacks specified in * the agent to perform the task using a large language model. */ export interface AgentLlmAgent { } /** * The agent which will transfer execution to a remote [Dialogflow * CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. * The Dialogflow agent will process subsequent user queries until the session * ends or flow ends, and the control is transferred back to the parent CES * agent. */ export interface AgentRemoteDialogflowAgent { /** * Required. The * [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) * agent resource name. Format: * `projects/{project}/locations/{location}/agents/{agent}` */ agent?: string; /** * Optional. The environment ID of the Dialogflow agent to be used for the * agent execution. If not specified, the draft environment will be used. */ environmentId?: string; /** * Optional. The flow ID of the flow in the Dialogflow agent. */ flowId?: string; /** * Optional. The mapping of the app variables names to the Dialogflow session * parameters names to be sent to the Dialogflow agent as input. */ inputVariableMapping?: { [key: string]: string }; /** * Optional. The mapping of the Dialogflow session parameters names to the * app variables names to be sent back to the CES agent after the Dialogflow * agent execution ends. */ outputVariableMapping?: { [key: string]: string }; /** * Optional. Indicates whether to respect the message-level interruption * settings configured in the Dialogflow agent. * If false: all response * messages from the Dialogflow agent follow the app-level barge-in settings. * * If true: only response messages with * [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) * set to true will be interruptable, all other messages follow the app-level * barge-in settings. */ respectResponseInterruptionSettings?: boolean; } /** * Represents a tool that allows the agent to call another agent. */ export interface AgentTool { /** * Optional. The resource name of the agent that is the entry point of the * tool. Format: `projects/{project}/locations/{location}/agents/{agent}` */ agent?: string; /** * Optional. Description of the tool's purpose. */ description?: string; /** * Required. The name of the agent tool. */ name?: string; /** * Optional. Deprecated: Use `agent` instead. The resource name of the root * agent that is the entry point of the tool. Format: * `projects/{project}/locations/{location}/agents/{agent}` */ rootAgent?: string; } /** * Represents an event indicating the transfer of a conversation to a different * agent. */ export interface AgentTransfer { /** * Output only. Display name of the agent. */ readonly displayName?: string; /** * Required. The agent to which the conversation is being transferred. The * agent will handle the conversation from this point forward. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ targetAgent?: string; } /** * Configuration for the ambient sound to be played with the synthesized agent * response, to enhance the naturalness of the conversation. */ export interface AmbientSoundConfig { /** * Optional. Ambient noise as a mono-channel, 16kHz WAV file stored in [Cloud * Storage](https://cloud.google.com/storage). Note: Please make sure the CES * service agent `service-@gcp-sa-ces.iam.gserviceaccount.com` has * `storage.objects.get` permission to the Cloud Storage object. */ gcsUri?: string; /** * Optional. Deprecated: `prebuilt_ambient_noise` is deprecated in favor of * `prebuilt_ambient_sound`. */ prebuiltAmbientNoise?: | "PREBUILT_AMBIENT_NOISE_UNSPECIFIED" | "RETAIL_STORE" | "CONVENTION_HALL" | "OUTDOOR"; /** * Optional. Name of the prebuilt ambient sound. Valid values are: - * "coffee_shop" - "keyboard" - "keypad" - "hum" - "office_1" - "office_2" - * "office_3" - "room_1" - "room_2" - "room_3" - "room_4" - "room_5" - * "air_conditioner" */ prebuiltAmbientSound?: string; /** * Optional. Volume gain (in dB) of the normal native volume supported by * ambient noise, in the range [-96.0, 16.0]. If unset, or set to a value of * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) * will play at approximately half the amplitude of the normal native signal * amplitude. A value of +6.0 (dB) will play at approximately twice the * amplitude of the normal native signal amplitude. We strongly recommend not * to exceed +10 (dB) as there's usually no effective increase in loudness for * any value greater than that. */ volumeGainDb?: number; } /** * Authentication information required for API calls. */ export interface ApiAuthentication { /** * Optional. Config for API key auth. */ apiKeyConfig?: ApiKeyConfig; /** * Optional. Config for bearer token auth. */ bearerTokenConfig?: BearerTokenConfig; /** * Optional. Config for OAuth. */ oauthConfig?: OAuthConfig; /** * Optional. Config for service account authentication. */ serviceAccountAuthConfig?: ServiceAccountAuthConfig; /** * Optional. Config for ID token auth generated from CES service agent. */ serviceAgentIdTokenAuthConfig?: ServiceAgentIdTokenAuthConfig; } /** * Configurations for authentication with API key. */ export interface ApiKeyConfig { /** * Required. The name of the SecretManager secret version resource storing * the API key. Format: * `projects/{project}/secrets/{secret}/versions/{version}` Note: You should * grant `roles/secretmanager.secretAccessor` role to the CES service agent * `service-@gcp-sa-ces.iam.gserviceaccount.com`. */ apiKeySecretVersion?: string; /** * Required. The parameter name or the header name of the API key. E.g., If * the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would * be the parameter name. */ keyName?: string; /** * Required. Key location in the request. */ requestLocation?: | "REQUEST_LOCATION_UNSPECIFIED" | "HEADER" | "QUERY_STRING"; } /** * An app serves as a top-level container for a group of agents, including the * root agent and its sub-agents, along with their associated configurations. * These agents work together to achieve specific goals within the app's * context. */ export interface App { /** * Optional. Audio processing configuration of the app. */ audioProcessingConfig?: AudioProcessingConfig; /** * Optional. The default client certificate settings for the app. */ clientCertificateSettings?: ClientCertificateSettings; /** * Output only. Timestamp when the app was created. */ readonly createTime?: Date; /** * Optional. The data store settings for the app. */ dataStoreSettings?: DataStoreSettings; /** * Optional. The default channel profile used by the app. */ defaultChannelProfile?: ChannelProfile; /** * Output only. Number of deployments in the app. */ readonly deploymentCount?: number; /** * Optional. Human-readable description of the app. */ description?: string; /** * Required. Display name of the app. */ displayName?: string; /** * Optional. Error handling settings of the app. */ errorHandlingSettings?: ErrorHandlingSettings; /** * Output only. Etag used to ensure the object hasn't changed during a * read-modify-write operation. If the etag is empty, the update will * overwrite any concurrent changes. */ readonly etag?: string; /** * Optional. The evaluation thresholds for the app. */ evaluationMetricsThresholds?: EvaluationMetricsThresholds; /** * Optional. Instructions for all the agents in the app. You can use this * instruction to set up a stable identity or personality across all the * agents. */ globalInstruction?: string; /** * Optional. List of guardrails for the app. Format: * `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` */ guardrails?: string[]; /** * Optional. Language settings of the app. */ languageSettings?: LanguageSettings; /** * Optional. Indicates whether the app is locked for changes. If the app is * locked, modifications to the app resources will be rejected. */ locked?: boolean; /** * Optional. Logging settings of the app. */ loggingSettings?: LoggingSettings; /** * Optional. Metadata about the app. This field can be used to store * additional information relevant to the app's details or intended usages. */ metadata?: { [key: string]: string }; /** * Optional. The default LLM model settings for the app. Individual resources * (e.g. agents, guardrails) can override these configurations as needed. */ modelSettings?: ModelSettings; /** * Identifier. The unique identifier of the app. Format: * `projects/{project}/locations/{location}/apps/{app}` */ name?: string; /** * Optional. Whether the app is pinned in the app list. */ pinned?: boolean; /** * Output only. The declarations of predefined variables for the app. */ readonly predefinedVariableDeclarations?: AppVariableDeclaration[]; /** * Optional. The root agent is the entry point of the app. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ rootAgent?: string; /** * Optional. TimeZone settings of the app. */ timeZoneSettings?: TimeZoneSettings; /** * Optional. The tool execution mode for the app. If not provided, will * default to PARALLEL. */ toolExecutionMode?: | "TOOL_EXECUTION_MODE_UNSPECIFIED" | "PARALLEL" | "SEQUENTIAL"; /** * Output only. Timestamp when the app was last updated. */ readonly updateTime?: Date; /** * Optional. The declarations of the variables. */ variableDeclarations?: AppVariableDeclaration[]; } function serializeApp(data: any): App { return { ...data, audioProcessingConfig: data["audioProcessingConfig"] !== undefined ? serializeAudioProcessingConfig(data["audioProcessingConfig"]) : undefined, loggingSettings: data["loggingSettings"] !== undefined ? serializeLoggingSettings(data["loggingSettings"]) : undefined, variableDeclarations: data["variableDeclarations"] !== undefined ? data["variableDeclarations"].map((item: any) => (serializeAppVariableDeclaration(item))) : undefined, }; } function deserializeApp(data: any): App { return { ...data, audioProcessingConfig: data["audioProcessingConfig"] !== undefined ? deserializeAudioProcessingConfig(data["audioProcessingConfig"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, loggingSettings: data["loggingSettings"] !== undefined ? deserializeLoggingSettings(data["loggingSettings"]) : undefined, predefinedVariableDeclarations: data["predefinedVariableDeclarations"] !== undefined ? data["predefinedVariableDeclarations"].map((item: any) => (deserializeAppVariableDeclaration(item))) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, variableDeclarations: data["variableDeclarations"] !== undefined ? data["variableDeclarations"].map((item: any) => (deserializeAppVariableDeclaration(item))) : undefined, }; } /** * A snapshot of the app. */ export interface AppSnapshot { /** * Optional. List of agents in the app. */ agents?: Agent[]; /** * Optional. The basic settings for the app. */ app?: App; /** * Optional. List of examples in the app. */ examples?: Example[]; /** * Optional. List of guardrails in the app. */ guardrails?: Guardrail[]; /** * Optional. List of tools in the app. */ tools?: Tool[]; /** * Optional. List of toolsets in the app. */ toolsets?: Toolset[]; } function serializeAppSnapshot(data: any): AppSnapshot { return { ...data, app: data["app"] !== undefined ? serializeApp(data["app"]) : undefined, examples: data["examples"] !== undefined ? data["examples"].map((item: any) => (serializeExample(item))) : undefined, tools: data["tools"] !== undefined ? data["tools"].map((item: any) => (serializeTool(item))) : undefined, toolsets: data["toolsets"] !== undefined ? data["toolsets"].map((item: any) => (serializeToolset(item))) : undefined, }; } function deserializeAppSnapshot(data: any): AppSnapshot { return { ...data, app: data["app"] !== undefined ? deserializeApp(data["app"]) : undefined, examples: data["examples"] !== undefined ? data["examples"].map((item: any) => (deserializeExample(item))) : undefined, tools: data["tools"] !== undefined ? data["tools"].map((item: any) => (deserializeTool(item))) : undefined, toolsets: data["toolsets"] !== undefined ? data["toolsets"].map((item: any) => (deserializeToolset(item))) : undefined, }; } /** * Defines the structure and metadata for a variable. */ export interface AppVariableDeclaration { /** * Required. The description of the variable. */ description?: string; /** * Required. The name of the variable. The name must start with a letter or * underscore and contain only letters, numbers, or underscores. */ name?: string; /** * Required. The schema of the variable. */ schema?: Schema; } function serializeAppVariableDeclaration(data: any): AppVariableDeclaration { return { ...data, schema: data["schema"] !== undefined ? serializeSchema(data["schema"]) : undefined, }; } function deserializeAppVariableDeclaration(data: any): AppVariableDeclaration { return { ...data, schema: data["schema"] !== undefined ? deserializeSchema(data["schema"]) : undefined, }; } /** * In Customer Engagement Suite (CES), an app version is a snapshot of the app * at a specific point in time. It is immutable and cannot be modified once * created. */ export interface AppVersion { /** * Output only. Timestamp when the app version was created. */ readonly createTime?: Date; /** * Output only. Email of the user who created the app version. */ readonly creator?: string; /** * Optional. The description of the app version. */ description?: string; /** * Optional. The display name of the app version. */ displayName?: string; /** * Output only. Etag used to ensure the object hasn't changed during a * read-modify-write operation. If the etag is empty, the update will * overwrite any concurrent changes. */ readonly etag?: string; /** * Identifier. The unique identifier of the app version. Format: * `projects/{project}/locations/{location}/apps/{app}/versions/{version}` */ name?: string; /** * Output only. The snapshot of the app when the version is created. */ readonly snapshot?: AppSnapshot; } /** * Configuration for how the input and output audio should be processed and * delivered. */ export interface AudioProcessingConfig { /** * Optional. Configuration for the ambient sound to be played with the * synthesized agent response, to enhance the naturalness of the conversation. */ ambientSoundConfig?: AmbientSoundConfig; /** * Optional. Configures the agent behavior for the user barge-in activities. */ bargeInConfig?: BargeInConfig; /** * Optional. The duration of user inactivity (no speech or interaction) * before the agent prompts the user for reengagement. If not set, the agent * will not prompt the user for reengagement. */ inactivityTimeout?: number /* Duration */; /** * Optional. Configuration of how the agent response should be synthesized, * mapping from the language code to SynthesizeSpeechConfig. If the * configuration for the specified language code is not found, the * configuration for the root language code will be used. For example, if the * map contains "en-us" and "en", and the specified language code is "en-gb", * then "en" configuration will be used. Note: Language code is * case-insensitive. */ synthesizeSpeechConfigs?: { [key: string]: SynthesizeSpeechConfig }; } function serializeAudioProcessingConfig(data: any): AudioProcessingConfig { return { ...data, inactivityTimeout: data["inactivityTimeout"] !== undefined ? data["inactivityTimeout"] : undefined, }; } function deserializeAudioProcessingConfig(data: any): AudioProcessingConfig { return { ...data, inactivityTimeout: data["inactivityTimeout"] !== undefined ? data["inactivityTimeout"] : undefined, }; } /** * Configuration for how the audio interactions should be recorded. */ export interface AudioRecordingConfig { /** * Optional. The [Cloud Storage](https://cloud.google.com/storage) bucket to * store the session audio recordings. The URI must start with "gs://". Please * choose a bucket location that meets your data residency requirements. Note: * If the Cloud Storage bucket is in a different project from the app, you * should grant `storage.objects.create` permission to the CES service agent * `service-@gcp-sa-ces.iam.gserviceaccount.com`. */ gcsBucket?: string; /** * Optional. The Cloud Storage path prefix for audio recordings. This prefix * can include the following placeholders, which will be dynamically * substituted at serving time: - $project: project ID - $location: app * location - $app: app ID - $date: session date in YYYY-MM-DD format - * $session: session ID If the path prefix is not specified, the default * prefix `$project/$location/$app/$date/$session/` will be used. */ gcsPathPrefix?: string; } /** * Configuration for how the user barge-in activities should be handled. */ export interface BargeInConfig { /** * Optional. If enabled, the agent will adapt its next response based on the * assumption that the user hasn't heard the full preceding agent message. * This should not be used in scenarios where agent responses are displayed * visually. */ bargeInAwareness?: boolean; /** * Optional. Disables user barge-in while the agent is speaking. If true, * user input during agent response playback will be ignored. Deprecated: * `disable_barge_in` is deprecated in favor of `disable_barge_in_control` in * ChannelProfile. */ disableBargeIn?: boolean; } /** * Request message for AgentService.BatchDeleteConversations. */ export interface BatchDeleteConversationsRequest { /** * Required. The resource names of the conversations to delete. */ conversations?: string[]; } /** * Configurations for authentication with a bearer token. */ export interface BearerTokenConfig { /** * Required. The bearer token. Must be in the format `$context.variables.`. */ token?: string; } /** * Settings to describe the BigQuery export behaviors for the app. */ export interface BigQueryExportSettings { /** * Optional. The BigQuery **dataset ID** to export the data to. */ dataset?: string; /** * Optional. Indicates whether the BigQuery export is enabled. */ enabled?: boolean; /** * Optional. The **project ID** of the BigQuery dataset to export the data * to. Note: If the BigQuery dataset is in a different project from the app, * you should grant `roles/bigquery.admin` role to the CES service agent * `service-@gcp-sa-ces.iam.gserviceaccount.com`. */ project?: string; } /** * Represents a blob input or output in the conversation. */ export interface Blob { /** * Required. Raw bytes of the blob. */ data?: Uint8Array; /** * Required. The IANA standard MIME type of the source data. */ mimeType?: string; } function serializeBlob(data: any): Blob { return { ...data, data: data["data"] !== undefined ? encodeBase64(data["data"]) : undefined, }; } function deserializeBlob(data: any): Blob { return { ...data, data: data["data"] !== undefined ? decodeBase64(data["data"] as string) : undefined, }; } /** * A callback defines the custom logic to be executed at various stages of * agent interaction. */ export interface Callback { /** * Optional. Human-readable description of the callback. */ description?: string; /** * Optional. Whether the callback is disabled. Disabled callbacks are ignored * by the agent. */ disabled?: boolean; /** * Optional. If enabled, the callback will also be executed on intermediate * model outputs. This setting only affects after model callback. **ENABLE * WITH CAUTION**. Typically after model callback only needs to be executed * after receiving all model responses. Enabling proactive execution may have * negative implication on the execution cost and latency, and should only be * enabled in rare situations. */ proactiveExecutionEnabled?: boolean; /** * Required. The python code to execute for the callback. */ pythonCode?: string; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * Changelogs represent a change made to the app or to an resource within the * app. */ export interface Changelog { /** * Output only. The action that was performed on the resource. */ readonly action?: string; /** * Output only. Email address of the change author. */ readonly author?: string; /** * Output only. The time when the change was made. */ readonly createTime?: Date; /** * Output only. The dependent resources that were changed. */ readonly dependentResources?: { [key: string]: any }[]; /** * Output only. Description of the change. which typically captures the * changed fields in the resource. */ readonly description?: string; /** * Output only. Display name of the change. It typically should be the * display name of the resource that was changed. */ readonly displayName?: string; /** * Identifier. The unique identifier of the changelog. Format: * `projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}` */ name?: string; /** * Output only. The new resource after the change. */ readonly newResource?: { [key: string]: any }; /** * Output only. The original resource before the change. */ readonly originalResource?: { [key: string]: any }; /** * Output only. The resource that was changed. */ readonly resource?: string; /** * Output only. The type of the resource that was changed. */ readonly resourceType?: string; /** * Output only. The monotonically increasing sequence number of the * changelog. */ readonly sequenceNumber?: bigint; } /** * A ChannelProfile configures the agent's behavior for a specific * communication channel, such as web UI or telephony. */ export interface ChannelProfile { /** * Optional. The type of the channel profile. */ channelType?: | "UNKNOWN" | "WEB_UI" | "API" | "TWILIO" | "GOOGLE_TELEPHONY_PLATFORM" | "CONTACT_CENTER_AS_A_SERVICE" | "FIVE9" | "CONTACT_CENTER_INTEGRATION"; /** * Optional. Whether to disable user barge-in control in the conversation. - * **true**: User interruptions are disabled while the agent is speaking. - * **false**: The agent retains automatic control over when the user can * interrupt. */ disableBargeInControl?: boolean; /** * Optional. Whether to disable DTMF (dual-tone multi-frequency). */ disableDtmf?: boolean; /** * Optional. The noise suppression level of the channel profile. Available * values are "low", "moderate", "high", "very_high". */ noiseSuppressionLevel?: string; /** * Optional. The persona property of the channel profile. */ personaProperty?: ChannelProfilePersonaProperty; /** * Optional. The unique identifier of the channel profile. */ profileId?: string; /** * Optional. The configuration for the web widget. */ webWidgetConfig?: ChannelProfileWebWidgetConfig; } /** * Represents the persona property of a channel. */ export interface ChannelProfilePersonaProperty { /** * Optional. The persona of the channel. */ persona?: | "UNKNOWN" | "CONCISE" | "CHATTY"; } /** * Message for configuration for the web widget. */ export interface ChannelProfileWebWidgetConfig { /** * Optional. The modality of the web widget. */ modality?: | "MODALITY_UNSPECIFIED" | "CHAT_AND_VOICE" | "VOICE_ONLY" | "CHAT_ONLY" | "CHAT_VOICE_AND_VIDEO"; /** * Optional. The security settings of the web widget. */ securitySettings?: ChannelProfileWebWidgetConfigSecuritySettings; /** * Optional. The theme of the web widget. */ theme?: | "THEME_UNSPECIFIED" | "LIGHT" | "DARK"; /** * Optional. The title of the web widget. */ webWidgetTitle?: string; } /** * Security settings for the web widget. */ export interface ChannelProfileWebWidgetConfigSecuritySettings { /** * Optional. The origins that are allowed to host the web widget. An origin * is defined by RFC 6454. If empty, all origins are allowed. A maximum of 100 * origins is allowed. Example: "https://example.com" */ allowedOrigins?: string[]; /** * Optional. Indicates whether origin check for the web widget is enabled. If * `true`, the web widget will check the origin of the website that loads the * web widget and only allow it to be loaded in the same origin or any of the * allowed origins. */ enableOriginCheck?: boolean; /** * Optional. Indicates whether public access to the web widget is enabled. If * `true`, the web widget will be publicly accessible. If `false`, the web * widget must be integrated with your own authentication and authorization * system to return valid credentials for accessing the CES agent. */ enablePublicAccess?: boolean; /** * Optional. Indicates whether reCAPTCHA verification for the web widget is * enabled. */ enableRecaptcha?: boolean; } /** * A chunk of content within a message. */ export interface Chunk { /** * Optional. Agent transfer event. */ agentTransfer?: AgentTransfer; /** * Optional. Blob data. */ blob?: Blob; /** * A struct represents default variables at the start of the conversation, * keyed by variable names. */ defaultVariables?: { [key: string]: any }; /** * Optional. Image data. */ image?: Image; /** * Optional. Custom payload data. */ payload?: { [key: string]: any }; /** * Optional. Text data. */ text?: string; /** * Optional. Tool execution request. */ toolCall?: ToolCall; /** * Optional. Tool execution response. */ toolResponse?: ToolResponse; /** * Optional. Transcript associated with the audio. */ transcript?: string; /** * A struct represents variables that were updated in the conversation, keyed * by variable names. */ updatedVariables?: { [key: string]: any }; } function serializeChunk(data: any): Chunk { return { ...data, blob: data["blob"] !== undefined ? serializeBlob(data["blob"]) : undefined, image: data["image"] !== undefined ? serializeImage(data["image"]) : undefined, }; } function deserializeChunk(data: any): Chunk { return { ...data, blob: data["blob"] !== undefined ? deserializeBlob(data["blob"]) : undefined, image: data["image"] !== undefined ? deserializeImage(data["image"]) : undefined, }; } /** * Citations associated with the agent response. */ export interface Citations { /** * List of cited pieces of information. */ citedChunks?: CitationsCitedChunk[]; } /** * Piece of cited information. */ export interface CitationsCitedChunk { /** * Text used for citation. */ text?: string; /** * Title of the cited document. */ title?: string; /** * URI used for citation. */ uri?: string; } /** * Settings for custom client certificates. */ export interface ClientCertificateSettings { /** * Optional. The name of the SecretManager secret version resource storing * the passphrase to decrypt the private key. Should be left unset if the * private key is not encrypted. Format: * `projects/{project}/secrets/{secret}/versions/{version}` */ passphrase?: string; /** * Required. The name of the SecretManager secret version resource storing * the private key encoded in PEM format. Format: * `projects/{project}/secrets/{secret}/versions/{version}` */ privateKey?: string; /** * Required. The TLS certificate encoded in PEM format. This string must * include the begin header and end footer lines. */ tlsCertificate?: string; } /** * Represents a client-side function that the agent can invoke. When the tool * is chosen by the agent, control is handed off to the client. The client is * responsible for executing the function and returning the result as a * ToolResponse to continue the interaction with the agent. */ export interface ClientFunction { /** * Optional. The function description. */ description?: string; /** * Required. The function name. */ name?: string; /** * Optional. The schema of the function parameters. */ parameters?: Schema; /** * Optional. The schema of the function response. */ response?: Schema; } function serializeClientFunction(data: any): ClientFunction { return { ...data, parameters: data["parameters"] !== undefined ? serializeSchema(data["parameters"]) : undefined, response: data["response"] !== undefined ? serializeSchema(data["response"]) : undefined, }; } function deserializeClientFunction(data: any): ClientFunction { return { ...data, parameters: data["parameters"] !== undefined ? deserializeSchema(data["parameters"]) : undefined, response: data["response"] !== undefined ? deserializeSchema(data["response"]) : undefined, }; } /** * Settings to describe the Cloud Logging behaviors for the app. */ export interface CloudLoggingSettings { /** * Optional. Whether to enable Cloud Logging for the sessions. */ enableCloudLogging?: boolean; } /** * A code block to be executed instead of a real tool call. */ export interface CodeBlock { /** * Required. Python code which will be invoked in tool fake mode. Expected * Python function signature - To catch all tool calls: def * fake_tool_call(tool: Tool, input: dict[str, Any], callback_context: * CallbackContext) -> Optional[dict[str, Any]]: To catch a specific tool * call: def fake_{tool_id}(tool: Tool, input: dict[str, Any], * callback_context: CallbackContext) -> Optional[dict[str, Any]]: If the * function returns None, the real tool will be invoked instead. */ pythonCode?: string; } /** * A ConnectorTool allows connections to different integrations. See: * https://cloud.google.com/integration-connectors/docs/overview. */ export interface ConnectorTool { /** * Required. Action for the tool to use. */ action?: Action; /** * Optional. Configures how authentication is handled in Integration * Connectors. By default, an admin authentication is passed in the * Integration Connectors API requests. You can override it with a different * end-user authentication config. **Note**: The Connection must have * authentication override enabled in order to specify an EUC configuration * here - otherwise, the ConnectorTool creation will fail. See * https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override * for details. */ authConfig?: EndUserAuthConfig; /** * Required. The full resource name of the referenced Integration Connectors * Connection. Format: * `projects/{project}/locations/{location}/connections/{connection}` */ connection?: string; /** * Optional. The description of the tool that can be used by the Agent to * decide whether to call this ConnectorTool. */ description?: string; /** * Optional. The name of the tool that can be used by the Agent to decide * whether to call this ConnectorTool. */ name?: string; } /** * A toolset that generates tools from an Integration Connectors Connection. */ export interface ConnectorToolset { /** * Optional. Configures how authentication is handled in Integration * Connectors. By default, an admin authentication is passed in the * Integration Connectors API requests. You can override it with a different * end-user authentication config. **Note**: The Connection must have * authentication override enabled in order to specify an EUC configuration * here - otherwise, the Toolset creation will fail. See: * https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override */ authConfig?: EndUserAuthConfig; /** * Required. The full resource name of the referenced Integration Connectors * Connection. Format: * `projects/{project}/locations/{location}/connections/{connection}` */ connection?: string; /** * Required. The list of connector actions/entity operations to generate * tools for. */ connectorActions?: Action[]; } /** * A conversation represents an interaction between an end user and the CES * app. */ export interface Conversation { /** * Output only. The version of the app used for processing the conversation. * Format: * `projects/{project}/locations/{location}/apps/{app}/versions/{version}` */ readonly appVersion?: string; /** * DEPRECATED. Please use input_types instead. */ channelType?: | "CHANNEL_TYPE_UNSPECIFIED" | "TEXT" | "AUDIO" | "MULTIMODAL"; /** * Output only. The deployment of the app used for processing the * conversation. Format: * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` */ readonly deployment?: string; /** * Output only. Timestamp when the conversation was completed. */ readonly endTime?: Date; /** * Output only. The agent that initially handles the conversation. If not * specified, the conversation is handled by the root agent. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ readonly entryAgent?: string; /** * Output only. The input types of the conversation. */ readonly inputTypes?: | "INPUT_TYPE_UNSPECIFIED" | "INPUT_TYPE_TEXT" | "INPUT_TYPE_AUDIO" | "INPUT_TYPE_IMAGE" | "INPUT_TYPE_BLOB" | "INPUT_TYPE_TOOL_RESPONSE" | "INPUT_TYPE_VARIABLES"[]; /** * Output only. The language code of the conversation. */ readonly languageCode?: string; /** * Deprecated. Use turns instead. */ messages?: Message[]; /** * Identifier. The unique identifier of the conversation. Format: * `projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}` */ name?: string; /** * Output only. Indicate the source of the conversation. */ readonly source?: | "SOURCE_UNSPECIFIED" | "LIVE" | "SIMULATOR" | "EVAL" | "AGENT_TOOL"; /** * Output only. Timestamp when the conversation was created. */ readonly startTime?: Date; /** * Output only. The number of turns in the conversation. */ readonly turnCount?: number; /** * Required. The turns in the conversation. */ turns?: ConversationTurn[]; } function serializeConversation(data: any): Conversation { return { ...data, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (serializeMessage(item))) : undefined, turns: data["turns"] !== undefined ? data["turns"].map((item: any) => (serializeConversationTurn(item))) : undefined, }; } function deserializeConversation(data: any): Conversation { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (deserializeMessage(item))) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, turns: data["turns"] !== undefined ? data["turns"].map((item: any) => (deserializeConversationTurn(item))) : undefined, }; } /** * Settings to describe the conversation logging behaviors for the app. */ export interface ConversationLoggingSettings { /** * Optional. Whether to disable conversation logging for the sessions. */ disableConversationLogging?: boolean; /** * Optional. Controls the retention window for the conversation. If not set, * the conversation will be retained for 365 days. */ retentionWindow?: number /* Duration */; } function serializeConversationLoggingSettings(data: any): ConversationLoggingSettings { return { ...data, retentionWindow: data["retentionWindow"] !== undefined ? data["retentionWindow"] : undefined, }; } function deserializeConversationLoggingSettings(data: any): ConversationLoggingSettings { return { ...data, retentionWindow: data["retentionWindow"] !== undefined ? data["retentionWindow"] : undefined, }; } /** * All information about a single turn in the conversation. */ export interface ConversationTurn { /** * Optional. List of messages in the conversation turn, including user input, * agent responses and intermediate events during the processing. */ messages?: Message[]; /** * Optional. The root span of the action processing. */ rootSpan?: Span; } function serializeConversationTurn(data: any): ConversationTurn { return { ...data, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (serializeMessage(item))) : undefined, }; } function deserializeConversationTurn(data: any): ConversationTurn { return { ...data, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (deserializeMessage(item))) : undefined, }; } /** * A DataStore resource in Vertex AI Search. */ export interface DataStore { /** * Output only. The connector config for the data store connection. */ readonly connectorConfig?: DataStoreConnectorConfig; /** * Output only. Timestamp when the data store was created. */ readonly createTime?: Date; /** * Output only. The display name of the data store. */ readonly displayName?: string; /** * Output only. The document processing mode for the data store connection. * Only set for PUBLIC_WEB and UNSTRUCTURED data stores. */ readonly documentProcessingMode?: | "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" | "DOCUMENTS" | "CHUNKS"; /** * Required. Full resource name of the DataStore. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */ name?: string; /** * Output only. The type of the data store. This field is readonly and * populated by the server. */ readonly type?: | "DATA_STORE_TYPE_UNSPECIFIED" | "PUBLIC_WEB" | "UNSTRUCTURED" | "FAQ" | "CONNECTOR"; } /** * The connector config for the data store connection. */ export interface DataStoreConnectorConfig { /** * Resource name of the collection the data store belongs to. */ collection?: string; /** * Display name of the collection the data store belongs to. */ collectionDisplayName?: string; /** * The name of the data source. Example: `salesforce`, `jira`, `confluence`, * `bigquery`. */ dataSource?: string; } /** * Data store related settings for the app. */ export interface DataStoreSettings { /** * Output only. The engines for the app. */ readonly engines?: DataStoreSettingsEngine[]; } /** * An engine to which the data stores are connected. See Vertex AI Search: * https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. */ export interface DataStoreSettingsEngine { /** * Output only. The resource name of the engine. Format: * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */ readonly name?: string; /** * Output only. The type of the engine. */ readonly type?: | "TYPE_UNSPECIFIED" | "ENGINE_TYPE_SEARCH" | "ENGINE_TYPE_CHAT"; } /** * Tool to retrieve from Vertex AI Search datastore or engine for grounding. * Accepts either a datastore or an engine, but not both. See Vertex AI Search: * https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. */ export interface DataStoreTool { /** * Optional. Boost specification to boost certain documents. */ boostSpecs?: DataStoreToolBoostSpecs[]; /** * Optional. Search within a single specific DataStore. */ dataStoreSource?: DataStoreToolDataStoreSource; /** * Optional. The tool description. */ description?: string; /** * Optional. Search within an Engine (potentially across multiple * DataStores). */ engineSource?: DataStoreToolEngineSource; /** * Optional. The filter parameter behavior. */ filterParameterBehavior?: | "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED" | "ALWAYS_INCLUDE" | "NEVER_INCLUDE"; /** * Optional. The modality configs for the data store. */ modalityConfigs?: DataStoreToolModalityConfig[]; /** * Required. The data store tool name. */ name?: string; } /** * Boost specification to boost certain documents. */ export interface DataStoreToolBoostSpec { /** * Required. A list of boosting specifications. */ conditionBoostSpecs?: DataStoreToolBoostSpecConditionBoostSpec[]; } /** * Boost specification for a condition. */ export interface DataStoreToolBoostSpecConditionBoostSpec { /** * Optional. Strength of the boost, which should be in [-1, 1]. Negative * boost means demotion. Default is 0.0. Setting to 1.0 gives the suggestions * a big promotion. However, it does not necessarily mean that the top result * will be a boosted suggestion. Setting to -1.0 gives the suggestions a big * demotion. However, other suggestions that are relevant might still be * shown. Setting to 0.0 means no boost applied. The boosting condition is * ignored. */ boost?: number; /** * Optional. Complex specification for custom ranking based on customer * defined attribute value. */ boostControlSpec?: DataStoreToolBoostSpecConditionBoostSpecBoostControlSpec; /** * Required. An expression which specifies a boost condition. The syntax is * the same as filter expression syntax. Currently, the only supported * condition is a list of BCP-47 lang codes. Example: To boost suggestions in * languages en or fr: (lang_code: ANY("en", "fr")) */ condition?: string; } /** * Specification for custom ranking based on customer specified attribute * value. It provides more controls for customized ranking than the simple * (condition, boost) combination above. */ export interface DataStoreToolBoostSpecConditionBoostSpecBoostControlSpec { /** * Optional. The attribute type to be used to determine the boost amount. The * attribute value can be derived from the field value of the specified * field_name. In the case of numerical it is straightforward i.e. * attribute_value = numerical_field_value. In the case of freshness however, * attribute_value = (time.now() - datetime_field_value). */ attributeType?: | "ATTRIBUTE_TYPE_UNSPECIFIED" | "NUMERICAL" | "FRESHNESS"; /** * Optional. The control points used to define the curve. The monotonic * function (defined through the interpolation_type above) passes through the * control points listed here. */ controlPoints?: DataStoreToolBoostSpecConditionBoostSpecBoostControlSpecControlPoint[]; /** * Optional. The name of the field whose value will be used to determine the * boost amount. */ fieldName?: string; /** * Optional. The interpolation type to be applied to connect the control * points listed below. */ interpolationType?: | "INTERPOLATION_TYPE_UNSPECIFIED" | "LINEAR"; } /** * The control points used to define the curve. The curve defined through these * control points can only be monotonically increasing or decreasing(constant * values are acceptable). */ export interface DataStoreToolBoostSpecConditionBoostSpecBoostControlSpecControlPoint { /** * Optional. Can be one of: 1. The numerical field value. 2. The duration * spec for freshness: The value must be formatted as an XSD `dayTimeDuration` * value (a restricted subset of an ISO 8601 duration value). The pattern for * this is: `nDnM]`. */ attributeValue?: string; /** * Optional. The value between -1 to 1 by which to boost the score if the * attribute_value evaluates to the value specified above. */ boostAmount?: number; } /** * Boost specifications to boost certain documents. For more information, * please refer to * https://cloud.google.com/generative-ai-app-builder/docs/boosting. */ export interface DataStoreToolBoostSpecs { /** * Required. The Data Store where the boosting configuration is applied. Full * resource name of DataStore, such as * projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}. */ dataStores?: string[]; /** * Required. A list of boosting specifications. */ spec?: DataStoreToolBoostSpec[]; } /** * Configuration for searching within a specific DataStore. */ export interface DataStoreToolDataStoreSource { /** * Optional. The data store. */ dataStore?: DataStore; /** * Optional. Filter specification for the DataStore. See: * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata */ filter?: string; } /** * Configuration for searching within an Engine, potentially targeting specific * DataStores. */ export interface DataStoreToolEngineSource { /** * Optional. Use to target specific DataStores within the Engine. If empty, * the search applies to all DataStores associated with the Engine. */ dataStoreSources?: DataStoreToolDataStoreSource[]; /** * Required. Full resource name of the Engine. Format: * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */ engine?: string; /** * Optional. A filter applied to the search across the Engine. Not relevant * and not used if 'data_store_sources' is provided. See: * https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata */ filter?: string; } /** * Grounding configuration. */ export interface DataStoreToolGroundingConfig { /** * Optional. Whether grounding is disabled. */ disabled?: boolean; /** * Optional. The groundedness threshold of the answer based on the retrieved * sources. The value has a configurable range of [1, 5]. The level is used to * threshold the groundedness of the answer, meaning that all responses with a * groundedness score below the threshold will fall back to returning relevant * snippets only. For example, a level of 3 means that the groundedness score * must be 3 or higher for the response to be returned. */ groundingLevel?: number; } /** * If specified, will apply the given configuration for the specified modality. */ export interface DataStoreToolModalityConfig { /** * Optional. The grounding configuration. */ groundingConfig?: DataStoreToolGroundingConfig; /** * Required. The modality type. */ modalityType?: | "MODALITY_TYPE_UNSPECIFIED" | "TEXT" | "AUDIO"; /** * Optional. The rewriter config. */ rewriterConfig?: DataStoreToolRewriterConfig; /** * Optional. The summarization config. */ summarizationConfig?: DataStoreToolSummarizationConfig; } /** * Rewriter configuration. */ export interface DataStoreToolRewriterConfig { /** * Optional. Whether the rewriter is disabled. */ disabled?: boolean; /** * Required. Configurations for the LLM model. */ modelSettings?: ModelSettings; /** * Optional. The prompt definition. If not set, default prompt will be used. */ prompt?: string; } /** * Summarization configuration. */ export interface DataStoreToolSummarizationConfig { /** * Optional. Whether summarization is disabled. */ disabled?: boolean; /** * Optional. Configurations for the LLM model. */ modelSettings?: ModelSettings; /** * Optional. The prompt definition. If not set, default prompt will be used. */ prompt?: string; } /** * A deployment represents an immutable, queryable version of the app. It is * used to deploy an app version with a specific channel profile. */ export interface Deployment { /** * Optional. The resource name of the app version to deploy. Format: * `projects/{project}/locations/{location}/apps/{app}/versions/{version}` Use * `projects/{project}/locations/{location}/apps/{app}/versions/-` to use the * draft app. */ appVersion?: string; /** * Required. The channel profile used in the deployment. */ channelProfile?: ChannelProfile; /** * Output only. Timestamp when this deployment was created. */ readonly createTime?: Date; /** * Required. Display name of the deployment. */ displayName?: string; /** * Output only. Etag used to ensure the object hasn't changed during a * read-modify-write operation. If the etag is empty, the update will * overwrite any concurrent changes. */ readonly etag?: string; /** * Identifier. The resource name of the deployment. Format: * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` */ name?: string; /** * Output only. Timestamp when this deployment was last updated. */ readonly updateTime?: Date; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * Defines project/location level endpoint control policy. */ export interface EndpointControlPolicy { /** * Optional. The allowed HTTP(s) origins that tools in the App are able to * directly call. The enforcement depends on the value of enforcement_scope * and the VPC-SC status of the project. If a port number is not provided, all * ports will be allowed. Otherwise, the port number must match exactly. For * example, "https://example.com" will match "https://example.com:443" and any * other port. "https://example.com:443" will only match * "https://example.com:443". */ allowedOrigins?: string[]; /** * Optional. The scope in which this policy's allowed_origins list is * enforced. */ enforcementScope?: | "ENFORCEMENT_SCOPE_UNSPECIFIED" | "VPCSC_ONLY" | "ALWAYS"; } /** * Indicates the session has terminated, due to either successful completion * (e.g. user says "Good bye!" ) or an agent escalation. The agent will not * process any further inputs after session is terminated and the client should * half-close and disconnect after receiving all remaining responses from the * agent. */ export interface EndSession { /** * Optional. Provides additional information about the end session signal, * such as the reason for ending the session. */ metadata?: { [key: string]: any }; } /** * End-user authentication configuration used for Connection calls. The field * values must be the names of context variables in the format * `$context.variables.`. */ export interface EndUserAuthConfig { /** * Oauth 2.0 Authorization Code authentication. */ oauth2AuthCodeConfig?: EndUserAuthConfigOauth2AuthCodeConfig; /** * JWT Profile Oauth 2.0 Authorization Grant authentication. */ oauth2JwtBearerConfig?: EndUserAuthConfigOauth2JwtBearerConfig; } /** * Oauth 2.0 Authorization Code authentication configuration. */ export interface EndUserAuthConfigOauth2AuthCodeConfig { /** * Required. Oauth token parameter name to pass through. Must be in the * format `$context.variables.`. */ oauthToken?: string; } /** * JWT Profile Oauth 2.0 Authorization Grant authentication configuration. */ export interface EndUserAuthConfigOauth2JwtBearerConfig { /** * Required. Client parameter name to pass through. Must be in the format * `$context.variables.`. */ clientKey?: string; /** * Required. Issuer parameter name to pass through. Must be in the format * `$context.variables.`. */ issuer?: string; /** * Required. Subject parameter name to pass through. Must be in the format * `$context.variables.`. */ subject?: string; } /** * Settings to describe how errors should be handled in the app. */ export interface ErrorHandlingSettings { /** * Optional. Configuration for ending the session in case of system errors * (e.g. LLM errors). */ endSessionConfig?: ErrorHandlingSettingsEndSessionConfig; /** * Optional. The strategy to use for error handling. */ errorHandlingStrategy?: | "ERROR_HANDLING_STRATEGY_UNSPECIFIED" | "NONE" | "FALLBACK_RESPONSE" | "END_SESSION"; /** * Optional. Configuration for handling fallback responses. */ fallbackResponseConfig?: ErrorHandlingSettingsFallbackResponseConfig; } /** * Configuration for ending the session in case of system errors (e.g. LLM * errors). */ export interface ErrorHandlingSettingsEndSessionConfig { /** * Optional. Whether to escalate the session in EndSession. If session is * escalated, metadata in EndSession will contain `session_escalated = true`. * See * https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/deploy/google-telephony-platform#transfer_a_call_to_a_human_agent * for details. */ escalateSession?: boolean; } /** * Configuration for handling fallback responses. */ export interface ErrorHandlingSettingsFallbackResponseConfig { /** * Optional. The fallback messages in case of system errors (e.g. LLM * errors), mapped by [supported language * code](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/reference/language). */ customFallbackMessages?: { [key: string]: string }; /** * Optional. The maximum number of fallback attempts to make before the agent * emitting EndSession Signal. */ maxFallbackAttempts?: number; } /** * Threshold settings for metrics in an Evaluation. */ export interface EvaluationMetricsThresholds { /** * Optional. The golden evaluation metrics thresholds. */ goldenEvaluationMetricsThresholds?: EvaluationMetricsThresholdsGoldenEvaluationMetricsThresholds; /** * Optional. The hallucination metric behavior for golden evaluations. */ goldenHallucinationMetricBehavior?: | "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" | "DISABLED" | "ENABLED"; /** * Optional. Deprecated: Use `golden_hallucination_metric_behavior` instead. * The hallucination metric behavior is currently used for golden evaluations. */ hallucinationMetricBehavior?: | "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" | "DISABLED" | "ENABLED"; /** * Optional. The hallucination metric behavior for scenario evaluations. */ scenarioHallucinationMetricBehavior?: | "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" | "DISABLED" | "ENABLED"; } /** * Settings for golden evaluations. */ export interface EvaluationMetricsThresholdsGoldenEvaluationMetricsThresholds { /** * Optional. The expectation level metrics thresholds. */ expectationLevelMetricsThresholds?: EvaluationMetricsThresholdsGoldenEvaluationMetricsThresholdsExpectationLevelMetricsThresholds; /** * Optional. The tool matching settings. An extra tool call is a tool call * that is present in the execution but does not match any tool call in the * golden expectation. */ toolMatchingSettings?: EvaluationMetricsThresholdsToolMatchingSettings; /** * Optional. The turn level metrics thresholds. */ turnLevelMetricsThresholds?: EvaluationMetricsThresholdsGoldenEvaluationMetricsThresholdsTurnLevelMetricsThresholds; } /** * Expectation level metrics thresholds. */ export interface EvaluationMetricsThresholdsGoldenEvaluationMetricsThresholdsExpectationLevelMetricsThresholds { /** * Optional. The success threshold for individual tool invocation parameter * correctness. Must be a float between 0 and 1. Default is 1.0. */ toolInvocationParameterCorrectnessThreshold?: number; } /** * Turn level metrics thresholds. */ export interface EvaluationMetricsThresholdsGoldenEvaluationMetricsThresholdsTurnLevelMetricsThresholds { /** * Optional. The success threshold for overall tool invocation correctness. * Must be a float between 0 and 1. Default is 1.0. */ overallToolInvocationCorrectnessThreshold?: number; /** * Optional. The semantic similarity channel to use for evaluation. */ semanticSimilarityChannel?: | "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED" | "TEXT" | "AUDIO"; /** * Optional. The success threshold for semantic similarity. Must be an * integer between 0 and 4. Default is >= 3. */ semanticSimilaritySuccessThreshold?: number; } /** * Settings for matching tool calls. */ export interface EvaluationMetricsThresholdsToolMatchingSettings { /** * Optional. Behavior for extra tool calls. Defaults to FAIL. */ extraToolCallBehavior?: | "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED" | "FAIL" | "ALLOW"; } /** * Event input. */ export interface Event { /** * Required. The name of the event. */ event?: string; } /** * An example represents a sample conversation between the user and the * agent(s). */ export interface Example { /** * Output only. Timestamp when the example was created. */ readonly createTime?: Date; /** * Optional. Human-readable description of the example. */ description?: string; /** * Required. Display name of the example. */ displayName?: string; /** * Optional. The agent that initially handles the conversation. If not * specified, the example represents a conversation that is handled by the * root agent. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ entryAgent?: string; /** * Etag used to ensure the object hasn't changed during a read-modify-write * operation. If the etag is empty, the update will overwrite any concurrent * changes. */ etag?: string; /** * Output only. The example may become invalid if referencing resources are * deleted. Invalid examples will not be used as few-shot examples. */ readonly invalid?: boolean; /** * Optional. The collection of messages that make up the conversation. */ messages?: Message[]; /** * Identifier. The unique identifier of the example. Format: * `projects/{project}/locations/{location}/apps/{app}/examples/{example}` */ name?: string; /** * Output only. Timestamp when the example was last updated. */ readonly updateTime?: Date; } function serializeExample(data: any): Example { return { ...data, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (serializeMessage(item))) : undefined, }; } function deserializeExample(data: any): Example { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (deserializeMessage(item))) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for ToolService.ExecuteTool. */ export interface ExecuteToolRequest { /** * Optional. The input parameters and values for the tool in JSON object * format. */ args?: { [key: string]: any }; /** * Optional. The * [ToolCallContext](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/python#environment * for details) to be passed to the Python tool. */ context?: { [key: string]: any }; /** * Optional. Mock configuration for the tool execution. If this field is set, * tools that call other tools will be mocked based on the provided patterns * and responses. */ mockConfig?: MockConfig; /** * Optional. The name of the tool to execute. Format: * projects/{project}/locations/{location}/apps/{app}/tools/{tool} */ tool?: string; /** * Optional. The toolset tool to execute. Only one tool should match the * predicate from the toolset. Otherwise, an error will be returned. */ toolsetTool?: ToolsetTool; /** * Optional. The variables that are available for the tool execution. */ variables?: { [key: string]: any }; } /** * Response message for ToolService.ExecuteTool. */ export interface ExecuteToolResponse { /** * The tool execution result in JSON object format. Use "output" key to * specify tool response and "error" key to specify error details (if any). If * "output" and "error" keys are not specified, then whole "response" is * treated as tool execution result. */ response?: { [key: string]: any }; /** * The name of the tool that got executed. Format: * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` */ tool?: string; /** * The toolset tool that got executed. */ toolsetTool?: ToolsetTool; /** * The variable values at the end of the tool execution. */ variables?: { [key: string]: any }; } /** * Request message for AgentService.ExportApp. */ export interface ExportAppRequest { /** * Optional. The resource name of the app version to export. Format: * `projects/{project}/locations/{location}/apps/{app}/versions/{version}`. */ appVersion?: string; /** * Required. The format to export the app in. */ exportFormat?: | "EXPORT_FORMAT_UNSPECIFIED" | "JSON" | "YAML"; /** * Optional. The [Google Cloud * Storage](https://cloud.google.com/storage/docs/) URI to which to export the * app. The format of this URI must be `gs:///`. The exported app archive will * be written directly to the specified GCS object. */ gcsUri?: string; } /** * Response message for AgentService.ExportApp. */ export interface ExportAppResponse { /** * App folder compressed as a zip file. */ appContent?: Uint8Array; /** * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to * which the app was exported. */ appUri?: string; } function serializeExportAppResponse(data: any): ExportAppResponse { return { ...data, appContent: data["appContent"] !== undefined ? encodeBase64(data["appContent"]) : undefined, }; } function deserializeExportAppResponse(data: any): ExportAppResponse { return { ...data, appContent: data["appContent"] !== undefined ? decodeBase64(data["appContent"] as string) : undefined, }; } /** * Expression condition based on session state. */ export interface ExpressionCondition { /** * Required. The string representation of cloud.api.Expression condition. */ expression?: string; } /** * The file search tool allows the agent to search across the files uploaded by * the app/agent developer. It has presets to give relatively good quality * search over the uploaded files and summarization of the retrieved results. */ export interface FileSearchTool { /** * Optional. The type of the corpus. Default is FULLY_MANAGED. */ corpusType?: | "CORPUS_TYPE_UNSPECIFIED" | "USER_OWNED" | "FULLY_MANAGED"; /** * Optional. The tool description. */ description?: string; /** * Optional. The corpus where files are stored. Format: * projects/{project}/locations/{location}/ragCorpora/{rag_corpus} */ fileCorpus?: string; /** * Required. The tool name. */ name?: string; } /** * Request message for WidgetService.GenerateChatToken. */ export interface GenerateChatTokenRequest { /** * Required. The deployment of the app to use for the session. Format: * projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} */ deployment?: string; /** * Optional. Indicates if live handoff is enabled for the session. */ liveHandoffEnabled?: boolean; /** * Optional. The reCAPTCHA token generated by the client-side chat widget. */ recaptchaToken?: string; } /** * Response message for WidgetService.GenerateChatToken. */ export interface GenerateChatTokenResponse { /** * The session scoped token for chat widget to authenticate with Session * APIs. */ chatToken?: string; /** * The time at which the chat token expires. */ expireTime?: Date; } function serializeGenerateChatTokenResponse(data: any): GenerateChatTokenResponse { return { ...data, expireTime: data["expireTime"] !== undefined ? data["expireTime"].toISOString() : undefined, }; } function deserializeGenerateChatTokenResponse(data: any): GenerateChatTokenResponse { return { ...data, expireTime: data["expireTime"] !== undefined ? new Date(data["expireTime"]) : undefined, }; } /** * Search suggestions from Google Search Tool. */ export interface GoogleSearchSuggestions { /** * Compliant HTML and CSS styling for search suggestions. The provided HTML * and CSS automatically adapts to your device settings, displaying in either * light or dark mode indicated by `@media(prefers-color-scheme)`. */ htmls?: string[]; /** * List of queries used to perform the google search along with the search * result URIs forming the search suggestions. */ webSearchQueries?: WebSearchQuery[]; } /** * Represents a tool to perform Google web searches for grounding. See * https://cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool#google-search. */ export interface GoogleSearchTool { /** * Optional. Content will be fetched directly from these URLs for context and * grounding. Example: "https://example.com/path.html". A maximum of 20 URLs * are allowed. */ contextUrls?: string[]; /** * Optional. Description of the tool's purpose. */ description?: string; /** * Optional. List of domains to be excluded from the search results. Example: * "example.com". A maximum of 2000 domains can be excluded. */ excludeDomains?: string[]; /** * Required. The name of the tool. */ name?: string; /** * Optional. Specifies domains to restrict search results to. Example: * "example.com", "another.site". A maximum of 20 domains can be specified. */ preferredDomains?: string[]; /** * Optional. Prompt instructions passed to planner on how the search results * should be processed for text and voice. */ promptConfig?: GoogleSearchToolPromptConfig; } /** * Prompt settings used by the model when processing or summarizing the google * search results. */ export interface GoogleSearchToolPromptConfig { /** * Optional. Defines the prompt used for the system instructions when * interacting with the agent in chat conversations. If not set, default * prompt will be used. */ textPrompt?: string; /** * Optional. Defines the prompt used for the system instructions when * interacting with the agent in voice conversations. If not set, default * prompt will be used. */ voicePrompt?: string; } /** * Guardrail contains a list of checks and balances to keep the agents safe and * secure. */ export interface Guardrail { /** * Optional. Action to take when the guardrail is triggered. */ action?: TriggerAction; /** * Optional. Guardrail that potentially blocks the conversation based on the * result of the callback execution. */ codeCallback?: GuardrailCodeCallback; /** * Optional. Guardrail that bans certain content from being used in the * conversation. */ contentFilter?: GuardrailContentFilter; /** * Output only. Timestamp when the guardrail was created. */ readonly createTime?: Date; /** * Optional. Description of the guardrail. */ description?: string; /** * Required. Display name of the guardrail. */ displayName?: string; /** * Optional. Whether the guardrail is enabled. */ enabled?: boolean; /** * Etag used to ensure the object hasn't changed during a read-modify-write * operation. If the etag is empty, the update will overwrite any concurrent * changes. */ etag?: string; /** * Optional. Guardrail that blocks the conversation if the LLM response is * considered violating the policy based on the LLM classification. */ llmPolicy?: GuardrailLlmPolicy; /** * Optional. Guardrail that blocks the conversation if the prompt is * considered unsafe based on the LLM classification. */ llmPromptSecurity?: GuardrailLlmPromptSecurity; /** * Optional. Guardrail that blocks the conversation if the LLM response is * considered unsafe based on the model safety settings. */ modelSafety?: GuardrailModelSafety; /** * Identifier. The unique identifier of the guardrail. Format: * `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` */ name?: string; /** * Output only. Timestamp when the guardrail was last updated. */ readonly updateTime?: Date; } /** * Guardrail that blocks the conversation based on the code callbacks provided. */ export interface GuardrailCodeCallback { /** * Optional. The callback to execute after the agent is called. Each callback * function is expected to return a structure (e.g., a dict or object) * containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - 'reason': A * string explaining the decision. A 'TRIGGER' decision may halt further * processing. */ afterAgentCallback?: Callback; /** * Optional. The callback to execute after the model is called. If there are * multiple calls to the model, the callback will be executed multiple times. * Each callback function is expected to return a structure (e.g., a dict or * object) containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - * 'reason': A string explaining the decision. A 'TRIGGER' decision may halt * further processing. */ afterModelCallback?: Callback; /** * Optional. The callback to execute before the agent is called. Each * callback function is expected to return a structure (e.g., a dict or * object) containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - * 'reason': A string explaining the decision. A 'TRIGGER' decision may halt * further processing. */ beforeAgentCallback?: Callback; /** * Optional. The callback to execute before the model is called. If there are * multiple calls to the model, the callback will be executed multiple times. * Each callback function is expected to return a structure (e.g., a dict or * object) containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - * 'reason': A string explaining the decision. A 'TRIGGER' decision may halt * further processing. */ beforeModelCallback?: Callback; } /** * Guardrail that bans certain content from being used in the conversation. */ export interface GuardrailContentFilter { /** * Optional. List of banned phrases. Applies to both user inputs and agent * responses. */ bannedContents?: string[]; /** * Optional. List of banned phrases. Applies only to agent responses. */ bannedContentsInAgentResponse?: string[]; /** * Optional. List of banned phrases. Applies only to user inputs. */ bannedContentsInUserInput?: string[]; /** * Optional. If true, diacritics are ignored during matching. */ disregardDiacritics?: boolean; /** * Required. Match type for the content filter. */ matchType?: | "MATCH_TYPE_UNSPECIFIED" | "SIMPLE_STRING_MATCH" | "WORD_BOUNDARY_STRING_MATCH" | "REGEXP_MATCH"; } /** * Guardrail that blocks the conversation if the LLM response is considered * violating the policy based on the LLM classification. */ export interface GuardrailLlmPolicy { /** * Optional. By default, the LLM policy check is bypassed for short * utterances. Enabling this setting applies the policy check to all * utterances, including those that would normally be skipped. */ allowShortUtterance?: boolean; /** * Optional. If an error occurs during the policy check, fail open and do not * trigger the guardrail. */ failOpen?: boolean; /** * Optional. When checking this policy, consider the last 'n' messages in the * conversation. When not set a default value of 10 will be used. */ maxConversationMessages?: number; /** * Optional. Model settings. */ modelSettings?: ModelSettings; /** * Required. Defines when to apply the policy check during the conversation. * If set to `POLICY_SCOPE_UNSPECIFIED`, the policy will be applied to the * user input. When applying the policy to the agent response, additional * latency will be introduced before the agent can respond. */ policyScope?: | "POLICY_SCOPE_UNSPECIFIED" | "USER_QUERY" | "AGENT_RESPONSE" | "USER_QUERY_AND_AGENT_RESPONSE"; /** * Required. Policy prompt. */ prompt?: string; } /** * Guardrail that blocks the conversation if the input is considered unsafe * based on the LLM classification. */ export interface GuardrailLlmPromptSecurity { /** * Optional. Use a user-defined LlmPolicy to configure the security * guardrail. */ customPolicy?: GuardrailLlmPolicy; /** * Optional. Use the system's predefined default security settings. To select * this mode, include an empty 'default_settings' message in the request. The * 'default_prompt_template' field within will be populated by the server in * the response. */ defaultSettings?: GuardrailLlmPromptSecurityDefaultSecuritySettings; /** * Optional. Determines the behavior when the guardrail encounters an LLM * error. - If true: the guardrail is bypassed. - If false (default): the * guardrail triggers/blocks. Note: If a custom policy is provided, this field * is ignored in favor of the policy's 'fail_open' configuration. */ failOpen?: boolean; } /** * Configuration for default system security settings. */ export interface GuardrailLlmPromptSecurityDefaultSecuritySettings { /** * Output only. The default prompt template used by the system. This field is * for display purposes to show the user what prompt the system uses by * default. It is OUTPUT_ONLY. */ readonly defaultPromptTemplate?: string; } /** * Model safety settings overrides. When this is set, it will override the * default settings and trigger the guardrail if the response is considered * unsafe. */ export interface GuardrailModelSafety { /** * Required. List of safety settings. */ safetySettings?: GuardrailModelSafetySafetySetting[]; } /** * Safety setting. */ export interface GuardrailModelSafetySafetySetting { /** * Required. The harm category. */ category?: | "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT"; /** * Required. The harm block threshold. */ threshold?: | "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF"; } /** * Represents an image input or output in the conversation. */ export interface Image { /** * Required. Raw bytes of the image. */ data?: Uint8Array; /** * Required. The IANA standard MIME type of the source data. Supported image * types includes: * image/png * image/jpeg * image/webp */ mimeType?: string; } function serializeImage(data: any): Image { return { ...data, data: data["data"] !== undefined ? encodeBase64(data["data"]) : undefined, }; } function deserializeImage(data: any): Image { return { ...data, data: data["data"] !== undefined ? decodeBase64(data["data"] as string) : undefined, }; } /** * Request message for AgentService.ImportApp. */ export interface ImportAppRequest { /** * Raw bytes representing the compressed zip file with the app folder * structure. */ appContent?: Uint8Array; /** * Optional. The ID to use for the imported app. * If not specified, a unique * ID will be automatically assigned for the app. * Otherwise, the imported * app will use this ID as the final component of its resource name. If an app * with the same ID already exists at the specified location in the project, * the content of the existing app will be replaced. */ appId?: string; /** * Optional. The display name of the app to import. * If the app is created * on import, and the display name is specified, the imported app will use * this display name. If a conflict is detected with an existing app, a * timestamp will be appended to the display name to make it unique. * If the * app is a reimport, this field should not be set. Providing a display name * during reimport will result in an INVALID_ARGUMENT error. */ displayName?: string; /** * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI * from which to import app. The format of this URI must be `gs:///`. */ gcsUri?: string; /** * Optional. Flag for overriding the app lock during import. If set to true, * the import process will ignore the app lock. */ ignoreAppLock?: boolean; /** * Optional. Options governing the import process for the app. */ importOptions?: ImportAppRequestImportOptions; } function serializeImportAppRequest(data: any): ImportAppRequest { return { ...data, appContent: data["appContent"] !== undefined ? encodeBase64(data["appContent"]) : undefined, }; } function deserializeImportAppRequest(data: any): ImportAppRequest { return { ...data, appContent: data["appContent"] !== undefined ? decodeBase64(data["appContent"] as string) : undefined, }; } /** * Configuration options for the app import process. These options control how * the import behaves, particularly when conflicts arise with existing app data. */ export interface ImportAppRequestImportOptions { /** * Optional. The strategy to use when resolving conflicts during import. */ conflictResolutionStrategy?: | "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" | "REPLACE" | "OVERWRITE"; } /** * Response message for AgentService.ImportApp. */ export interface ImportAppResponse { /** * The resource name of the app that was imported. */ name?: string; /** * Warning messages generated during the import process. If errors occur for * specific resources, they will not be included in the imported app and the * error will be mentioned here. */ warnings?: string[]; } /** * InputAudioConfig configures how the CES agent should interpret the incoming * audio data. */ export interface InputAudioConfig { /** * Required. The encoding of the input audio data. */ audioEncoding?: | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "MULAW" | "ALAW"; /** * Optional. Whether to enable noise suppression on the input audio. * Available values are "low", "moderate", "high", "very_high". */ noiseSuppressionLevel?: string; /** * Required. The sample rate (in Hertz) of the input audio data. */ sampleRateHertz?: number; } /** * Language settings of the app. */ export interface LanguageSettings { /** * Optional. The default language code of the app. */ defaultLanguageCode?: string; /** * Optional. Enables multilingual support. If true, agents in the app will * use pre-built instructions to improve handling of multilingual input. */ enableMultilingualSupport?: boolean; /** * Optional. Deprecated: This feature is no longer supported. Use * `enable_multilingual_support` instead to improve handling of multilingual * input. The action to perform when an agent receives input in an unsupported * language. This can be a predefined action or a custom tool call. Valid * values are: - A tool's full resource name, which triggers a specific tool * execution. - A predefined system action, such as "escalate" or "exit", * which triggers an EndSession signal with corresponding metadata to * terminate the conversation. */ fallbackAction?: string; /** * Optional. List of languages codes supported by the app, in addition to the * `default_language_code`. */ supportedLanguageCodes?: string[]; } /** * Response message for AgentService.ListAgents. */ export interface ListAgentsResponse { /** * The list of agents. */ agents?: Agent[]; /** * A token that can be sent as ListAgentsRequest.page_token to retrieve the * next page. Absence of this field indicates there are no subsequent pages. */ nextPageToken?: string; } /** * Response message for AgentService.ListApps. */ export interface ListAppsResponse { /** * The list of apps. */ apps?: App[]; /** * A token that can be sent as ListAppsRequest.page_token to retrieve the * next page. Absence of this field indicates there are no subsequent pages. */ nextPageToken?: string; /** * Unordered list. Locations that could not be reached. */ unreachable?: string[]; } function serializeListAppsResponse(data: any): ListAppsResponse { return { ...data, apps: data["apps"] !== undefined ? data["apps"].map((item: any) => (serializeApp(item))) : undefined, }; } function deserializeListAppsResponse(data: any): ListAppsResponse { return { ...data, apps: data["apps"] !== undefined ? data["apps"].map((item: any) => (deserializeApp(item))) : undefined, }; } /** * Response message for AgentService.ListAppVersions. */ export interface ListAppVersionsResponse { /** * The list of app versions. */ appVersions?: AppVersion[]; /** * A token that can be sent as ListAppVersionsRequest.page_token to retrieve * the next page. Absence of this field indicates there are no subsequent * pages. */ nextPageToken?: string; } /** * Response message for AgentService.ListChangelogs. */ export interface ListChangelogsResponse { /** * The list of changelogs. */ changelogs?: Changelog[]; /** * A token that can be sent as ListChangelogsRequest.page_token to retrieve * the next page. Absence of this field indicates there are no subsequent * pages. */ nextPageToken?: string; } /** * Response message for AgentService.ListConversations. */ export interface ListConversationsResponse { /** * The list of conversations. */ conversations?: Conversation[]; /** * A token that can be sent as ListConversationsRequest.page_token to * retrieve the next page. Absence of this field indicates there are no * subsequent pages. */ nextPageToken?: string; } function serializeListConversationsResponse(data: any): ListConversationsResponse { return { ...data, conversations: data["conversations"] !== undefined ? data["conversations"].map((item: any) => (serializeConversation(item))) : undefined, }; } function deserializeListConversationsResponse(data: any): ListConversationsResponse { return { ...data, conversations: data["conversations"] !== undefined ? data["conversations"].map((item: any) => (deserializeConversation(item))) : undefined, }; } /** * Response message for AgentService.ListDeployments. */ export interface ListDeploymentsResponse { /** * The list of deployments. */ deployments?: Deployment[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * Response message for AgentService.ListExamples. */ export interface ListExamplesResponse { /** * The list of examples. */ examples?: Example[]; /** * A token that can be sent as ListExamplesRequest.page_token to retrieve the * next page. Absence of this field indicates there are no subsequent pages. */ nextPageToken?: string; } function serializeListExamplesResponse(data: any): ListExamplesResponse { return { ...data, examples: data["examples"] !== undefined ? data["examples"].map((item: any) => (serializeExample(item))) : undefined, }; } function deserializeListExamplesResponse(data: any): ListExamplesResponse { return { ...data, examples: data["examples"] !== undefined ? data["examples"].map((item: any) => (deserializeExample(item))) : undefined, }; } /** * Response message for AgentService.ListGuardrails. */ export interface ListGuardrailsResponse { /** * The list of guardrails. */ guardrails?: Guardrail[]; /** * A token that can be sent as ListGuardrailsRequest.page_token to retrieve * the next page. Absence of this field indicates there are no subsequent * pages. */ nextPageToken?: string; } /** * The response message for Locations.ListLocations. */ export interface ListLocationsResponse { /** * A list of locations that matches the specified filter in the request. */ locations?: Location[]; /** * The standard List next-page token. */ nextPageToken?: string; } /** * The response message for Operations.ListOperations. */ export interface ListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string; /** * A list of operations that matches the specified filter in the request. */ operations?: Operation[]; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections. For example, when attempting to list all resources across all * supported locations. */ unreachable?: string[]; } /** * Response message for AgentService.ListToolsets. */ export interface ListToolsetsResponse { /** * A token that can be sent as ListToolsetsRequest.page_token to retrieve the * next page. Absence of this field indicates there are no subsequent pages. */ nextPageToken?: string; /** * The list of toolsets. */ toolsets?: Toolset[]; } function serializeListToolsetsResponse(data: any): ListToolsetsResponse { return { ...data, toolsets: data["toolsets"] !== undefined ? data["toolsets"].map((item: any) => (serializeToolset(item))) : undefined, }; } function deserializeListToolsetsResponse(data: any): ListToolsetsResponse { return { ...data, toolsets: data["toolsets"] !== undefined ? data["toolsets"].map((item: any) => (deserializeToolset(item))) : undefined, }; } /** * Response message for AgentService.ListTools. */ export interface ListToolsResponse { /** * A token that can be sent as ListToolsRequest.page_token to retrieve the * next page. Absence of this field indicates there are no subsequent pages. */ nextPageToken?: string; /** * The list of tools. */ tools?: Tool[]; } function serializeListToolsResponse(data: any): ListToolsResponse { return { ...data, tools: data["tools"] !== undefined ? data["tools"].map((item: any) => (serializeTool(item))) : undefined, }; } function deserializeListToolsResponse(data: any): ListToolsResponse { return { ...data, tools: data["tools"] !== undefined ? data["tools"].map((item: any) => (deserializeTool(item))) : undefined, }; } /** * A resource that represents a Google Cloud location. */ export interface Location { /** * The friendly name for this location, typically a nearby city name. For * example, "Tokyo". */ displayName?: string; /** * Cross-service attributes for the location. For example * {"cloud.googleapis.com/region": "us-east1"} */ labels?: { [key: string]: string }; /** * The canonical id for this location. For example: `"us-east1"`. */ locationId?: string; /** * Service-specific metadata. For example the available capacity at the given * location. */ metadata?: { [key: string]: any }; /** * Resource name for the location, which may vary between implementations. * For example: `"projects/example-project/locations/us-east1"` */ name?: string; } /** * Settings to describe the logging behaviors for the app. */ export interface LoggingSettings { /** * Optional. Configuration for how audio interactions should be recorded. */ audioRecordingConfig?: AudioRecordingConfig; /** * Optional. Settings to describe the BigQuery export behaviors for the app. * The conversation data will be exported to BigQuery tables if it is enabled. */ bigqueryExportSettings?: BigQueryExportSettings; /** * Optional. Settings to describe the Cloud Logging behaviors for the app. */ cloudLoggingSettings?: CloudLoggingSettings; /** * Optional. Settings to describe the conversation logging behaviors for the * app. */ conversationLoggingSettings?: ConversationLoggingSettings; /** * Optional. Configuration for how audio interactions should be recorded for * the evaluation. By default, audio recording is not enabled for evaluation * sessions. */ evaluationAudioRecordingConfig?: AudioRecordingConfig; /** * Optional. Settings to describe the conversation data collection behaviors * for the LLM analysis pipeline for the app. */ metricAnalysisSettings?: MetricAnalysisSettings; /** * Optional. Configuration for how sensitive data should be redacted. */ redactionConfig?: RedactionConfig; } function serializeLoggingSettings(data: any): LoggingSettings { return { ...data, conversationLoggingSettings: data["conversationLoggingSettings"] !== undefined ? serializeConversationLoggingSettings(data["conversationLoggingSettings"]) : undefined, }; } function deserializeLoggingSettings(data: any): LoggingSettings { return { ...data, conversationLoggingSettings: data["conversationLoggingSettings"] !== undefined ? deserializeConversationLoggingSettings(data["conversationLoggingSettings"]) : undefined, }; } /** * An MCP tool. See * https://modelcontextprotocol.io/specification/2025-06-18/server/tools for * more details. */ export interface McpTool { /** * Optional. Authentication information required to execute the tool against * the MCP server. For bearer token authentication, the token applies only to * tool execution, not to listing tools. This requires that tools can be * listed without authentication. */ apiAuthentication?: ApiAuthentication; /** * Optional. The custom headers to send in the request to the MCP server. The * values must be in the format `$context.variables.` and can be set in the * session variables. See * https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/open-api#openapi-injection * for more details. */ customHeaders?: { [key: string]: string }; /** * Optional. The description of the MCP tool. */ description?: string; /** * Optional. The schema of the input arguments of the MCP tool. */ inputSchema?: Schema; /** * Required. The name of the MCP tool. */ name?: string; /** * Optional. The schema of the output arguments of the MCP tool. */ outputSchema?: Schema; /** * Required. The server address of the MCP server, e.g., * "https://example.com/mcp/". If the server is built with the MCP SDK, the * url should be suffixed with "/mcp/". Only Streamable HTTP transport based * servers are supported. This is the same as the server_address in the * McpToolset. See * https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http * for more details. */ serverAddress?: string; /** * Optional. Service Directory configuration for VPC-SC, used to resolve * service names within a perimeter. */ serviceDirectoryConfig?: ServiceDirectoryConfig; /** * Optional. The TLS configuration. Includes the custom server certificates * that the client should trust. */ tlsConfig?: TlsConfig; } function serializeMcpTool(data: any): McpTool { return { ...data, inputSchema: data["inputSchema"] !== undefined ? serializeSchema(data["inputSchema"]) : undefined, outputSchema: data["outputSchema"] !== undefined ? serializeSchema(data["outputSchema"]) : undefined, tlsConfig: data["tlsConfig"] !== undefined ? serializeTlsConfig(data["tlsConfig"]) : undefined, }; } function deserializeMcpTool(data: any): McpTool { return { ...data, inputSchema: data["inputSchema"] !== undefined ? deserializeSchema(data["inputSchema"]) : undefined, outputSchema: data["outputSchema"] !== undefined ? deserializeSchema(data["outputSchema"]) : undefined, tlsConfig: data["tlsConfig"] !== undefined ? deserializeTlsConfig(data["tlsConfig"]) : undefined, }; } /** * A toolset that contains a list of tools that are offered by the MCP server. */ export interface McpToolset { /** * Optional. Authentication information required to access tools and execute * a tool against the MCP server. For bearer token authentication, the token * applies only to tool execution, not to listing tools. This requires that * tools can be listed without authentication. */ apiAuthentication?: ApiAuthentication; /** * Optional. The custom headers to send in the request to the MCP server. The * values must be in the format `$context.variables.` and can be set in the * session variables. See * https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/open-api#openapi-injection * for more details. */ customHeaders?: { [key: string]: string }; /** * Required. The address of the MCP server, for example, * "https://example.com/mcp/". If the server is built with the MCP SDK, the * url should be suffixed with "/mcp/". Only Streamable HTTP transport based * servers are supported. See * https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http * for more details. */ serverAddress?: string; /** * Optional. Service Directory configuration for VPC-SC, used to resolve * service names within a perimeter. */ serviceDirectoryConfig?: ServiceDirectoryConfig; /** * Optional. The TLS configuration. Includes the custom server certificates * that the client should trust. */ tlsConfig?: TlsConfig; } function serializeMcpToolset(data: any): McpToolset { return { ...data, tlsConfig: data["tlsConfig"] !== undefined ? serializeTlsConfig(data["tlsConfig"]) : undefined, }; } function deserializeMcpToolset(data: any): McpToolset { return { ...data, tlsConfig: data["tlsConfig"] !== undefined ? deserializeTlsConfig(data["tlsConfig"]) : undefined, }; } /** * A message within a conversation. */ export interface Message { /** * Optional. Content of the message as a series of chunks. */ chunks?: Chunk[]; /** * Optional. Timestamp when the message was sent or received. Should not be * used if the message is part of an example. */ eventTime?: Date; /** * Optional. The role within the conversation, e.g., user, agent. */ role?: string; } function serializeMessage(data: any): Message { return { ...data, chunks: data["chunks"] !== undefined ? data["chunks"].map((item: any) => (serializeChunk(item))) : undefined, eventTime: data["eventTime"] !== undefined ? data["eventTime"].toISOString() : undefined, }; } function deserializeMessage(data: any): Message { return { ...data, chunks: data["chunks"] !== undefined ? data["chunks"].map((item: any) => (deserializeChunk(item))) : undefined, eventTime: data["eventTime"] !== undefined ? new Date(data["eventTime"]) : undefined, }; } /** * Settings to describe the conversation data collection behaviors for LLM * analysis metrics pipeline. */ export interface MetricAnalysisSettings { /** * Optional. Whether to collect conversation data for llm analysis metrics. * If true, conversation data will not be collected for llm analysis metrics; * otherwise, conversation data will be collected. */ llmMetricsOptedOut?: boolean; } /** * Mock tool calls configuration for the session. */ export interface MockConfig { /** * Optional. All tool calls to mock for the duration of the session. */ mockedToolCalls?: MockedToolCall[]; /** * Required. Beavhior for tool calls that don't match any args patterns in * mocked_tool_calls. */ unmatchedToolCallBehavior?: | "UNMATCHED_TOOL_CALL_BEHAVIOR_UNSPECIFIED" | "FAIL" | "PASS_THROUGH"; } /** * A mocked tool call. Expresses the target tool + a pattern to match against * that tool's args / inputs. If the pattern matches, then the mock response * will be returned. */ export interface MockedToolCall { /** * Required. A pattern to match against the args / inputs of all dispatched * tool calls. If the tool call inputs match this pattern, then mock output * will be returned. */ expectedArgsPattern?: { [key: string]: any }; /** * Optional. The mock response / output to return if the tool call args / * inputs match the pattern. */ mockResponse?: { [key: string]: any }; /** * Required. Deprecated. Use tool_identifier instead. */ tool?: string; /** * Optional. The name of the tool to mock. Format: * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` */ toolId?: string; /** * Optional. The toolset to mock. */ toolset?: ToolsetTool; } /** * Model settings contains various configurations for the LLM model. */ export interface ModelSettings { /** * Optional. The LLM model that the agent should use. If not set, the agent * will inherit the model from its parent agent. */ model?: string; /** * Optional. If set, this temperature will be used for the LLM model. * Temperature controls the randomness of the model's responses. Lower * temperatures produce responses that are more predictable. Higher * temperatures produce responses that are more creative. */ temperature?: number; } /** * Configurations for authentication with OAuth. */ export interface OAuthConfig { /** * Required. The client ID from the OAuth provider. */ clientId?: string; /** * Required. The name of the SecretManager secret version resource storing * the client secret. Format: * `projects/{project}/secrets/{secret}/versions/{version}` Note: You should * grant `roles/secretmanager.secretAccessor` role to the CES service agent * `service-@gcp-sa-ces.iam.gserviceaccount.com`. */ clientSecretVersion?: string; /** * Required. OAuth grant types. */ oauthGrantType?: | "OAUTH_GRANT_TYPE_UNSPECIFIED" | "CLIENT_CREDENTIAL"; /** * Optional. The OAuth scopes to grant. */ scopes?: string[]; /** * Required. The token endpoint in the OAuth provider to exchange for an * access token. */ tokenEndpoint?: string; } /** * Represents an Omnichannel resource. */ export interface Omnichannel { /** * Output only. Timestamp when the omnichannel resource was created. */ readonly createTime?: Date; /** * Optional. Human-readable description of the omnichannel resource. */ description?: string; /** * Required. Display name of the omnichannel resource. */ displayName?: string; /** * Output only. Etag used to ensure the object hasn't changed during a * read-modify-write operation. */ readonly etag?: string; /** * Optional. The integration config for the omnichannel resource. */ integrationConfig?: OmnichannelIntegrationConfig; /** * Identifier. The unique identifier of the omnichannel resource. Format: * `projects/{project}/locations/{location}/omnichannels/{omnichannel}` */ name?: string; /** * Output only. Timestamp when the omnichannel resource was last updated. */ readonly updateTime?: Date; } /** * OmnichannelIntegrationConfig contains all App integration configs. */ export interface OmnichannelIntegrationConfig { /** * Optional. Various of configuration for handling App events. */ channelConfigs?: { [key: string]: OmnichannelIntegrationConfigChannelConfig }; /** * Optional. The key of routing_configs is a key of `app_configs`, value is a * `RoutingConfig`, which contains subscriber's key. */ routingConfigs?: { [key: string]: OmnichannelIntegrationConfigRoutingConfig }; /** * Optional. Various of subscribers configs. */ subscriberConfigs?: { [key: string]: OmnichannelIntegrationConfigSubscriberConfig }; } /** * Configs for CES app. */ export interface OmnichannelIntegrationConfigCesAppConfig { /** * The unique identifier of the CES app. Format: * `projects/{project}/locations/{location}/apps/{app}` */ app?: string; } /** * ChannelConfig contains config for various of app integration. */ export interface OmnichannelIntegrationConfigChannelConfig { /** * WhatsApp config. */ whatsappConfig?: OmnichannelIntegrationConfigWhatsappConfig; } /** * Routing config specify how/who to route app events to a subscriber. */ export interface OmnichannelIntegrationConfigRoutingConfig { /** * The key of the subscriber. */ subscriberKey?: string; } /** * Configs of subscribers. */ export interface OmnichannelIntegrationConfigSubscriberConfig { /** * Ces app config. */ cesAppConfig?: OmnichannelIntegrationConfigCesAppConfig; } /** * How Omnichannel should receive/reply events from WhatsApp. */ export interface OmnichannelIntegrationConfigWhatsappConfig { /** * The Meta Business Portfolio (MBP) ID. * https://www.facebook.com/business/help/1710077379203657 */ metaBusinessPortfolioId?: string; /** * The phone number used for sending/receiving messages. */ phoneNumber?: string; /** * The Phone Number ID associated with the WhatsApp Business Account. */ phoneNumberId?: string; /** * The verify token configured in the Meta App Dashboard for webhook * verification. */ webhookVerifyToken?: string; /** * The customer's WhatsApp Business Account (WABA) ID. */ whatsappBusinessAccountId?: string; /** * The access token for authenticating API calls to the WhatsApp Cloud API. * https://developers.facebook.com/docs/whatsapp/business-management-api/get-started/#business-integration-system-user-access-tokens */ whatsappBusinessToken?: string; } /** * Represents the metadata of the long-running operation. */ export interface OmnichannelOperationMetadata { /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; } /** * A remote API tool defined by an OpenAPI schema. */ export interface OpenApiTool { /** * Optional. Authentication information required by the API. */ apiAuthentication?: ApiAuthentication; /** * Optional. The description of the tool. If not provided, the description of * the tool will be derived from the OpenAPI schema, from * `operation.description` or `operation.summary`. */ description?: string; /** * Optional. If true, the agent will ignore unknown fields in the API * response. */ ignoreUnknownFields?: boolean; /** * Optional. The name of the tool. If not provided, the name of the tool will * be derived from the OpenAPI schema, from `operation.operationId`. */ name?: string; /** * Required. The OpenAPI schema in JSON or YAML format. */ openApiSchema?: string; /** * Optional. Service Directory configuration. */ serviceDirectoryConfig?: ServiceDirectoryConfig; /** * Optional. The TLS configuration. Includes the custom server certificates * that the client will trust. */ tlsConfig?: TlsConfig; /** * Optional. The server URL of the Open API schema. This field is only set in * tools in the environment dependencies during the export process if the * schema contains a server url. During the import process, if this url is * present in the environment dependencies and the schema has the $env_var * placeholder, it will replace the placeholder in the schema. */ url?: string; } function serializeOpenApiTool(data: any): OpenApiTool { return { ...data, tlsConfig: data["tlsConfig"] !== undefined ? serializeTlsConfig(data["tlsConfig"]) : undefined, }; } function deserializeOpenApiTool(data: any): OpenApiTool { return { ...data, tlsConfig: data["tlsConfig"] !== undefined ? deserializeTlsConfig(data["tlsConfig"]) : undefined, }; } /** * A toolset that contains a list of tools that are defined by an OpenAPI * schema. */ export interface OpenApiToolset { /** * Optional. Authentication information required by the API. */ apiAuthentication?: ApiAuthentication; /** * Optional. If true, the agent will ignore unknown fields in the API * response for all operations defined in the OpenAPI schema. */ ignoreUnknownFields?: boolean; /** * Required. The OpenAPI schema of the toolset. */ openApiSchema?: string; /** * Optional. Service Directory configuration. */ serviceDirectoryConfig?: ServiceDirectoryConfig; /** * Optional. The TLS configuration. Includes the custom server certificates */ tlsConfig?: TlsConfig; /** * Optional. The server URL of the Open API schema. This field is only set in * toolsets in the environment dependencies during the export process if the * schema contains a server url. During the import process, if this url is * present in the environment dependencies and the schema has the $env_var * placeholder, it will replace the placeholder in the schema. */ url?: string; } function serializeOpenApiToolset(data: any): OpenApiToolset { return { ...data, tlsConfig: data["tlsConfig"] !== undefined ? serializeTlsConfig(data["tlsConfig"]) : undefined, }; } function deserializeOpenApiToolset(data: any): OpenApiToolset { return { ...data, tlsConfig: data["tlsConfig"] !== undefined ? deserializeTlsConfig(data["tlsConfig"]) : undefined, }; } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface Operation { /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. */ done?: boolean; /** * The error result of the operation in case of failure or cancellation. */ error?: Status; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any }; /** * The server-assigned name, which is only unique within the same service * that originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ name?: string; /** * The normal, successful response of the operation. If the original method * returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is * the original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any }; } /** * Represents the metadata of the long-running operation. */ export interface OperationMetadata { /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * google.longrunning.Operation.error value with a google.rpc.Status.code of * `1`, corresponding to `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; } /** * OutputAudioConfig configures how the CES agent should synthesize outgoing * audio responses. */ export interface OutputAudioConfig { /** * Required. The encoding of the output audio data. */ audioEncoding?: | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "MULAW" | "ALAW"; /** * Required. The sample rate (in Hertz) of the output audio data. */ sampleRateHertz?: number; } /** * Additional options for ces#projectsLocationsAppsAgentsCreate. */ export interface ProjectsLocationsAppsAgentsCreateOptions { /** * Optional. The ID to use for the agent, which will become the final * component of the agent's resource name. If not provided, a unique ID will * be automatically assigned for the agent. */ agentId?: string; } /** * Additional options for ces#projectsLocationsAppsAgentsDelete. */ export interface ProjectsLocationsAppsAgentsDeleteOptions { /** * Optional. The current etag of the agent. If an etag is not provided, the * deletion will overwrite any concurrent changes. If an etag is provided and * does not match the current etag of the agent, deletion will be blocked and * an ABORTED error will be returned. */ etag?: string; /** * Optional. Indicates whether to forcefully delete the agent, even if it is * still referenced by other app/agents/examples. * If `force = false`, the * deletion fails if other agents/examples reference it. * If `force = true`, * delete the agent and remove it from all referencing apps/agents/examples. */ force?: boolean; } /** * Additional options for ces#projectsLocationsAppsAgentsList. */ export interface ProjectsLocationsAppsAgentsListOptions { /** * Optional. Filter to be applied when listing the agents. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListAgents call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsAgentsPatch. */ export interface ProjectsLocationsAppsAgentsPatchOptions { /** * Optional. Field mask is used to control which fields get updated. If the * mask is not present, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsAppsAgentsPatchOptions(data: any): ProjectsLocationsAppsAgentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAppsAgentsPatchOptions(data: any): ProjectsLocationsAppsAgentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ces#projectsLocationsAppsChangelogsList. */ export interface ProjectsLocationsAppsChangelogsListOptions { /** * Optional. Filter to be applied when listing the changelogs. See * https://google.aip.dev/160 for more details. The filter string can be used * to filter by `action`, `resource_type`, `resource_name`, `author`, and * `create_time`. The `:` comparator can be used for case-insensitive partial * matching on string fields, while `=` performs an exact case-sensitive * match. Examples: * `action:update` (case-insensitive partial match) * * `action="Create"` (case-sensitive exact match) * `resource_type:agent` * * `resource_name:my-agent` * `author:me@example.com` * `create_time > * "2025-01-01T00:00:00Z"` * `create_time <= "2025-01-01T00:00:00Z" AND * resource_type:tool` */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListChangelogs call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsConversationsDelete. */ export interface ProjectsLocationsAppsConversationsDeleteOptions { /** * Optional. Indicate the source of the conversation. If not set, Source.Live * will be applied by default. */ source?: | "SOURCE_UNSPECIFIED" | "LIVE" | "SIMULATOR" | "EVAL" | "AGENT_TOOL"; } /** * Additional options for ces#projectsLocationsAppsConversationsGet. */ export interface ProjectsLocationsAppsConversationsGetOptions { /** * Optional. Indicate the source of the conversation. If not set, all source * will be searched. */ source?: | "SOURCE_UNSPECIFIED" | "LIVE" | "SIMULATOR" | "EVAL" | "AGENT_TOOL"; } /** * Additional options for ces#projectsLocationsAppsConversationsList. */ export interface ProjectsLocationsAppsConversationsListOptions { /** * Optional. Filter to be applied when listing the conversations. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListConversations call. */ pageToken?: string; /** * Optional. Indicate the source of the conversation. If not set, Source.Live * will be applied by default. Will be deprecated in favor of `sources` field. */ source?: | "SOURCE_UNSPECIFIED" | "LIVE" | "SIMULATOR" | "EVAL" | "AGENT_TOOL"; /** * Optional. Indicate the sources of the conversations. If not set, all * available sources will be applied by default. */ sources?: | "SOURCE_UNSPECIFIED" | "LIVE" | "SIMULATOR" | "EVAL" | "AGENT_TOOL"; } /** * Additional options for ces#projectsLocationsAppsCreate. */ export interface ProjectsLocationsAppsCreateOptions { /** * Optional. The ID to use for the app, which will become the final component * of the app's resource name. If not provided, a unique ID will be * automatically assigned for the app. */ appId?: string; } /** * Additional options for ces#projectsLocationsAppsDelete. */ export interface ProjectsLocationsAppsDeleteOptions { /** * Optional. The current etag of the app. If an etag is not provided, the * deletion will overwrite any concurrent changes. If an etag is provided and * does not match the current etag of the app, deletion will be blocked and an * ABORTED error will be returned. */ etag?: string; } /** * Additional options for ces#projectsLocationsAppsDeploymentsCreate. */ export interface ProjectsLocationsAppsDeploymentsCreateOptions { /** * Optional. The ID to use for the deployment, which will become the final * component of the deployment's resource name. If not provided, a unique ID * will be automatically assigned for the deployment. */ deploymentId?: string; } /** * Additional options for ces#projectsLocationsAppsDeploymentsDelete. */ export interface ProjectsLocationsAppsDeploymentsDeleteOptions { /** * Optional. The etag of the deployment. If an etag is provided and does not * match the current etag of the deployment, deletion will be blocked and an * ABORTED error will be returned. */ etag?: string; } /** * Additional options for ces#projectsLocationsAppsDeploymentsList. */ export interface ProjectsLocationsAppsDeploymentsListOptions { /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. The maximum number of deployments to return. The service may * return fewer than this value. If unspecified, at most 50 deployments will * be returned. The maximum value is 1000; values above 1000 will be coerced * to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListDeployments` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListDeployments` must match the call that provided * the page token. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsDeploymentsPatch. */ export interface ProjectsLocationsAppsDeploymentsPatchOptions { /** * Optional. The list of fields to update. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsAppsDeploymentsPatchOptions(data: any): ProjectsLocationsAppsDeploymentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAppsDeploymentsPatchOptions(data: any): ProjectsLocationsAppsDeploymentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ces#projectsLocationsAppsExamplesCreate. */ export interface ProjectsLocationsAppsExamplesCreateOptions { /** * Optional. The ID to use for the example, which will become the final * component of the example's resource name. If not provided, a unique ID will * be automatically assigned for the example. */ exampleId?: string; } /** * Additional options for ces#projectsLocationsAppsExamplesDelete. */ export interface ProjectsLocationsAppsExamplesDeleteOptions { /** * Optional. The current etag of the example. If an etag is not provided, the * deletion will overwrite any concurrent changes. If an etag is provided and * does not match the current etag of the example, deletion will be blocked * and an ABORTED error will be returned. */ etag?: string; } /** * Additional options for ces#projectsLocationsAppsExamplesList. */ export interface ProjectsLocationsAppsExamplesListOptions { /** * Optional. Filter to be applied when listing the examples. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListExamples call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsExamplesPatch. */ export interface ProjectsLocationsAppsExamplesPatchOptions { /** * Optional. Field mask is used to control which fields get updated. If the * mask is not present, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsAppsExamplesPatchOptions(data: any): ProjectsLocationsAppsExamplesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAppsExamplesPatchOptions(data: any): ProjectsLocationsAppsExamplesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ces#projectsLocationsAppsGuardrailsCreate. */ export interface ProjectsLocationsAppsGuardrailsCreateOptions { /** * Optional. The ID to use for the guardrail, which will become the final * component of the guardrail's resource name. If not provided, a unique ID * will be automatically assigned for the guardrail. */ guardrailId?: string; } /** * Additional options for ces#projectsLocationsAppsGuardrailsDelete. */ export interface ProjectsLocationsAppsGuardrailsDeleteOptions { /** * Optional. The current etag of the guardrail. If an etag is not provided, * the deletion will overwrite any concurrent changes. If an etag is provided * and does not match the current etag of the guardrail, deletion will be * blocked and an ABORTED error will be returned. */ etag?: string; /** * Optional. Indicates whether to forcefully delete the guardrail, even if it * is still referenced by app/agents. * If `force = false`, the deletion fails * if any apps/agents still reference the guardrail. * If `force = true`, all * existing references from apps/agents will be removed and the guardrail will * be deleted. */ force?: boolean; } /** * Additional options for ces#projectsLocationsAppsGuardrailsList. */ export interface ProjectsLocationsAppsGuardrailsListOptions { /** * Optional. Filter to be applied when listing the guardrails. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListGuardrails call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsGuardrailsPatch. */ export interface ProjectsLocationsAppsGuardrailsPatchOptions { /** * Optional. Field mask is used to control which fields get updated. If the * mask is not present, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsAppsGuardrailsPatchOptions(data: any): ProjectsLocationsAppsGuardrailsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAppsGuardrailsPatchOptions(data: any): ProjectsLocationsAppsGuardrailsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ces#projectsLocationsAppsList. */ export interface ProjectsLocationsAppsListOptions { /** * Optional. Filter to be applied when listing the apps. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListApps call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsPatch. */ export interface ProjectsLocationsAppsPatchOptions { /** * Optional. Field mask is used to control which fields get updated. If the * mask is not present, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsAppsPatchOptions(data: any): ProjectsLocationsAppsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAppsPatchOptions(data: any): ProjectsLocationsAppsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ces#projectsLocationsAppsToolsCreate. */ export interface ProjectsLocationsAppsToolsCreateOptions { /** * Optional. The ID to use for the tool, which will become the final * component of the tool's resource name. If not provided, a unique ID will be * automatically assigned for the tool. */ toolId?: string; } /** * Additional options for ces#projectsLocationsAppsToolsDelete. */ export interface ProjectsLocationsAppsToolsDeleteOptions { /** * Optional. The current etag of the tool. If an etag is not provided, the * deletion will overwrite any concurrent changes. If an etag is provided and * does not match the current etag of the tool, deletion will be blocked and * an ABORTED error will be returned. */ etag?: string; /** * Optional. Indicates whether to forcefully delete the tool, even if it is * still referenced by agents/examples. * If `force = false`, the deletion * will fail if any agents still reference the tool. * If `force = true`, all * existing references from agents will be removed and the tool will be * deleted. */ force?: boolean; } /** * Additional options for ces#projectsLocationsAppsToolsetsCreate. */ export interface ProjectsLocationsAppsToolsetsCreateOptions { /** * Optional. The ID to use for the toolset, which will become the final * component of the toolset's resource name. If not provided, a unique ID will * be automatically assigned for the toolset. */ toolsetId?: string; } /** * Additional options for ces#projectsLocationsAppsToolsetsDelete. */ export interface ProjectsLocationsAppsToolsetsDeleteOptions { /** * Optional. The current etag of the toolset. If an etag is not provided, the * deletion will overwrite any concurrent changes. If an etag is provided and * does not match the current etag of the toolset, deletion will be blocked * and an ABORTED error will be returned. */ etag?: string; /** * Optional. Indicates whether to forcefully delete the toolset, even if it * is still referenced by app/agents. * If `force = false`, the deletion fails * if any agents still reference the toolset. * If `force = true`, all * existing references from agents will be removed and the toolset will be * deleted. */ force?: boolean; } /** * Additional options for ces#projectsLocationsAppsToolsetsList. */ export interface ProjectsLocationsAppsToolsetsListOptions { /** * Optional. Filter to be applied when listing the toolsets. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListToolsets call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsToolsetsPatch. */ export interface ProjectsLocationsAppsToolsetsPatchOptions { /** * Optional. Field mask is used to control which fields get updated. If the * mask is not present, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsAppsToolsetsPatchOptions(data: any): ProjectsLocationsAppsToolsetsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAppsToolsetsPatchOptions(data: any): ProjectsLocationsAppsToolsetsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ces#projectsLocationsAppsToolsList. */ export interface ProjectsLocationsAppsToolsListOptions { /** * Optional. Filter to be applied when listing the tools. Use * "include_system_tools=true" to include system tools in the response. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListTools call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsAppsToolsPatch. */ export interface ProjectsLocationsAppsToolsPatchOptions { /** * Optional. Field mask is used to control which fields get updated. If the * mask is not present, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsAppsToolsPatchOptions(data: any): ProjectsLocationsAppsToolsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAppsToolsPatchOptions(data: any): ProjectsLocationsAppsToolsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ces#projectsLocationsAppsVersionsCreate. */ export interface ProjectsLocationsAppsVersionsCreateOptions { /** * Optional. The ID to use for the app version, which will become the final * component of the app version's resource name. If not provided, a unique ID * will be automatically assigned for the app version. */ appVersionId?: string; } /** * Additional options for ces#projectsLocationsAppsVersionsDelete. */ export interface ProjectsLocationsAppsVersionsDeleteOptions { /** * Optional. The current etag of the app version. If an etag is not provided, * the deletion will overwrite any concurrent changes. If an etag is provided * and does not match the current etag of the app version, deletion will be * blocked and an ABORTED error will be returned. */ etag?: string; } /** * Additional options for ces#projectsLocationsAppsVersionsList. */ export interface ProjectsLocationsAppsVersionsListOptions { /** * Optional. Filter to be applied when listing the app versions. See * https://google.aip.dev/160 for more details. */ filter?: string; /** * Optional. Field to sort by. Only "name" and "create_time" is supported. * See https://google.aip.dev/132#ordering for more details. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. The next_page_token value returned from a previous list * AgentService.ListAppVersions call. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * Optional. Do not use this field. It is unsupported and is ignored unless * explicitly documented otherwise. This is primarily for internal usage. */ extraLocationTypes?: string; /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for ces#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * Python code block to evaluate the condition. */ export interface PythonCodeCondition { /** * Required. The python code to execute. */ pythonCode?: string; } /** * A Python function tool. */ export interface PythonFunction { /** * Output only. The description of the Python function, parsed from the * python code's docstring. */ readonly description?: string; /** * Optional. The name of the Python function to execute. Must match a Python * function name defined in the python code. Case sensitive. If the name is * not provided, the first function defined in the python code will be used. */ name?: string; /** * Optional. The Python code to execute for the tool. */ pythonCode?: string; } /** * Configuration to instruct how sensitive data should be handled. */ export interface RedactionConfig { /** * Optional. [DLP](https://cloud.google.com/dlp/docs) deidentify template * name to instruct on how to de-identify content. Format: * `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}` */ deidentifyTemplate?: string; /** * Optional. If true, redaction will be applied in various logging scenarios, * including conversation history, Cloud Logging and audio recording. */ enableRedaction?: boolean; /** * Optional. [DLP](https://cloud.google.com/dlp/docs) inspect template name * to configure detection of sensitive data types. Format: * `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}` */ inspectTemplate?: string; } /** * Request message for AgentService.RestoreAppVersion */ export interface RestoreAppVersionRequest { } /** * Request message for ToolService.RetrieveToolSchema. */ export interface RetrieveToolSchemaRequest { /** * Optional. The name of the tool to retrieve the schema for. Format: * projects/{project}/locations/{location}/apps/{app}/tools/{tool} */ tool?: string; /** * Optional. The toolset tool to retrieve the schema for. Only one tool * should match the predicate from the toolset. Otherwise, an error will be * returned. */ toolsetTool?: ToolsetTool; } /** * Response message for ToolService.RetrieveToolSchema. */ export interface RetrieveToolSchemaResponse { /** * The schema of the tool input parameters. */ inputSchema?: Schema; /** * The schema of the tool output parameters. */ outputSchema?: Schema; /** * The name of the tool that the schema is for. Format: * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` */ tool?: string; /** * The toolset tool that the schema is for. */ toolsetTool?: ToolsetTool; } function serializeRetrieveToolSchemaResponse(data: any): RetrieveToolSchemaResponse { return { ...data, inputSchema: data["inputSchema"] !== undefined ? serializeSchema(data["inputSchema"]) : undefined, outputSchema: data["outputSchema"] !== undefined ? serializeSchema(data["outputSchema"]) : undefined, }; } function deserializeRetrieveToolSchemaResponse(data: any): RetrieveToolSchemaResponse { return { ...data, inputSchema: data["inputSchema"] !== undefined ? deserializeSchema(data["inputSchema"]) : undefined, outputSchema: data["outputSchema"] !== undefined ? deserializeSchema(data["outputSchema"]) : undefined, }; } /** * Request message for ToolService.RetrieveTools. */ export interface RetrieveToolsRequest { /** * Optional. The identifiers of the tools to retrieve from the toolset. If * empty, all tools in the toolset will be returned. */ toolIds?: string[]; } /** * Response message for ToolService.RetrieveTools. */ export interface RetrieveToolsResponse { /** * The list of tools that are included in the specified toolset. */ tools?: Tool[]; } function serializeRetrieveToolsResponse(data: any): RetrieveToolsResponse { return { ...data, tools: data["tools"] !== undefined ? data["tools"].map((item: any) => (serializeTool(item))) : undefined, }; } function deserializeRetrieveToolsResponse(data: any): RetrieveToolsResponse { return { ...data, tools: data["tools"] !== undefined ? data["tools"].map((item: any) => (deserializeTool(item))) : undefined, }; } /** * Request message for SessionService.RunSession. */ export interface RunSessionRequest { /** * Required. The configuration for the session. */ config?: SessionConfig; /** * Required. Inputs for the session. */ inputs?: SessionInput[]; } function serializeRunSessionRequest(data: any): RunSessionRequest { return { ...data, config: data["config"] !== undefined ? serializeSessionConfig(data["config"]) : undefined, inputs: data["inputs"] !== undefined ? data["inputs"].map((item: any) => (serializeSessionInput(item))) : undefined, }; } function deserializeRunSessionRequest(data: any): RunSessionRequest { return { ...data, config: data["config"] !== undefined ? deserializeSessionConfig(data["config"]) : undefined, inputs: data["inputs"] !== undefined ? data["inputs"].map((item: any) => (deserializeSessionInput(item))) : undefined, }; } /** * Response message for SessionService.RunSession. */ export interface RunSessionResponse { /** * Outputs for the session. */ outputs?: SessionOutput[]; } function serializeRunSessionResponse(data: any): RunSessionResponse { return { ...data, outputs: data["outputs"] !== undefined ? data["outputs"].map((item: any) => (serializeSessionOutput(item))) : undefined, }; } function deserializeRunSessionResponse(data: any): RunSessionResponse { return { ...data, outputs: data["outputs"] !== undefined ? data["outputs"].map((item: any) => (deserializeSessionOutput(item))) : undefined, }; } /** * Represents a select subset of an OpenAPI 3.0 schema object. */ export interface Schema { /** * Optional. Can either be a boolean or an object, controls the presence of * additional properties. */ additionalProperties?: Schema; /** * Optional. The value should be validated against any (one or more) of the * subschemas in the list. */ anyOf?: Schema[]; /** * Optional. Default value of the data. */ default?: any; /** * Optional. A map of definitions for use by `ref`. Only allowed at the root * of the schema. */ defs?: { [key: string]: Schema }; /** * Optional. The description of the data. */ description?: string; /** * Optional. Possible values of the element of primitive type with enum * format. Examples: 1. We can define direction as : {type:STRING, * format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define * apartment number as : {type:INTEGER, format:enum, enum:["101", "201", * "301"]} */ enum?: string[]; /** * Optional. Schema of the elements of Type.ARRAY. */ items?: Schema; /** * Optional. Maximum value for Type.INTEGER and Type.NUMBER. */ maximum?: number; /** * Optional. Maximum number of the elements for Type.ARRAY. */ maxItems?: bigint; /** * Optional. Minimum value for Type.INTEGER and Type.NUMBER. */ minimum?: number; /** * Optional. Minimum number of the elements for Type.ARRAY. */ minItems?: bigint; /** * Optional. Indicates if the value may be null. */ nullable?: boolean; /** * Optional. Schemas of initial elements of Type.ARRAY. */ prefixItems?: Schema[]; /** * Optional. Properties of Type.OBJECT. */ properties?: { [key: string]: Schema }; /** * Optional. Allows indirect references between schema nodes. The value * should be a valid reference to a child of the root `defs`. For example, the * following schema defines a reference to a schema node named "Pet": ``` * type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object * properties: name: type: string ``` The value of the "pet" property is a * reference to the schema node named "Pet". See details in * https://json-schema.org/understanding-json-schema/structuring. */ ref?: string; /** * Optional. Required properties of Type.OBJECT. */ required?: string[]; /** * Optional. The title of the schema. */ title?: string; /** * Required. The type of the data. */ type?: | "TYPE_UNSPECIFIED" | "STRING" | "INTEGER" | "NUMBER" | "BOOLEAN" | "OBJECT" | "ARRAY"; /** * Optional. Indicate the items in the array must be unique. Only applies to * TYPE.ARRAY. */ uniqueItems?: boolean; } function serializeSchema(data: any): Schema { return { ...data, additionalProperties: data["additionalProperties"] !== undefined ? serializeSchema(data["additionalProperties"]) : undefined, anyOf: data["anyOf"] !== undefined ? data["anyOf"].map((item: any) => (serializeSchema(item))) : undefined, defs: data["defs"] !== undefined ? Object.fromEntries(Object.entries(data["defs"]).map(([k, v]: [string, any]) => ([k, serializeSchema(v)]))) : undefined, items: data["items"] !== undefined ? serializeSchema(data["items"]) : undefined, maxItems: data["maxItems"] !== undefined ? String(data["maxItems"]) : undefined, minItems: data["minItems"] !== undefined ? String(data["minItems"]) : undefined, prefixItems: data["prefixItems"] !== undefined ? data["prefixItems"].map((item: any) => (serializeSchema(item))) : undefined, properties: data["properties"] !== undefined ? Object.fromEntries(Object.entries(data["properties"]).map(([k, v]: [string, any]) => ([k, serializeSchema(v)]))) : undefined, }; } function deserializeSchema(data: any): Schema { return { ...data, additionalProperties: data["additionalProperties"] !== undefined ? deserializeSchema(data["additionalProperties"]) : undefined, anyOf: data["anyOf"] !== undefined ? data["anyOf"].map((item: any) => (deserializeSchema(item))) : undefined, defs: data["defs"] !== undefined ? Object.fromEntries(Object.entries(data["defs"]).map(([k, v]: [string, any]) => ([k, deserializeSchema(v)]))) : undefined, items: data["items"] !== undefined ? deserializeSchema(data["items"]) : undefined, maxItems: data["maxItems"] !== undefined ? BigInt(data["maxItems"]) : undefined, minItems: data["minItems"] !== undefined ? BigInt(data["minItems"]) : undefined, prefixItems: data["prefixItems"] !== undefined ? data["prefixItems"].map((item: any) => (deserializeSchema(item))) : undefined, properties: data["properties"] !== undefined ? Object.fromEntries(Object.entries(data["properties"]).map(([k, v]: [string, any]) => ([k, deserializeSchema(v)]))) : undefined, }; } /** * Project/Location level security settings for CES. */ export interface SecuritySettings { /** * Output only. Create time of the security settings. */ readonly createTime?: Date; /** * Optional. Endpoint control related settings. */ endpointControlPolicy?: EndpointControlPolicy; /** * Output only. Etag of the security settings. */ readonly etag?: string; /** * Identifier. The unique identifier of the security settings. Format: * `projects/{project}/locations/{location}/securitySettings` */ name?: string; /** * Output only. Last update time of the security settings. */ readonly updateTime?: Date; } /** * Configurations for authentication using a custom service account. */ export interface ServiceAccountAuthConfig { /** * Optional. The OAuth scopes to grant. If not specified, the default scope * `https://www.googleapis.com/auth/cloud-platform` is used. */ scopes?: string[]; /** * Required. The email address of the service account used for * authentication. CES uses this service account to exchange an access token * and the access token is then sent in the `Authorization` header of the * request. The service account must have the * `roles/iam.serviceAccountTokenCreator` role granted to the CES service * agent `service-@gcp-sa-ces.iam.gserviceaccount.com`. */ serviceAccount?: string; } /** * Configurations for authentication with [ID * token](https://cloud.google.com/docs/authentication/token-types#id) generated * from service agent. */ export interface ServiceAgentIdTokenAuthConfig { } /** * Configuration for tools using Service Directory. */ export interface ServiceDirectoryConfig { /** * Required. The name of [Service * Directory](https://cloud.google.com/service-directory) service. Format: * `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}`. * Location of the service directory must be the same as the location of the * app. */ service?: string; } /** * The configuration for the session. */ export interface SessionConfig { /** * Optional. The deployment of the app to use for the session. Format: * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` */ deployment?: string; /** * Optional. Whether to enable streaming text outputs from the model. By * default, text outputs from the model are collected before sending to the * client. NOTE: This is only supported for text (non-voice) sessions via * StreamRunSession or BidiRunSession. */ enableTextStreaming?: boolean; /** * Optional. The entry agent to handle the session. If not specified, the * session will be handled by the root agent of the app. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ entryAgent?: string; /** * Optional. The historical context of the session, including user inputs, * agent responses, and other messages. Typically, CES agent would manage * session automatically so client doesn't need to explicitly populate this * field. However, client can optionally override the historical contexts to * force the session start from certain state. */ historicalContexts?: Message[]; /** * Optional. Configuration for processing the input audio. */ inputAudioConfig?: InputAudioConfig; /** * Optional. Configuration for generating the output audio. */ outputAudioConfig?: OutputAudioConfig; /** * Optional. * [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) * to send to the remote * [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) * agent when the session control is transferred to the remote agent. */ remoteDialogflowQueryParameters?: SessionConfigRemoteDialogflowQueryParameters; /** * Optional. The time zone of the user. If provided, the agent will use the * time zone for date and time related variables. Otherwise, the agent will * use the time zone specified in the App.time_zone_settings. The format is * the IANA Time Zone Database time zone, e.g. "America/Los_Angeles". */ timeZone?: string; /** * Optional. Whether to use tool fakes for the session. If this field is set, * the agent will attempt use tool fakes instead of calling the real tools. */ useToolFakes?: boolean; } function serializeSessionConfig(data: any): SessionConfig { return { ...data, historicalContexts: data["historicalContexts"] !== undefined ? data["historicalContexts"].map((item: any) => (serializeMessage(item))) : undefined, }; } function deserializeSessionConfig(data: any): SessionConfig { return { ...data, historicalContexts: data["historicalContexts"] !== undefined ? data["historicalContexts"].map((item: any) => (deserializeMessage(item))) : undefined, }; } /** * * [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) * to send to the remote * [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) * agent when the session control is transferred to the remote agent. */ export interface SessionConfigRemoteDialogflowQueryParameters { /** * Optional. The end user metadata to be sent in * [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). */ endUserMetadata?: { [key: string]: any }; /** * Optional. The payload to be sent in * [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). */ payload?: { [key: string]: any }; /** * Optional. The HTTP headers to be sent as webhook_headers in * [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). */ webhookHeaders?: { [key: string]: string }; } /** * Input for the session. */ export interface SessionInput { /** * Optional. Audio data from the end user. */ audio?: Uint8Array; /** * Optional. Blob data from the end user. */ blob?: Blob; /** * Optional. DTMF digits from the end user. */ dtmf?: string; /** * Optional. Event input. */ event?: Event; /** * Optional. Image data from the end user. */ image?: Image; /** * Optional. Text data from the end user. */ text?: string; /** * Optional. Execution results for the tool calls from the client. */ toolResponses?: ToolResponses; /** * Optional. Contextual variables for the session, keyed by name. Only * variables declared in the app will be used by the CES agent. Unrecognized * variables will still be sent to the Dialogflow agent as additional session * parameters. */ variables?: { [key: string]: any }; /** * Optional. A flag to indicate if the current message is a fragment of a * larger input in the bidi streaming session. When set to `true`, the agent * defers processing until it receives a subsequent message where * `will_continue` is `false`, or until the system detects an endpoint in the * audio input. NOTE: This field does not apply to audio and DTMF inputs, as * they are always processed automatically based on the endpointing signal. */ willContinue?: boolean; } function serializeSessionInput(data: any): SessionInput { return { ...data, audio: data["audio"] !== undefined ? encodeBase64(data["audio"]) : undefined, blob: data["blob"] !== undefined ? serializeBlob(data["blob"]) : undefined, image: data["image"] !== undefined ? serializeImage(data["image"]) : undefined, }; } function deserializeSessionInput(data: any): SessionInput { return { ...data, audio: data["audio"] !== undefined ? decodeBase64(data["audio"] as string) : undefined, blob: data["blob"] !== undefined ? deserializeBlob(data["blob"]) : undefined, image: data["image"] !== undefined ? deserializeImage(data["image"]) : undefined, }; } /** * Output for the session. */ export interface SessionOutput { /** * Output audio from the CES agent. */ audio?: Uint8Array; /** * Citations that provide the source information for the agent's generated * text. */ citations?: Citations; /** * Optional. Diagnostic information contains execution details during the * processing of the input. Only populated in the last SessionOutput (with * `turn_completed=true`) for each turn. */ diagnosticInfo?: SessionOutputDiagnosticInfo; /** * Indicates the session has ended. */ endSession?: EndSession; /** * The suggestions returned from Google Search as a result of invoking the * GoogleSearchTool. */ googleSearchSuggestions?: GoogleSearchSuggestions; /** * Custom payload with structured output from the CES agent. */ payload?: { [key: string]: any }; /** * Output text from the CES agent. */ text?: string; /** * Request for the client to execute the tools. */ toolCalls?: ToolCalls; /** * If true, the CES agent has detected the end of the current conversation * turn and will provide no further output for this turn. */ turnCompleted?: boolean; /** * Indicates the sequential order of conversation turn to which this output * belongs to, starting from 1. */ turnIndex?: number; } function serializeSessionOutput(data: any): SessionOutput { return { ...data, audio: data["audio"] !== undefined ? encodeBase64(data["audio"]) : undefined, diagnosticInfo: data["diagnosticInfo"] !== undefined ? serializeSessionOutputDiagnosticInfo(data["diagnosticInfo"]) : undefined, }; } function deserializeSessionOutput(data: any): SessionOutput { return { ...data, audio: data["audio"] !== undefined ? decodeBase64(data["audio"] as string) : undefined, diagnosticInfo: data["diagnosticInfo"] !== undefined ? deserializeSessionOutputDiagnosticInfo(data["diagnosticInfo"]) : undefined, }; } /** * Contains execution details during the processing. */ export interface SessionOutputDiagnosticInfo { /** * List of the messages that happened during the processing. */ messages?: Message[]; /** * A trace of the entire request processing, represented as a root span. This * span can contain nested child spans for specific operations. */ rootSpan?: Span; } function serializeSessionOutputDiagnosticInfo(data: any): SessionOutputDiagnosticInfo { return { ...data, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (serializeMessage(item))) : undefined, }; } function deserializeSessionOutputDiagnosticInfo(data: any): SessionOutputDiagnosticInfo { return { ...data, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (deserializeMessage(item))) : undefined, }; } /** * A span is a unit of work or a single operation during the request * processing. */ export interface Span { /** * Output only. Key-value attributes associated with the span. */ readonly attributes?: { [key: string]: any }; /** * Output only. The child spans that are nested under this span. */ readonly childSpans?: Span[]; /** * Output only. The duration of the span. */ readonly duration?: number /* Duration */; /** * Output only. The end time of the span. */ readonly endTime?: Date; /** * Output only. The name of the span. */ readonly name?: string; /** * Output only. The start time of the span. */ readonly startTime?: Date; } /** * 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). */ export interface Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ details?: { [key: string]: any }[]; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ message?: string; } /** * Configuration for how the agent response should be synthesized. */ export interface SynthesizeSpeechConfig { /** * Optional. The speaking rate/speed in the range [0.25, 2.0]. 1.0 is the * normal native speed supported by the specific voice. 2.0 is twice as fast, * and 0.5 is half as fast. Values outside of the range [0.25, 2.0] will * return an error. */ speakingRate?: number; /** * Optional. The name of the voice. If not set, the service will choose a * voice based on the other parameters such as language_code. For the list of * available voices, please refer to [Supported voices and * languages](https://cloud.google.com/text-to-speech/docs/voices) from Cloud * Text-to-Speech. */ voice?: string; } /** * Pre-defined system tool. */ export interface SystemTool { /** * Output only. The description of the system tool. */ readonly description?: string; /** * Required. The name of the system tool. */ name?: string; } /** * TimeZone settings of the app. */ export interface TimeZoneSettings { /** * Optional. The time zone of the app from the [time zone * database](https://www.iana.org/time-zones), e.g., America/Los_Angeles, * Europe/Paris. */ timeZone?: string; } /** * The TLS configuration. */ export interface TlsConfig { /** * Required. Specifies a list of allowed custom CA certificates for HTTPS * verification. */ caCerts?: TlsConfigCaCert[]; } function serializeTlsConfig(data: any): TlsConfig { return { ...data, caCerts: data["caCerts"] !== undefined ? data["caCerts"].map((item: any) => (serializeTlsConfigCaCert(item))) : undefined, }; } function deserializeTlsConfig(data: any): TlsConfig { return { ...data, caCerts: data["caCerts"] !== undefined ? data["caCerts"].map((item: any) => (deserializeTlsConfigCaCert(item))) : undefined, }; } /** * The CA certificate. */ export interface TlsConfigCaCert { /** * Required. The allowed custom CA certificates (in DER format) for HTTPS * verification. This overrides the default SSL trust store. If this is empty * or unspecified, CES will use Google's default trust store to verify * certificates. N.B. Make sure the HTTPS server certificates are signed with * "subject alt name". For instance a certificate can be self-signed using the * following command: ``` openssl x509 -req -days 200 -in example.com.csr \ * -signkey example.com.key \ -out example.com.crt \ -extfile <(printf * "\nsubjectAltName='DNS:www.example.com'") ``` */ cert?: Uint8Array; /** * Required. The name of the allowed custom CA certificates. This can be used * to disambiguate the custom CA certificates. */ displayName?: string; } function serializeTlsConfigCaCert(data: any): TlsConfigCaCert { return { ...data, cert: data["cert"] !== undefined ? encodeBase64(data["cert"]) : undefined, }; } function deserializeTlsConfigCaCert(data: any): TlsConfigCaCert { return { ...data, cert: data["cert"] !== undefined ? decodeBase64(data["cert"] as string) : undefined, }; } /** * A tool represents an action that the CES agent can take to achieve certain * goals. */ export interface Tool { /** * Optional. The agent tool. */ agentTool?: AgentTool; /** * Optional. The client function. */ clientFunction?: ClientFunction; /** * Optional. The Integration Connector tool. */ connectorTool?: ConnectorTool; /** * Output only. Timestamp when the tool was created. */ readonly createTime?: Date; /** * Optional. The data store tool. */ dataStoreTool?: DataStoreTool; /** * Output only. The display name of the tool, derived based on the tool's * type. For example, display name of a ClientFunction is derived from its * `name` property. */ readonly displayName?: string; /** * Etag used to ensure the object hasn't changed during a read-modify-write * operation. If the etag is empty, the update will overwrite any concurrent * changes. */ etag?: string; /** * Optional. The execution type of the tool. */ executionType?: | "EXECUTION_TYPE_UNSPECIFIED" | "SYNCHRONOUS" | "ASYNCHRONOUS"; /** * Optional. The file search tool. */ fileSearchTool?: FileSearchTool; /** * Output only. If the tool is generated by the LLM assistant, this field * contains a descriptive summary of the generation. */ readonly generatedSummary?: string; /** * Optional. The google search tool. */ googleSearchTool?: GoogleSearchTool; /** * Optional. The MCP tool. An MCP tool cannot be created or updated directly * and is managed by the MCP toolset. */ mcpTool?: McpTool; /** * Identifier. The resource name of the tool. Format: * * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` for * standalone tools. * * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}/tools/{tool}` * for tools retrieved from a toolset. These tools are dynamic and * output-only; they cannot be referenced directly where a tool is expected. */ name?: string; /** * Optional. The open API tool. */ openApiTool?: OpenApiTool; /** * Optional. The python function tool. */ pythonFunction?: PythonFunction; /** * Optional. The system tool. */ systemTool?: SystemTool; /** * Optional. Configuration for tool behavior in fake mode. */ toolFakeConfig?: ToolFakeConfig; /** * Output only. Timestamp when the tool was last updated. */ readonly updateTime?: Date; /** * Optional. The widget tool. */ widgetTool?: WidgetTool; } function serializeTool(data: any): Tool { return { ...data, clientFunction: data["clientFunction"] !== undefined ? serializeClientFunction(data["clientFunction"]) : undefined, mcpTool: data["mcpTool"] !== undefined ? serializeMcpTool(data["mcpTool"]) : undefined, openApiTool: data["openApiTool"] !== undefined ? serializeOpenApiTool(data["openApiTool"]) : undefined, widgetTool: data["widgetTool"] !== undefined ? serializeWidgetTool(data["widgetTool"]) : undefined, }; } function deserializeTool(data: any): Tool { return { ...data, clientFunction: data["clientFunction"] !== undefined ? deserializeClientFunction(data["clientFunction"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, mcpTool: data["mcpTool"] !== undefined ? deserializeMcpTool(data["mcpTool"]) : undefined, openApiTool: data["openApiTool"] !== undefined ? deserializeOpenApiTool(data["openApiTool"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, widgetTool: data["widgetTool"] !== undefined ? deserializeWidgetTool(data["widgetTool"]) : undefined, }; } /** * Request for the client or the agent to execute the specified tool. */ export interface ToolCall { /** * Optional. The input parameters and values for the tool in JSON object * format. */ args?: { [key: string]: any }; /** * Output only. Display name of the tool. */ readonly displayName?: string; /** * Optional. The unique identifier of the tool call. If populated, the client * should return the execution result with the matching ID in ToolResponse. */ id?: string; /** * Optional. The name of the tool to execute. Format: * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` */ tool?: string; /** * Optional. The toolset tool to execute. */ toolsetTool?: ToolsetTool; } /** * Request for the client to execute the tools and return the execution results * before continuing the session. */ export interface ToolCalls { /** * Optional. The list of tool calls to execute. */ toolCalls?: ToolCall[]; } /** * Configuration for tool behavior in fake mode. */ export interface ToolFakeConfig { /** * Optional. Code block which will be executed instead of a real tool call. */ codeBlock?: CodeBlock; /** * Optional. Whether the tool is using fake mode. */ enableFakeMode?: boolean; } /** * The execution result of a specific tool from the client or the agent. */ export interface ToolResponse { /** * Output only. Display name of the tool. */ readonly displayName?: string; /** * Optional. The matching ID of the tool call the response is for. */ id?: string; /** * Required. The tool execution result in JSON object format. Use "output" * key to specify tool response and "error" key to specify error details (if * any). If "output" and "error" keys are not specified, then whole "response" * is treated as tool execution result. */ response?: { [key: string]: any }; /** * Optional. The name of the tool to execute. Format: * `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` */ tool?: string; /** * Optional. The toolset tool that got executed. */ toolsetTool?: ToolsetTool; } /** * Execution results for the requested tool calls from the client. */ export interface ToolResponses { /** * Optional. The list of tool execution results. */ toolResponses?: ToolResponse[]; } /** * A toolset represents a group of dynamically managed tools that can be used * by the agent. */ export interface Toolset { /** * Optional. A toolset that generates tools from an Integration Connectors * Connection. */ connectorToolset?: ConnectorToolset; /** * Output only. Timestamp when the toolset was created. */ readonly createTime?: Date; /** * Optional. The description of the toolset. */ description?: string; /** * Optional. The display name of the toolset. Must be unique within the same * app. */ displayName?: string; /** * ETag used to ensure the object hasn't changed during a read-modify-write * operation. If the etag is empty, the update will overwrite any concurrent * changes. */ etag?: string; /** * Optional. The execution type of the tools in the toolset. */ executionType?: | "EXECUTION_TYPE_UNSPECIFIED" | "SYNCHRONOUS" | "ASYNCHRONOUS"; /** * Optional. A toolset that contains a list of tools that are offered by the * MCP server. */ mcpToolset?: McpToolset; /** * Identifier. The unique identifier of the toolset. Format: * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` */ name?: string; /** * Optional. A toolset that contains a list of tools that are defined by an * OpenAPI schema. */ openApiToolset?: OpenApiToolset; /** * Optional. Configuration for tools behavior in fake mode. */ toolFakeConfig?: ToolFakeConfig; /** * Output only. Timestamp when the toolset was last updated. */ readonly updateTime?: Date; } function serializeToolset(data: any): Toolset { return { ...data, mcpToolset: data["mcpToolset"] !== undefined ? serializeMcpToolset(data["mcpToolset"]) : undefined, openApiToolset: data["openApiToolset"] !== undefined ? serializeOpenApiToolset(data["openApiToolset"]) : undefined, }; } function deserializeToolset(data: any): Toolset { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, mcpToolset: data["mcpToolset"] !== undefined ? deserializeMcpToolset(data["mcpToolset"]) : undefined, openApiToolset: data["openApiToolset"] !== undefined ? deserializeOpenApiToolset(data["openApiToolset"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * A tool that is created from a toolset. */ export interface ToolsetTool { /** * Optional. The tool ID to filter the tools to retrieve the schema for. */ toolId?: string; /** * Required. The resource name of the Toolset from which this tool is * derived. Format: * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` */ toolset?: string; } /** * Rule for transferring to a specific agent. */ export interface TransferRule { /** * Required. The resource name of the child agent the rule applies to. * Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ childAgent?: string; /** * Optional. A rule that immediately transfers to the target agent when the * condition is met. */ deterministicTransfer?: TransferRuleDeterministicTransfer; /** * Required. The direction of the transfer. */ direction?: | "DIRECTION_UNSPECIFIED" | "PARENT_TO_CHILD" | "CHILD_TO_PARENT"; /** * Optional. Rule that prevents the planner from transferring to the target * agent. */ disablePlannerTransfer?: TransferRuleDisablePlannerTransfer; } /** * Deterministic transfer rule. When the condition evaluates to true, the * transfer occurs. */ export interface TransferRuleDeterministicTransfer { /** * Optional. A rule that evaluates a session state condition. If the * condition evaluates to true, the transfer occurs. */ expressionCondition?: ExpressionCondition; /** * Optional. A rule that uses Python code block to evaluate the conditions. * If the condition evaluates to true, the transfer occurs. */ pythonCodeCondition?: PythonCodeCondition; } /** * A rule that prevents the planner from transferring to the target agent. */ export interface TransferRuleDisablePlannerTransfer { /** * Required. If the condition evaluates to true, planner will not be allowed * to transfer to the target agent. */ expressionCondition?: ExpressionCondition; } /** * Action that is taken when a certain precondition is met. */ export interface TriggerAction { /** * Optional. Respond with a generative answer. */ generativeAnswer?: TriggerActionGenerativeAnswer; /** * Optional. Immediately respond with a preconfigured response. */ respondImmediately?: TriggerActionRespondImmediately; /** * Optional. Transfer the conversation to a different agent. */ transferAgent?: TriggerActionTransferAgent; } /** * The agent will immediately respond with a generative answer. */ export interface TriggerActionGenerativeAnswer { /** * Required. The prompt to use for the generative answer. */ prompt?: string; } /** * The agent will immediately respond with a preconfigured response. */ export interface TriggerActionRespondImmediately { /** * Required. The canned responses for the agent to choose from. The response * is chosen randomly. */ responses?: TriggerActionResponse[]; } /** * Represents a response from the agent. */ export interface TriggerActionResponse { /** * Optional. Whether the response is disabled. Disabled responses are not * used by the agent. */ disabled?: boolean; /** * Required. Text for the agent to respond with. */ text?: string; } /** * The agent will transfer the conversation to a different agent. */ export interface TriggerActionTransferAgent { /** * Required. The name of the agent to transfer the conversation to. The agent * must be in the same app as the current agent. Format: * `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` */ agent?: string; } /** * Represents a single web search query and its associated search uri. */ export interface WebSearchQuery { /** * The search query text. */ query?: string; /** * The URI to the Google Search results page for the query. */ uri?: string; } /** * Represents a widget tool that the agent can invoke. When the tool is chosen * by the agent, agent will return the widget to the client. The client is * responsible for processing the widget and generating the next user query to * continue the interaction with the agent. */ export interface WidgetTool { /** * Optional. The mapping that defines how data from a source tool is mapped * to the widget's input parameters. */ dataMapping?: WidgetToolDataMapping; /** * Optional. The description of the widget tool. */ description?: string; /** * Required. The display name of the widget tool. */ name?: string; /** * Optional. The input parameters of the widget tool. */ parameters?: Schema; /** * Optional. Configuration for rendering the widget. */ uiConfig?: { [key: string]: any }; /** * Optional. The type of the widget tool. If not specified, the default type * will be CUSTOMIZED. */ widgetType?: | "WIDGET_TYPE_UNSPECIFIED" | "CUSTOM" | "PRODUCT_CAROUSEL" | "PRODUCT_DETAILS" | "QUICK_ACTIONS" | "PRODUCT_COMPARISON" | "ADVANCED_PRODUCT_DETAILS" | "SHORT_FORM" | "OVERALL_SATISFACTION" | "ORDER_SUMMARY" | "APPOINTMENT_DETAILS" | "APPOINTMENT_SCHEDULER" | "CONTACT_FORM"; } function serializeWidgetTool(data: any): WidgetTool { return { ...data, parameters: data["parameters"] !== undefined ? serializeSchema(data["parameters"]) : undefined, }; } function deserializeWidgetTool(data: any): WidgetTool { return { ...data, parameters: data["parameters"] !== undefined ? deserializeSchema(data["parameters"]) : undefined, }; } /** * Configuration for mapping data from a source tool to the widget's input * parameters. */ export interface WidgetToolDataMapping { /** * Optional. A map of widget input parameter fields to the corresponding * output fields of the source tool. */ fieldMappings?: { [key: string]: string }; /** * Optional. The mode of the data mapping. */ mode?: | "MODE_UNSPECIFIED" | "FIELD_MAPPING" | "PYTHON_SCRIPT"; /** * Optional. Configuration for a Python function used to transform the source * tool's output into the widget's input format. */ pythonFunction?: PythonFunction; /** * Deprecated: Use `python_function` instead. */ pythonScript?: string; /** * Optional. The resource name of the tool that provides the data for the * widget (e.g., a search tool or a custom function). Format: * `projects/{project}/locations/{location}/agents/{agent}/tools/{tool}` */ sourceToolName?: string; } function decodeBase64(b64: string): Uint8Array { const binString = atob(b64); const size = binString.length; const bytes = new Uint8Array(size); for (let i = 0; i < size; i++) { bytes[i] = binString.charCodeAt(i); } return bytes; } const base64abc = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"]; /** * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation * @param data */ function encodeBase64(uint8: Uint8Array): string { let result = "", i; const l = uint8.length; for (i = 2; i < l; i += 3) { result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; result += base64abc[uint8[i] & 0x3f]; } if (i === l + 1) { // 1 octet yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[(uint8[i - 2] & 0x03) << 4]; result += "=="; } if (i === l) { // 2 octets yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[(uint8[i - 1] & 0x0f) << 2]; result += "="; } return result; }