// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Discovery Engine API Client for Deno * ==================================== * * Discovery Engine API. * * Docs: https://cloud.google.com/generative-ai-app-builder/docs/ * Source: https://googleapis.deno.dev/v1/discoveryengine:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Discovery Engine API. */ export class DiscoveryEngine { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://discoveryengine.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * 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 projectsLocationsCollectionsDataConnectorOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataConnectorOperationsList(name: string, opts: ProjectsLocationsCollectionsDataConnectorOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Gets index freshness metadata for Documents. Supported for website search * only. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. */ async projectsLocationsCollectionsDataStoresBranchesBatchGetDocumentsMetadata(parent: string, opts: ProjectsLocationsCollectionsDataStoresBranchesBatchGetDocumentsMetadataOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/batchGetDocumentsMetadata`); if (opts["matcher.fhirMatcher.fhirResources"] !== undefined) { url.searchParams.append("matcher.fhirMatcher.fhirResources", String(opts["matcher.fhirMatcher.fhirResources"])); } if (opts["matcher.urisMatcher.uris"] !== undefined) { url.searchParams.append("matcher.urisMatcher.uris", String(opts["matcher.urisMatcher.uris"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponse(data); } /** * Creates a Document. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. */ async projectsLocationsCollectionsDataStoresBranchesDocumentsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Document, opts: ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Document(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/documents`); if (opts.documentId !== undefined) { url.searchParams.append("documentId", String(opts.documentId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Document(data); } /** * Deletes a Document. * * @param name Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned. */ async projectsLocationsCollectionsDataStoresBranchesDocumentsDelete(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 GoogleProtobufEmpty; } /** * Gets a Document. * * @param name Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned. */ async projectsLocationsCollectionsDataStoresBranchesDocumentsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Document(data); } /** * Bulk import of multiple Documents. Request processing may be synchronous. * Non-existing items are created. Note: It is possible for a subset of the * Documents to be successfully updated. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission. */ async projectsLocationsCollectionsDataStoresBranchesDocumentsImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportDocumentsRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ImportDocumentsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/documents:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Gets a list of Documents. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned. */ async projectsLocationsCollectionsDataStoresBranchesDocumentsList(parent: string, opts: ProjectsLocationsCollectionsDataStoresBranchesDocumentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/documents`); 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 deserializeGoogleCloudDiscoveryengineV1ListDocumentsResponse(data); } /** * Updates a Document. * * @param name Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. */ async projectsLocationsCollectionsDataStoresBranchesDocumentsPatch(name: string, req: GoogleCloudDiscoveryengineV1Document, opts: ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Document(req); opts = serializeProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } 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 deserializeGoogleCloudDiscoveryengineV1Document(data); } /** * Permanently deletes all selected Documents in a branch. This process is * asynchronous. Depending on the number of Documents to be deleted, this * operation can take hours to complete. Before the delete operation * completes, some Documents might still be returned by * DocumentService.GetDocument or DocumentService.ListDocuments. To get a list * of the Documents to be deleted, set PurgeDocumentsRequest.force to false. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. */ async projectsLocationsCollectionsDataStoresBranchesDocumentsPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeDocumentsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/documents:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataStoresBranchesOperationsCancel(name: string, req: GoogleLongrunningCancelOperationRequest): 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 GoogleProtobufEmpty; } /** * 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 projectsLocationsCollectionsDataStoresBranchesOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataStoresBranchesOperationsList(name: string, opts: ProjectsLocationsCollectionsDataStoresBranchesOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Completes the specified user input with keyword suggestions. * * @param dataStore Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. */ async projectsLocationsCollectionsDataStoresCompleteQuery(dataStore: string, opts: ProjectsLocationsCollectionsDataStoresCompleteQueryOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ dataStore }:completeQuery`); if (opts.includeTailSuggestions !== undefined) { url.searchParams.append("includeTailSuggestions", String(opts.includeTailSuggestions)); } if (opts.query !== undefined) { url.searchParams.append("query", String(opts.query)); } if (opts.queryModel !== undefined) { url.searchParams.append("queryModel", String(opts.queryModel)); } if (opts.userPseudoId !== undefined) { url.searchParams.append("userPseudoId", String(opts.userPseudoId)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleCloudDiscoveryengineV1CompleteQueryResponse; } /** * Imports CompletionSuggestions for a DataStore. * * @param parent Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*` */ async projectsLocationsCollectionsDataStoresCompletionSuggestionsImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/completionSuggestions:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Permanently deletes all CompletionSuggestions for a DataStore. * * @param parent Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*. */ async projectsLocationsCollectionsDataStoresCompletionSuggestionsPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/completionSuggestions:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Creates a Control. By default 1000 controls are allowed for a data store. * A request can be submitted to adjust this limit. If the Control to create * already exists, an ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` or `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. */ async projectsLocationsCollectionsDataStoresControlsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Control, opts: ProjectsLocationsCollectionsDataStoresControlsCreateOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Control(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/controls`); if (opts.controlId !== undefined) { url.searchParams.append("controlId", String(opts.controlId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Deletes a Control. If the Control to delete does not exist, a NOT_FOUND * error is returned. * * @param name Required. The resource name of the Control to delete. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` */ async projectsLocationsCollectionsDataStoresControlsDelete(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 GoogleProtobufEmpty; } /** * Gets a Control. * * @param name Required. The resource name of the Control to get. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` */ async projectsLocationsCollectionsDataStoresControlsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Lists all Controls by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` or `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. */ async projectsLocationsCollectionsDataStoresControlsList(parent: string, opts: ProjectsLocationsCollectionsDataStoresControlsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/controls`); 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 deserializeGoogleCloudDiscoveryengineV1ListControlsResponse(data); } /** * Updates a Control. Control action type cannot be changed. If the Control * to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/*/locations/global/dataStore/*/controls/*` */ async projectsLocationsCollectionsDataStoresControlsPatch(name: string, req: GoogleCloudDiscoveryengineV1Control, opts: ProjectsLocationsCollectionsDataStoresControlsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Control(req); opts = serializeProjectsLocationsCollectionsDataStoresControlsPatchOptions(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 deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Converses a conversation. * * @param name Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session. */ async projectsLocationsCollectionsDataStoresConversationsConverse(name: string, req: GoogleCloudDiscoveryengineV1ConverseConversationRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ConverseConversationRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:converse`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1ConverseConversationResponse(data); } /** * Creates a Conversation. If the Conversation to create already exists, an * ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsDataStoresConversationsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Conversation): Promise { req = serializeGoogleCloudDiscoveryengineV1Conversation(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Deletes a Conversation. If the Conversation to delete does not exist, a * NOT_FOUND error is returned. * * @param name Required. The resource name of the Conversation to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` */ async projectsLocationsCollectionsDataStoresConversationsDelete(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 GoogleProtobufEmpty; } /** * Gets a Conversation. * * @param name Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` */ async projectsLocationsCollectionsDataStoresConversationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Lists all Conversations by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsDataStoresConversationsList(parent: string, opts: ProjectsLocationsCollectionsDataStoresConversationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations`); 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 deserializeGoogleCloudDiscoveryengineV1ListConversationsResponse(data); } /** * Updates a Conversation. Conversation action type cannot be changed. If the * Conversation to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. */ async projectsLocationsCollectionsDataStoresConversationsPatch(name: string, req: GoogleCloudDiscoveryengineV1Conversation, opts: ProjectsLocationsCollectionsDataStoresConversationsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Conversation(req); opts = serializeProjectsLocationsCollectionsDataStoresConversationsPatchOptions(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 deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Creates a DataStore. DataStore is for storing Documents. To serve these * documents for Search, or Recommendation use case, an Engine needs to be * created separately. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}`. */ async projectsLocationsCollectionsDataStoresCreate(parent: string, req: GoogleCloudDiscoveryengineV1DataStore, opts: ProjectsLocationsCollectionsDataStoresCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/dataStores`); if (opts.cmekConfigName !== undefined) { url.searchParams.append("cmekConfigName", String(opts.cmekConfigName)); } if (opts.createAdvancedSiteSearch !== undefined) { url.searchParams.append("createAdvancedSiteSearch", String(opts.createAdvancedSiteSearch)); } if (opts.dataStoreId !== undefined) { url.searchParams.append("dataStoreId", String(opts.dataStoreId)); } if (opts.disableCmek !== undefined) { url.searchParams.append("disableCmek", String(opts.disableCmek)); } if (opts.skipDefaultSchemaCreation !== undefined) { url.searchParams.append("skipDefaultSchemaCreation", String(opts.skipDefaultSchemaCreation)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Gets a list of all the custom models. * * @param dataStore Required. The resource name of the parent Data Store, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. This field is used to identify the data store where to fetch the models from. */ async projectsLocationsCollectionsDataStoresCustomModelsList(dataStore: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ dataStore }/customModels`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1ListCustomModelsResponse(data); } /** * Deletes a DataStore. * * @param name Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. If the caller does not have permission to delete the DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the DataStore to delete does not exist, a NOT_FOUND error is returned. */ async projectsLocationsCollectionsDataStoresDelete(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 GoogleLongrunningOperation; } /** * Gets a DataStore. * * @param name Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. If the caller does not have permission to access the DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested DataStore does not exist, a NOT_FOUND error is returned. */ async projectsLocationsCollectionsDataStoresGet(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 GoogleCloudDiscoveryengineV1DataStore; } /** * Gets the SiteSearchEngine. * * @param name Required. Resource name of SiteSearchEngine, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. If the caller does not have permission to access the [SiteSearchEngine], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. */ async projectsLocationsCollectionsDataStoresGetSiteSearchEngine(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 GoogleCloudDiscoveryengineV1SiteSearchEngine; } /** * Lists all the DataStores associated with the project. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection_id}`. If the caller does not have permission to list DataStores under this location, regardless of whether or not this data store exists, a PERMISSION_DENIED error is returned. */ async projectsLocationsCollectionsDataStoresList(parent: string, opts: ProjectsLocationsCollectionsDataStoresListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/dataStores`); 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 GoogleCloudDiscoveryengineV1ListDataStoresResponse; } /** * 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 projectsLocationsCollectionsDataStoresModelsOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataStoresModelsOperationsList(name: string, opts: ProjectsLocationsCollectionsDataStoresModelsOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * 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 projectsLocationsCollectionsDataStoresOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataStoresOperationsList(name: string, opts: ProjectsLocationsCollectionsDataStoresOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Updates a DataStore * * @param name Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. */ async projectsLocationsCollectionsDataStoresPatch(name: string, req: GoogleCloudDiscoveryengineV1DataStore, opts: ProjectsLocationsCollectionsDataStoresPatchOptions = {}): Promise { opts = serializeProjectsLocationsCollectionsDataStoresPatchOptions(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 GoogleCloudDiscoveryengineV1DataStore; } /** * Creates a Schema. * * @param parent Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. */ async projectsLocationsCollectionsDataStoresSchemasCreate(parent: string, req: GoogleCloudDiscoveryengineV1Schema, opts: ProjectsLocationsCollectionsDataStoresSchemasCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemas`); if (opts.schemaId !== undefined) { url.searchParams.append("schemaId", String(opts.schemaId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes a Schema. * * @param name Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. */ async projectsLocationsCollectionsDataStoresSchemasDelete(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 GoogleLongrunningOperation; } /** * Gets a Schema. * * @param name Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. */ async projectsLocationsCollectionsDataStoresSchemasGet(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 GoogleCloudDiscoveryengineV1Schema; } /** * Gets a list of Schemas. * * @param parent Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. */ async projectsLocationsCollectionsDataStoresSchemasList(parent: string, opts: ProjectsLocationsCollectionsDataStoresSchemasListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemas`); 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 GoogleCloudDiscoveryengineV1ListSchemasResponse; } /** * 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 projectsLocationsCollectionsDataStoresSchemasOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataStoresSchemasOperationsList(name: string, opts: ProjectsLocationsCollectionsDataStoresSchemasOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Updates a Schema. * * @param name Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. */ async projectsLocationsCollectionsDataStoresSchemasPatch(name: string, req: GoogleCloudDiscoveryengineV1Schema, opts: ProjectsLocationsCollectionsDataStoresSchemasPatchOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as GoogleLongrunningOperation; } /** * Answer query method. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsDataStoresServingConfigsAnswer(servingConfig: string, req: GoogleCloudDiscoveryengineV1AnswerQueryRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:answer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data); } /** * Updates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig * does not exist. * * @param name Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` */ async projectsLocationsCollectionsDataStoresServingConfigsPatch(name: string, req: GoogleCloudDiscoveryengineV1ServingConfig, opts: ProjectsLocationsCollectionsDataStoresServingConfigsPatchOptions = {}): Promise { opts = serializeProjectsLocationsCollectionsDataStoresServingConfigsPatchOptions(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 GoogleCloudDiscoveryengineV1ServingConfig; } /** * Makes a recommendation, which requires a contextual user event. * * @param servingConfig Required. Full resource name of a ServingConfig: `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` One default serving config is created along with your recommendation engine creation. The engine ID is used as the ID of the default serving config. For example, for Engine `projects/*/locations/global/collections/*/engines/my-engine`, you can use `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` for your RecommendationService.Recommend requests. */ async projectsLocationsCollectionsDataStoresServingConfigsRecommend(servingConfig: string, req: GoogleCloudDiscoveryengineV1RecommendRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1RecommendRequest(req); const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:recommend`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1RecommendResponse(data); } /** * Performs a search. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsDataStoresServingConfigsSearch(servingConfig: string, req: GoogleCloudDiscoveryengineV1SearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:search`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1SearchResponse(data); } /** * Performs a search. Similar to the SearchService.Search method, but a lite * version that allows API key for authentication, where OAuth and IAM checks * are not required. Only public website search is supported by this method. * If data stores and engines not associated with public website search are * specified, a `FAILED_PRECONDITION` error is returned. This method can be * used for easy onboarding without having to implement an authentication * backend. However, it is strongly recommended to use SearchService.Search * instead with required OAuth and IAM checks to provide better data security. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsDataStoresServingConfigsSearchLite(servingConfig: string, req: GoogleCloudDiscoveryengineV1SearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:searchLite`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1SearchResponse(data); } /** * Answer query method (streaming). It takes one AnswerQueryRequest and * returns multiple AnswerQueryResponse messages in a stream. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsDataStoresServingConfigsStreamAnswer(servingConfig: string, req: GoogleCloudDiscoveryengineV1AnswerQueryRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:streamAnswer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data); } /** * Gets a Answer. * * @param name Required. The resource name of the Answer to get. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` */ async projectsLocationsCollectionsDataStoresSessionsAnswersGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Answer(data); } /** * Creates a Session. If the Session to create already exists, an * ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsDataStoresSessionsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Session): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/sessions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleCloudDiscoveryengineV1Session; } /** * Deletes a Session. If the Session to delete does not exist, a NOT_FOUND * error is returned. * * @param name Required. The resource name of the Session to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ async projectsLocationsCollectionsDataStoresSessionsDelete(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 GoogleProtobufEmpty; } /** * Gets a Session. * * @param name Required. The resource name of the Session to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ async projectsLocationsCollectionsDataStoresSessionsGet(name: string, opts: ProjectsLocationsCollectionsDataStoresSessionsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.includeAnswerDetails !== undefined) { url.searchParams.append("includeAnswerDetails", String(opts.includeAnswerDetails)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleCloudDiscoveryengineV1Session; } /** * Lists all Sessions by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsDataStoresSessionsList(parent: string, opts: ProjectsLocationsCollectionsDataStoresSessionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/sessions`); 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 GoogleCloudDiscoveryengineV1ListSessionsResponse; } /** * Updates a Session. Session action type cannot be changed. If the Session * to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` */ async projectsLocationsCollectionsDataStoresSessionsPatch(name: string, req: GoogleCloudDiscoveryengineV1Session, opts: ProjectsLocationsCollectionsDataStoresSessionsPatchOptions = {}): Promise { opts = serializeProjectsLocationsCollectionsDataStoresSessionsPatchOptions(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 GoogleCloudDiscoveryengineV1Session; } /** * Verify target sites' ownership and validity. This API sends all the target * sites under site search engine for verification. * * @param parent Required. The parent resource shared by all TargetSites being verified. `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineBatchVerifyTargetSites(parent: string, req: GoogleCloudDiscoveryengineV1BatchVerifyTargetSitesRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }:batchVerifyTargetSites`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Downgrade from advanced site search to basic site search. * * @param siteSearchEngine Required. Full resource name of the SiteSearchEngine, such as `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineDisableAdvancedSiteSearch(siteSearchEngine: string, req: GoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ siteSearchEngine }:disableAdvancedSiteSearch`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Upgrade from basic site search to advanced site search. * * @param siteSearchEngine Required. Full resource name of the SiteSearchEngine, such as `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineEnableAdvancedSiteSearch(siteSearchEngine: string, req: GoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ siteSearchEngine }:enableAdvancedSiteSearch`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Returns list of target sites with its domain verification status. This * method can only be called under data store with BASIC_SITE_SEARCH state at * the moment. * * @param siteSearchEngine Required. The site search engine resource under which we fetch all the domain verification status. `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineFetchDomainVerificationStatus(siteSearchEngine: string, opts: ProjectsLocationsCollectionsDataStoresSiteSearchEngineFetchDomainVerificationStatusOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ siteSearchEngine }:fetchDomainVerificationStatus`); 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 GoogleCloudDiscoveryengineV1FetchDomainVerificationStatusResponse; } /** * 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 projectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataStoresSiteSearchEngineOperationsList(name: string, opts: ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Request on-demand recrawl for a list of URIs. * * @param siteSearchEngine Required. Full resource name of the SiteSearchEngine, such as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineRecrawlUris(siteSearchEngine: string, req: GoogleCloudDiscoveryengineV1RecrawlUrisRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ siteSearchEngine }:recrawlUris`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Creates TargetSite in a batch. * * @param parent Required. The parent resource shared by all TargetSites being created. `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. The parent field in the CreateBookRequest messages must either be empty or match this field. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesBatchCreate(parent: string, req: GoogleCloudDiscoveryengineV1BatchCreateTargetSitesRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/targetSites:batchCreate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Creates a TargetSite. * * @param parent Required. Parent resource name of TargetSite, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesCreate(parent: string, req: GoogleCloudDiscoveryengineV1TargetSite): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/targetSites`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes a TargetSite. * * @param name Required. Full resource name of TargetSite, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested TargetSite does not exist, a NOT_FOUND error is returned. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesDelete(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 GoogleLongrunningOperation; } /** * Gets a TargetSite. * * @param name Required. Full resource name of TargetSite, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested TargetSite does not exist, a NOT_FOUND error is returned. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesGet(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 GoogleCloudDiscoveryengineV1TargetSite; } /** * Gets a list of TargetSites. * * @param parent Required. The parent site search engine resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. If the caller does not have permission to list TargetSites under this site search engine, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesList(parent: string, opts: ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/targetSites`); 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 GoogleCloudDiscoveryengineV1ListTargetSitesResponse; } /** * 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 projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsList(name: string, opts: ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Updates a TargetSite. * * @param name Output only. The fully qualified resource name of the target site. `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` The `target_site_id` is system-generated. */ async projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesPatch(name: string, req: GoogleCloudDiscoveryengineV1TargetSite): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as GoogleLongrunningOperation; } /** * Imports all SuggestionDenyListEntry for a DataStore. * * @param parent Required. The parent data store resource name for which to import denylist entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. */ async projectsLocationsCollectionsDataStoresSuggestionDenyListEntriesImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/suggestionDenyListEntries:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Permanently deletes all SuggestionDenyListEntry for a DataStore. * * @param parent Required. The parent data store resource name for which to import denylist entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. */ async projectsLocationsCollectionsDataStoresSuggestionDenyListEntriesPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/suggestionDenyListEntries:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Trains a custom model. * * @param dataStore Required. The resource name of the Data Store, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. This field is used to identify the data store where to train the models. */ async projectsLocationsCollectionsDataStoresTrainCustomModel(dataStore: string, req: GoogleCloudDiscoveryengineV1TrainCustomModelRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ dataStore }:trainCustomModel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Writes a single user event from the browser. This uses a GET request to * due to browser restriction of POST-ing to a third-party domain. This method * is used only by the Discovery Engine API JavaScript pixel and Google Tag * Manager. Users should not call this method directly. * * @param parent Required. The parent resource name. If the collect user event action is applied in DataStore level, the format is: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. If the collect user event action is applied in Location level, for example, the event with Document across multiple DataStore, the format is: `projects/{project}/locations/{location}`. */ async projectsLocationsCollectionsDataStoresUserEventsCollect(parent: string, opts: ProjectsLocationsCollectionsDataStoresUserEventsCollectOptions = {}): Promise { opts = serializeProjectsLocationsCollectionsDataStoresUserEventsCollectOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:collect`); if (opts.ets !== undefined) { url.searchParams.append("ets", String(opts.ets)); } if (opts.uri !== undefined) { url.searchParams.append("uri", String(opts.uri)); } if (opts.userEvent !== undefined) { url.searchParams.append("userEvent", String(opts.userEvent)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleApiHttpBody(data); } /** * Bulk import of user events. Request processing might be synchronous. * Events that already exist are skipped. Use this method for backfilling * historical user events. Operation.response is of type ImportResponse. Note * that it is possible for a subset of the items to be successfully inserted. * Operation.metadata is of type ImportMetadata. * * @param parent Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` */ async projectsLocationsCollectionsDataStoresUserEventsImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportUserEventsRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ImportUserEventsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes permanently all user events specified by the filter provided. * Depending on the number of events specified by the filter, this operation * could take hours or days to complete. To test a filter, use the list * command first. * * @param parent Required. The resource name of the catalog under which the events are created. The format is `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. */ async projectsLocationsCollectionsDataStoresUserEventsPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeUserEventsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Writes a single user event. * * @param parent Required. The parent resource name. If the write user event action is applied in DataStore level, the format is: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. If the write user event action is applied in Location level, for example, the event with Document across multiple DataStore, the format is: `projects/{project}/locations/{location}`. */ async projectsLocationsCollectionsDataStoresUserEventsWrite(parent: string, req: GoogleCloudDiscoveryengineV1UserEvent, opts: ProjectsLocationsCollectionsDataStoresUserEventsWriteOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1UserEvent(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:write`); if (opts.writeAsync !== undefined) { url.searchParams.append("writeAsync", String(opts.writeAsync)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1UserEvent(data); } /** * Creates a Control. By default 1000 controls are allowed for a data store. * A request can be submitted to adjust this limit. If the Control to create * already exists, an ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` or `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. */ async projectsLocationsCollectionsEnginesControlsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Control, opts: ProjectsLocationsCollectionsEnginesControlsCreateOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Control(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/controls`); if (opts.controlId !== undefined) { url.searchParams.append("controlId", String(opts.controlId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Deletes a Control. If the Control to delete does not exist, a NOT_FOUND * error is returned. * * @param name Required. The resource name of the Control to delete. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` */ async projectsLocationsCollectionsEnginesControlsDelete(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 GoogleProtobufEmpty; } /** * Gets a Control. * * @param name Required. The resource name of the Control to get. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` */ async projectsLocationsCollectionsEnginesControlsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Lists all Controls by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` or `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. */ async projectsLocationsCollectionsEnginesControlsList(parent: string, opts: ProjectsLocationsCollectionsEnginesControlsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/controls`); 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 deserializeGoogleCloudDiscoveryengineV1ListControlsResponse(data); } /** * Updates a Control. Control action type cannot be changed. If the Control * to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/*/locations/global/dataStore/*/controls/*` */ async projectsLocationsCollectionsEnginesControlsPatch(name: string, req: GoogleCloudDiscoveryengineV1Control, opts: ProjectsLocationsCollectionsEnginesControlsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Control(req); opts = serializeProjectsLocationsCollectionsEnginesControlsPatchOptions(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 deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Converses a conversation. * * @param name Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session. */ async projectsLocationsCollectionsEnginesConversationsConverse(name: string, req: GoogleCloudDiscoveryengineV1ConverseConversationRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ConverseConversationRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:converse`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1ConverseConversationResponse(data); } /** * Creates a Conversation. If the Conversation to create already exists, an * ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsEnginesConversationsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Conversation): Promise { req = serializeGoogleCloudDiscoveryengineV1Conversation(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Deletes a Conversation. If the Conversation to delete does not exist, a * NOT_FOUND error is returned. * * @param name Required. The resource name of the Conversation to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` */ async projectsLocationsCollectionsEnginesConversationsDelete(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 GoogleProtobufEmpty; } /** * Gets a Conversation. * * @param name Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` */ async projectsLocationsCollectionsEnginesConversationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Lists all Conversations by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsEnginesConversationsList(parent: string, opts: ProjectsLocationsCollectionsEnginesConversationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations`); 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 deserializeGoogleCloudDiscoveryengineV1ListConversationsResponse(data); } /** * Updates a Conversation. Conversation action type cannot be changed. If the * Conversation to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. */ async projectsLocationsCollectionsEnginesConversationsPatch(name: string, req: GoogleCloudDiscoveryengineV1Conversation, opts: ProjectsLocationsCollectionsEnginesConversationsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Conversation(req); opts = serializeProjectsLocationsCollectionsEnginesConversationsPatchOptions(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 deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Creates a Engine. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}`. */ async projectsLocationsCollectionsEnginesCreate(parent: string, req: GoogleCloudDiscoveryengineV1Engine, opts: ProjectsLocationsCollectionsEnginesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/engines`); if (opts.engineId !== undefined) { url.searchParams.append("engineId", String(opts.engineId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes a Engine. * * @param name Required. Full resource name of Engine, such as `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. If the caller does not have permission to delete the Engine, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Engine to delete does not exist, a NOT_FOUND error is returned. */ async projectsLocationsCollectionsEnginesDelete(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 GoogleLongrunningOperation; } /** * Gets a Engine. * * @param name Required. Full resource name of Engine, such as `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. */ async projectsLocationsCollectionsEnginesGet(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 GoogleCloudDiscoveryengineV1Engine; } /** * Lists all the Engines associated with the project. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection_id}`. */ async projectsLocationsCollectionsEnginesList(parent: string, opts: ProjectsLocationsCollectionsEnginesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/engines`); 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 GoogleCloudDiscoveryengineV1ListEnginesResponse; } /** * 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 projectsLocationsCollectionsEnginesOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsEnginesOperationsList(name: string, opts: ProjectsLocationsCollectionsEnginesOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Updates an Engine * * @param name Immutable. The fully qualified resource name of the engine. This field must be a UTF-8 encoded string with a length limit of 1024 characters. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` engine should be 1-63 characters, and valid characters are /a-z0-9*/. Otherwise, an INVALID_ARGUMENT error is returned. */ async projectsLocationsCollectionsEnginesPatch(name: string, req: GoogleCloudDiscoveryengineV1Engine, opts: ProjectsLocationsCollectionsEnginesPatchOptions = {}): Promise { opts = serializeProjectsLocationsCollectionsEnginesPatchOptions(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 GoogleCloudDiscoveryengineV1Engine; } /** * Answer query method. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsEnginesServingConfigsAnswer(servingConfig: string, req: GoogleCloudDiscoveryengineV1AnswerQueryRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:answer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data); } /** * Updates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig * does not exist. * * @param name Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` */ async projectsLocationsCollectionsEnginesServingConfigsPatch(name: string, req: GoogleCloudDiscoveryengineV1ServingConfig, opts: ProjectsLocationsCollectionsEnginesServingConfigsPatchOptions = {}): Promise { opts = serializeProjectsLocationsCollectionsEnginesServingConfigsPatchOptions(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 GoogleCloudDiscoveryengineV1ServingConfig; } /** * Makes a recommendation, which requires a contextual user event. * * @param servingConfig Required. Full resource name of a ServingConfig: `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` One default serving config is created along with your recommendation engine creation. The engine ID is used as the ID of the default serving config. For example, for Engine `projects/*/locations/global/collections/*/engines/my-engine`, you can use `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` for your RecommendationService.Recommend requests. */ async projectsLocationsCollectionsEnginesServingConfigsRecommend(servingConfig: string, req: GoogleCloudDiscoveryengineV1RecommendRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1RecommendRequest(req); const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:recommend`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1RecommendResponse(data); } /** * Performs a search. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsEnginesServingConfigsSearch(servingConfig: string, req: GoogleCloudDiscoveryengineV1SearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:search`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1SearchResponse(data); } /** * Performs a search. Similar to the SearchService.Search method, but a lite * version that allows API key for authentication, where OAuth and IAM checks * are not required. Only public website search is supported by this method. * If data stores and engines not associated with public website search are * specified, a `FAILED_PRECONDITION` error is returned. This method can be * used for easy onboarding without having to implement an authentication * backend. However, it is strongly recommended to use SearchService.Search * instead with required OAuth and IAM checks to provide better data security. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsEnginesServingConfigsSearchLite(servingConfig: string, req: GoogleCloudDiscoveryengineV1SearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:searchLite`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1SearchResponse(data); } /** * Answer query method (streaming). It takes one AnswerQueryRequest and * returns multiple AnswerQueryResponse messages in a stream. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsCollectionsEnginesServingConfigsStreamAnswer(servingConfig: string, req: GoogleCloudDiscoveryengineV1AnswerQueryRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:streamAnswer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data); } /** * Gets a Answer. * * @param name Required. The resource name of the Answer to get. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` */ async projectsLocationsCollectionsEnginesSessionsAnswersGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Answer(data); } /** * Creates a Session. If the Session to create already exists, an * ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsEnginesSessionsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Session): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/sessions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleCloudDiscoveryengineV1Session; } /** * Deletes a Session. If the Session to delete does not exist, a NOT_FOUND * error is returned. * * @param name Required. The resource name of the Session to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ async projectsLocationsCollectionsEnginesSessionsDelete(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 GoogleProtobufEmpty; } /** * Gets a Session. * * @param name Required. The resource name of the Session to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ async projectsLocationsCollectionsEnginesSessionsGet(name: string, opts: ProjectsLocationsCollectionsEnginesSessionsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.includeAnswerDetails !== undefined) { url.searchParams.append("includeAnswerDetails", String(opts.includeAnswerDetails)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleCloudDiscoveryengineV1Session; } /** * Lists all Sessions by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsCollectionsEnginesSessionsList(parent: string, opts: ProjectsLocationsCollectionsEnginesSessionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/sessions`); 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 GoogleCloudDiscoveryengineV1ListSessionsResponse; } /** * Updates a Session. Session action type cannot be changed. If the Session * to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` */ async projectsLocationsCollectionsEnginesSessionsPatch(name: string, req: GoogleCloudDiscoveryengineV1Session, opts: ProjectsLocationsCollectionsEnginesSessionsPatchOptions = {}): Promise { opts = serializeProjectsLocationsCollectionsEnginesSessionsPatchOptions(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 GoogleCloudDiscoveryengineV1Session; } /** * 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 projectsLocationsCollectionsOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsCollectionsOperationsList(name: string, opts: ProjectsLocationsCollectionsOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Gets index freshness metadata for Documents. Supported for website search * only. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. */ async projectsLocationsDataStoresBranchesBatchGetDocumentsMetadata(parent: string, opts: ProjectsLocationsDataStoresBranchesBatchGetDocumentsMetadataOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/batchGetDocumentsMetadata`); if (opts["matcher.fhirMatcher.fhirResources"] !== undefined) { url.searchParams.append("matcher.fhirMatcher.fhirResources", String(opts["matcher.fhirMatcher.fhirResources"])); } if (opts["matcher.urisMatcher.uris"] !== undefined) { url.searchParams.append("matcher.urisMatcher.uris", String(opts["matcher.urisMatcher.uris"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponse(data); } /** * Creates a Document. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. */ async projectsLocationsDataStoresBranchesDocumentsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Document, opts: ProjectsLocationsDataStoresBranchesDocumentsCreateOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Document(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/documents`); if (opts.documentId !== undefined) { url.searchParams.append("documentId", String(opts.documentId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Document(data); } /** * Deletes a Document. * * @param name Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned. */ async projectsLocationsDataStoresBranchesDocumentsDelete(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 GoogleProtobufEmpty; } /** * Gets a Document. * * @param name Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned. */ async projectsLocationsDataStoresBranchesDocumentsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Document(data); } /** * Bulk import of multiple Documents. Request processing may be synchronous. * Non-existing items are created. Note: It is possible for a subset of the * Documents to be successfully updated. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission. */ async projectsLocationsDataStoresBranchesDocumentsImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportDocumentsRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ImportDocumentsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/documents:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Gets a list of Documents. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned. */ async projectsLocationsDataStoresBranchesDocumentsList(parent: string, opts: ProjectsLocationsDataStoresBranchesDocumentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/documents`); 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 deserializeGoogleCloudDiscoveryengineV1ListDocumentsResponse(data); } /** * Updates a Document. * * @param name Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. */ async projectsLocationsDataStoresBranchesDocumentsPatch(name: string, req: GoogleCloudDiscoveryengineV1Document, opts: ProjectsLocationsDataStoresBranchesDocumentsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Document(req); opts = serializeProjectsLocationsDataStoresBranchesDocumentsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } 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 deserializeGoogleCloudDiscoveryengineV1Document(data); } /** * Permanently deletes all selected Documents in a branch. This process is * asynchronous. Depending on the number of Documents to be deleted, this * operation can take hours to complete. Before the delete operation * completes, some Documents might still be returned by * DocumentService.GetDocument or DocumentService.ListDocuments. To get a list * of the Documents to be deleted, set PurgeDocumentsRequest.force to false. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. */ async projectsLocationsDataStoresBranchesDocumentsPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeDocumentsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/documents:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * 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 projectsLocationsDataStoresBranchesOperationsCancel(name: string, req: GoogleLongrunningCancelOperationRequest): 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 GoogleProtobufEmpty; } /** * 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 projectsLocationsDataStoresBranchesOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsDataStoresBranchesOperationsList(name: string, opts: ProjectsLocationsDataStoresBranchesOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Completes the specified user input with keyword suggestions. * * @param dataStore Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. */ async projectsLocationsDataStoresCompleteQuery(dataStore: string, opts: ProjectsLocationsDataStoresCompleteQueryOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ dataStore }:completeQuery`); if (opts.includeTailSuggestions !== undefined) { url.searchParams.append("includeTailSuggestions", String(opts.includeTailSuggestions)); } if (opts.query !== undefined) { url.searchParams.append("query", String(opts.query)); } if (opts.queryModel !== undefined) { url.searchParams.append("queryModel", String(opts.queryModel)); } if (opts.userPseudoId !== undefined) { url.searchParams.append("userPseudoId", String(opts.userPseudoId)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleCloudDiscoveryengineV1CompleteQueryResponse; } /** * Imports CompletionSuggestions for a DataStore. * * @param parent Required. The parent data store resource name for which to import customer autocomplete suggestions. Follows pattern `projects/*/locations/*/collections/*/dataStores/*` */ async projectsLocationsDataStoresCompletionSuggestionsImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/completionSuggestions:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Permanently deletes all CompletionSuggestions for a DataStore. * * @param parent Required. The parent data store resource name for which to purge completion suggestions. Follows pattern projects/*/locations/*/collections/*/dataStores/*. */ async projectsLocationsDataStoresCompletionSuggestionsPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/completionSuggestions:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Creates a Control. By default 1000 controls are allowed for a data store. * A request can be submitted to adjust this limit. If the Control to create * already exists, an ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` or `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. */ async projectsLocationsDataStoresControlsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Control, opts: ProjectsLocationsDataStoresControlsCreateOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Control(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/controls`); if (opts.controlId !== undefined) { url.searchParams.append("controlId", String(opts.controlId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Deletes a Control. If the Control to delete does not exist, a NOT_FOUND * error is returned. * * @param name Required. The resource name of the Control to delete. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` */ async projectsLocationsDataStoresControlsDelete(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 GoogleProtobufEmpty; } /** * Gets a Control. * * @param name Required. The resource name of the Control to get. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` */ async projectsLocationsDataStoresControlsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Lists all Controls by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` or `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. */ async projectsLocationsDataStoresControlsList(parent: string, opts: ProjectsLocationsDataStoresControlsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/controls`); 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 deserializeGoogleCloudDiscoveryengineV1ListControlsResponse(data); } /** * Updates a Control. Control action type cannot be changed. If the Control * to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/*/locations/global/dataStore/*/controls/*` */ async projectsLocationsDataStoresControlsPatch(name: string, req: GoogleCloudDiscoveryengineV1Control, opts: ProjectsLocationsDataStoresControlsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Control(req); opts = serializeProjectsLocationsDataStoresControlsPatchOptions(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 deserializeGoogleCloudDiscoveryengineV1Control(data); } /** * Converses a conversation. * * @param name Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session. */ async projectsLocationsDataStoresConversationsConverse(name: string, req: GoogleCloudDiscoveryengineV1ConverseConversationRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ConverseConversationRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:converse`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1ConverseConversationResponse(data); } /** * Creates a Conversation. If the Conversation to create already exists, an * ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsDataStoresConversationsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Conversation): Promise { req = serializeGoogleCloudDiscoveryengineV1Conversation(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Deletes a Conversation. If the Conversation to delete does not exist, a * NOT_FOUND error is returned. * * @param name Required. The resource name of the Conversation to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` */ async projectsLocationsDataStoresConversationsDelete(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 GoogleProtobufEmpty; } /** * Gets a Conversation. * * @param name Required. The resource name of the Conversation to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` */ async projectsLocationsDataStoresConversationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Lists all Conversations by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsDataStoresConversationsList(parent: string, opts: ProjectsLocationsDataStoresConversationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/conversations`); 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 deserializeGoogleCloudDiscoveryengineV1ListConversationsResponse(data); } /** * Updates a Conversation. Conversation action type cannot be changed. If the * Conversation to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` or `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. */ async projectsLocationsDataStoresConversationsPatch(name: string, req: GoogleCloudDiscoveryengineV1Conversation, opts: ProjectsLocationsDataStoresConversationsPatchOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1Conversation(req); opts = serializeProjectsLocationsDataStoresConversationsPatchOptions(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 deserializeGoogleCloudDiscoveryengineV1Conversation(data); } /** * Creates a DataStore. DataStore is for storing Documents. To serve these * documents for Search, or Recommendation use case, an Engine needs to be * created separately. * * @param parent Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}`. */ async projectsLocationsDataStoresCreate(parent: string, req: GoogleCloudDiscoveryengineV1DataStore, opts: ProjectsLocationsDataStoresCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/dataStores`); if (opts.cmekConfigName !== undefined) { url.searchParams.append("cmekConfigName", String(opts.cmekConfigName)); } if (opts.createAdvancedSiteSearch !== undefined) { url.searchParams.append("createAdvancedSiteSearch", String(opts.createAdvancedSiteSearch)); } if (opts.dataStoreId !== undefined) { url.searchParams.append("dataStoreId", String(opts.dataStoreId)); } if (opts.disableCmek !== undefined) { url.searchParams.append("disableCmek", String(opts.disableCmek)); } if (opts.skipDefaultSchemaCreation !== undefined) { url.searchParams.append("skipDefaultSchemaCreation", String(opts.skipDefaultSchemaCreation)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes a DataStore. * * @param name Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. If the caller does not have permission to delete the DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the DataStore to delete does not exist, a NOT_FOUND error is returned. */ async projectsLocationsDataStoresDelete(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 GoogleLongrunningOperation; } /** * Gets a DataStore. * * @param name Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. If the caller does not have permission to access the DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested DataStore does not exist, a NOT_FOUND error is returned. */ async projectsLocationsDataStoresGet(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 GoogleCloudDiscoveryengineV1DataStore; } /** * Gets the SiteSearchEngine. * * @param name Required. Resource name of SiteSearchEngine, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. If the caller does not have permission to access the [SiteSearchEngine], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. */ async projectsLocationsDataStoresGetSiteSearchEngine(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 GoogleCloudDiscoveryengineV1SiteSearchEngine; } /** * Lists all the DataStores associated with the project. * * @param parent Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection_id}`. If the caller does not have permission to list DataStores under this location, regardless of whether or not this data store exists, a PERMISSION_DENIED error is returned. */ async projectsLocationsDataStoresList(parent: string, opts: ProjectsLocationsDataStoresListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/dataStores`); 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 GoogleCloudDiscoveryengineV1ListDataStoresResponse; } /** * 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 projectsLocationsDataStoresModelsOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsDataStoresModelsOperationsList(name: string, opts: ProjectsLocationsDataStoresModelsOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * 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 projectsLocationsDataStoresOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsDataStoresOperationsList(name: string, opts: ProjectsLocationsDataStoresOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Updates a DataStore * * @param name Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. */ async projectsLocationsDataStoresPatch(name: string, req: GoogleCloudDiscoveryengineV1DataStore, opts: ProjectsLocationsDataStoresPatchOptions = {}): Promise { opts = serializeProjectsLocationsDataStoresPatchOptions(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 GoogleCloudDiscoveryengineV1DataStore; } /** * Creates a Schema. * * @param parent Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. */ async projectsLocationsDataStoresSchemasCreate(parent: string, req: GoogleCloudDiscoveryengineV1Schema, opts: ProjectsLocationsDataStoresSchemasCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemas`); if (opts.schemaId !== undefined) { url.searchParams.append("schemaId", String(opts.schemaId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes a Schema. * * @param name Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. */ async projectsLocationsDataStoresSchemasDelete(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 GoogleLongrunningOperation; } /** * Gets a Schema. * * @param name Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. */ async projectsLocationsDataStoresSchemasGet(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 GoogleCloudDiscoveryengineV1Schema; } /** * Gets a list of Schemas. * * @param parent Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. */ async projectsLocationsDataStoresSchemasList(parent: string, opts: ProjectsLocationsDataStoresSchemasListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/schemas`); 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 GoogleCloudDiscoveryengineV1ListSchemasResponse; } /** * Updates a Schema. * * @param name Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. */ async projectsLocationsDataStoresSchemasPatch(name: string, req: GoogleCloudDiscoveryengineV1Schema, opts: ProjectsLocationsDataStoresSchemasPatchOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as GoogleLongrunningOperation; } /** * Answer query method. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsDataStoresServingConfigsAnswer(servingConfig: string, req: GoogleCloudDiscoveryengineV1AnswerQueryRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:answer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data); } /** * Updates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig * does not exist. * * @param name Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` */ async projectsLocationsDataStoresServingConfigsPatch(name: string, req: GoogleCloudDiscoveryengineV1ServingConfig, opts: ProjectsLocationsDataStoresServingConfigsPatchOptions = {}): Promise { opts = serializeProjectsLocationsDataStoresServingConfigsPatchOptions(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 GoogleCloudDiscoveryengineV1ServingConfig; } /** * Makes a recommendation, which requires a contextual user event. * * @param servingConfig Required. Full resource name of a ServingConfig: `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` One default serving config is created along with your recommendation engine creation. The engine ID is used as the ID of the default serving config. For example, for Engine `projects/*/locations/global/collections/*/engines/my-engine`, you can use `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` for your RecommendationService.Recommend requests. */ async projectsLocationsDataStoresServingConfigsRecommend(servingConfig: string, req: GoogleCloudDiscoveryengineV1RecommendRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1RecommendRequest(req); const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:recommend`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1RecommendResponse(data); } /** * Performs a search. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsDataStoresServingConfigsSearch(servingConfig: string, req: GoogleCloudDiscoveryengineV1SearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:search`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1SearchResponse(data); } /** * Performs a search. Similar to the SearchService.Search method, but a lite * version that allows API key for authentication, where OAuth and IAM checks * are not required. Only public website search is supported by this method. * If data stores and engines not associated with public website search are * specified, a `FAILED_PRECONDITION` error is returned. This method can be * used for easy onboarding without having to implement an authentication * backend. However, it is strongly recommended to use SearchService.Search * instead with required OAuth and IAM checks to provide better data security. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsDataStoresServingConfigsSearchLite(servingConfig: string, req: GoogleCloudDiscoveryengineV1SearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:searchLite`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1SearchResponse(data); } /** * Answer query method (streaming). It takes one AnswerQueryRequest and * returns multiple AnswerQueryResponse messages in a stream. * * @param servingConfig Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. */ async projectsLocationsDataStoresServingConfigsStreamAnswer(servingConfig: string, req: GoogleCloudDiscoveryengineV1AnswerQueryRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ servingConfig }:streamAnswer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data); } /** * Gets a Answer. * * @param name Required. The resource name of the Answer to get. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` */ async projectsLocationsDataStoresSessionsAnswersGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleCloudDiscoveryengineV1Answer(data); } /** * Creates a Session. If the Session to create already exists, an * ALREADY_EXISTS error is returned. * * @param parent Required. Full resource name of parent data store. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsDataStoresSessionsCreate(parent: string, req: GoogleCloudDiscoveryengineV1Session): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/sessions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleCloudDiscoveryengineV1Session; } /** * Deletes a Session. If the Session to delete does not exist, a NOT_FOUND * error is returned. * * @param name Required. The resource name of the Session to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ async projectsLocationsDataStoresSessionsDelete(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 GoogleProtobufEmpty; } /** * Gets a Session. * * @param name Required. The resource name of the Session to get. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ async projectsLocationsDataStoresSessionsGet(name: string, opts: ProjectsLocationsDataStoresSessionsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.includeAnswerDetails !== undefined) { url.searchParams.append("includeAnswerDetails", String(opts.includeAnswerDetails)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleCloudDiscoveryengineV1Session; } /** * Lists all Sessions by their parent DataStore. * * @param parent Required. The data store resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ async projectsLocationsDataStoresSessionsList(parent: string, opts: ProjectsLocationsDataStoresSessionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/sessions`); 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 GoogleCloudDiscoveryengineV1ListSessionsResponse; } /** * Updates a Session. Session action type cannot be changed. If the Session * to update does not exist, a NOT_FOUND error is returned. * * @param name Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` */ async projectsLocationsDataStoresSessionsPatch(name: string, req: GoogleCloudDiscoveryengineV1Session, opts: ProjectsLocationsDataStoresSessionsPatchOptions = {}): Promise { opts = serializeProjectsLocationsDataStoresSessionsPatchOptions(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 GoogleCloudDiscoveryengineV1Session; } /** * Downgrade from advanced site search to basic site search. * * @param siteSearchEngine Required. Full resource name of the SiteSearchEngine, such as `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. */ async projectsLocationsDataStoresSiteSearchEngineDisableAdvancedSiteSearch(siteSearchEngine: string, req: GoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ siteSearchEngine }:disableAdvancedSiteSearch`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Upgrade from basic site search to advanced site search. * * @param siteSearchEngine Required. Full resource name of the SiteSearchEngine, such as `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. */ async projectsLocationsDataStoresSiteSearchEngineEnableAdvancedSiteSearch(siteSearchEngine: string, req: GoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ siteSearchEngine }:enableAdvancedSiteSearch`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Request on-demand recrawl for a list of URIs. * * @param siteSearchEngine Required. Full resource name of the SiteSearchEngine, such as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. */ async projectsLocationsDataStoresSiteSearchEngineRecrawlUris(siteSearchEngine: string, req: GoogleCloudDiscoveryengineV1RecrawlUrisRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ siteSearchEngine }:recrawlUris`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Creates TargetSite in a batch. * * @param parent Required. The parent resource shared by all TargetSites being created. `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. The parent field in the CreateBookRequest messages must either be empty or match this field. */ async projectsLocationsDataStoresSiteSearchEngineTargetSitesBatchCreate(parent: string, req: GoogleCloudDiscoveryengineV1BatchCreateTargetSitesRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/targetSites:batchCreate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Creates a TargetSite. * * @param parent Required. Parent resource name of TargetSite, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. */ async projectsLocationsDataStoresSiteSearchEngineTargetSitesCreate(parent: string, req: GoogleCloudDiscoveryengineV1TargetSite): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/targetSites`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes a TargetSite. * * @param name Required. Full resource name of TargetSite, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested TargetSite does not exist, a NOT_FOUND error is returned. */ async projectsLocationsDataStoresSiteSearchEngineTargetSitesDelete(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 GoogleLongrunningOperation; } /** * Gets a TargetSite. * * @param name Required. Full resource name of TargetSite, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. If the caller does not have permission to access the TargetSite, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested TargetSite does not exist, a NOT_FOUND error is returned. */ async projectsLocationsDataStoresSiteSearchEngineTargetSitesGet(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 GoogleCloudDiscoveryengineV1TargetSite; } /** * Gets a list of TargetSites. * * @param parent Required. The parent site search engine resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. If the caller does not have permission to list TargetSites under this site search engine, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned. */ async projectsLocationsDataStoresSiteSearchEngineTargetSitesList(parent: string, opts: ProjectsLocationsDataStoresSiteSearchEngineTargetSitesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/targetSites`); 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 GoogleCloudDiscoveryengineV1ListTargetSitesResponse; } /** * Updates a TargetSite. * * @param name Output only. The fully qualified resource name of the target site. `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` The `target_site_id` is system-generated. */ async projectsLocationsDataStoresSiteSearchEngineTargetSitesPatch(name: string, req: GoogleCloudDiscoveryengineV1TargetSite): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as GoogleLongrunningOperation; } /** * Imports all SuggestionDenyListEntry for a DataStore. * * @param parent Required. The parent data store resource name for which to import denylist entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. */ async projectsLocationsDataStoresSuggestionDenyListEntriesImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/suggestionDenyListEntries:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Permanently deletes all SuggestionDenyListEntry for a DataStore. * * @param parent Required. The parent data store resource name for which to import denylist entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. */ async projectsLocationsDataStoresSuggestionDenyListEntriesPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/suggestionDenyListEntries:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Writes a single user event from the browser. This uses a GET request to * due to browser restriction of POST-ing to a third-party domain. This method * is used only by the Discovery Engine API JavaScript pixel and Google Tag * Manager. Users should not call this method directly. * * @param parent Required. The parent resource name. If the collect user event action is applied in DataStore level, the format is: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. If the collect user event action is applied in Location level, for example, the event with Document across multiple DataStore, the format is: `projects/{project}/locations/{location}`. */ async projectsLocationsDataStoresUserEventsCollect(parent: string, opts: ProjectsLocationsDataStoresUserEventsCollectOptions = {}): Promise { opts = serializeProjectsLocationsDataStoresUserEventsCollectOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:collect`); if (opts.ets !== undefined) { url.searchParams.append("ets", String(opts.ets)); } if (opts.uri !== undefined) { url.searchParams.append("uri", String(opts.uri)); } if (opts.userEvent !== undefined) { url.searchParams.append("userEvent", String(opts.userEvent)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleApiHttpBody(data); } /** * Bulk import of user events. Request processing might be synchronous. * Events that already exist are skipped. Use this method for backfilling * historical user events. Operation.response is of type ImportResponse. Note * that it is possible for a subset of the items to be successfully inserted. * Operation.metadata is of type ImportMetadata. * * @param parent Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` */ async projectsLocationsDataStoresUserEventsImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportUserEventsRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ImportUserEventsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Deletes permanently all user events specified by the filter provided. * Depending on the number of events specified by the filter, this operation * could take hours or days to complete. To test a filter, use the list * command first. * * @param parent Required. The resource name of the catalog under which the events are created. The format is `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. */ async projectsLocationsDataStoresUserEventsPurge(parent: string, req: GoogleCloudDiscoveryengineV1PurgeUserEventsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:purge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Writes a single user event. * * @param parent Required. The parent resource name. If the write user event action is applied in DataStore level, the format is: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. If the write user event action is applied in Location level, for example, the event with Document across multiple DataStore, the format is: `projects/{project}/locations/{location}`. */ async projectsLocationsDataStoresUserEventsWrite(parent: string, req: GoogleCloudDiscoveryengineV1UserEvent, opts: ProjectsLocationsDataStoresUserEventsWriteOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1UserEvent(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:write`); if (opts.writeAsync !== undefined) { url.searchParams.append("writeAsync", String(opts.writeAsync)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1UserEvent(data); } /** * Performs a grounding check. * * @param groundingConfig Required. The resource name of the grounding config, such as `projects/*/locations/global/groundingConfigs/default_grounding_config`. */ async projectsLocationsGroundingConfigsCheck(groundingConfig: string, req: GoogleCloudDiscoveryengineV1CheckGroundingRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ groundingConfig }:check`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleCloudDiscoveryengineV1CheckGroundingResponse; } /** * 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 projectsLocationsIdentityMappingStoresOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsLocationsIdentityMappingStoresOperationsList(name: string, opts: ProjectsLocationsIdentityMappingStoresOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * 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 GoogleLongrunningOperation; } /** * 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Ranks a list of text records based on the given input query. * * @param rankingConfig Required. The resource name of the rank service config, such as `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. */ async projectsLocationsRankingConfigsRank(rankingConfig: string, req: GoogleCloudDiscoveryengineV1RankRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ rankingConfig }:rank`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleCloudDiscoveryengineV1RankResponse; } /** * Writes a single user event from the browser. This uses a GET request to * due to browser restriction of POST-ing to a third-party domain. This method * is used only by the Discovery Engine API JavaScript pixel and Google Tag * Manager. Users should not call this method directly. * * @param parent Required. The parent resource name. If the collect user event action is applied in DataStore level, the format is: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. If the collect user event action is applied in Location level, for example, the event with Document across multiple DataStore, the format is: `projects/{project}/locations/{location}`. */ async projectsLocationsUserEventsCollect(parent: string, opts: ProjectsLocationsUserEventsCollectOptions = {}): Promise { opts = serializeProjectsLocationsUserEventsCollectOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:collect`); if (opts.ets !== undefined) { url.searchParams.append("ets", String(opts.ets)); } if (opts.uri !== undefined) { url.searchParams.append("uri", String(opts.uri)); } if (opts.userEvent !== undefined) { url.searchParams.append("userEvent", String(opts.userEvent)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleApiHttpBody(data); } /** * Bulk import of user events. Request processing might be synchronous. * Events that already exist are skipped. Use this method for backfilling * historical user events. Operation.response is of type ImportResponse. Note * that it is possible for a subset of the items to be successfully inserted. * Operation.metadata is of type ImportMetadata. * * @param parent Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` */ async projectsLocationsUserEventsImport(parent: string, req: GoogleCloudDiscoveryengineV1ImportUserEventsRequest): Promise { req = serializeGoogleCloudDiscoveryengineV1ImportUserEventsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } /** * Writes a single user event. * * @param parent Required. The parent resource name. If the write user event action is applied in DataStore level, the format is: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. If the write user event action is applied in Location level, for example, the event with Document across multiple DataStore, the format is: `projects/{project}/locations/{location}`. */ async projectsLocationsUserEventsWrite(parent: string, req: GoogleCloudDiscoveryengineV1UserEvent, opts: ProjectsLocationsUserEventsWriteOptions = {}): Promise { req = serializeGoogleCloudDiscoveryengineV1UserEvent(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/userEvents:write`); if (opts.writeAsync !== undefined) { url.searchParams.append("writeAsync", String(opts.writeAsync)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGoogleCloudDiscoveryengineV1UserEvent(data); } /** * 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 projectsOperationsCancel(name: string, req: GoogleLongrunningCancelOperationRequest): 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 GoogleProtobufEmpty; } /** * 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 projectsOperationsGet(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 GoogleLongrunningOperation; } /** * 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 projectsOperationsList(name: string, opts: ProjectsOperationsListOptions = {}): 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleLongrunningListOperationsResponse; } /** * Provisions the project resource. During the process, related systems will * get prepared and initialized. Caller must read the [Terms for data * use](https://cloud.google.com/retail/data-use-terms), and optionally * specify in request to provide consent to that service terms. * * @param name Required. Full resource name of a Project, such as `projects/{project_id_or_number}`. */ async projectsProvision(name: string, req: GoogleCloudDiscoveryengineV1ProvisionProjectRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:provision`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleLongrunningOperation; } } /** * `Distribution` contains summary statistics for a population of values. It * optionally contains a histogram representing the distribution of those values * across a set of buckets. The summary statistics are the count, mean, sum of * the squared deviation from the mean, the minimum, and the maximum of the set * of population of values. The histogram is based on a sequence of buckets and * gives a count of values that fall into each bucket. The boundaries of the * buckets are given either explicitly or by formulas for buckets of fixed or * exponentially increasing widths. Although it is not forbidden, it is * generally a bad idea to include non-finite values (infinities or NaNs) in the * population of values, as this will render the `mean` and * `sum_of_squared_deviation` fields meaningless. */ export interface GoogleApiDistribution { /** * The number of values in each bucket of the histogram, as described in * `bucket_options`. If the distribution does not have a histogram, then omit * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. If present, `bucket_counts` should contain N values, where N * is the number of buckets specified in `bucket_options`. If you supply fewer * than N values, the remaining values are assumed to be 0. The order of the * values in `bucket_counts` follows the bucket numbering schemes described * for the three bucket types. The first value must be the count for the * underflow bucket (number 0). The next N-2 values are the counts for the * finite buckets (number 1 through N-2). The N'th value in `bucket_counts` is * the count for the overflow bucket (number N-1). */ bucketCounts?: bigint[]; /** * Defines the histogram bucket boundaries. If the distribution does not * contain a histogram, then omit this field. */ bucketOptions?: GoogleApiDistributionBucketOptions; /** * The number of values in the population. Must be non-negative. This value * must equal the sum of the values in `bucket_counts` if a histogram is * provided. */ count?: bigint; /** * Must be in increasing order of `value` field. */ exemplars?: GoogleApiDistributionExemplar[]; /** * The arithmetic mean of the values in the population. If `count` is zero * then this field must be zero. */ mean?: number; /** * If specified, contains the range of the population values. The field must * not be present if the `count` is zero. */ range?: GoogleApiDistributionRange; /** * The sum of squared deviations from the mean of the values in the * population. For values x_i this is: Sum[i=1..n]((x_i - mean)^2) Knuth, "The * Art of Computer Programming", Vol. 2, page 232, 3rd edition describes * Welford's method for accumulating this sum in one pass. If `count` is zero * then this field must be zero. */ sumOfSquaredDeviation?: number; } function serializeGoogleApiDistribution(data: any): GoogleApiDistribution { return { ...data, bucketCounts: data["bucketCounts"] !== undefined ? data["bucketCounts"].map((item: any) => (String(item))) : undefined, count: data["count"] !== undefined ? String(data["count"]) : undefined, exemplars: data["exemplars"] !== undefined ? data["exemplars"].map((item: any) => (serializeGoogleApiDistributionExemplar(item))) : undefined, }; } function deserializeGoogleApiDistribution(data: any): GoogleApiDistribution { return { ...data, bucketCounts: data["bucketCounts"] !== undefined ? data["bucketCounts"].map((item: any) => (BigInt(item))) : undefined, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, exemplars: data["exemplars"] !== undefined ? data["exemplars"].map((item: any) => (deserializeGoogleApiDistributionExemplar(item))) : undefined, }; } /** * `BucketOptions` describes the bucket boundaries used to create a histogram * for the distribution. The buckets can be in a linear sequence, an exponential * sequence, or each bucket can be specified explicitly. `BucketOptions` does * not include the number of values in each bucket. A bucket has an inclusive * lower bound and exclusive upper bound for the values that are counted for * that bucket. The upper bound of a bucket must be strictly greater than the * lower bound. The sequence of N buckets for a distribution consists of an * underflow bucket (number 0), zero or more finite buckets (number 1 through N * - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the * lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - * 1. The buckets span the whole range of finite values: lower bound of the * underflow bucket is -infinity and the upper bound of the overflow bucket is * +infinity. The finite buckets are so-called because both bounds are finite. */ export interface GoogleApiDistributionBucketOptions { /** * The explicit buckets. */ explicitBuckets?: GoogleApiDistributionBucketOptionsExplicit; /** * The exponential buckets. */ exponentialBuckets?: GoogleApiDistributionBucketOptionsExponential; /** * The linear bucket. */ linearBuckets?: GoogleApiDistributionBucketOptionsLinear; } /** * Specifies a set of buckets with arbitrary widths. There are `size(bounds) + * 1` (= N) buckets. Bucket `i` has the following boundaries: Upper bound (0 <= * i < N-1): bounds[i] Lower bound (1 <= i < N); bounds[i - 1] The `bounds` * field must contain at least one element. If `bounds` has only one element, * then there are no finite buckets, and that single element is the common * boundary of the overflow and underflow buckets. */ export interface GoogleApiDistributionBucketOptionsExplicit { /** * The values must be monotonically increasing. */ bounds?: number[]; } /** * Specifies an exponential sequence of buckets that have a width that is * proportional to the value of the lower bound. Each bucket represents a * constant relative uncertainty on a specific value in the bucket. There are * `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the following * boundaries: Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower * bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). */ export interface GoogleApiDistributionBucketOptionsExponential { /** * Must be greater than 1. */ growthFactor?: number; /** * Must be greater than 0. */ numFiniteBuckets?: number; /** * Must be greater than 0. */ scale?: number; } /** * Specifies a linear sequence of buckets that all have the same width (except * overflow and underflow). Each bucket represents a constant absolute * uncertainty on the specific value in the bucket. There are * `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the following * boundaries: Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 * <= i < N): offset + (width * (i - 1)). */ export interface GoogleApiDistributionBucketOptionsLinear { /** * Must be greater than 0. */ numFiniteBuckets?: number; /** * Lower bound of the first bucket. */ offset?: number; /** * Must be greater than 0. */ width?: number; } /** * Exemplars are example points that may be used to annotate aggregated * distribution values. They are metadata that gives information about a * particular value added to a Distribution bucket, such as a trace ID that was * active when a value was added. They may contain further information, such as * a example values and timestamps, origin, etc. */ export interface GoogleApiDistributionExemplar { /** * Contextual information about the example value. Examples are: Trace: * type.googleapis.com/google.monitoring.v3.SpanContext Literal string: * type.googleapis.com/google.protobuf.StringValue Labels dropped during * aggregation: type.googleapis.com/google.monitoring.v3.DroppedLabels There * may be only a single attachment of any given message type in a single * exemplar, and this is enforced by the system. */ attachments?: { [key: string]: any }[]; /** * The observation (sampling) time of the above value. */ timestamp?: Date; /** * Value of the exemplar point. This value determines to which bucket the * exemplar belongs. */ value?: number; } function serializeGoogleApiDistributionExemplar(data: any): GoogleApiDistributionExemplar { return { ...data, timestamp: data["timestamp"] !== undefined ? data["timestamp"].toISOString() : undefined, }; } function deserializeGoogleApiDistributionExemplar(data: any): GoogleApiDistributionExemplar { return { ...data, timestamp: data["timestamp"] !== undefined ? new Date(data["timestamp"]) : undefined, }; } /** * The range of the population values. */ export interface GoogleApiDistributionRange { /** * The maximum of the population values. */ max?: number; /** * The minimum of the population values. */ min?: number; } /** * Message that represents an arbitrary HTTP body. It should only be used for * payload formats that can't be represented as JSON, such as raw binary or an * HTML page. This message can be used both in streaming and non-streaming API * methods in the request as well as the response. It can be used as a top-level * request field, which is convenient if one wants to extract parameters from * either the URL or HTTP template into the request fields and also want access * to the raw HTTP body. Example: message GetResourceRequest { // A unique * request id. string request_id = 1; // The raw HTTP body is bound to this * field. google.api.HttpBody http_body = 2; } service ResourceService { rpc * GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc * UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } * Example with streaming methods: service CaldavService { rpc * GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); * rpc UpdateCalendar(stream google.api.HttpBody) returns (stream * google.api.HttpBody); } Use of this type only changes how the request and * response bodies are handled, all other features will continue to work * unchanged. */ export interface GoogleApiHttpBody { /** * The HTTP Content-Type header value specifying the content type of the * body. */ contentType?: string; /** * The HTTP request/response body as raw binary. */ data?: Uint8Array; /** * Application specific response metadata. Must be set in the first response * for streaming APIs. */ extensions?: { [key: string]: any }[]; } function serializeGoogleApiHttpBody(data: any): GoogleApiHttpBody { return { ...data, data: data["data"] !== undefined ? encodeBase64(data["data"]) : undefined, }; } function deserializeGoogleApiHttpBody(data: any): GoogleApiHttpBody { return { ...data, data: data["data"] !== undefined ? decodeBase64(data["data"] as string) : undefined, }; } /** * A specific metric, identified by specifying values for all of the labels of * a `MetricDescriptor`. */ export interface GoogleApiMetric { /** * The set of label values that uniquely identify this metric. All labels * listed in the `MetricDescriptor` must be assigned values. */ labels?: { [key: string]: string }; /** * An existing metric type, see google.api.MetricDescriptor. For example, * `custom.googleapis.com/invoice/paid/amount`. */ type?: string; } /** * An object representing a resource that can be used for monitoring, logging, * billing, or other purposes. Examples include virtual machine instances, * databases, and storage devices such as disks. The `type` field identifies a * MonitoredResourceDescriptor object that describes the resource's schema. * Information in the `labels` field identifies the actual resource and its * attributes according to the schema. For example, a particular Compute Engine * VM instance could be represented by the following object, because the * MonitoredResourceDescriptor for `"gce_instance"` has labels `"project_id"`, * `"instance_id"` and `"zone"`: { "type": "gce_instance", "labels": { * "project_id": "my-project", "instance_id": "12345678901234", "zone": * "us-central1-a" }} */ export interface GoogleApiMonitoredResource { /** * Required. Values for all of the labels listed in the associated monitored * resource descriptor. For example, Compute Engine VM instances use the * labels `"project_id"`, `"instance_id"`, and `"zone"`. */ labels?: { [key: string]: string }; /** * Required. The monitored resource type. This field must match the `type` * field of a MonitoredResourceDescriptor object. For example, the type of a * Compute Engine VM instance is `gce_instance`. Some descriptors include the * service name in the type; for example, the type of a Datastream stream is * `datastream.googleapis.com/Stream`. */ type?: string; } /** * Auxiliary metadata for a MonitoredResource object. MonitoredResource objects * contain the minimum set of information to uniquely identify a monitored * resource instance. There is some other useful auxiliary metadata. Monitoring * and Logging use an ingestion pipeline to extract metadata for cloud resources * of all types, and store the metadata in this message. */ export interface GoogleApiMonitoredResourceMetadata { /** * Output only. Values for predefined system metadata labels. System labels * are a kind of metadata extracted by Google, including "machine_image", * "vpc", "subnet_id", "security_group", "name", etc. System label values can * be only strings, Boolean values, or a list of strings. For example: { * "name": "my-test-instance", "security_group": ["a", "b", "c"], * "spot_instance": false } */ systemLabels?: { [key: string]: any }; /** * Output only. A map of user-defined metadata labels. */ userLabels?: { [key: string]: string }; } /** * A description of the context in which an error occurred. */ export interface GoogleCloudDiscoveryengineLoggingErrorContext { /** * The HTTP request which was processed when the error was triggered. */ httpRequest?: GoogleCloudDiscoveryengineLoggingHttpRequestContext; /** * The location in the source code where the decision was made to report the * error, usually the place where it was logged. */ reportLocation?: GoogleCloudDiscoveryengineLoggingSourceLocation; } /** * An error log which is reported to the Error Reporting system. */ export interface GoogleCloudDiscoveryengineLoggingErrorLog { /** * A description of the context in which the error occurred. */ context?: GoogleCloudDiscoveryengineLoggingErrorContext; /** * The error payload that is populated on LRO import APIs. */ importPayload?: GoogleCloudDiscoveryengineLoggingImportErrorContext; /** * A message describing the error. */ message?: string; /** * The API request payload, represented as a protocol buffer. Most API * request types are supported—for example: * * `type.googleapis.com/google.cloud.discoveryengine.v1alpha.DocumentService.CreateDocumentRequest` * * * `type.googleapis.com/google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEventRequest` */ requestPayload?: { [key: string]: any }; /** * The API response payload, represented as a protocol buffer. This is used * to log some "soft errors", where the response is valid but we consider * there are some quality issues like unjoined events. The following API * responses are supported, and no PII is included: * * `google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend` * * `google.cloud.discoveryengine.v1alpha.UserEventService.WriteUserEvent` * * `google.cloud.discoveryengine.v1alpha.UserEventService.CollectUserEvent` */ responsePayload?: { [key: string]: any }; /** * The service context in which this error has occurred. */ serviceContext?: GoogleCloudDiscoveryengineLoggingServiceContext; /** * The RPC status associated with the error log. */ status?: GoogleRpcStatus; } /** * HTTP request data that is related to a reported error. */ export interface GoogleCloudDiscoveryengineLoggingHttpRequestContext { /** * The HTTP response status code for the request. */ responseStatusCode?: number; } /** * The error payload that is populated on LRO import APIs, including the * following: * * `google.cloud.discoveryengine.v1alpha.DocumentService.ImportDocuments` * * `google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents` */ export interface GoogleCloudDiscoveryengineLoggingImportErrorContext { /** * The detailed content which caused the error on importing a document. */ document?: string; /** * Google Cloud Storage file path of the import source. Can be set for batch * operation error. */ gcsPath?: string; /** * Line number of the content in file. Should be empty for permission or * batch operation error. */ lineNumber?: string; /** * The operation resource name of the LRO. */ operation?: string; /** * The detailed content which caused the error on importing a user event. */ userEvent?: string; } /** * Describes a running service that sends errors. */ export interface GoogleCloudDiscoveryengineLoggingServiceContext { /** * An identifier of the service—for example, * `discoveryengine.googleapis.com`. */ service?: string; } /** * Indicates a location in the source code of the service for which errors are * reported. */ export interface GoogleCloudDiscoveryengineLoggingSourceLocation { /** * Human-readable name of a function or method—for example, * `google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend`. */ functionName?: string; } /** * Configuration data for advance site search. */ export interface GoogleCloudDiscoveryengineV1AdvancedSiteSearchConfig { } /** * AlloyDB source import data from. */ export interface GoogleCloudDiscoveryengineV1AlloyDbSource { /** * Required. The AlloyDB cluster to copy the data from with a length limit of * 256 characters. */ clusterId?: string; /** * Required. The AlloyDB database to copy the data from with a length limit * of 256 characters. */ databaseId?: string; /** * Intermediate Cloud Storage directory used for the import with a length * limit of 2,000 characters. Can be specified if one wants to have the * AlloyDB export to a specific Cloud Storage directory. Ensure that the * AlloyDB service account has the necessary Cloud Storage Admin permissions * to access the specified Cloud Storage directory. */ gcsStagingDir?: string; /** * Required. The AlloyDB location to copy the data from with a length limit * of 256 characters. */ locationId?: string; /** * The project ID that contains the AlloyDB source. Has a length limit of 128 * characters. If not specified, inherits the project ID from the parent * request. */ projectId?: string; /** * Required. The AlloyDB table to copy the data from with a length limit of * 256 characters. */ tableId?: string; } /** * Access Control Configuration. */ export interface GoogleCloudDiscoveryengineV1alphaAclConfig { /** * Identity provider config. */ idpConfig?: GoogleCloudDiscoveryengineV1alphaIdpConfig; /** * Immutable. The full resource name of the acl configuration. Format: * `projects/{project}/locations/{location}/aclConfig`. This field must be a * UTF-8 encoded string with a length limit of 1024 characters. */ name?: string; } /** * Configuration data for advance site search. */ export interface GoogleCloudDiscoveryengineV1alphaAdvancedSiteSearchConfig { /** * If set true, automatic refresh is disabled for the DataStore. */ disableAutomaticRefresh?: boolean; /** * If set true, initial indexing is disabled for the DataStore. */ disableInitialIndex?: boolean; } /** * Defines an answer. */ export interface GoogleCloudDiscoveryengineV1alphaAnswer { /** * Additional answer-skipped reasons. This provides the reason for ignored * cases. If nothing is skipped, this field is not set. */ answerSkippedReasons?: | "ANSWER_SKIPPED_REASON_UNSPECIFIED" | "ADVERSARIAL_QUERY_IGNORED" | "NON_ANSWER_SEEKING_QUERY_IGNORED" | "OUT_OF_DOMAIN_QUERY_IGNORED" | "POTENTIAL_POLICY_VIOLATION" | "NO_RELEVANT_CONTENT" | "JAIL_BREAKING_QUERY_IGNORED" | "CUSTOMER_POLICY_VIOLATION" | "NON_ANSWER_SEEKING_QUERY_IGNORED_V2" | "LOW_GROUNDED_ANSWER"[]; /** * The textual answer. */ answerText?: string; /** * Citations. */ citations?: GoogleCloudDiscoveryengineV1alphaAnswerCitation[]; /** * Output only. Answer completed timestamp. */ readonly completeTime?: Date; /** * Output only. Answer creation timestamp. */ readonly createTime?: Date; /** * A score in the range of [0, 1] describing how grounded the answer is by * the reference chunks. */ groundingScore?: number; /** * Optional. Grounding supports. */ groundingSupports?: GoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport[]; /** * Immutable. Fully qualified name * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*\/answers/*` */ name?: string; /** * Query understanding information. */ queryUnderstandingInfo?: GoogleCloudDiscoveryengineV1alphaAnswerQueryUnderstandingInfo; /** * References. */ references?: GoogleCloudDiscoveryengineV1alphaAnswerReference[]; /** * Suggested related questions. */ relatedQuestions?: string[]; /** * The state of the answer generation. */ state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS" | "FAILED" | "SUCCEEDED"; /** * Answer generation steps. */ steps?: GoogleCloudDiscoveryengineV1alphaAnswerStep[]; } function serializeGoogleCloudDiscoveryengineV1alphaAnswer(data: any): GoogleCloudDiscoveryengineV1alphaAnswer { return { ...data, citations: data["citations"] !== undefined ? data["citations"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1alphaAnswerCitation(item))) : undefined, groundingSupports: data["groundingSupports"] !== undefined ? data["groundingSupports"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaAnswer(data: any): GoogleCloudDiscoveryengineV1alphaAnswer { return { ...data, citations: data["citations"] !== undefined ? data["citations"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1alphaAnswerCitation(item))) : undefined, completeTime: data["completeTime"] !== undefined ? new Date(data["completeTime"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, groundingSupports: data["groundingSupports"] !== undefined ? data["groundingSupports"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport(item))) : undefined, }; } /** * Citation info for a segment. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerCitation { /** * End of the attributed segment, exclusive. */ endIndex?: bigint; /** * Citation sources for the attributed segment. */ sources?: GoogleCloudDiscoveryengineV1alphaAnswerCitationSource[]; /** * Index indicates the start of the segment, measured in bytes (UTF-8 * unicode). */ startIndex?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaAnswerCitation(data: any): GoogleCloudDiscoveryengineV1alphaAnswerCitation { return { ...data, endIndex: data["endIndex"] !== undefined ? String(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? String(data["startIndex"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaAnswerCitation(data: any): GoogleCloudDiscoveryengineV1alphaAnswerCitation { return { ...data, endIndex: data["endIndex"] !== undefined ? BigInt(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? BigInt(data["startIndex"]) : undefined, }; } /** * Citation source. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerCitationSource { /** * ID of the citation source. */ referenceId?: string; } /** * Grounding support for a claim in `answer_text`. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport { /** * Required. End of the claim, exclusive. */ endIndex?: bigint; /** * Indicates that this claim required grounding check. When the system * decided this claim didn't require attribution/grounding check, this field * is set to false. In that case, no grounding check was done for the claim * and therefore `grounding_score`, `sources` is not returned. */ groundingCheckRequired?: boolean; /** * A score in the range of [0, 1] describing how grounded is a specific claim * by the references. Higher value means that the claim is better supported by * the reference chunks. */ groundingScore?: number; /** * Optional. Citation sources for the claim. */ sources?: GoogleCloudDiscoveryengineV1alphaAnswerCitationSource[]; /** * Required. Index indicates the start of the claim, measured in bytes (UTF-8 * unicode). */ startIndex?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport(data: any): GoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport { return { ...data, endIndex: data["endIndex"] !== undefined ? String(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? String(data["startIndex"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport(data: any): GoogleCloudDiscoveryengineV1alphaAnswerGroundingSupport { return { ...data, endIndex: data["endIndex"] !== undefined ? BigInt(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? BigInt(data["startIndex"]) : undefined, }; } /** * Query understanding information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerQueryUnderstandingInfo { /** * Query classification information. */ queryClassificationInfo?: GoogleCloudDiscoveryengineV1alphaAnswerQueryUnderstandingInfoQueryClassificationInfo[]; } /** * Query classification information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerQueryUnderstandingInfoQueryClassificationInfo { /** * Classification output. */ positive?: boolean; /** * Query classification type. */ type?: | "TYPE_UNSPECIFIED" | "ADVERSARIAL_QUERY" | "NON_ANSWER_SEEKING_QUERY" | "JAIL_BREAKING_QUERY" | "NON_ANSWER_SEEKING_QUERY_V2"; } /** * Reference. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerReference { /** * Chunk information. */ chunkInfo?: GoogleCloudDiscoveryengineV1alphaAnswerReferenceChunkInfo; /** * Structured document information. */ structuredDocumentInfo?: GoogleCloudDiscoveryengineV1alphaAnswerReferenceStructuredDocumentInfo; /** * Unstructured document information. */ unstructuredDocumentInfo?: GoogleCloudDiscoveryengineV1alphaAnswerReferenceUnstructuredDocumentInfo; } /** * Chunk information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerReferenceChunkInfo { /** * Chunk resource name. */ chunk?: string; /** * Chunk textual content. */ content?: string; /** * Document metadata. */ documentMetadata?: GoogleCloudDiscoveryengineV1alphaAnswerReferenceChunkInfoDocumentMetadata; /** * The relevance of the chunk for a given query. Values range from 0.0 * (completely irrelevant) to 1.0 (completely relevant). This value is for * informational purpose only. It may change for the same query and chunk at * any time due to a model retraining or change in implementation. */ relevanceScore?: number; } /** * Document metadata. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerReferenceChunkInfoDocumentMetadata { /** * Document resource name. */ document?: string; /** * Page identifier. */ pageIdentifier?: string; /** * The structured JSON metadata for the document. It is populated from the * struct data from the Chunk in search result. */ structData?: { [key: string]: any }; /** * Title. */ title?: string; /** * URI for the document. */ uri?: string; } /** * Structured search information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerReferenceStructuredDocumentInfo { /** * Document resource name. */ document?: string; /** * Structured search data. */ structData?: { [key: string]: any }; } /** * Unstructured document information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerReferenceUnstructuredDocumentInfo { /** * List of cited chunk contents derived from document content. */ chunkContents?: GoogleCloudDiscoveryengineV1alphaAnswerReferenceUnstructuredDocumentInfoChunkContent[]; /** * Document resource name. */ document?: string; /** * The structured JSON metadata for the document. It is populated from the * struct data from the Chunk in search result. */ structData?: { [key: string]: any }; /** * Title. */ title?: string; /** * URI for the document. */ uri?: string; } /** * Chunk content. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerReferenceUnstructuredDocumentInfoChunkContent { /** * Chunk textual content. */ content?: string; /** * Page identifier. */ pageIdentifier?: string; /** * The relevance of the chunk for a given query. Values range from 0.0 * (completely irrelevant) to 1.0 (completely relevant). This value is for * informational purpose only. It may change for the same query and chunk at * any time due to a model retraining or change in implementation. */ relevanceScore?: number; } /** * Step information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerStep { /** * Actions. */ actions?: GoogleCloudDiscoveryengineV1alphaAnswerStepAction[]; /** * The description of the step. */ description?: string; /** * The state of the step. */ state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS" | "FAILED" | "SUCCEEDED"; /** * The thought of the step. */ thought?: string; } /** * Action. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerStepAction { /** * Observation. */ observation?: GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservation; /** * Search action. */ searchAction?: GoogleCloudDiscoveryengineV1alphaAnswerStepActionSearchAction; } /** * Observation. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservation { /** * Search results observed by the search action, it can be snippets info or * chunk info, depending on the citation type set by the user. */ searchResults?: GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservationSearchResult[]; } export interface GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservationSearchResult { /** * If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate * chunk info. */ chunkInfo?: GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservationSearchResultChunkInfo[]; /** * Document resource name. */ document?: string; /** * If citation_type is DOCUMENT_LEVEL_CITATION, populate document level * snippets. */ snippetInfo?: GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservationSearchResultSnippetInfo[]; /** * Data representation. The structured JSON data for the document. It's * populated from the struct data from the Document, or the Chunk in search * result. */ structData?: { [key: string]: any }; /** * Title. */ title?: string; /** * URI for the document. */ uri?: string; } /** * Chunk information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservationSearchResultChunkInfo { /** * Chunk resource name. */ chunk?: string; /** * Chunk textual content. */ content?: string; /** * The relevance of the chunk for a given query. Values range from 0.0 * (completely irrelevant) to 1.0 (completely relevant). This value is for * informational purpose only. It may change for the same query and chunk at * any time due to a model retraining or change in implementation. */ relevanceScore?: number; } /** * Snippet information. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerStepActionObservationSearchResultSnippetInfo { /** * Snippet content. */ snippet?: string; /** * Status of the snippet defined by the search team. */ snippetStatus?: string; } /** * Search action. */ export interface GoogleCloudDiscoveryengineV1alphaAnswerStepActionSearchAction { /** * The query to search. */ query?: string; } /** * Metadata related to the progress of the * SiteSearchEngineService.BatchCreateTargetSites operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaBatchCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaBatchCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.BatchCreateTargetSites method. */ export interface GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse { /** * TargetSites created. */ targetSites?: GoogleCloudDiscoveryengineV1alphaTargetSite[]; } /** * Configurations used to enable CMEK data encryption with Cloud KMS keys. */ export interface GoogleCloudDiscoveryengineV1alphaCmekConfig { /** * Output only. The default CmekConfig for the Customer. */ readonly isDefault?: boolean; /** * Kms key resource name which will be used to encrypt resources * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{keyId}`. */ kmsKey?: string; /** * Kms key version resource name which will be used to encrypt resources * `/cryptoKeyVersions/{keyVersion}`. */ kmsKeyVersion?: string; /** * Output only. The timestamp of the last key rotation. */ readonly lastRotationTimestampMicros?: bigint; /** * Required. Name of the CmekConfig, of the form * `projects/{project}/locations/{location}/cmekConfig` or * `projects/{project}/locations/{location}/cmekConfigs/{cmekConfig}`. */ name?: string; /** * Output only. State of the CmekConfig. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "KEY_ISSUE" | "DELETING" | "UNUSABLE" | "ACTIVE_ROTATING"; } /** * Defines circumstances to be checked before allowing a behavior */ export interface GoogleCloudDiscoveryengineV1alphaCondition { /** * Range of time(s) specifying when condition is active. Maximum of 10 time * ranges. */ activeTimeRange?: GoogleCloudDiscoveryengineV1alphaConditionTimeRange[]; /** * Optional. Query regex to match the whole search query. Cannot be set when * Condition.query_terms is set. This is currently supporting promotion use * case. */ queryRegex?: string; /** * Search only A list of terms to match the query on. Cannot be set when * Condition.query_regex is set. Maximum of 10 query terms. */ queryTerms?: GoogleCloudDiscoveryengineV1alphaConditionQueryTerm[]; } function serializeGoogleCloudDiscoveryengineV1alphaCondition(data: any): GoogleCloudDiscoveryengineV1alphaCondition { return { ...data, activeTimeRange: data["activeTimeRange"] !== undefined ? data["activeTimeRange"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1alphaConditionTimeRange(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCondition(data: any): GoogleCloudDiscoveryengineV1alphaCondition { return { ...data, activeTimeRange: data["activeTimeRange"] !== undefined ? data["activeTimeRange"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1alphaConditionTimeRange(item))) : undefined, }; } /** * Matcher for search request query */ export interface GoogleCloudDiscoveryengineV1alphaConditionQueryTerm { /** * Whether the search query needs to exactly match the query term. */ fullMatch?: boolean; /** * The specific query value to match against Must be lowercase, must be * UTF-8. Can have at most 3 space separated terms if full_match is true. * Cannot be an empty string. Maximum length of 5000 characters. */ value?: string; } /** * Used for time-dependent conditions. */ export interface GoogleCloudDiscoveryengineV1alphaConditionTimeRange { /** * End of time range. Range is inclusive. Must be in the future. */ endTime?: Date; /** * Start of time range. Range is inclusive. */ startTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaConditionTimeRange(data: any): GoogleCloudDiscoveryengineV1alphaConditionTimeRange { return { ...data, endTime: data["endTime"] !== undefined ? data["endTime"].toISOString() : undefined, startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaConditionTimeRange(data: any): GoogleCloudDiscoveryengineV1alphaConditionTimeRange { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * Defines a conditioned behavior to employ during serving. Must be attached to * a ServingConfig to be considered at serving time. Permitted actions dependent * on `SolutionType`. */ export interface GoogleCloudDiscoveryengineV1alphaControl { /** * Output only. List of all ServingConfig IDs this control is attached to. * May take up to 10 minutes to update after changes. */ readonly associatedServingConfigIds?: string[]; /** * Defines a boost-type control */ boostAction?: GoogleCloudDiscoveryengineV1alphaControlBoostAction; /** * Determines when the associated action will trigger. Omit to always apply * the action. Currently only a single condition may be specified. Otherwise * an INVALID ARGUMENT error is thrown. */ conditions?: GoogleCloudDiscoveryengineV1alphaCondition[]; /** * Required. Human readable name. The identifier used in UI views. Must be * UTF-8 encoded string. Length limit is 128 characters. Otherwise an INVALID * ARGUMENT error is thrown. */ displayName?: string; /** * Defines a filter-type control Currently not supported by Recommendation */ filterAction?: GoogleCloudDiscoveryengineV1alphaControlFilterAction; /** * Immutable. Fully qualified name * `projects/*\/locations/global/dataStore/*\/controls/*` */ name?: string; /** * Promote certain links based on predefined trigger queries. This now only * supports basic site search. */ promoteAction?: GoogleCloudDiscoveryengineV1alphaControlPromoteAction; /** * Defines a redirect-type control. */ redirectAction?: GoogleCloudDiscoveryengineV1alphaControlRedirectAction; /** * Required. Immutable. What solution the control belongs to. Must be * compatible with vertical of resource. Otherwise an INVALID ARGUMENT error * is thrown. */ solutionType?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"; /** * Treats a group of terms as synonyms of one another. */ synonymsAction?: GoogleCloudDiscoveryengineV1alphaControlSynonymsAction; /** * Specifies the use case for the control. Affects what condition fields can * be set. Only applies to SOLUTION_TYPE_SEARCH. Currently only allow one use * case per control. Must be set when solution_type is * SolutionType.SOLUTION_TYPE_SEARCH. */ useCases?: | "SEARCH_USE_CASE_UNSPECIFIED" | "SEARCH_USE_CASE_SEARCH" | "SEARCH_USE_CASE_BROWSE"[]; } function serializeGoogleCloudDiscoveryengineV1alphaControl(data: any): GoogleCloudDiscoveryengineV1alphaControl { return { ...data, conditions: data["conditions"] !== undefined ? data["conditions"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1alphaCondition(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaControl(data: any): GoogleCloudDiscoveryengineV1alphaControl { return { ...data, conditions: data["conditions"] !== undefined ? data["conditions"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1alphaCondition(item))) : undefined, }; } /** * Adjusts order of products in returned list. */ export interface GoogleCloudDiscoveryengineV1alphaControlBoostAction { /** * Required. Strength of the boost, which should be in [-1, 1]. Negative * boost means demotion. Default is 0.0 (No-op). */ boost?: number; /** * Required. Specifies which data store's documents can be boosted by this * control. Full data store name e.g. * projects/123/locations/global/collections/default_collection/dataStores/default_data_store */ dataStore?: string; /** * Required. Specifies which products to apply the boost to. If no filter is * provided all products will be boosted (No-op). Syntax documentation: * https://cloud.google.com/retail/docs/filter-and-order Maximum length is * 5000 characters. Otherwise an INVALID ARGUMENT error is thrown. */ filter?: string; } /** * Specified which products may be included in results. Uses same filter as * boost. */ export interface GoogleCloudDiscoveryengineV1alphaControlFilterAction { /** * Required. Specifies which data store's documents can be filtered by this * control. Full data store name e.g. * projects/123/locations/global/collections/default_collection/dataStores/default_data_store */ dataStore?: string; /** * Required. A filter to apply on the matching condition results. Required * Syntax documentation: https://cloud.google.com/retail/docs/filter-and-order * Maximum length is 5000 characters. Otherwise an INVALID ARGUMENT error is * thrown. */ filter?: string; } /** * Promote certain links based on some trigger queries. Example: Promote shoe * store link when searching for `shoe` keyword. The link can be outside of * associated data store. */ export interface GoogleCloudDiscoveryengineV1alphaControlPromoteAction { /** * Required. Data store with which this promotion is attached to. */ dataStore?: string; /** * Required. Promotion attached to this action. */ searchLinkPromotion?: GoogleCloudDiscoveryengineV1alphaSearchLinkPromotion; } /** * Redirects a shopper to the provided URI. */ export interface GoogleCloudDiscoveryengineV1alphaControlRedirectAction { /** * Required. The URI to which the shopper will be redirected. Required. URI * must have length equal or less than 2000 characters. Otherwise an INVALID * ARGUMENT error is thrown. */ redirectUri?: string; } /** * Creates a set of terms that will act as synonyms of one another. Example: * "happy" will also be considered as "glad", "glad" will also be considered as * "happy". */ export interface GoogleCloudDiscoveryengineV1alphaControlSynonymsAction { /** * Defines a set of synonyms. Can specify up to 100 synonyms. Must specify at * least 2 synonyms. Otherwise an INVALID ARGUMENT error is thrown. */ synonyms?: string[]; } /** * The historical crawl rate timeseries data, used for monitoring. */ export interface GoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries { /** * The QPS of the crawl rate. */ qpsTimeSeries?: GoogleMonitoringV3TimeSeries; } function serializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data: any): GoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries { return { ...data, qpsTimeSeries: data["qpsTimeSeries"] !== undefined ? serializeGoogleMonitoringV3TimeSeries(data["qpsTimeSeries"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data: any): GoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries { return { ...data, qpsTimeSeries: data["qpsTimeSeries"] !== undefined ? deserializeGoogleMonitoringV3TimeSeries(data["qpsTimeSeries"]) : undefined, }; } /** * Metadata related to the progress of the DataStoreService.CreateDataStore * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaCreateDataStoreMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaCreateDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCreateDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the EngineService.CreateEngine * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaCreateEngineMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaCreateEngineMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCreateEngineMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for EvaluationService.CreateEvaluation method. */ export interface GoogleCloudDiscoveryengineV1alphaCreateEvaluationMetadata { } /** * Metadata for Create Schema LRO. */ export interface GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.CreateSitemap operation. This will be returned by the * google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaCreateSitemapMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaCreateSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCreateSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.CreateTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaCreateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Defines custom fine tuning spec. */ export interface GoogleCloudDiscoveryengineV1alphaCustomFineTuningSpec { /** * Whether or not to enable and include custom fine tuned search adaptor * model. */ enableSearchAdaptor?: boolean; } /** * Metadata that describes a custom tuned model. */ export interface GoogleCloudDiscoveryengineV1alphaCustomTuningModel { /** * Deprecated: Timestamp the Model was created at. */ createTime?: Date; /** * The display name of the model. */ displayName?: string; /** * Currently this is only populated if the model state is * `INPUT_VALIDATION_FAILED`. */ errorMessage?: string; /** * The metrics of the trained model. */ metrics?: { [key: string]: number }; /** * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). */ modelState?: | "MODEL_STATE_UNSPECIFIED" | "TRAINING_PAUSED" | "TRAINING" | "TRAINING_COMPLETE" | "READY_FOR_SERVING" | "TRAINING_FAILED" | "NO_IMPROVEMENT" | "INPUT_VALIDATION_FAILED"; /** * The version of the model. */ modelVersion?: bigint; /** * Required. The fully qualified resource name of the model. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. * Model must be an alpha-numerical string with limit of 40 characters. */ name?: string; /** * Timestamp the model training was initiated. */ trainingStartTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaCustomTuningModel(data: any): GoogleCloudDiscoveryengineV1alphaCustomTuningModel { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, modelVersion: data["modelVersion"] !== undefined ? String(data["modelVersion"]) : undefined, trainingStartTime: data["trainingStartTime"] !== undefined ? data["trainingStartTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaCustomTuningModel(data: any): GoogleCloudDiscoveryengineV1alphaCustomTuningModel { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, modelVersion: data["modelVersion"] !== undefined ? BigInt(data["modelVersion"]) : undefined, trainingStartTime: data["trainingStartTime"] !== undefined ? new Date(data["trainingStartTime"]) : undefined, }; } /** * DataStore captures global settings and configs at the DataStore level. */ export interface GoogleCloudDiscoveryengineV1alphaDataStore { /** * Immutable. Whether data in the DataStore has ACL information. If set to * `true`, the source data must have ACL. ACL will be ingested when data is * ingested by DocumentService.ImportDocuments methods. When ACL is enabled * for the DataStore, Document can't be accessed by calling * DocumentService.GetDocument or DocumentService.ListDocuments. Currently ACL * is only supported in `GENERIC` industry vertical with non-`PUBLIC_WEBSITE` * content config. */ aclEnabled?: boolean; /** * Optional. Configuration for advanced site search. */ advancedSiteSearchConfig?: GoogleCloudDiscoveryengineV1alphaAdvancedSiteSearchConfig; /** * Output only. Data size estimation for billing. */ readonly billingEstimation?: GoogleCloudDiscoveryengineV1alphaDataStoreBillingEstimation; /** * Output only. CMEK-related information for the DataStore. */ readonly cmekConfig?: GoogleCloudDiscoveryengineV1alphaCmekConfig; /** * Immutable. The content config of the data store. If this field is unset, * the server behavior defaults to ContentConfig.NO_CONTENT. */ contentConfig?: | "CONTENT_CONFIG_UNSPECIFIED" | "NO_CONTENT" | "CONTENT_REQUIRED" | "PUBLIC_WEBSITE" | "GOOGLE_WORKSPACE"; /** * Output only. Timestamp the DataStore was created at. */ readonly createTime?: Date; /** * Output only. The id of the default Schema asscociated to this data store. */ readonly defaultSchemaId?: string; /** * Required. The data store display name. This field must be a UTF-8 encoded * string with a length limit of 128 characters. Otherwise, an * INVALID_ARGUMENT error is returned. */ displayName?: string; /** * Configuration for Document understanding and enrichment. */ documentProcessingConfig?: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfig; /** * Output only. Data store level identity provider config. */ readonly idpConfig?: GoogleCloudDiscoveryengineV1alphaIdpConfig; /** * Immutable. The industry vertical that the data store registers. */ industryVertical?: | "INDUSTRY_VERTICAL_UNSPECIFIED" | "GENERIC" | "MEDIA" | "HEALTHCARE_FHIR"; /** * Input only. The KMS key to be used to protect this DataStore at creation * time. Must be set for requests that need to comply with CMEK Org Policy * protections. If this field is set and processed successfully, the DataStore * will be protected by the KMS key, as indicated in the cmek_config field. */ kmsKeyName?: string; /** * Language info for DataStore. */ languageInfo?: GoogleCloudDiscoveryengineV1alphaLanguageInfo; /** * Immutable. The full resource name of the data store. Format: * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * Optional. Configuration for Natural Language Query Understanding. */ naturalLanguageQueryUnderstandingConfig?: GoogleCloudDiscoveryengineV1alphaNaturalLanguageQueryUnderstandingConfig; /** * Optional. Stores serving config at DataStore level. */ servingConfigDataStore?: GoogleCloudDiscoveryengineV1alphaDataStoreServingConfigDataStore; /** * The solutions that the data store enrolls. Available solutions for each * industry_vertical: * `MEDIA`: `SOLUTION_TYPE_RECOMMENDATION` and * `SOLUTION_TYPE_SEARCH`. * `SITE_SEARCH`: `SOLUTION_TYPE_SEARCH` is * automatically enrolled. Other solutions cannot be enrolled. */ solutionTypes?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"[]; /** * The start schema to use for this DataStore when provisioning it. If unset, * a default vertical specialized schema will be used. This field is only used * by CreateDataStore API, and will be ignored if used in other APIs. This * field will be omitted from all API responses including CreateDataStore API. * To retrieve a schema of a DataStore, use SchemaService.GetSchema API * instead. The provided schema will be validated against certain rules on * schema. Learn more from [this * doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema). */ startingSchema?: GoogleCloudDiscoveryengineV1alphaSchema; /** * Config to store data store type configuration for workspace data. This * must be set when DataStore.content_config is set as * DataStore.ContentConfig.GOOGLE_WORKSPACE. */ workspaceConfig?: GoogleCloudDiscoveryengineV1alphaWorkspaceConfig; } /** * Estimation of data size per data store. */ export interface GoogleCloudDiscoveryengineV1alphaDataStoreBillingEstimation { /** * Data size for structured data in terms of bytes. */ structuredDataSize?: bigint; /** * Last updated timestamp for structured data. */ structuredDataUpdateTime?: Date; /** * Data size for unstructured data in terms of bytes. */ unstructuredDataSize?: bigint; /** * Last updated timestamp for unstructured data. */ unstructuredDataUpdateTime?: Date; /** * Data size for websites in terms of bytes. */ websiteDataSize?: bigint; /** * Last updated timestamp for websites. */ websiteDataUpdateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaDataStoreBillingEstimation(data: any): GoogleCloudDiscoveryengineV1alphaDataStoreBillingEstimation { return { ...data, structuredDataSize: data["structuredDataSize"] !== undefined ? String(data["structuredDataSize"]) : undefined, structuredDataUpdateTime: data["structuredDataUpdateTime"] !== undefined ? data["structuredDataUpdateTime"].toISOString() : undefined, unstructuredDataSize: data["unstructuredDataSize"] !== undefined ? String(data["unstructuredDataSize"]) : undefined, unstructuredDataUpdateTime: data["unstructuredDataUpdateTime"] !== undefined ? data["unstructuredDataUpdateTime"].toISOString() : undefined, websiteDataSize: data["websiteDataSize"] !== undefined ? String(data["websiteDataSize"]) : undefined, websiteDataUpdateTime: data["websiteDataUpdateTime"] !== undefined ? data["websiteDataUpdateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDataStoreBillingEstimation(data: any): GoogleCloudDiscoveryengineV1alphaDataStoreBillingEstimation { return { ...data, structuredDataSize: data["structuredDataSize"] !== undefined ? BigInt(data["structuredDataSize"]) : undefined, structuredDataUpdateTime: data["structuredDataUpdateTime"] !== undefined ? new Date(data["structuredDataUpdateTime"]) : undefined, unstructuredDataSize: data["unstructuredDataSize"] !== undefined ? BigInt(data["unstructuredDataSize"]) : undefined, unstructuredDataUpdateTime: data["unstructuredDataUpdateTime"] !== undefined ? new Date(data["unstructuredDataUpdateTime"]) : undefined, websiteDataSize: data["websiteDataSize"] !== undefined ? BigInt(data["websiteDataSize"]) : undefined, websiteDataUpdateTime: data["websiteDataUpdateTime"] !== undefined ? new Date(data["websiteDataUpdateTime"]) : undefined, }; } /** * Stores information regarding the serving configurations at DataStore level. */ export interface GoogleCloudDiscoveryengineV1alphaDataStoreServingConfigDataStore { /** * If set true, the DataStore will not be available for serving search * requests. */ disabledForServing?: boolean; } /** * The historical dedicated crawl rate timeseries data, used for monitoring. * Dedicated crawl is used by Vertex AI to crawl the user's website when * dedicate crawl is set. */ export interface GoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries { /** * Vertex AI's dedicated crawl rate time series of auto-refresh, which is the * crawl rate of Google-CloudVertexBot when dedicate crawl is set, and the * crawl rate is for best effort use cases like refreshing urls periodically. */ autoRefreshCrawlRate?: GoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries; /** * Vertex AI's dedicated crawl rate time series of user triggered crawl, * which is the crawl rate of Google-CloudVertexBot when dedicate crawl is * set, and user triggered crawl rate is for deterministic use cases like * crawling urls or sitemaps specified by users. */ userTriggeredCrawlRate?: GoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries; } function serializeGoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries(data: any): GoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries { return { ...data, autoRefreshCrawlRate: data["autoRefreshCrawlRate"] !== undefined ? serializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["autoRefreshCrawlRate"]) : undefined, userTriggeredCrawlRate: data["userTriggeredCrawlRate"] !== undefined ? serializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["userTriggeredCrawlRate"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries(data: any): GoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries { return { ...data, autoRefreshCrawlRate: data["autoRefreshCrawlRate"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["autoRefreshCrawlRate"]) : undefined, userTriggeredCrawlRate: data["userTriggeredCrawlRate"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["userTriggeredCrawlRate"]) : undefined, }; } /** * Metadata related to the progress of the DataStoreService.DeleteDataStore * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaDeleteDataStoreMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaDeleteDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDeleteDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the EngineService.DeleteEngine * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaDeleteEngineMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaDeleteEngineMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDeleteEngineMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for DeleteSchema LRO. */ export interface GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request for DeleteSession method. */ export interface GoogleCloudDiscoveryengineV1alphaDeleteSessionRequest { /** * Required. The resource name of the Session to delete. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ name?: string; } /** * Metadata related to the progress of the * SiteSearchEngineService.DeleteSitemap operation. This will be returned by the * google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaDeleteSitemapMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaDeleteSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDeleteSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.DeleteTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaDeleteTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaDeleteTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDeleteTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDeleteTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.DisableAdvancedSiteSearch operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaDisableAdvancedSiteSearchMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaDisableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDisableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaDisableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1alphaDisableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.DisableAdvancedSiteSearch * method. */ export interface GoogleCloudDiscoveryengineV1alphaDisableAdvancedSiteSearchResponse { } /** * A singleton resource of DataStore. If it's empty when DataStore is created * and DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED, the default * parser will default to digital parser. */ export interface GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfig { /** * Whether chunking mode is enabled. */ chunkingConfig?: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigChunkingConfig; /** * Configurations for default Document parser. If not specified, we will * configure it as default DigitalParsingConfig, and the default parsing * config will be applied to all file types for Document parsing. */ defaultParsingConfig?: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfig; /** * The full resource name of the Document Processing Config. Format: * `projects/*\/locations/*\/collections/*\/dataStores/*\/documentProcessingConfig`. */ name?: string; /** * Map from file type to override the default parsing configuration based on * the file type. Supported keys: * `pdf`: Override parsing config for PDF * files, either digital parsing, ocr parsing or layout parsing is supported. * * `html`: Override parsing config for HTML files, only digital parsing and * layout parsing are supported. * `docx`: Override parsing config for DOCX * files, only digital parsing and layout parsing are supported. * `pptx`: * Override parsing config for PPTX files, only digital parsing and layout * parsing are supported. * `xlsm`: Override parsing config for XLSM files, * only digital parsing and layout parsing are supported. * `xlsx`: Override * parsing config for XLSX files, only digital parsing and layout parsing are * supported. */ parsingConfigOverrides?: { [key: string]: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfig }; } /** * Configuration for chunking config. */ export interface GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigChunkingConfig { /** * Configuration for the layout based chunking. */ layoutBasedChunkingConfig?: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig; } /** * Configuration for the layout based chunking. */ export interface GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig { /** * The token size limit for each chunk. Supported values: 100-500 * (inclusive). Default value: 500. */ chunkSize?: number; /** * Whether to include appending different levels of headings to chunks from * the middle of the document to prevent context loss. Default value: False. */ includeAncestorHeadings?: boolean; } /** * Related configurations applied to a specific type of document parser. */ export interface GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfig { /** * Configurations applied to digital parser. */ digitalParsingConfig?: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfigDigitalParsingConfig; /** * Configurations applied to layout parser. */ layoutParsingConfig?: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfigLayoutParsingConfig; /** * Configurations applied to OCR parser. Currently it only applies to PDFs. */ ocrParsingConfig?: GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfigOcrParsingConfig; } /** * The digital parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfigDigitalParsingConfig { } /** * The layout parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfigLayoutParsingConfig { } /** * The OCR parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1alphaDocumentProcessingConfigParsingConfigOcrParsingConfig { /** * [DEPRECATED] This field is deprecated. To use the additional enhanced * document elements processing, please switch to `layout_parsing_config`. */ enhancedDocumentElements?: string[]; /** * If true, will use native text instead of OCR text on pages containing * native text. */ useNativeText?: boolean; } /** * Metadata related to the progress of the * SiteSearchEngineService.EnableAdvancedSiteSearch operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaEnableAdvancedSiteSearchMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaEnableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1alphaEnableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaEnableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1alphaEnableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.EnableAdvancedSiteSearch * method. */ export interface GoogleCloudDiscoveryengineV1alphaEnableAdvancedSiteSearchResponse { } /** * Metadata that describes the training and serving parameters of an Engine. */ export interface GoogleCloudDiscoveryengineV1alphaEngine { /** * Configurations for the Chat Engine. Only applicable if solution_type is * SOLUTION_TYPE_CHAT. */ chatEngineConfig?: GoogleCloudDiscoveryengineV1alphaEngineChatEngineConfig; /** * Output only. Additional information of the Chat Engine. Only applicable if * solution_type is SOLUTION_TYPE_CHAT. */ readonly chatEngineMetadata?: GoogleCloudDiscoveryengineV1alphaEngineChatEngineMetadata; /** * Common config spec that specifies the metadata of the engine. */ commonConfig?: GoogleCloudDiscoveryengineV1alphaEngineCommonConfig; /** * Output only. Timestamp the Recommendation Engine was created at. */ readonly createTime?: Date; /** * The data stores associated with this engine. For SOLUTION_TYPE_SEARCH and * SOLUTION_TYPE_RECOMMENDATION type of engines, they can only associate with * at most one data store. If solution_type is SOLUTION_TYPE_CHAT, multiple * DataStores in the same Collection can be associated here. Note that when * used in CreateEngineRequest, one DataStore id must be provided as the * system will use it for necessary initializations. */ dataStoreIds?: string[]; /** * Optional. Whether to disable analytics for searches performed on this * engine. */ disableAnalytics?: boolean; /** * Required. The display name of the engine. Should be human readable. UTF-8 * encoded string with limit of 1024 characters. */ displayName?: string; /** * The industry vertical that the engine registers. The restriction of the * Engine industry vertical is based on DataStore: If unspecified, default to * `GENERIC`. Vertical on Engine has to match vertical of the DataStore linked * to the engine. */ industryVertical?: | "INDUSTRY_VERTICAL_UNSPECIFIED" | "GENERIC" | "MEDIA" | "HEALTHCARE_FHIR"; /** * Configurations for the Media Engine. Only applicable on the data stores * with solution_type SOLUTION_TYPE_RECOMMENDATION and IndustryVertical.MEDIA * vertical. */ mediaRecommendationEngineConfig?: GoogleCloudDiscoveryengineV1alphaEngineMediaRecommendationEngineConfig; /** * Immutable. The fully qualified resource name of the engine. This field * must be a UTF-8 encoded string with a length limit of 1024 characters. * Format: * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` * engine should be 1-63 characters, and valid characters are /a-z0-9*\/. * Otherwise, an INVALID_ARGUMENT error is returned. */ name?: string; /** * Output only. Additional information of a recommendation engine. Only * applicable if solution_type is SOLUTION_TYPE_RECOMMENDATION. */ readonly recommendationMetadata?: GoogleCloudDiscoveryengineV1alphaEngineRecommendationMetadata; /** * Configurations for the Search Engine. Only applicable if solution_type is * SOLUTION_TYPE_SEARCH. */ searchEngineConfig?: GoogleCloudDiscoveryengineV1alphaEngineSearchEngineConfig; /** * Additional config specs for a `similar-items` engine. */ similarDocumentsConfig?: GoogleCloudDiscoveryengineV1alphaEngineSimilarDocumentsEngineConfig; /** * Required. The solutions of the engine. */ solutionType?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"; /** * Output only. Timestamp the Recommendation Engine was last updated. */ readonly updateTime?: Date; } /** * Configurations for a Chat Engine. */ export interface GoogleCloudDiscoveryengineV1alphaEngineChatEngineConfig { /** * The configurationt generate the Dialogflow agent that is associated to * this Engine. Note that these configurations are one-time consumed by and * passed to Dialogflow service. It means they cannot be retrieved using * EngineService.GetEngine or EngineService.ListEngines API after engine * creation. */ agentCreationConfig?: GoogleCloudDiscoveryengineV1alphaEngineChatEngineConfigAgentCreationConfig; /** * The resource name of an exist Dialogflow agent to link to this Chat * Engine. Customers can either provide `agent_creation_config` to create * agent or provide an agent name that links the agent with the Chat engine. * Format: `projects//locations//agents/`. Note that the * `dialogflow_agent_to_link` are one-time consumed by and passed to * Dialogflow service. It means they cannot be retrieved using * EngineService.GetEngine or EngineService.ListEngines API after engine * creation. Use ChatEngineMetadata.dialogflow_agent for actual agent * association after Engine is created. */ dialogflowAgentToLink?: string; } /** * Configurations for generating a Dialogflow agent. Note that these * configurations are one-time consumed by and passed to Dialogflow service. It * means they cannot be retrieved using EngineService.GetEngine or * EngineService.ListEngines API after engine creation. */ export interface GoogleCloudDiscoveryengineV1alphaEngineChatEngineConfigAgentCreationConfig { /** * Name of the company, organization or other entity that the agent * represents. Used for knowledge connector LLM prompt and for knowledge * search. */ business?: string; /** * Required. The default language of the agent as a language tag. See * [Language * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a * list of the currently supported language codes. */ defaultLanguageCode?: string; /** * Agent location for Agent creation, supported values: global/us/eu. If not * provided, us Engine will create Agent using us-central-1 by default; eu * Engine will create Agent using eu-west-1 by default. */ location?: string; /** * Required. The time zone of the agent from the [time zone * database](https://www.iana.org/time-zones), e.g., America/New_York, * Europe/Paris. */ timeZone?: string; } /** * Additional information of a Chat Engine. Fields in this message are output * only. */ export interface GoogleCloudDiscoveryengineV1alphaEngineChatEngineMetadata { /** * The resource name of a Dialogflow agent, that this Chat Engine refers to. * Format: `projects//locations//agents/`. */ dialogflowAgent?: string; } /** * Common configurations for an Engine. */ export interface GoogleCloudDiscoveryengineV1alphaEngineCommonConfig { /** * The name of the company, business or entity that is associated with the * engine. Setting this may help improve LLM related features. */ companyName?: string; } /** * Additional config specs for a Media Recommendation engine. */ export interface GoogleCloudDiscoveryengineV1alphaEngineMediaRecommendationEngineConfig { /** * The optimization objective. e.g., `cvr`. This field together with * optimization_objective describe engine metadata to use to control engine * training and serving. Currently supported values: `ctr`, `cvr`. If not * specified, we choose default based on engine type. Default depends on type * of recommendation: `recommended-for-you` => `ctr` `others-you-may-like` => * `ctr` */ optimizationObjective?: string; /** * Name and value of the custom threshold for cvr optimization_objective. For * target_field `watch-time`, target_field_value must be an integer value * indicating the media progress time in seconds between (0, 86400] (excludes * 0, includes 86400) (e.g., 90). For target_field `watch-percentage`, the * target_field_value must be a valid float value between (0, 1.0] (excludes * 0, includes 1.0) (e.g., 0.5). */ optimizationObjectiveConfig?: GoogleCloudDiscoveryengineV1alphaEngineMediaRecommendationEngineConfigOptimizationObjectiveConfig; /** * The training state that the engine is in (e.g. `TRAINING` or `PAUSED`). * Since part of the cost of running the service is frequency of training - * this can be used to determine when to train engine in order to control * cost. If not specified: the default value for `CreateEngine` method is * `TRAINING`. The default value for `UpdateEngine` method is to keep the * state the same as before. */ trainingState?: | "TRAINING_STATE_UNSPECIFIED" | "PAUSED" | "TRAINING"; /** * Required. The type of engine. e.g., `recommended-for-you`. This field * together with optimization_objective describe engine metadata to use to * control engine training and serving. Currently supported values: * `recommended-for-you`, `others-you-may-like`, `more-like-this`, * `most-popular-items`. */ type?: string; } /** * Custom threshold for `cvr` optimization_objective. */ export interface GoogleCloudDiscoveryengineV1alphaEngineMediaRecommendationEngineConfigOptimizationObjectiveConfig { /** * Required. The name of the field to target. Currently supported values: * `watch-percentage`, `watch-time`. */ targetField?: string; /** * Required. The threshold to be applied to the target (e.g., 0.5). */ targetFieldValueFloat?: number; } /** * Additional information of a recommendation engine. */ export interface GoogleCloudDiscoveryengineV1alphaEngineRecommendationMetadata { /** * Output only. The state of data requirements for this engine: `DATA_OK` and * `DATA_ERROR`. Engine cannot be trained if the data is in `DATA_ERROR` * state. Engine can have `DATA_ERROR` state even if serving state is * `ACTIVE`: engines were trained successfully before, but cannot be refreshed * because the underlying engine no longer has sufficient data for training. */ readonly dataState?: | "DATA_STATE_UNSPECIFIED" | "DATA_OK" | "DATA_ERROR"; /** * Output only. The timestamp when the latest successful tune finished. Only * applicable on Media Recommendation engines. */ readonly lastTuneTime?: Date; /** * Output only. The serving state of the engine: `ACTIVE`, `NOT_ACTIVE`. */ readonly servingState?: | "SERVING_STATE_UNSPECIFIED" | "INACTIVE" | "ACTIVE" | "TUNED"; /** * Output only. The latest tune operation id associated with the engine. Only * applicable on Media Recommendation engines. If present, this operation id * can be used to determine if there is an ongoing tune for this engine. To * check the operation status, send the GetOperation request with this * operation id in the engine resource format. If no tuning has happened for * this engine, the string is empty. */ readonly tuningOperation?: string; } /** * Configurations for a Search Engine. */ export interface GoogleCloudDiscoveryengineV1alphaEngineSearchEngineConfig { /** * The add-on that this search engine enables. */ searchAddOns?: | "SEARCH_ADD_ON_UNSPECIFIED" | "SEARCH_ADD_ON_LLM"[]; /** * The search feature tier of this engine. Different tiers might have * different pricing. To learn more, check the pricing documentation. Defaults * to SearchTier.SEARCH_TIER_STANDARD if not specified. */ searchTier?: | "SEARCH_TIER_UNSPECIFIED" | "SEARCH_TIER_STANDARD" | "SEARCH_TIER_ENTERPRISE"; } /** * Additional config specs for a `similar-items` engine. */ export interface GoogleCloudDiscoveryengineV1alphaEngineSimilarDocumentsEngineConfig { } /** * Metadata related to the progress of the EstimateDataSize operation. This is * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaEstimateDataSizeMetadata { /** * Operation create time. */ createTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaEstimateDataSizeMetadata(data: any): GoogleCloudDiscoveryengineV1alphaEstimateDataSizeMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaEstimateDataSizeMetadata(data: any): GoogleCloudDiscoveryengineV1alphaEstimateDataSizeMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, }; } /** * Response of the EstimateDataSize request. If the long running operation was * successful, then this message is returned by the * google.longrunning.Operations.response field if the operation was successful. */ export interface GoogleCloudDiscoveryengineV1alphaEstimateDataSizeResponse { /** * Data size in terms of bytes. */ dataSizeBytes?: bigint; /** * Total number of documents. */ documentCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaEstimateDataSizeResponse(data: any): GoogleCloudDiscoveryengineV1alphaEstimateDataSizeResponse { return { ...data, dataSizeBytes: data["dataSizeBytes"] !== undefined ? String(data["dataSizeBytes"]) : undefined, documentCount: data["documentCount"] !== undefined ? String(data["documentCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaEstimateDataSizeResponse(data: any): GoogleCloudDiscoveryengineV1alphaEstimateDataSizeResponse { return { ...data, dataSizeBytes: data["dataSizeBytes"] !== undefined ? BigInt(data["dataSizeBytes"]) : undefined, documentCount: data["documentCount"] !== undefined ? BigInt(data["documentCount"]) : undefined, }; } /** * An evaluation is a single execution (or run) of an evaluation process. It * encapsulates the state of the evaluation and the resulting data. */ export interface GoogleCloudDiscoveryengineV1alphaEvaluation { /** * Output only. Timestamp the Evaluation was created at. */ readonly createTime?: Date; /** * Output only. Timestamp the Evaluation was completed at. */ readonly endTime?: Date; /** * Output only. The error that occurred during evaluation. Only populated * when the evaluation's state is FAILED. */ readonly error?: GoogleRpcStatus; /** * Output only. A sample of errors encountered while processing the request. */ readonly errorSamples?: GoogleRpcStatus[]; /** * Required. The specification of the evaluation. */ evaluationSpec?: GoogleCloudDiscoveryengineV1alphaEvaluationEvaluationSpec; /** * Identifier. The full resource name of the Evaluation, in the format of * `projects/{project}/locations/{location}/evaluations/{evaluation}`. This * field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * Output only. The metrics produced by the evaluation, averaged across all * SampleQuerys in the SampleQuerySet. Only populated when the evaluation's * state is SUCCEEDED. */ readonly qualityMetrics?: GoogleCloudDiscoveryengineV1alphaQualityMetrics; /** * Output only. The state of the evaluation. */ readonly state?: | "STATE_UNSPECIFIED" | "PENDING" | "RUNNING" | "SUCCEEDED" | "FAILED"; } /** * Describes the specification of the evaluation. */ export interface GoogleCloudDiscoveryengineV1alphaEvaluationEvaluationSpec { /** * Required. The specification of the query set. */ querySetSpec?: GoogleCloudDiscoveryengineV1alphaEvaluationEvaluationSpecQuerySetSpec; /** * Required. The search request that is used to perform the evaluation. Only * the following fields within SearchRequest are supported; if any other * fields are provided, an UNSUPPORTED error will be returned: * * SearchRequest.serving_config * SearchRequest.branch * * SearchRequest.canonical_filter * SearchRequest.query_expansion_spec * * SearchRequest.spell_correction_spec * SearchRequest.content_search_spec * * SearchRequest.user_pseudo_id */ searchRequest?: GoogleCloudDiscoveryengineV1alphaSearchRequest; } /** * Describes the specification of the query set. */ export interface GoogleCloudDiscoveryengineV1alphaEvaluationEvaluationSpecQuerySetSpec { /** * Required. The full resource name of the SampleQuerySet used for the * evaluation, in the format of * `projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}`. */ sampleQuerySet?: string; } /** * Response message for SiteSearchEngineService.FetchSitemaps method. */ export interface GoogleCloudDiscoveryengineV1alphaFetchSitemapsResponse { /** * List of Sitemaps fetched. */ sitemapsMetadata?: GoogleCloudDiscoveryengineV1alphaFetchSitemapsResponseSitemapMetadata[]; } /** * Contains a Sitemap and its metadata. */ export interface GoogleCloudDiscoveryengineV1alphaFetchSitemapsResponseSitemapMetadata { /** * The Sitemap. */ sitemap?: GoogleCloudDiscoveryengineV1alphaSitemap; } /** * Configurations for fields of a schema. For example, configuring a field is * indexable, or searchable. */ export interface GoogleCloudDiscoveryengineV1alphaFieldConfig { /** * If this field is set, only the corresponding source will be indexed for * this field. Otherwise, the values from different sources are merged. * Assuming a page with `` in meta tag, and `` in page map: if this enum is * set to METATAGS, we will only index ``; if this enum is not set, we will * merge them and index ``. */ advancedSiteSearchDataSources?: | "ADVANCED_SITE_SEARCH_DATA_SOURCE_UNSPECIFIED" | "METATAGS" | "PAGEMAP" | "URI_PATTERN_MAPPING" | "SCHEMA_ORG"[]; /** * If completable_option is COMPLETABLE_ENABLED, field values are directly * used and returned as suggestions for Autocomplete in * CompletionService.CompleteQuery. If completable_option is unset, the server * behavior defaults to COMPLETABLE_DISABLED for fields that support setting * completable options, which are just `string` fields. For those fields that * do not support setting completable options, the server will skip * completable option setting, and setting completable_option for those fields * will throw `INVALID_ARGUMENT` error. */ completableOption?: | "COMPLETABLE_OPTION_UNSPECIFIED" | "COMPLETABLE_ENABLED" | "COMPLETABLE_DISABLED"; /** * If dynamic_facetable_option is DYNAMIC_FACETABLE_ENABLED, field values are * available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED if * FieldConfig.indexable_option is INDEXABLE_DISABLED. Otherwise, an * `INVALID_ARGUMENT` error will be returned. If dynamic_facetable_option is * unset, the server behavior defaults to DYNAMIC_FACETABLE_DISABLED for * fields that support setting dynamic facetable options. For those fields * that do not support setting dynamic facetable options, such as `object` and * `boolean`, the server will skip dynamic facetable option setting, and * setting dynamic_facetable_option for those fields will throw * `INVALID_ARGUMENT` error. */ dynamicFacetableOption?: | "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" | "DYNAMIC_FACETABLE_ENABLED" | "DYNAMIC_FACETABLE_DISABLED"; /** * Required. Field path of the schema field. For example: `title`, * `description`, `release_info.release_year`. */ fieldPath?: string; /** * Output only. Raw type of the field. */ readonly fieldType?: | "FIELD_TYPE_UNSPECIFIED" | "OBJECT" | "STRING" | "NUMBER" | "INTEGER" | "BOOLEAN" | "GEOLOCATION" | "DATETIME"; /** * If indexable_option is INDEXABLE_ENABLED, field values are indexed so that * it can be filtered or faceted in SearchService.Search. If indexable_option * is unset, the server behavior defaults to INDEXABLE_DISABLED for fields * that support setting indexable options. For those fields that do not * support setting indexable options, such as `object` and `boolean` and key * properties, the server will skip indexable_option setting, and setting * indexable_option for those fields will throw `INVALID_ARGUMENT` error. */ indexableOption?: | "INDEXABLE_OPTION_UNSPECIFIED" | "INDEXABLE_ENABLED" | "INDEXABLE_DISABLED"; /** * Output only. Type of the key property that this field is mapped to. Empty * string if this is not annotated as mapped to a key property. Example types * are `title`, `description`. Full list is defined by `keyPropertyMapping` in * the schema field annotation. If the schema field has a `KeyPropertyMapping` * annotation, `indexable_option` and `searchable_option` of this field cannot * be modified. */ readonly keyPropertyType?: string; /** * Optional. The metatag name found in the HTML page. If user defines this * field, the value of this metatag name will be used to extract metatag. If * the user does not define this field, the FieldConfig.field_path will be * used to extract metatag. */ metatagName?: string; /** * If recs_filterable_option is FILTERABLE_ENABLED, field values are * filterable by filter expression in RecommendationService.Recommend. If * FILTERABLE_ENABLED but the field type is numerical, field values are not * filterable by text queries in RecommendationService.Recommend. Only textual * fields are supported. If recs_filterable_option is unset, the default * setting is FILTERABLE_DISABLED for fields that support setting filterable * options. When a field set to [FILTERABLE_DISABLED] is filtered, a warning * is generated and an empty result is returned. */ recsFilterableOption?: | "FILTERABLE_OPTION_UNSPECIFIED" | "FILTERABLE_ENABLED" | "FILTERABLE_DISABLED"; /** * If retrievable_option is RETRIEVABLE_ENABLED, field values are included in * the search results. If retrievable_option is unset, the server behavior * defaults to RETRIEVABLE_DISABLED for fields that support setting * retrievable options. For those fields that do not support setting * retrievable options, such as `object` and `boolean`, the server will skip * retrievable option setting, and setting retrievable_option for those fields * will throw `INVALID_ARGUMENT` error. */ retrievableOption?: | "RETRIEVABLE_OPTION_UNSPECIFIED" | "RETRIEVABLE_ENABLED" | "RETRIEVABLE_DISABLED"; /** * Field paths for indexing custom attribute from schema.org data. More * details of schema.org and its defined types can be found at * [schema.org](https://schema.org). It is only used on advanced site search * schema. Currently only support full path from root. The full path to a * field is constructed by concatenating field names, starting from `_root`, * with a period `.` as the delimiter. Examples: * Publish date of the root: * _root.datePublished * Publish date of the reviews: * _root.review.datePublished */ schemaOrgPaths?: string[]; /** * If searchable_option is SEARCHABLE_ENABLED, field values are searchable by * text queries in SearchService.Search. If SEARCHABLE_ENABLED but field type * is numerical, field values will not be searchable by text queries in * SearchService.Search, as there are no text values associated to numerical * fields. If searchable_option is unset, the server behavior defaults to * SEARCHABLE_DISABLED for fields that support setting searchable options. * Only `string` fields that have no key property mapping support setting * searchable_option. For those fields that do not support setting searchable * options, the server will skip searchable option setting, and setting * searchable_option for those fields will throw `INVALID_ARGUMENT` error. */ searchableOption?: | "SEARCHABLE_OPTION_UNSPECIFIED" | "SEARCHABLE_ENABLED" | "SEARCHABLE_DISABLED"; } /** * Request for GetSession method. */ export interface GoogleCloudDiscoveryengineV1alphaGetSessionRequest { /** * Optional. If set to true, the full session including all answer details * will be returned. */ includeAnswerDetails?: boolean; /** * Required. The resource name of the Session to get. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` */ name?: string; } /** * Response message for SiteSearchEngineService.GetUriPatternDocumentData * method. */ export interface GoogleCloudDiscoveryengineV1alphaGetUriPatternDocumentDataResponse { /** * Document data keyed by URI pattern. For example: document_data_map = { * "www.url1.com/*": { "Categories": ["category1", "category2"] }, * "www.url2.com/*": { "Categories": ["category3"] } } */ documentDataMap?: { [key: string]: { [key: string]: any } }; } /** * Identity Provider Config. */ export interface GoogleCloudDiscoveryengineV1alphaIdpConfig { /** * External Identity provider config. */ externalIdpConfig?: GoogleCloudDiscoveryengineV1alphaIdpConfigExternalIdpConfig; /** * Identity provider type configured. */ idpType?: | "IDP_TYPE_UNSPECIFIED" | "GSUITE" | "THIRD_PARTY"; } /** * Third party IDP Config. */ export interface GoogleCloudDiscoveryengineV1alphaIdpConfigExternalIdpConfig { /** * Workforce pool name. Example: "locations/global/workforcePools/pool_id" */ workforcePoolName?: string; } /** * Metadata related to the progress of the ImportCompletionSuggestions * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of CompletionSuggestions that failed to be imported. */ failureCount?: bigint; /** * Count of CompletionSuggestions successfully imported. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the CompletionService.ImportCompletionSuggestions method. If the * long running operation is done, this message is returned by the * google.longrunning.Operations.response field if the operation is successful. */ export interface GoogleCloudDiscoveryengineV1alphaImportCompletionSuggestionsResponse { /** * The desired location of errors incurred during the Import. */ errorConfig?: GoogleCloudDiscoveryengineV1alphaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Metadata related to the progress of the ImportDocuments operation. This is * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were processed successfully. */ successCount?: bigint; /** * Total count of entries that were processed. */ totalCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? String(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? BigInt(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the ImportDocumentsRequest. If the long running operation is * done, then this message is returned by the * google.longrunning.Operations.response field if the operation was successful. */ export interface GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse { /** * Echoes the destination for the complete errors in the request if set. */ errorConfig?: GoogleCloudDiscoveryengineV1alphaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Configuration of destination for Import related errors. */ export interface GoogleCloudDiscoveryengineV1alphaImportErrorConfig { /** * Cloud Storage prefix for import errors. This must be an empty, existing * Cloud Storage directory. Import errors are written to sharded files in this * directory, one per line, as a JSON-encoded `google.rpc.Status` message. */ gcsPrefix?: string; } /** * Metadata related to the progress of the ImportSampleQueries operation. This * will be returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaImportSampleQueriesMetadata { /** * ImportSampleQueries operation create time. */ createTime?: Date; /** * Count of SampleQuerys that failed to be imported. */ failureCount?: bigint; /** * Count of SampleQuerys successfully imported. */ successCount?: bigint; /** * Total count of SampleQuerys that were processed. */ totalCount?: bigint; /** * ImportSampleQueries operation last update time. If the operation is done, * this is also the finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaImportSampleQueriesMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportSampleQueriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? String(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaImportSampleQueriesMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportSampleQueriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? BigInt(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the SampleQueryService.ImportSampleQueries method. If the long * running operation is done, this message is returned by the * google.longrunning.Operations.response field if the operation is successful. */ export interface GoogleCloudDiscoveryengineV1alphaImportSampleQueriesResponse { /** * The desired location of errors incurred during the Import. */ errorConfig?: GoogleCloudDiscoveryengineV1alphaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Metadata related to the progress of the ImportSuggestionDenyListEntries * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for CompletionService.ImportSuggestionDenyListEntries * method. */ export interface GoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Count of deny list entries that failed to be imported. */ failedEntriesCount?: bigint; /** * Count of deny list entries successfully imported. */ importedEntriesCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesResponse { return { ...data, failedEntriesCount: data["failedEntriesCount"] !== undefined ? String(data["failedEntriesCount"]) : undefined, importedEntriesCount: data["importedEntriesCount"] !== undefined ? String(data["importedEntriesCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1alphaImportSuggestionDenyListEntriesResponse { return { ...data, failedEntriesCount: data["failedEntriesCount"] !== undefined ? BigInt(data["failedEntriesCount"]) : undefined, importedEntriesCount: data["importedEntriesCount"] !== undefined ? BigInt(data["importedEntriesCount"]) : undefined, }; } /** * Metadata related to the progress of the Import operation. This is returned * by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were processed successfully. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the ImportUserEventsRequest. If the long running operation was * successful, then this message is returned by the * google.longrunning.Operations.response field if the operation was successful. */ export interface GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse { /** * Echoes the destination for the complete errors if this field was set in * the request. */ errorConfig?: GoogleCloudDiscoveryengineV1alphaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Count of user events imported with complete existing Documents. */ joinedEventsCount?: bigint; /** * Count of user events imported, but with Document information not found in * the existing Branch. */ unjoinedEventsCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaImportUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse { return { ...data, joinedEventsCount: data["joinedEventsCount"] !== undefined ? String(data["joinedEventsCount"]) : undefined, unjoinedEventsCount: data["unjoinedEventsCount"] !== undefined ? String(data["unjoinedEventsCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaImportUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse { return { ...data, joinedEventsCount: data["joinedEventsCount"] !== undefined ? BigInt(data["joinedEventsCount"]) : undefined, unjoinedEventsCount: data["unjoinedEventsCount"] !== undefined ? BigInt(data["unjoinedEventsCount"]) : undefined, }; } /** * A floating point interval. */ export interface GoogleCloudDiscoveryengineV1alphaInterval { /** * Exclusive upper bound. */ exclusiveMaximum?: number; /** * Exclusive lower bound. */ exclusiveMinimum?: number; /** * Inclusive upper bound. */ maximum?: number; /** * Inclusive lower bound. */ minimum?: number; } /** * Language info for DataStore. */ export interface GoogleCloudDiscoveryengineV1alphaLanguageInfo { /** * Output only. Language part of normalized_language_code. E.g.: `en-US` -> * `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. */ readonly language?: string; /** * The language code for the DataStore. */ languageCode?: string; /** * Output only. This is the normalized form of language_code. E.g.: * language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have * normalized_language_code of `en-GB`. */ readonly normalizedLanguageCode?: string; /** * Output only. Region part of normalized_language_code, if present. E.g.: * `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. */ readonly region?: string; } /** * Response message for SearchTuningService.ListCustomModels method. */ export interface GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse { /** * List of custom tuning models. */ models?: GoogleCloudDiscoveryengineV1alphaCustomTuningModel[]; } function serializeGoogleCloudDiscoveryengineV1alphaListCustomModelsResponse(data: any): GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse { return { ...data, models: data["models"] !== undefined ? data["models"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1alphaCustomTuningModel(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaListCustomModelsResponse(data: any): GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse { return { ...data, models: data["models"] !== undefined ? data["models"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1alphaCustomTuningModel(item))) : undefined, }; } /** * Request for ListSessions method. */ export interface GoogleCloudDiscoveryengineV1alphaListSessionsRequest { /** * A filter to apply on the list results. The supported features are: * user_pseudo_id, state. Example: "user_pseudo_id = some_id" */ filter?: string; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. Supported fields: * * `update_time` * `create_time` * `session_name` Example: "update_time desc" * "create_time" */ orderBy?: string; /** * Maximum number of results to return. If unspecified, defaults to 50. Max * allowed value is 1000. */ pageSize?: number; /** * A page token, received from a previous `ListSessions` call. Provide this * to retrieve the subsequent page. */ pageToken?: string; /** * Required. The data store resource name. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` */ parent?: string; } /** * Response for ListSessions method. */ export interface GoogleCloudDiscoveryengineV1alphaListSessionsResponse { /** * Pagination token, if not returned indicates the last page. */ nextPageToken?: string; /** * All the Sessions for a given data store. */ sessions?: GoogleCloudDiscoveryengineV1alphaSession[]; } /** * Configuration for Natural Language Query Understanding. */ export interface GoogleCloudDiscoveryengineV1alphaNaturalLanguageQueryUnderstandingConfig { /** * Mode of Natural Language Query Understanding. If this field is unset, the * behavior defaults to NaturalLanguageQueryUnderstandingConfig.Mode.DISABLED. */ mode?: | "MODE_UNSPECIFIED" | "DISABLED" | "ENABLED"; } /** * Response message for CrawlRateManagementService.ObtainCrawlRate method. The * response contains organcic or dedicated crawl rate time series data for * monitoring, depending on whether dedicated crawl rate is set. */ export interface GoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse { /** * The historical dedicated crawl rate timeseries data, used for monitoring. */ dedicatedCrawlRateTimeSeries?: GoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries; /** * Errors from service when handling the request. */ error?: GoogleRpcStatus; /** * The historical organic crawl rate timeseries data, used for monitoring. */ organicCrawlRateTimeSeries?: GoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries; /** * Output only. The state of the response. */ readonly state?: | "STATE_UNSPECIFIED" | "SUCCEEDED" | "FAILED"; } function serializeGoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse(data: any): GoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse { return { ...data, dedicatedCrawlRateTimeSeries: data["dedicatedCrawlRateTimeSeries"] !== undefined ? serializeGoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries(data["dedicatedCrawlRateTimeSeries"]) : undefined, organicCrawlRateTimeSeries: data["organicCrawlRateTimeSeries"] !== undefined ? serializeGoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries(data["organicCrawlRateTimeSeries"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse(data: any): GoogleCloudDiscoveryengineV1alphaObtainCrawlRateResponse { return { ...data, dedicatedCrawlRateTimeSeries: data["dedicatedCrawlRateTimeSeries"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1alphaDedicatedCrawlRateTimeSeries(data["dedicatedCrawlRateTimeSeries"]) : undefined, organicCrawlRateTimeSeries: data["organicCrawlRateTimeSeries"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries(data["organicCrawlRateTimeSeries"]) : undefined, }; } /** * The historical organic crawl rate timeseries data, used for monitoring. * Organic crawl is auto-determined by Google to crawl the user's website when * dedicate crawl is not set. Crawl rate is the QPS of crawl request Google * sends to the user's website. */ export interface GoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries { /** * Google's organic crawl rate time series, which is the sum of all * googlebots' crawl rate. Please refer to * https://developers.google.com/search/docs/crawling-indexing/overview-google-crawlers * for more details about googlebots. */ googleOrganicCrawlRate?: GoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries; /** * Vertex AI's organic crawl rate time series, which is the crawl rate of * Google-CloudVertexBot when dedicate crawl is not set. Please refer to * https://developers.google.com/search/docs/crawling-indexing/google-common-crawlers#google-cloudvertexbot * for more details about Google-CloudVertexBot. */ vertexAiOrganicCrawlRate?: GoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries; } function serializeGoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries(data: any): GoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries { return { ...data, googleOrganicCrawlRate: data["googleOrganicCrawlRate"] !== undefined ? serializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["googleOrganicCrawlRate"]) : undefined, vertexAiOrganicCrawlRate: data["vertexAiOrganicCrawlRate"] !== undefined ? serializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["vertexAiOrganicCrawlRate"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries(data: any): GoogleCloudDiscoveryengineV1alphaOrganicCrawlRateTimeSeries { return { ...data, googleOrganicCrawlRate: data["googleOrganicCrawlRate"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["googleOrganicCrawlRate"]) : undefined, vertexAiOrganicCrawlRate: data["vertexAiOrganicCrawlRate"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1alphaCrawlRateTimeSeries(data["vertexAiOrganicCrawlRate"]) : undefined, }; } /** * Metadata and configurations for a Google Cloud project in the service. */ export interface GoogleCloudDiscoveryengineV1alphaProject { /** * Output only. The timestamp when this project is created. */ readonly createTime?: Date; /** * Output only. Full resource name of the project, for example * `projects/{project}`. Note that when making requests, project number and * project id are both acceptable, but the server will always respond in * project number. */ readonly name?: string; /** * Output only. The timestamp when this project is successfully provisioned. * Empty value means this project is still provisioning and is not ready for * use. */ readonly provisionCompletionTime?: Date; /** * Output only. A map of terms of services. The key is the `id` of * ServiceTerms. */ readonly serviceTermsMap?: { [key: string]: GoogleCloudDiscoveryengineV1alphaProjectServiceTerms }; } /** * Metadata about the terms of service. */ export interface GoogleCloudDiscoveryengineV1alphaProjectServiceTerms { /** * The last time when the project agreed to the terms of service. */ acceptTime?: Date; /** * The last time when the project declined or revoked the agreement to terms * of service. */ declineTime?: Date; /** * The unique identifier of this terms of service. Available terms: * * `GA_DATA_USE_TERMS`: [Terms for data * use](https://cloud.google.com/retail/data-use-terms). When using this as * `id`, the acceptable version to provide is `2022-11-23`. */ id?: string; /** * Whether the project has accepted/rejected the service terms or it is still * pending. */ state?: | "STATE_UNSPECIFIED" | "TERMS_ACCEPTED" | "TERMS_PENDING" | "TERMS_DECLINED"; /** * The version string of the terms of service. For acceptable values, see the * comments for id above. */ version?: string; } function serializeGoogleCloudDiscoveryengineV1alphaProjectServiceTerms(data: any): GoogleCloudDiscoveryengineV1alphaProjectServiceTerms { return { ...data, acceptTime: data["acceptTime"] !== undefined ? data["acceptTime"].toISOString() : undefined, declineTime: data["declineTime"] !== undefined ? data["declineTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaProjectServiceTerms(data: any): GoogleCloudDiscoveryengineV1alphaProjectServiceTerms { return { ...data, acceptTime: data["acceptTime"] !== undefined ? new Date(data["acceptTime"]) : undefined, declineTime: data["declineTime"] !== undefined ? new Date(data["declineTime"]) : undefined, }; } /** * Metadata associated with a project provision operation. */ export interface GoogleCloudDiscoveryengineV1alphaProvisionProjectMetadata { } /** * Metadata related to the progress of the PurgeCompletionSuggestions * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for CompletionService.PurgeCompletionSuggestions method. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeCompletionSuggestionsResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Whether the completion suggestions were successfully purged. */ purgeSucceeded?: boolean; } /** * Metadata related to the progress of the PurgeDocuments operation. This will * be returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were ignored as entries were not found. */ ignoredCount?: bigint; /** * Count of entries that were deleted successfully. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, ignoredCount: data["ignoredCount"] !== undefined ? String(data["ignoredCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, ignoredCount: data["ignoredCount"] !== undefined ? BigInt(data["ignoredCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for DocumentService.PurgeDocuments method. If the long * running operation is successfully done, then this message is returned by the * google.longrunning.Operations.response field. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse { /** * The total count of documents purged as a result of the operation. */ purgeCount?: bigint; /** * A sample of document names that will be deleted. Only populated if `force` * is set to false. A max of 100 names will be returned and the names are * chosen at random. */ purgeSample?: string[]; } function serializeGoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? String(data["purgeCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? BigInt(data["purgeCount"]) : undefined, }; } /** * Metadata related to the progress of the PurgeSuggestionDenyListEntries * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for CompletionService.PurgeSuggestionDenyListEntries * method. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Number of suggestion deny list entries purged. */ purgeCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? String(data["purgeCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1alphaPurgeSuggestionDenyListEntriesResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? BigInt(data["purgeCount"]) : undefined, }; } /** * Metadata related to the progress of the PurgeUserEvents operation. This will * be returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were deleted successfully. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the PurgeUserEventsRequest. If the long running operation is * successfully done, then this message is returned by the * google.longrunning.Operations.response field. */ export interface GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse { /** * The total count of events purged as a result of the operation. */ purgeCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? String(data["purgeCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? BigInt(data["purgeCount"]) : undefined, }; } /** * Describes the metrics produced by the evaluation. */ export interface GoogleCloudDiscoveryengineV1alphaQualityMetrics { /** * Normalized discounted cumulative gain (NDCG) per document, at various * top-k cutoff levels. NDCG measures the ranking quality, giving higher * relevance to top results. Example (top-3): Suppose SampleQuery with three * retrieved documents (D1, D2, D3) and binary relevance judgements (1 for * relevant, 0 for not relevant): Retrieved: [D3 (0), D1 (1), D2 (1)] Ideal: * [D1 (1), D2 (1), D3 (0)] Calculate NDCG@3 for each SampleQuery: * DCG@3: * 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13 * Ideal DCG@3: 1/log2(1+1) + * 1/log2(2+1) + 0/log2(3+1) = 1.63 * NDCG@3: 1.13/1.63 = 0.693 */ docNdcg?: GoogleCloudDiscoveryengineV1alphaQualityMetricsTopkMetrics; /** * Precision per document, at various top-k cutoff levels. Precision is the * fraction of retrieved documents that are relevant. Example (top-5): * For a * single SampleQuery, If 4 out of 5 retrieved documents in the top-5 are * relevant, precision@5 = 4/5 = 0.8 */ docPrecision?: GoogleCloudDiscoveryengineV1alphaQualityMetricsTopkMetrics; /** * Recall per document, at various top-k cutoff levels. Recall is the * fraction of relevant documents retrieved out of all relevant documents. * Example (top-5): * For a single SampleQuery, If 3 out of 5 relevant * documents are retrieved in the top-5, recall@5 = 3/5 = 0.6 */ docRecall?: GoogleCloudDiscoveryengineV1alphaQualityMetricsTopkMetrics; /** * Normalized discounted cumulative gain (NDCG) per page, at various top-k * cutoff levels. NDCG measures the ranking quality, giving higher relevance * to top results. Example (top-3): Suppose SampleQuery with three retrieved * pages (P1, P2, P3) and binary relevance judgements (1 for relevant, 0 for * not relevant): Retrieved: [P3 (0), P1 (1), P2 (1)] Ideal: [P1 (1), P2 (1), * P3 (0)] Calculate NDCG@3 for SampleQuery: * DCG@3: 0/log2(1+1) + * 1/log2(2+1) + 1/log2(3+1) = 1.13 * Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + * 0/log2(3+1) = 1.63 * NDCG@3: 1.13/1.63 = 0.693 */ pageNdcg?: GoogleCloudDiscoveryengineV1alphaQualityMetricsTopkMetrics; /** * Recall per page, at various top-k cutoff levels. Recall is the fraction of * relevant pages retrieved out of all relevant pages. Example (top-5): * For * a single SampleQuery, if 3 out of 5 relevant pages are retrieved in the * top-5, recall@5 = 3/5 = 0.6 */ pageRecall?: GoogleCloudDiscoveryengineV1alphaQualityMetricsTopkMetrics; } /** * Stores the metric values at specific top-k levels. */ export interface GoogleCloudDiscoveryengineV1alphaQualityMetricsTopkMetrics { /** * The top-1 value. */ top1?: number; /** * The top-10 value. */ top10?: number; /** * The top-3 value. */ top3?: number; /** * The top-5 value. */ top5?: number; } /** * Defines a user inputed query. */ export interface GoogleCloudDiscoveryengineV1alphaQuery { /** * Unique Id for the query. */ queryId?: string; /** * Plain text. */ text?: string; } /** * Metadata related to the progress of the SiteSearchEngineService.RecrawlUris * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaRecrawlUrisMetadata { /** * Operation create time. */ createTime?: Date; /** * Unique URIs in the request that have invalid format. Sample limited to * 1000. */ invalidUris?: string[]; /** * Total number of unique URIs in the request that have invalid format. */ invalidUrisCount?: number; /** * Total number of URIs that have yet to be crawled. */ pendingCount?: number; /** * Total number of URIs that were rejected due to insufficient indexing * resources. */ quotaExceededCount?: number; /** * Total number of URIs that have been crawled so far. */ successCount?: number; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; /** * Unique URIs in the request that don't match any TargetSite in the * DataStore, only match TargetSites that haven't been fully indexed, or match * a TargetSite with type EXCLUDE. Sample limited to 1000. */ urisNotMatchingTargetSites?: string[]; /** * Total number of URIs that don't match any TargetSites. */ urisNotMatchingTargetSitesCount?: number; /** * Total number of unique URIs in the request that are not in invalid_uris. */ validUrisCount?: number; } function serializeGoogleCloudDiscoveryengineV1alphaRecrawlUrisMetadata(data: any): GoogleCloudDiscoveryengineV1alphaRecrawlUrisMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaRecrawlUrisMetadata(data: any): GoogleCloudDiscoveryengineV1alphaRecrawlUrisMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.RecrawlUris method. */ export interface GoogleCloudDiscoveryengineV1alphaRecrawlUrisResponse { /** * URIs that were not crawled before the LRO terminated. */ failedUris?: string[]; /** * Details for a sample of up to 10 `failed_uris`. */ failureSamples?: GoogleCloudDiscoveryengineV1alphaRecrawlUrisResponseFailureInfo[]; } /** * Details about why a particular URI failed to be crawled. Each FailureInfo * contains one FailureReason per CorpusType. */ export interface GoogleCloudDiscoveryengineV1alphaRecrawlUrisResponseFailureInfo { /** * List of failure reasons by corpus type (e.g. desktop, mobile). */ failureReasons?: GoogleCloudDiscoveryengineV1alphaRecrawlUrisResponseFailureInfoFailureReason[]; /** * URI that failed to be crawled. */ uri?: string; } /** * Details about why crawling failed for a particular CorpusType, e.g., DESKTOP * and MOBILE crawling may fail for different reasons. */ export interface GoogleCloudDiscoveryengineV1alphaRecrawlUrisResponseFailureInfoFailureReason { /** * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED. */ corpusType?: | "CORPUS_TYPE_UNSPECIFIED" | "DESKTOP" | "MOBILE"; /** * Reason why the URI was not crawled. */ errorMessage?: string; } /** * Defines the structure and layout of a type of document data. */ export interface GoogleCloudDiscoveryengineV1alphaSchema { /** * Output only. Configurations for fields of the schema. */ readonly fieldConfigs?: GoogleCloudDiscoveryengineV1alphaFieldConfig[]; /** * The JSON representation of the schema. */ jsonSchema?: string; /** * Immutable. The full resource name of the schema, in the format of * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * The structured representation of the schema. */ structSchema?: { [key: string]: any }; } /** * Promotion proto includes uri and other helping information to display the * promotion. */ export interface GoogleCloudDiscoveryengineV1alphaSearchLinkPromotion { /** * Optional. The Promotion description. Maximum length: 200 characters. */ description?: string; /** * Optional. The enabled promotion will be returned for any serving configs * associated with the parent of the control this promotion is attached to. * This flag is used for basic site search only. */ enabled?: boolean; /** * Optional. The promotion thumbnail image url. */ imageUri?: string; /** * Required. The title of the promotion. Maximum length: 160 characters. */ title?: string; /** * Required. The URL for the page the user wants to promote. */ uri?: string; } /** * Request message for SearchService.Search method. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequest { /** * Boost specification to boost certain documents. For more information on * boosting, see * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) */ boostSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec; /** * The branch resource name, such as * `projects/*\/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. * Use `default_branch` as the branch ID or leave this field empty, to search * documents under the default branch. */ branch?: string; /** * The default filter that is applied when a user performs a search without * checking any filters on the search page. The filter applied to every search * request when quality improvement such as query expansion is needed. In the * case a query does not have a sufficient amount of results this filter will * be used to determine whether or not to enable the query expansion flow. The * original filter will still be used for the query expanded search. This * field is strongly recommended to achieve high search quality. For more * information about filter syntax, see SearchRequest.filter. */ canonicalFilter?: string; /** * A specification for configuring the behavior of content search. */ contentSearchSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec; /** * Custom fine tuning configs. If set, it has higher priority than the * configs set in ServingConfig.custom_fine_tuning_spec. */ customFineTuningSpec?: GoogleCloudDiscoveryengineV1alphaCustomFineTuningSpec; /** * Specs defining DataStores to filter on in a search call and configurations * for those data stores. This is only considered for Engines with multiple * data stores. For engines with a single data store, the specs directly under * SearchRequest should be used. */ dataStoreSpecs?: GoogleCloudDiscoveryengineV1alphaSearchRequestDataStoreSpec[]; /** * Uses the provided embedding to do additional semantic document retrieval. * The retrieval is based on the dot product of * SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document * embedding that is provided in * SearchRequest.EmbeddingSpec.EmbeddingVector.field_path. If * SearchRequest.EmbeddingSpec.EmbeddingVector.field_path is not provided, it * will use ServingConfig.EmbeddingConfig.field_path. */ embeddingSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec; /** * Facet specifications for faceted search. If empty, no facets are returned. * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error * is returned. */ facetSpecs?: GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec[]; /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. Filter * expression is case-sensitive. If this field is unrecognizable, an * `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by * mapping the LHS filter key to a key property defined in the Vertex AI * Search backend -- this mapping is defined by the customer in their schema. * For example a media customer might have a field 'name' in their schema. In * this case the filter would look like this: filter --> name:'ANY("king * kong")' For more information about filtering including syntax and filter * operators, see * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; /** * Raw image query. */ imageQuery?: GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery; /** * The BCP-47 language code, such as "en-US" or "sr-Latn". For more * information, see [Standard * fields](https://cloud.google.com/apis/design/standard_fields). This field * helps to better interpret the query. If a value isn't specified, the query * language code is automatically detected, which may not be accurate. */ languageCode?: string; /** * If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional * natural language query understanding will be done. */ naturalLanguageQueryUnderstandingSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestNaturalLanguageQueryUnderstandingSpec; /** * A 0-indexed integer that specifies the current offset (that is, starting * result location, amongst the Documents deemed by the API as relevant) in * search results. This field is only considered if page_token is unset. If * this field is negative, an `INVALID_ARGUMENT` is returned. */ offset?: number; /** * The maximum number of results to return for OneBox. This applies to each * OneBox type individually. Default number is 10. */ oneBoxPageSize?: number; /** * The order in which documents are returned. Documents can be ordered by a * field in an Document object. Leave it unset if ordered by relevance. * `order_by` expression is case-sensitive. For more information on ordering * the website search results, see [Order web search * results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). * For more information on ordering the healthcare search results, see [Order * healthcare search * results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. */ orderBy?: string; /** * Maximum number of Documents to return. The maximum allowed value depends * on the data type. Values above the maximum value are coerced to the maximum * value. * Websites with basic indexing: Default `10`, Maximum `25`. * * Websites with advanced indexing: Default `25`, Maximum `50`. * Other: * Default `50`, Maximum `100`. If this field is negative, an * `INVALID_ARGUMENT` is returned. */ pageSize?: number; /** * A page token received from a previous SearchService.Search call. Provide * this to retrieve the subsequent page. When paginating, all other parameters * provided to SearchService.Search must match the call that provided the page * token. Otherwise, an `INVALID_ARGUMENT` error is returned. */ pageToken?: string; /** * Additional search parameters. For public website search only, supported * values are: * `user_country_code`: string. Default empty. If set to * non-empty, results are restricted or boosted based on the location * provided. For example, `user_country_code: "au"` For available codes see * [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, which * enables image searching. For example, `search_type: 1` */ params?: { [key: string]: any }; /** * The specification for personalization. Notice that if both * ServingConfig.personalization_spec and SearchRequest.personalization_spec * are set, SearchRequest.personalization_spec overrides * ServingConfig.personalization_spec. */ personalizationSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestPersonalizationSpec; /** * Raw search query. */ query?: string; /** * The query expansion specification that specifies the conditions under * which query expansion occurs. */ queryExpansionSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec; /** * The ranking expression controls the customized ranking on retrieval * documents. This overrides ServingConfig.ranking_expression. The ranking * expression is a single function or multiple functions that are joined by * "+". * ranking_expression = function, { " + ", function }; Supported * functions: * double * relevance_score * double * * dotProduct(embedding_field_path) Function variables: * `relevance_score`: * pre-defined keywords, used for measure relevance between query and * document. * `embedding_field_path`: the document embedding field used with * query embedding vector. * `dotProduct`: embedding function between * embedding_field_path and query embedding vector. Example ranking * expression: If document has an embedding field doc_embedding, the ranking * expression could be `0.5 * relevance_score + 0.3 * * dotProduct(doc_embedding)`. */ rankingExpression?: string; /** * The Unicode country/region code (CLDR) of a location, such as "US" and * "419". For more information, see [Standard * fields](https://cloud.google.com/apis/design/standard_fields). If set, then * results will be boosted based on the region_code provided. */ regionCode?: string; /** * The relevance threshold of the search results. Default to Google defined * threshold, leveraging a balance of precision and recall to deliver both * highly accurate results and comprehensive coverage of relevant information. */ relevanceThreshold?: | "RELEVANCE_THRESHOLD_UNSPECIFIED" | "LOWEST" | "LOW" | "MEDIUM" | "HIGH"; /** * Whether to turn on safe search. This is only supported for website search. */ safeSearch?: boolean; /** * Search as you type configuration. Only supported for the * IndustryVertical.MEDIA vertical. */ searchAsYouTypeSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec; /** * Required. The resource name of the Search serving config, such as * `projects/*\/locations/global/collections/default_collection/engines/*\/servingConfigs/default_serving_config`, * or * `projects/*\/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. * This field is used to identify the serving configuration name, set of * models used to make the search. */ servingConfig?: string; /** * The session resource name. Optional. Session allows users to do multi-turn * /search API calls or coordination between /search API calls and /answer API * calls. Example #1 (multi-turn /search API calls): 1. Call /search API with * the auto-session mode (see below). 2. Call /search API with the session ID * generated in the first call. Here, the previous search query gets * considered in query standing. I.e., if the first query is "How did Alphabet * do in 2022?" and the current query is "How about 2023?", the current query * will be interpreted as "How did Alphabet do in 2023?". Example #2 * (coordination between /search API calls and /answer API calls): 1. Call * /search API with the auto-session mode (see below). 2. Call /answer API * with the session ID generated in the first call. Here, the answer * generation happens in the context of the search results from the first * search call. Auto-session mode: when `projects/.../sessions/-` is used, a * new session gets automatically created. Otherwise, users can use the * create-session API to create a session manually. Multi-turn Search feature * is currently at private GA stage. Please use v1alpha or v1beta version * instead before we launch this feature to public GA. Or ask for allowlisting * through Google Support team. */ session?: string; /** * Session specification. Can be used only when `session` is set. */ sessionSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestSessionSpec; /** * The spell correction specification that specifies the mode under which * spell correction takes effect. */ spellCorrectionSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec; /** * Information about the end user. Highly recommended for analytics. * UserInfo.user_agent is used to deduce `device_type` for analytics. */ userInfo?: GoogleCloudDiscoveryengineV1alphaUserInfo; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Google Cloud * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; /** * A unique identifier for tracking visitors. For example, this could be * implemented with an HTTP cookie, which should be able to uniquely identify * a visitor on a single device. This unique identifier should not change if * the visitor logs in or out of the website. This field should NOT have a * fixed value such as `unknown_visitor`. This should be the same identifier * as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The * field must be a UTF-8 encoded string with a length limit of 128 characters. * Otherwise, an `INVALID_ARGUMENT` error is returned. */ userPseudoId?: string; } /** * Boost specification to boost certain documents. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec { /** * Condition boost specifications. If a document matches multiple conditions * in the specifictions, boost scores from these specifications are all * applied and combined in a non-linear way. Maximum number of specifications * is 20. */ conditionBoostSpecs?: GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec[]; } /** * Boost applies to documents which match a condition. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec { /** * Strength of the condition boost, which should be in [-1, 1]. Negative * boost means demotion. Default is 0.0. Setting to 1.0 gives the document a * big promotion. However, it does not necessarily mean that the boosted * document will be the top result at all times, nor that other documents will * be excluded. Results could still be shown even when none of them matches * the condition. And results that are significantly more relevant to the * search query can still trump your heavily favored but irrelevant documents. * Setting to -1.0 gives the document a big demotion. However, results that * are deeply relevant might still be shown. The document will have an * upstream battle to get a fairly high ranking, but it is not blocked out * completely. Setting to 0.0 means no boost applied. The boosting condition * is ignored. Only one of the (condition, boost) combination or the * boost_control_spec below are set. If both are set then the global boost is * ignored and the more fine-grained boost_control_spec is applied. */ boost?: number; /** * Complex specification for custom ranking based on customer defined * attribute value. */ boostControlSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpecBoostControlSpec; /** * An expression which specifies a boost condition. The syntax and supported * fields are the same as a filter expression. See SearchRequest.filter for * detail syntax and limitations. Examples: * To boost documents with document * ID "doc_1" or "doc_2", and color "Red" or "Blue": `(document_id: * ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))` */ 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 GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpecBoostControlSpec { /** * 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"; /** * 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?: GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpecBoostControlSpecControlPoint[]; /** * The name of the field whose value will be used to determine the boost * amount. */ fieldName?: string; /** * 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 GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpecBoostControlSpecControlPoint { /** * 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; /** * The value between -1 to 1 by which to boost the score if the * attribute_value evaluates to the value specified above. */ boostAmount?: number; } /** * A specification for configuring the behavior of content search. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec { /** * Specifies the chunk spec to be returned from the search response. Only * available if the SearchRequest.ContentSearchSpec.search_result_mode is set * to CHUNKS */ chunkSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecChunkSpec; /** * If there is no extractive_content_spec provided, there will be no * extractive answer in the search response. */ extractiveContentSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec; /** * Specifies the search result mode. If unspecified, the search result mode * defaults to `DOCUMENTS`. */ searchResultMode?: | "SEARCH_RESULT_MODE_UNSPECIFIED" | "DOCUMENTS" | "CHUNKS"; /** * If `snippetSpec` is not specified, snippets are not included in the search * response. */ snippetSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec; /** * If `summarySpec` is not specified, summaries are not included in the * search response. */ summarySpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec; } /** * Specifies the chunk spec to be returned from the search response. Only * available if the SearchRequest.ContentSearchSpec.search_result_mode is set to * CHUNKS */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecChunkSpec { /** * The number of next chunks to be returned of the current chunk. The maximum * allowed value is 3. If not specified, no next chunks will be returned. */ numNextChunks?: number; /** * The number of previous chunks to be returned of the current chunk. The * maximum allowed value is 3. If not specified, no previous chunks will be * returned. */ numPreviousChunks?: number; } /** * A specification for configuring the extractive content in a search response. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec { /** * The maximum number of extractive answers returned in each search result. * An extractive answer is a verbatim answer extracted from the original * document, which provides a precise and contextually relevant answer to the * search query. If the number of matching answers is less than the * `max_extractive_answer_count`, return all of the answers. Otherwise, return * the `max_extractive_answer_count`. At most five answers are returned for * each SearchResult. */ maxExtractiveAnswerCount?: number; /** * The max number of extractive segments returned in each search result. Only * applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED * or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is * a text segment extracted from the original document that is relevant to the * search query, and, in general, more verbose than an extractive answer. The * segment could then be used as input for LLMs to generate summaries and * answers. If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. */ maxExtractiveSegmentCount?: number; /** * Return at most `num_next_segments` segments after each selected segments. */ numNextSegments?: number; /** * Specifies whether to also include the adjacent from each selected * segments. Return at most `num_previous_segments` segments before each * selected segments. */ numPreviousSegments?: number; /** * Specifies whether to return the confidence score from the extractive * segments in each search result. This feature is available only for new or * allowlisted data stores. To allowlist your data store, contact your * Customer Engineer. The default value is `false`. */ returnExtractiveSegmentScore?: boolean; } /** * A specification for configuring snippets in a search response. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec { /** * [DEPRECATED] This field is deprecated. To control snippet return, use * `return_snippet` field. For backwards compatibility, we will return snippet * if max_snippet_count > 0. */ maxSnippetCount?: number; /** * [DEPRECATED] This field is deprecated and will have no affect on the * snippet. */ referenceOnly?: boolean; /** * If `true`, then return snippet. If no snippet can be generated, we return * "No snippet is available for this page." A `snippet_status` with `SUCCESS` * or `NO_SNIPPET_AVAILABLE` will also be returned. */ returnSnippet?: boolean; } /** * A specification for configuring a summary returned in a search response. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec { /** * Specifies whether to filter out adversarial queries. The default value is * `false`. Google employs search-query classification to detect adversarial * queries. No summary is returned if the search query is classified as an * adversarial query. For example, a user might ask a question regarding * negative comments about the company or submit a query designed to generate * unsafe, policy-violating output. If this field is set to `true`, we skip * generating summaries for adversarial queries and return fallback messages * instead. */ ignoreAdversarialQuery?: boolean; /** * Optional. Specifies whether to filter out jail-breaking queries. The * default value is `false`. Google employs search-query classification to * detect jail-breaking queries. No summary is returned if the search query is * classified as a jail-breaking query. A user might add instructions to the * query to change the tone, style, language, content of the answer, or ask * the model to act as a different entity, e.g. "Reply in the tone of a * competing company's CEO". If this field is set to `true`, we skip * generating summaries for jail-breaking queries and return fallback messages * instead. */ ignoreJailBreakingQuery?: boolean; /** * Specifies whether to filter out queries that have low relevance. The * default value is `false`. If this field is set to `false`, all search * results are used regardless of relevance to generate answers. If set to * `true`, only queries with high relevance search results will generate * answers. */ ignoreLowRelevantContent?: boolean; /** * Specifies whether to filter out queries that are not summary-seeking. The * default value is `false`. Google employs search-query classification to * detect summary-seeking queries. No summary is returned if the search query * is classified as a non-summary seeking query. For example, `why is the sky * blue` and `Who is the best soccer player in the world?` are summary-seeking * queries, but `SFO airport` and `world cup 2026` are not. They are most * likely navigational queries. If this field is set to `true`, we skip * generating summaries for non-summary seeking queries and return fallback * messages instead. */ ignoreNonSummarySeekingQuery?: boolean; /** * Specifies whether to include citations in the summary. The default value * is `false`. When this field is set to `true`, summaries include in-line * citation numbers. Example summary including citations: BigQuery is Google * Cloud's fully managed and completely serverless enterprise data warehouse * [1]. BigQuery supports all data types, works across clouds, and has * built-in machine learning and business intelligence, all within a unified * platform [2, 3]. The citation numbers refer to the returned search results * and are 1-indexed. For example, [1] means that the sentence is attributed * to the first search result. [2, 3] means that the sentence is attributed to * both the second and third search results. */ includeCitations?: boolean; /** * Language code for Summary. Use language tags defined by * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an * experimental feature. */ languageCode?: string; /** * If specified, the spec will be used to modify the prompt provided to the * LLM. */ modelPromptSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpecModelPromptSpec; /** * If specified, the spec will be used to modify the model specification * provided to the LLM. */ modelSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpecModelSpec; /** * The number of top results to generate the summary from. If the number of * results returned is less than `summaryResultCount`, the summary is * generated from all of the results. At most 10 results for documents mode, * or 50 for chunks mode, can be used to generate a summary. The chunks mode * is used when SearchRequest.ContentSearchSpec.search_result_mode is set to * CHUNKS. */ summaryResultCount?: number; /** * If true, answer will be generated from most relevant chunks from top * search results. This feature will improve summary quality. Note that with * this feature enabled, not all top search results will be referenced and * included in the reference list, so the citation source index only points to * the search results listed in the reference list. */ useSemanticChunks?: boolean; } /** * Specification of the prompt to use with the model. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpecModelPromptSpec { /** * Text at the beginning of the prompt that instructs the assistant. Examples * are available in the user guide. */ preamble?: string; } /** * Specification of the model. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpecModelSpec { /** * The model version used to generate the summary. Supported values are: * * `stable`: string. Default value when no value is specified. Uses a * generally available, fine-tuned model. For more information, see [Answer * generation model versions and * lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * * `preview`: string. (Public preview) Uses a preview model. For more * information, see [Answer generation model versions and * lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). */ version?: string; } /** * A struct to define data stores to filter on in a search call and * configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error * is returned. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestDataStoreSpec { /** * Optional. Boost specification to boost certain documents. For more * information on boosting, see * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) */ boostSpec?: GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec; /** * Required. Full resource name of DataStore, such as * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. */ dataStore?: string; /** * Optional. Filter specification to filter documents in the data store * specified by data_store field. For more information on filtering, see * [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; } /** * The specification that uses customized query embedding vector to do semantic * document retrieval. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec { /** * The embedding vector used for retrieval. Limit to 1. */ embeddingVectors?: GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector[]; } /** * Embedding vector. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector { /** * Embedding field path in schema. */ fieldPath?: string; /** * Query embedding vector. */ vector?: number[]; } /** * A facet specification to perform faceted search. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec { /** * Enables dynamic position for this facet. If set to true, the position of * this facet among all facets in the response is determined automatically. If * dynamic facets are enabled, it is ordered together. If set to false, the * position of this facet in the response is the same as in the request, and * it is ranked before the facets with dynamic position enable and all dynamic * facets. For example, you may always want to have rating facet returned in * the response, but it's not necessarily to always display the rating facet * at the top. In that case, you can set enable_dynamic_position to true so * that the position of rating facet in response is determined automatically. * Another example, assuming you have the following facets in the request: * * "rating", enable_dynamic_position = true * "price", enable_dynamic_position * = false * "brands", enable_dynamic_position = false And also you have a * dynamic facets enabled, which generates a facet `gender`. Then the final * order of the facets in the response can be ("price", "brands", "rating", * "gender") or ("price", "brands", "gender", "rating") depends on how API * orders "gender" and "rating" facets. However, notice that "price" and * "brands" are always ranked at first and second position because their * enable_dynamic_position is false. */ enableDynamicPosition?: boolean; /** * List of keys to exclude when faceting. By default, FacetKey.key is not * excluded from the filter unless it is listed in this field. Listing a facet * key in this field allows its values to appear as facet results, even when * they are filtered out of search results. Using this field does not affect * what search results are returned. For example, suppose there are 100 * documents with the color facet "Red" and 200 documents with the color facet * "Blue". A query containing the filter "color:ANY("Red")" and having "color" * as FacetKey.key would by default return only "Red" documents in the search * results, and also return "Red" with count 100 as the only color facet. * Although there are also blue documents available, "Blue" would not be shown * as an available facet value. If "color" is listed in "excludedFilterKeys", * then the query returns the facet values "Red" with count 100 and "Blue" * with count 200, because the "color" key is now excluded from the filter. * Because this field doesn't affect search results, the search results are * still correctly filtered to return only "Red" documents. A maximum of 100 * values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. */ excludedFilterKeys?: string[]; /** * Required. The facet key specification. */ facetKey?: GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey; /** * Maximum facet values that are returned for this facet. If unspecified, * defaults to 20. The maximum allowed value is 300. Values above 300 are * coerced to 300. For aggregation in healthcare search, when the * [FacetKey.key] is "healthcare_aggregation_key", the limit will be * overridden to 10,000 internally, regardless of the value set here. If this * field is negative, an `INVALID_ARGUMENT` is returned. */ limit?: number; } /** * Specifies how a facet is computed. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey { /** * True to make facet keys case insensitive when getting faceting values with * prefixes or contains; false otherwise. */ caseInsensitive?: boolean; /** * Only get facet values that contain the given strings. For example, suppose * "category" has three values "Action > 2022", "Action > 2021" and "Sci-Fi > * 2022". If set "contains" to "2022", the "category" facet only contains * "Action > 2022" and "Sci-Fi > 2022". Only supported on textual fields. * Maximum is 10. */ contains?: string[]; /** * Set only if values should be bucketed into intervals. Must be set for * facets with numerical values. Must not be set for facet with text values. * Maximum number of intervals is 30. */ intervals?: GoogleCloudDiscoveryengineV1alphaInterval[]; /** * Required. Supported textual and numerical facet keys in Document object, * over which the facet values are computed. Facet key is case-sensitive. */ key?: string; /** * The order in which documents are returned. Allowed values are: * "count * desc", which means order by SearchResponse.Facet.values.count descending. * * "value desc", which means order by SearchResponse.Facet.values.value * descending. Only applies to textual facets. If not set, textual values are * sorted in [natural * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical * intervals are sorted in the order given by FacetSpec.FacetKey.intervals. */ orderBy?: string; /** * Only get facet values that start with the given string prefix. For * example, suppose "category" has three values "Action > 2022", "Action > * 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the "category" * facet only contains "Action > 2022" and "Action > 2021". Only supported on * textual fields. Maximum is 10. */ prefixes?: string[]; /** * Only get facet for the given restricted values. Only supported on textual * fields. For example, suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "restricted_values" to "Action * > 2022", the "category" facet only contains "Action > 2022". Only supported * on textual fields. Maximum is 10. */ restrictedValues?: string[]; } /** * Specifies the image query input. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery { /** * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP. */ imageBytes?: string; } /** * Specification to enable natural language understanding capabilities for * search requests. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestNaturalLanguageQueryUnderstandingSpec { /** * The condition under which filter extraction should occur. Default to * Condition.DISABLED. */ filterExtractionCondition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "ENABLED"; /** * Field names used for location-based filtering, where geolocation filters * are detected in natural language search queries. Only valid when the * FilterExtractionCondition is set to `ENABLED`. If this field is set, it * overrides the field names set in * ServingConfig.geo_search_query_detection_field_names. */ geoSearchQueryDetectionFieldNames?: string[]; } /** * The specification for personalization. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestPersonalizationSpec { /** * The personalization mode of the search request. Defaults to Mode.AUTO. */ mode?: | "MODE_UNSPECIFIED" | "AUTO" | "DISABLED"; } /** * Specification to determine under which conditions query expansion should * occur. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec { /** * The condition under which query expansion should occur. Default to * Condition.DISABLED. */ condition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "AUTO"; /** * Whether to pin unexpanded results. If this field is set to true, * unexpanded products are always at the top of the search results, followed * by the expanded results. */ pinUnexpandedResults?: boolean; } /** * Specification for search as you type in search requests. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestSearchAsYouTypeSpec { /** * The condition under which search as you type should occur. Default to * Condition.DISABLED. */ condition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "ENABLED"; } /** * Session specification. Multi-turn Search feature is currently at private GA * stage. Please use v1alpha or v1beta version instead before we launch this * feature to public GA. Or ask for allowlisting through Google Support team. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestSessionSpec { /** * If set, the search result gets stored to the "turn" specified by this * query ID. Example: Let's say the session looks like this: session { name: * ".../sessions/xxx" turns { query { text: "What is foo?" query_id: * ".../questions/yyy" } answer: "Foo is ..." } turns { query { text: "How * about bar then?" query_id: ".../questions/zzz" } } } The user can call * /search API with a request like this: session: ".../sessions/xxx" * session_spec { query_id: ".../questions/zzz" } Then, the API stores the * search result, associated with the last turn. The stored search result can * be used by a subsequent /answer API call (with the session ID and the query * ID specified). Also, it is possible to call /search and /answer in parallel * with the same session ID & query ID. */ queryId?: string; /** * The number of top search results to persist. The persisted search results * can be used for the subsequent /answer api call. This field is simliar to * the `summary_result_count` field in * SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count. At most * 10 results for documents mode, or 50 for chunks mode. */ searchResultPersistenceCount?: number; } /** * The specification for query spell correction. */ export interface GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec { /** * The mode under which spell correction replaces the original search query. * Defaults to Mode.AUTO. */ mode?: | "MODE_UNSPECIFIED" | "SUGGESTION_ONLY" | "AUTO"; } /** * External session proto definition. */ export interface GoogleCloudDiscoveryengineV1alphaSession { /** * Optional. The display name of the session. This field is used to identify * the session in the UI. By default, the display name is the first turn query * text in the session. */ displayName?: string; /** * Output only. The time the session finished. */ readonly endTime?: Date; /** * Optional. Whether the session is pinned, pinned session will be displayed * on the top of the session list. */ isPinned?: boolean; /** * Immutable. Fully qualified name * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` */ name?: string; /** * Output only. The time the session started. */ readonly startTime?: Date; /** * The state of the session. */ state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS"; /** * Turns. */ turns?: GoogleCloudDiscoveryengineV1alphaSessionTurn[]; /** * A unique identifier for tracking users. */ userPseudoId?: string; } /** * Represents a turn, including a query from the user and a answer from * service. */ export interface GoogleCloudDiscoveryengineV1alphaSessionTurn { /** * The resource name of the answer to the user query. Only set if the answer * generation (/answer API call) happened in this turn. */ answer?: string; /** * Output only. In ConversationalSearchService.GetSession API, if * GetSessionRequest.include_answer_details is set to true, this field will be * populated when getting answer query session. */ readonly detailedAnswer?: GoogleCloudDiscoveryengineV1alphaAnswer; /** * The user query. */ query?: GoogleCloudDiscoveryengineV1alphaQuery; } /** * Metadata related to the progress of the * SiteSearchEngineService.SetUriPatternDocumentData operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaSetUriPatternDocumentDataMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaSetUriPatternDocumentDataMetadata(data: any): GoogleCloudDiscoveryengineV1alphaSetUriPatternDocumentDataMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaSetUriPatternDocumentDataMetadata(data: any): GoogleCloudDiscoveryengineV1alphaSetUriPatternDocumentDataMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.SetUriPatternDocumentData * method. */ export interface GoogleCloudDiscoveryengineV1alphaSetUriPatternDocumentDataResponse { } /** * A sitemap for the SiteSearchEngine. */ export interface GoogleCloudDiscoveryengineV1alphaSitemap { /** * Output only. The sitemap's creation time. */ readonly createTime?: Date; /** * Output only. The fully qualified resource name of the sitemap. * `projects/*\/locations/*\/collections/*\/dataStores/*\/siteSearchEngine/sitemaps/*` * The `sitemap_id` suffix is system-generated. */ readonly name?: string; /** * Public URI for the sitemap, e.g. `www.example.com/sitemap.xml`. */ uri?: string; } /** * Verification information for target sites in advanced site search. */ export interface GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo { /** * Site verification state indicating the ownership and validity. */ siteVerificationState?: | "SITE_VERIFICATION_STATE_UNSPECIFIED" | "VERIFIED" | "UNVERIFIED" | "EXEMPTED"; /** * Latest site verification time. */ verifyTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaSiteVerificationInfo(data: any): GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo { return { ...data, verifyTime: data["verifyTime"] !== undefined ? data["verifyTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaSiteVerificationInfo(data: any): GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo { return { ...data, verifyTime: data["verifyTime"] !== undefined ? new Date(data["verifyTime"]) : undefined, }; } /** * A target site for the SiteSearchEngine. */ export interface GoogleCloudDiscoveryengineV1alphaTargetSite { /** * Input only. If set to false, a uri_pattern is generated to include all * pages whose address contains the provided_uri_pattern. If set to true, an * uri_pattern is generated to try to be an exact match of the * provided_uri_pattern or just the specific page if the provided_uri_pattern * is a specific one. provided_uri_pattern is always normalized to generate * the URI pattern to be used by the search engine. */ exactMatch?: boolean; /** * Output only. Failure reason. */ readonly failureReason?: GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason; /** * Output only. This is system-generated based on the provided_uri_pattern. */ readonly generatedUriPattern?: string; /** * Output only. Indexing status. */ readonly indexingStatus?: | "INDEXING_STATUS_UNSPECIFIED" | "PENDING" | "FAILED" | "SUCCEEDED" | "DELETING"; /** * Output only. The fully qualified resource name of the target site. * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` * The `target_site_id` is system-generated. */ readonly name?: string; /** * Required. Input only. The user provided URI pattern from which the * `generated_uri_pattern` is generated. */ providedUriPattern?: string; /** * Output only. Root domain of the provided_uri_pattern. */ readonly rootDomainUri?: string; /** * Output only. Site ownership and validity verification status. */ readonly siteVerificationInfo?: GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo; /** * The type of the target site, e.g., whether the site is to be included or * excluded. */ type?: | "TYPE_UNSPECIFIED" | "INCLUDE" | "EXCLUDE"; /** * Output only. The target site's last updated time. */ readonly updateTime?: Date; } /** * Site search indexing failure reasons. */ export interface GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason { /** * Failed due to insufficient quota. */ quotaFailure?: GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure; } function serializeGoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason(data: any): GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason { return { ...data, quotaFailure: data["quotaFailure"] !== undefined ? serializeGoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure(data["quotaFailure"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason(data: any): GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason { return { ...data, quotaFailure: data["quotaFailure"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure(data["quotaFailure"]) : undefined, }; } /** * Failed due to insufficient quota. */ export interface GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure { /** * This number is an estimation on how much total quota this project needs to * successfully complete indexing. */ totalRequiredQuota?: bigint; } function serializeGoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure(data: any): GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure { return { ...data, totalRequiredQuota: data["totalRequiredQuota"] !== undefined ? String(data["totalRequiredQuota"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure(data: any): GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure { return { ...data, totalRequiredQuota: data["totalRequiredQuota"] !== undefined ? BigInt(data["totalRequiredQuota"]) : undefined, }; } /** * Metadata related to the progress of the TrainCustomModel operation. This is * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaTrainCustomModelMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaTrainCustomModelMetadata(data: any): GoogleCloudDiscoveryengineV1alphaTrainCustomModelMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaTrainCustomModelMetadata(data: any): GoogleCloudDiscoveryengineV1alphaTrainCustomModelMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the TrainCustomModelRequest. This message is returned by the * google.longrunning.Operations.response field. */ export interface GoogleCloudDiscoveryengineV1alphaTrainCustomModelResponse { /** * Echoes the destination for the complete errors in the request if set. */ errorConfig?: GoogleCloudDiscoveryengineV1alphaImportErrorConfig; /** * A sample of errors encountered while processing the data. */ errorSamples?: GoogleRpcStatus[]; /** * The metrics of the trained model. */ metrics?: { [key: string]: number }; /** * Fully qualified name of the CustomTuningModel. */ modelName?: string; /** * The trained model status. Possible values are: * **bad-data**: The * training data quality is bad. * **no-improvement**: Tuning didn't improve * performance. Won't deploy. * **in-progress**: Model training job creation * is in progress. * **training**: Model is actively training. * * **evaluating**: The model is evaluating trained metrics. * **indexing**: * The model trained metrics are indexing. * **ready**: The model is ready for * serving. */ modelStatus?: string; } /** * Metadata associated with a tune operation. */ export interface GoogleCloudDiscoveryengineV1alphaTuneEngineMetadata { /** * Required. The resource name of the engine that this tune applies to. * Format: * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}` */ engine?: string; } /** * Response associated with a tune operation. */ export interface GoogleCloudDiscoveryengineV1alphaTuneEngineResponse { } /** * Metadata related to the progress of the CmekConfigService.UpdateCmekConfig * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1alphaUpdateCmekConfigMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaUpdateCmekConfigMetadata(data: any): GoogleCloudDiscoveryengineV1alphaUpdateCmekConfigMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaUpdateCmekConfigMetadata(data: any): GoogleCloudDiscoveryengineV1alphaUpdateCmekConfigMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for UpdateSchema LRO. */ export interface GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request for UpdateSession method. */ export interface GoogleCloudDiscoveryengineV1alphaUpdateSessionRequest { /** * Required. The Session to update. */ session?: GoogleCloudDiscoveryengineV1alphaSession; /** * Indicates which fields in the provided Session to update. The following * are NOT supported: * Session.name If not set or empty, all supported fields * are updated. */ updateMask?: string /* FieldMask */; } function serializeGoogleCloudDiscoveryengineV1alphaUpdateSessionRequest(data: any): GoogleCloudDiscoveryengineV1alphaUpdateSessionRequest { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaUpdateSessionRequest(data: any): GoogleCloudDiscoveryengineV1alphaUpdateSessionRequest { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.UpdateTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1alphaUpdateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1alphaUpdateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaUpdateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1alphaUpdateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1alphaUpdateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Information of an end user. */ export interface GoogleCloudDiscoveryengineV1alphaUserInfo { /** * User agent as included in the HTTP header. The field must be a UTF-8 * encoded string with a length limit of 1,000 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. This should not be set when using the * client side event reporting with GTM or JavaScript tag in * UserEventService.CollectUserEvent or if UserEvent.direct_user_request is * set. */ userAgent?: string; /** * Highly recommended for logged-in users. Unique identifier for logged-in * user, such as a user name. Don't set for anonymous users. Always use a * hashed value for this ID. Don't set the field to the same fixed ID for * different users. This mixes the event history of those users together, * which results in degraded model quality. The field must be a UTF-8 encoded * string with a length limit of 128 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ userId?: string; } /** * Config to store data store type configuration for workspace data */ export interface GoogleCloudDiscoveryengineV1alphaWorkspaceConfig { /** * Obfuscated Dasher customer ID. */ dasherCustomerId?: string; /** * Optional. The super admin email address for the workspace that will be * used for access token generation. For now we only use it for Native Google * Drive connector data ingestion. */ superAdminEmailAddress?: string; /** * Optional. The super admin service account for the workspace that will be * used for access token generation. For now we only use it for Native Google * Drive connector data ingestion. */ superAdminServiceAccount?: string; /** * The Google Workspace data source. */ type?: | "TYPE_UNSPECIFIED" | "GOOGLE_DRIVE" | "GOOGLE_MAIL" | "GOOGLE_SITES" | "GOOGLE_CALENDAR" | "GOOGLE_CHAT" | "GOOGLE_GROUPS" | "GOOGLE_KEEP"; } /** * Defines an answer. */ export interface GoogleCloudDiscoveryengineV1Answer { /** * Additional answer-skipped reasons. This provides the reason for ignored * cases. If nothing is skipped, this field is not set. */ answerSkippedReasons?: | "ANSWER_SKIPPED_REASON_UNSPECIFIED" | "ADVERSARIAL_QUERY_IGNORED" | "NON_ANSWER_SEEKING_QUERY_IGNORED" | "OUT_OF_DOMAIN_QUERY_IGNORED" | "POTENTIAL_POLICY_VIOLATION" | "NO_RELEVANT_CONTENT" | "JAIL_BREAKING_QUERY_IGNORED" | "CUSTOMER_POLICY_VIOLATION" | "NON_ANSWER_SEEKING_QUERY_IGNORED_V2" | "LOW_GROUNDED_ANSWER"[]; /** * The textual answer. */ answerText?: string; /** * Citations. */ citations?: GoogleCloudDiscoveryengineV1AnswerCitation[]; /** * Output only. Answer completed timestamp. */ readonly completeTime?: Date; /** * Output only. Answer creation timestamp. */ readonly createTime?: Date; /** * A score in the range of [0, 1] describing how grounded the answer is by * the reference chunks. */ groundingScore?: number; /** * Optional. Grounding supports. */ groundingSupports?: GoogleCloudDiscoveryengineV1AnswerGroundingSupport[]; /** * Immutable. Fully qualified name * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*\/answers/*` */ name?: string; /** * Query understanding information. */ queryUnderstandingInfo?: GoogleCloudDiscoveryengineV1AnswerQueryUnderstandingInfo; /** * References. */ references?: GoogleCloudDiscoveryengineV1AnswerReference[]; /** * Suggested related questions. */ relatedQuestions?: string[]; /** * The state of the answer generation. */ state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS" | "FAILED" | "SUCCEEDED"; /** * Answer generation steps. */ steps?: GoogleCloudDiscoveryengineV1AnswerStep[]; } function serializeGoogleCloudDiscoveryengineV1Answer(data: any): GoogleCloudDiscoveryengineV1Answer { return { ...data, citations: data["citations"] !== undefined ? data["citations"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1AnswerCitation(item))) : undefined, groundingSupports: data["groundingSupports"] !== undefined ? data["groundingSupports"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1AnswerGroundingSupport(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1Answer(data: any): GoogleCloudDiscoveryengineV1Answer { return { ...data, citations: data["citations"] !== undefined ? data["citations"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1AnswerCitation(item))) : undefined, completeTime: data["completeTime"] !== undefined ? new Date(data["completeTime"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, groundingSupports: data["groundingSupports"] !== undefined ? data["groundingSupports"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1AnswerGroundingSupport(item))) : undefined, }; } /** * Citation info for a segment. */ export interface GoogleCloudDiscoveryengineV1AnswerCitation { /** * End of the attributed segment, exclusive. */ endIndex?: bigint; /** * Citation sources for the attributed segment. */ sources?: GoogleCloudDiscoveryengineV1AnswerCitationSource[]; /** * Index indicates the start of the segment, measured in bytes (UTF-8 * unicode). */ startIndex?: bigint; } function serializeGoogleCloudDiscoveryengineV1AnswerCitation(data: any): GoogleCloudDiscoveryengineV1AnswerCitation { return { ...data, endIndex: data["endIndex"] !== undefined ? String(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? String(data["startIndex"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1AnswerCitation(data: any): GoogleCloudDiscoveryengineV1AnswerCitation { return { ...data, endIndex: data["endIndex"] !== undefined ? BigInt(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? BigInt(data["startIndex"]) : undefined, }; } /** * Citation source. */ export interface GoogleCloudDiscoveryengineV1AnswerCitationSource { /** * ID of the citation source. */ referenceId?: string; } /** * Grounding support for a claim in `answer_text`. */ export interface GoogleCloudDiscoveryengineV1AnswerGroundingSupport { /** * Required. End of the claim, exclusive. */ endIndex?: bigint; /** * Indicates that this claim required grounding check. When the system * decided this claim didn't require attribution/grounding check, this field * is set to false. In that case, no grounding check was done for the claim * and therefore `grounding_score`, `sources` is not returned. */ groundingCheckRequired?: boolean; /** * A score in the range of [0, 1] describing how grounded is a specific claim * by the references. Higher value means that the claim is better supported by * the reference chunks. */ groundingScore?: number; /** * Optional. Citation sources for the claim. */ sources?: GoogleCloudDiscoveryengineV1AnswerCitationSource[]; /** * Required. Index indicates the start of the claim, measured in bytes (UTF-8 * unicode). */ startIndex?: bigint; } function serializeGoogleCloudDiscoveryengineV1AnswerGroundingSupport(data: any): GoogleCloudDiscoveryengineV1AnswerGroundingSupport { return { ...data, endIndex: data["endIndex"] !== undefined ? String(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? String(data["startIndex"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1AnswerGroundingSupport(data: any): GoogleCloudDiscoveryengineV1AnswerGroundingSupport { return { ...data, endIndex: data["endIndex"] !== undefined ? BigInt(data["endIndex"]) : undefined, startIndex: data["startIndex"] !== undefined ? BigInt(data["startIndex"]) : undefined, }; } /** * Request message for ConversationalSearchService.AnswerQuery method. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequest { /** * Answer generation specification. */ answerGenerationSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpec; /** * Deprecated: This field is deprecated. Streaming Answer API will be * supported. Asynchronous mode control. If enabled, the response will be * returned with answer/session resource name without final answer. The API * users need to do the polling to get the latest status of answer/session by * calling ConversationalSearchService.GetAnswer or * ConversationalSearchService.GetSession method. */ asynchronousMode?: boolean; /** * Optional. Grounding specification. */ groundingSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestGroundingSpec; /** * Required. Current user query. */ query?: GoogleCloudDiscoveryengineV1Query; /** * Query understanding specification. */ queryUnderstandingSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpec; /** * Related questions specification. */ relatedQuestionsSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestRelatedQuestionsSpec; /** * Model specification. */ safetySpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSafetySpec; /** * Search specification. */ searchSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpec; /** * The session resource name. Not required. When session field is not set, * the API is in sessionless mode. We support auto session mode: users can use * the wildcard symbol `-` as session ID. A new ID will be automatically * generated and assigned. */ session?: string; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Google Cloud * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; /** * A unique identifier for tracking visitors. For example, this could be * implemented with an HTTP cookie, which should be able to uniquely identify * a visitor on a single device. This unique identifier should not change if * the visitor logs in or out of the website. This field should NOT have a * fixed value such as `unknown_visitor`. The field must be a UTF-8 encoded * string with a length limit of 128 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ userPseudoId?: string; } /** * Answer generation specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpec { /** * Language code for Answer. Use language tags defined by * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an * experimental feature. */ answerLanguageCode?: string; /** * Specifies whether to filter out adversarial queries. The default value is * `false`. Google employs search-query classification to detect adversarial * queries. No answer is returned if the search query is classified as an * adversarial query. For example, a user might ask a question regarding * negative comments about the company or submit a query designed to generate * unsafe, policy-violating output. If this field is set to `true`, we skip * generating answers for adversarial queries and return fallback messages * instead. */ ignoreAdversarialQuery?: boolean; /** * Optional. Specifies whether to filter out jail-breaking queries. The * default value is `false`. Google employs search-query classification to * detect jail-breaking queries. No summary is returned if the search query is * classified as a jail-breaking query. A user might add instructions to the * query to change the tone, style, language, content of the answer, or ask * the model to act as a different entity, e.g. "Reply in the tone of a * competing company's CEO". If this field is set to `true`, we skip * generating summaries for jail-breaking queries and return fallback messages * instead. */ ignoreJailBreakingQuery?: boolean; /** * Specifies whether to filter out queries that have low relevance. If this * field is set to `false`, all search results are used regardless of * relevance to generate answers. If set to `true` or unset, the behavior will * be determined automatically by the service. */ ignoreLowRelevantContent?: boolean; /** * Specifies whether to filter out queries that are not answer-seeking. The * default value is `false`. Google employs search-query classification to * detect answer-seeking queries. No answer is returned if the search query is * classified as a non-answer seeking query. If this field is set to `true`, * we skip generating answers for non-answer seeking queries and return * fallback messages instead. */ ignoreNonAnswerSeekingQuery?: boolean; /** * Specifies whether to include citation metadata in the answer. The default * value is `false`. */ includeCitations?: boolean; /** * Answer generation model specification. */ modelSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpecModelSpec; /** * Answer generation prompt specification. */ promptSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpecPromptSpec; } /** * Answer Generation Model specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpecModelSpec { /** * Model version. If not set, it will use the default stable model. Allowed * values are: stable, preview. */ modelVersion?: string; } /** * Answer generation prompt specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpecPromptSpec { /** * Customized preamble. */ preamble?: string; } /** * Grounding specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestGroundingSpec { /** * Optional. Specifies whether to enable the filtering based on grounding * score and at what level. */ filteringLevel?: | "FILTERING_LEVEL_UNSPECIFIED" | "FILTERING_LEVEL_LOW" | "FILTERING_LEVEL_HIGH"; /** * Optional. Specifies whether to include grounding_supports in the answer. * The default value is `false`. When this field is set to `true`, returned * answer will have `grounding_score` and will contain GroundingSupports for * each claim. */ includeGroundingSupports?: boolean; } /** * Query understanding specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpec { /** * Query classification specification. */ queryClassificationSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpecQueryClassificationSpec; /** * Query rephraser specification. */ queryRephraserSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpecQueryRephraserSpec; } /** * Query classification specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpecQueryClassificationSpec { /** * Enabled query classification types. */ types?: | "TYPE_UNSPECIFIED" | "ADVERSARIAL_QUERY" | "NON_ANSWER_SEEKING_QUERY" | "JAIL_BREAKING_QUERY" | "NON_ANSWER_SEEKING_QUERY_V2"[]; } /** * Query rephraser specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpecQueryRephraserSpec { /** * Disable query rephraser. */ disable?: boolean; /** * Max rephrase steps. The max number is 5 steps. If not set or set to < 1, * it will be set to 1 by default. */ maxRephraseSteps?: number; /** * Optional. Query Rephraser Model specification. */ modelSpec?: GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpecQueryRephraserSpecModelSpec; } /** * Query Rephraser Model specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestQueryUnderstandingSpecQueryRephraserSpecModelSpec { /** * Optional. Enabled query rephraser model type. If not set, it will use * LARGE by default. */ modelType?: | "MODEL_TYPE_UNSPECIFIED" | "SMALL" | "LARGE"; } /** * Related questions specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestRelatedQuestionsSpec { /** * Enable related questions feature if true. */ enable?: boolean; } /** * Safety specification. There are two use cases: 1. when only * safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold will be applied * for all categories. 2. when safety_spec.enable is set and some * safety_settings are set, only specified safety_settings are applied. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSafetySpec { /** * Enable the safety filtering on the answer response. It is false by * default. */ enable?: boolean; } /** * Search specification. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpec { /** * Search parameters. */ searchParams?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchParams; /** * Search result list. */ searchResultList?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultList; } /** * Search parameters. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchParams { /** * Boost specification to boost certain documents in search results which may * affect the answer query response. For more information on boosting, see * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) */ boostSpec?: GoogleCloudDiscoveryengineV1SearchRequestBoostSpec; /** * Specs defining dataStores to filter on in a search call and configurations * for those dataStores. This is only considered for engines with multiple * dataStores use case. For single dataStore within an engine, they should use * the specs at the top level. */ dataStoreSpecs?: GoogleCloudDiscoveryengineV1SearchRequestDataStoreSpec[]; /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. Filter * expression is case-sensitive. This will be used to filter search results * which may affect the Answer response. If this field is unrecognizable, an * `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by * mapping the LHS filter key to a key property defined in the Vertex AI * Search backend -- this mapping is defined by the customer in their schema. * For example a media customers might have a field 'name' in their schema. In * this case the filter would look like this: filter --> name:'ANY("king * kong")' For more information about filtering including syntax and filter * operators, see * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; /** * Number of search results to return. The default value is 10. */ maxReturnResults?: number; /** * The order in which documents are returned. Documents can be ordered by a * field in an Document object. Leave it unset if ordered by relevance. * `order_by` expression is case-sensitive. For more information on ordering, * see [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. */ orderBy?: string; /** * Specifies the search result mode. If unspecified, the search result mode * defaults to `DOCUMENTS`. See [parse and chunk * documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents) */ searchResultMode?: | "SEARCH_RESULT_MODE_UNSPECIFIED" | "DOCUMENTS" | "CHUNKS"; } /** * Search result list. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultList { /** * Search results. */ searchResults?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResult[]; } /** * Search result. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResult { /** * Chunk information. */ chunkInfo?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfo; /** * Unstructured document information. */ unstructuredDocumentInfo?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfo; } /** * Chunk information. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfo { /** * Chunk resource name. */ chunk?: string; /** * Chunk textual content. */ content?: string; /** * Metadata of the document from the current chunk. */ documentMetadata?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata; } /** * Document metadata contains the information of the document of the current * chunk. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultChunkInfoDocumentMetadata { /** * Title of the document. */ title?: string; /** * Uri of the document. */ uri?: string; } /** * Unstructured document information. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfo { /** * Document resource name. */ document?: string; /** * List of document contexts. The content will be used for Answer Generation. * This is supposed to be the main content of the document that can be long * and comprehensive. */ documentContexts?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfoDocumentContext[]; /** * Deprecated: This field is deprecated and will have no effect on the Answer * generation. Please use document_contexts and extractive_segments fields. * List of extractive answers. */ extractiveAnswers?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfoExtractiveAnswer[]; /** * List of extractive segments. */ extractiveSegments?: GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfoExtractiveSegment[]; /** * Title. */ title?: string; /** * URI for the document. */ uri?: string; } /** * Document context. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfoDocumentContext { /** * Document content to be used for answer generation. */ content?: string; /** * Page identifier. */ pageIdentifier?: string; } /** * Extractive answer. * [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers) */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfoExtractiveAnswer { /** * Extractive answer content. */ content?: string; /** * Page identifier. */ pageIdentifier?: string; } /** * Extractive segment. * [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments) * Answer generation will only use it if document_contexts is empty. This is * supposed to be shorter snippets. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryRequestSearchSpecSearchResultListSearchResultUnstructuredDocumentInfoExtractiveSegment { /** * Extractive segment content. */ content?: string; /** * Page identifier. */ pageIdentifier?: string; } /** * Response message for ConversationalSearchService.AnswerQuery method. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryResponse { /** * Answer resource object. If * AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps * is greater than 1, use Answer.name to fetch answer information using * ConversationalSearchService.GetAnswer API. */ answer?: GoogleCloudDiscoveryengineV1Answer; /** * A global unique ID used for logging. */ answerQueryToken?: string; /** * Session resource object. It will be only available when session field is * set and valid in the AnswerQueryRequest request. */ session?: GoogleCloudDiscoveryengineV1Session; } function serializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data: any): GoogleCloudDiscoveryengineV1AnswerQueryResponse { return { ...data, answer: data["answer"] !== undefined ? serializeGoogleCloudDiscoveryengineV1Answer(data["answer"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1AnswerQueryResponse(data: any): GoogleCloudDiscoveryengineV1AnswerQueryResponse { return { ...data, answer: data["answer"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1Answer(data["answer"]) : undefined, }; } /** * Query understanding information. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryUnderstandingInfo { /** * Query classification information. */ queryClassificationInfo?: GoogleCloudDiscoveryengineV1AnswerQueryUnderstandingInfoQueryClassificationInfo[]; } /** * Query classification information. */ export interface GoogleCloudDiscoveryengineV1AnswerQueryUnderstandingInfoQueryClassificationInfo { /** * Classification output. */ positive?: boolean; /** * Query classification type. */ type?: | "TYPE_UNSPECIFIED" | "ADVERSARIAL_QUERY" | "NON_ANSWER_SEEKING_QUERY" | "JAIL_BREAKING_QUERY" | "NON_ANSWER_SEEKING_QUERY_V2"; } /** * Reference. */ export interface GoogleCloudDiscoveryengineV1AnswerReference { /** * Chunk information. */ chunkInfo?: GoogleCloudDiscoveryengineV1AnswerReferenceChunkInfo; /** * Structured document information. */ structuredDocumentInfo?: GoogleCloudDiscoveryengineV1AnswerReferenceStructuredDocumentInfo; /** * Unstructured document information. */ unstructuredDocumentInfo?: GoogleCloudDiscoveryengineV1AnswerReferenceUnstructuredDocumentInfo; } /** * Chunk information. */ export interface GoogleCloudDiscoveryengineV1AnswerReferenceChunkInfo { /** * Chunk resource name. */ chunk?: string; /** * Chunk textual content. */ content?: string; /** * Document metadata. */ documentMetadata?: GoogleCloudDiscoveryengineV1AnswerReferenceChunkInfoDocumentMetadata; /** * The relevance of the chunk for a given query. Values range from 0.0 * (completely irrelevant) to 1.0 (completely relevant). This value is for * informational purpose only. It may change for the same query and chunk at * any time due to a model retraining or change in implementation. */ relevanceScore?: number; } /** * Document metadata. */ export interface GoogleCloudDiscoveryengineV1AnswerReferenceChunkInfoDocumentMetadata { /** * Document resource name. */ document?: string; /** * Page identifier. */ pageIdentifier?: string; /** * The structured JSON metadata for the document. It is populated from the * struct data from the Chunk in search result. */ structData?: { [key: string]: any }; /** * Title. */ title?: string; /** * URI for the document. */ uri?: string; } /** * Structured search information. */ export interface GoogleCloudDiscoveryengineV1AnswerReferenceStructuredDocumentInfo { /** * Document resource name. */ document?: string; /** * Structured search data. */ structData?: { [key: string]: any }; } /** * Unstructured document information. */ export interface GoogleCloudDiscoveryengineV1AnswerReferenceUnstructuredDocumentInfo { /** * List of cited chunk contents derived from document content. */ chunkContents?: GoogleCloudDiscoveryengineV1AnswerReferenceUnstructuredDocumentInfoChunkContent[]; /** * Document resource name. */ document?: string; /** * The structured JSON metadata for the document. It is populated from the * struct data from the Chunk in search result. */ structData?: { [key: string]: any }; /** * Title. */ title?: string; /** * URI for the document. */ uri?: string; } /** * Chunk content. */ export interface GoogleCloudDiscoveryengineV1AnswerReferenceUnstructuredDocumentInfoChunkContent { /** * Chunk textual content. */ content?: string; /** * Page identifier. */ pageIdentifier?: string; /** * The relevance of the chunk for a given query. Values range from 0.0 * (completely irrelevant) to 1.0 (completely relevant). This value is for * informational purpose only. It may change for the same query and chunk at * any time due to a model retraining or change in implementation. */ relevanceScore?: number; } /** * Step information. */ export interface GoogleCloudDiscoveryengineV1AnswerStep { /** * Actions. */ actions?: GoogleCloudDiscoveryengineV1AnswerStepAction[]; /** * The description of the step. */ description?: string; /** * The state of the step. */ state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS" | "FAILED" | "SUCCEEDED"; /** * The thought of the step. */ thought?: string; } /** * Action. */ export interface GoogleCloudDiscoveryengineV1AnswerStepAction { /** * Observation. */ observation?: GoogleCloudDiscoveryengineV1AnswerStepActionObservation; /** * Search action. */ searchAction?: GoogleCloudDiscoveryengineV1AnswerStepActionSearchAction; } /** * Observation. */ export interface GoogleCloudDiscoveryengineV1AnswerStepActionObservation { /** * Search results observed by the search action, it can be snippets info or * chunk info, depending on the citation type set by the user. */ searchResults?: GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResult[]; } export interface GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResult { /** * If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate * chunk info. */ chunkInfo?: GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResultChunkInfo[]; /** * Document resource name. */ document?: string; /** * If citation_type is DOCUMENT_LEVEL_CITATION, populate document level * snippets. */ snippetInfo?: GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResultSnippetInfo[]; /** * Data representation. The structured JSON data for the document. It's * populated from the struct data from the Document, or the Chunk in search * result. */ structData?: { [key: string]: any }; /** * Title. */ title?: string; /** * URI for the document. */ uri?: string; } /** * Chunk information. */ export interface GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResultChunkInfo { /** * Chunk resource name. */ chunk?: string; /** * Chunk textual content. */ content?: string; /** * The relevance of the chunk for a given query. Values range from 0.0 * (completely irrelevant) to 1.0 (completely relevant). This value is for * informational purpose only. It may change for the same query and chunk at * any time due to a model retraining or change in implementation. */ relevanceScore?: number; } /** * Snippet information. */ export interface GoogleCloudDiscoveryengineV1AnswerStepActionObservationSearchResultSnippetInfo { /** * Snippet content. */ snippet?: string; /** * Status of the snippet defined by the search team. */ snippetStatus?: string; } /** * Search action. */ export interface GoogleCloudDiscoveryengineV1AnswerStepActionSearchAction { /** * The query to search. */ query?: string; } /** * Metadata related to the progress of the * SiteSearchEngineService.BatchCreateTargetSites operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1BatchCreateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1BatchCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1BatchCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1BatchCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1BatchCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for SiteSearchEngineService.BatchCreateTargetSites method. */ export interface GoogleCloudDiscoveryengineV1BatchCreateTargetSitesRequest { /** * Required. The request message specifying the resources to create. A * maximum of 20 TargetSites can be created in a batch. */ requests?: GoogleCloudDiscoveryengineV1CreateTargetSiteRequest[]; } /** * Response message for SiteSearchEngineService.BatchCreateTargetSites method. */ export interface GoogleCloudDiscoveryengineV1BatchCreateTargetSitesResponse { /** * TargetSites created. */ targetSites?: GoogleCloudDiscoveryengineV1TargetSite[]; } /** * Response message for DocumentService.BatchGetDocumentsMetadata method. */ export interface GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponse { /** * The metadata of the Documents. */ documentsMetadata?: GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata[]; } function serializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponse(data: any): GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponse { return { ...data, documentsMetadata: data["documentsMetadata"] !== undefined ? data["documentsMetadata"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponse(data: any): GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponse { return { ...data, documentsMetadata: data["documentsMetadata"] !== undefined ? data["documentsMetadata"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata(item))) : undefined, }; } /** * The metadata of a Document. */ export interface GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata { /** * The data ingestion source of the Document. Allowed values are: * `batch`: * Data ingested via Batch API, e.g., ImportDocuments. * `streaming` Data * ingested via Streaming API, e.g., FHIR streaming. */ dataIngestionSource?: string; /** * The timestamp of the last time the Document was last indexed. */ lastRefreshedTime?: Date; /** * The value of the matcher that was used to match the Document. */ matcherValue?: GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadataMatcherValue; /** * The state of the document. */ state?: | "STATE_UNSPECIFIED" | "INDEXED" | "NOT_IN_TARGET_SITE" | "NOT_IN_INDEX"; } function serializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata(data: any): GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata { return { ...data, lastRefreshedTime: data["lastRefreshedTime"] !== undefined ? data["lastRefreshedTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata(data: any): GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadata { return { ...data, lastRefreshedTime: data["lastRefreshedTime"] !== undefined ? new Date(data["lastRefreshedTime"]) : undefined, }; } /** * The value of the matcher that was used to match the Document. */ export interface GoogleCloudDiscoveryengineV1BatchGetDocumentsMetadataResponseDocumentMetadataMatcherValue { /** * Format: * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} */ fhirResource?: string; /** * If match by URI, the URI of the Document. */ uri?: string; } /** * Request message for SiteSearchEngineService.BatchVerifyTargetSites method. */ export interface GoogleCloudDiscoveryengineV1BatchVerifyTargetSitesRequest { } /** * Configuration data for advance site search. */ export interface GoogleCloudDiscoveryengineV1betaAdvancedSiteSearchConfig { } /** * Metadata related to the progress of the * SiteSearchEngineService.BatchCreateTargetSites operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaBatchCreateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaBatchCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaBatchCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaBatchCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaBatchCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.BatchCreateTargetSites method. */ export interface GoogleCloudDiscoveryengineV1betaBatchCreateTargetSitesResponse { /** * TargetSites created. */ targetSites?: GoogleCloudDiscoveryengineV1betaTargetSite[]; } /** * Configurations used to enable CMEK data encryption with Cloud KMS keys. */ export interface GoogleCloudDiscoveryengineV1betaCmekConfig { /** * Output only. The default CmekConfig for the Customer. */ readonly isDefault?: boolean; /** * Kms key resource name which will be used to encrypt resources * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{keyId}`. */ kmsKey?: string; /** * Kms key version resource name which will be used to encrypt resources * `/cryptoKeyVersions/{keyVersion}`. */ kmsKeyVersion?: string; /** * Output only. The timestamp of the last key rotation. */ readonly lastRotationTimestampMicros?: bigint; /** * Required. Name of the CmekConfig, of the form * `projects/{project}/locations/{location}/cmekConfig` or * `projects/{project}/locations/{location}/cmekConfigs/{cmekConfig}`. */ name?: string; /** * Output only. State of the CmekConfig. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "KEY_ISSUE" | "DELETING" | "UNUSABLE" | "ACTIVE_ROTATING"; } /** * Defines circumstances to be checked before allowing a behavior */ export interface GoogleCloudDiscoveryengineV1betaCondition { /** * Range of time(s) specifying when condition is active. Maximum of 10 time * ranges. */ activeTimeRange?: GoogleCloudDiscoveryengineV1betaConditionTimeRange[]; /** * Optional. Query regex to match the whole search query. Cannot be set when * Condition.query_terms is set. This is currently supporting promotion use * case. */ queryRegex?: string; /** * Search only A list of terms to match the query on. Cannot be set when * Condition.query_regex is set. Maximum of 10 query terms. */ queryTerms?: GoogleCloudDiscoveryengineV1betaConditionQueryTerm[]; } function serializeGoogleCloudDiscoveryengineV1betaCondition(data: any): GoogleCloudDiscoveryengineV1betaCondition { return { ...data, activeTimeRange: data["activeTimeRange"] !== undefined ? data["activeTimeRange"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1betaConditionTimeRange(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaCondition(data: any): GoogleCloudDiscoveryengineV1betaCondition { return { ...data, activeTimeRange: data["activeTimeRange"] !== undefined ? data["activeTimeRange"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1betaConditionTimeRange(item))) : undefined, }; } /** * Matcher for search request query */ export interface GoogleCloudDiscoveryengineV1betaConditionQueryTerm { /** * Whether the search query needs to exactly match the query term. */ fullMatch?: boolean; /** * The specific query value to match against Must be lowercase, must be * UTF-8. Can have at most 3 space separated terms if full_match is true. * Cannot be an empty string. Maximum length of 5000 characters. */ value?: string; } /** * Used for time-dependent conditions. */ export interface GoogleCloudDiscoveryengineV1betaConditionTimeRange { /** * End of time range. Range is inclusive. Must be in the future. */ endTime?: Date; /** * Start of time range. Range is inclusive. */ startTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaConditionTimeRange(data: any): GoogleCloudDiscoveryengineV1betaConditionTimeRange { return { ...data, endTime: data["endTime"] !== undefined ? data["endTime"].toISOString() : undefined, startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaConditionTimeRange(data: any): GoogleCloudDiscoveryengineV1betaConditionTimeRange { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * Defines a conditioned behavior to employ during serving. Must be attached to * a ServingConfig to be considered at serving time. Permitted actions dependent * on `SolutionType`. */ export interface GoogleCloudDiscoveryengineV1betaControl { /** * Output only. List of all ServingConfig IDs this control is attached to. * May take up to 10 minutes to update after changes. */ readonly associatedServingConfigIds?: string[]; /** * Defines a boost-type control */ boostAction?: GoogleCloudDiscoveryengineV1betaControlBoostAction; /** * Determines when the associated action will trigger. Omit to always apply * the action. Currently only a single condition may be specified. Otherwise * an INVALID ARGUMENT error is thrown. */ conditions?: GoogleCloudDiscoveryengineV1betaCondition[]; /** * Required. Human readable name. The identifier used in UI views. Must be * UTF-8 encoded string. Length limit is 128 characters. Otherwise an INVALID * ARGUMENT error is thrown. */ displayName?: string; /** * Defines a filter-type control Currently not supported by Recommendation */ filterAction?: GoogleCloudDiscoveryengineV1betaControlFilterAction; /** * Immutable. Fully qualified name * `projects/*\/locations/global/dataStore/*\/controls/*` */ name?: string; /** * Promote certain links based on predefined trigger queries. This now only * supports basic site search. */ promoteAction?: GoogleCloudDiscoveryengineV1betaControlPromoteAction; /** * Defines a redirect-type control. */ redirectAction?: GoogleCloudDiscoveryengineV1betaControlRedirectAction; /** * Required. Immutable. What solution the control belongs to. Must be * compatible with vertical of resource. Otherwise an INVALID ARGUMENT error * is thrown. */ solutionType?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"; /** * Treats a group of terms as synonyms of one another. */ synonymsAction?: GoogleCloudDiscoveryengineV1betaControlSynonymsAction; /** * Specifies the use case for the control. Affects what condition fields can * be set. Only applies to SOLUTION_TYPE_SEARCH. Currently only allow one use * case per control. Must be set when solution_type is * SolutionType.SOLUTION_TYPE_SEARCH. */ useCases?: | "SEARCH_USE_CASE_UNSPECIFIED" | "SEARCH_USE_CASE_SEARCH" | "SEARCH_USE_CASE_BROWSE"[]; } function serializeGoogleCloudDiscoveryengineV1betaControl(data: any): GoogleCloudDiscoveryengineV1betaControl { return { ...data, conditions: data["conditions"] !== undefined ? data["conditions"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1betaCondition(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaControl(data: any): GoogleCloudDiscoveryengineV1betaControl { return { ...data, conditions: data["conditions"] !== undefined ? data["conditions"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1betaCondition(item))) : undefined, }; } /** * Adjusts order of products in returned list. */ export interface GoogleCloudDiscoveryengineV1betaControlBoostAction { /** * Required. Strength of the boost, which should be in [-1, 1]. Negative * boost means demotion. Default is 0.0 (No-op). */ boost?: number; /** * Required. Specifies which data store's documents can be boosted by this * control. Full data store name e.g. * projects/123/locations/global/collections/default_collection/dataStores/default_data_store */ dataStore?: string; /** * Required. Specifies which products to apply the boost to. If no filter is * provided all products will be boosted (No-op). Syntax documentation: * https://cloud.google.com/retail/docs/filter-and-order Maximum length is * 5000 characters. Otherwise an INVALID ARGUMENT error is thrown. */ filter?: string; } /** * Specified which products may be included in results. Uses same filter as * boost. */ export interface GoogleCloudDiscoveryengineV1betaControlFilterAction { /** * Required. Specifies which data store's documents can be filtered by this * control. Full data store name e.g. * projects/123/locations/global/collections/default_collection/dataStores/default_data_store */ dataStore?: string; /** * Required. A filter to apply on the matching condition results. Required * Syntax documentation: https://cloud.google.com/retail/docs/filter-and-order * Maximum length is 5000 characters. Otherwise an INVALID ARGUMENT error is * thrown. */ filter?: string; } /** * Promote certain links based on some trigger queries. Example: Promote shoe * store link when searching for `shoe` keyword. The link can be outside of * associated data store. */ export interface GoogleCloudDiscoveryengineV1betaControlPromoteAction { /** * Required. Data store with which this promotion is attached to. */ dataStore?: string; /** * Required. Promotion attached to this action. */ searchLinkPromotion?: GoogleCloudDiscoveryengineV1betaSearchLinkPromotion; } /** * Redirects a shopper to the provided URI. */ export interface GoogleCloudDiscoveryengineV1betaControlRedirectAction { /** * Required. The URI to which the shopper will be redirected. Required. URI * must have length equal or less than 2000 characters. Otherwise an INVALID * ARGUMENT error is thrown. */ redirectUri?: string; } /** * Creates a set of terms that will act as synonyms of one another. Example: * "happy" will also be considered as "glad", "glad" will also be considered as * "happy". */ export interface GoogleCloudDiscoveryengineV1betaControlSynonymsAction { /** * Defines a set of synonyms. Can specify up to 100 synonyms. Must specify at * least 2 synonyms. Otherwise an INVALID ARGUMENT error is thrown. */ synonyms?: string[]; } /** * Metadata related to the progress of the DataStoreService.CreateDataStore * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1betaCreateDataStoreMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaCreateDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaCreateDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the EngineService.CreateEngine * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1betaCreateEngineMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaCreateEngineMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaCreateEngineMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for EvaluationService.CreateEvaluation method. */ export interface GoogleCloudDiscoveryengineV1betaCreateEvaluationMetadata { } /** * Metadata for Create Schema LRO. */ export interface GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaCreateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaCreateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.CreateSitemap operation. This will be returned by the * google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaCreateSitemapMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaCreateSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaCreateSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.CreateTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaCreateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaCreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaCreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata that describes a custom tuned model. */ export interface GoogleCloudDiscoveryengineV1betaCustomTuningModel { /** * Deprecated: Timestamp the Model was created at. */ createTime?: Date; /** * The display name of the model. */ displayName?: string; /** * Currently this is only populated if the model state is * `INPUT_VALIDATION_FAILED`. */ errorMessage?: string; /** * The metrics of the trained model. */ metrics?: { [key: string]: number }; /** * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). */ modelState?: | "MODEL_STATE_UNSPECIFIED" | "TRAINING_PAUSED" | "TRAINING" | "TRAINING_COMPLETE" | "READY_FOR_SERVING" | "TRAINING_FAILED" | "NO_IMPROVEMENT" | "INPUT_VALIDATION_FAILED"; /** * The version of the model. */ modelVersion?: bigint; /** * Required. The fully qualified resource name of the model. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. * Model must be an alpha-numerical string with limit of 40 characters. */ name?: string; /** * Timestamp the model training was initiated. */ trainingStartTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaCustomTuningModel(data: any): GoogleCloudDiscoveryengineV1betaCustomTuningModel { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, modelVersion: data["modelVersion"] !== undefined ? String(data["modelVersion"]) : undefined, trainingStartTime: data["trainingStartTime"] !== undefined ? data["trainingStartTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaCustomTuningModel(data: any): GoogleCloudDiscoveryengineV1betaCustomTuningModel { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, modelVersion: data["modelVersion"] !== undefined ? BigInt(data["modelVersion"]) : undefined, trainingStartTime: data["trainingStartTime"] !== undefined ? new Date(data["trainingStartTime"]) : undefined, }; } /** * DataStore captures global settings and configs at the DataStore level. */ export interface GoogleCloudDiscoveryengineV1betaDataStore { /** * Optional. Configuration for advanced site search. */ advancedSiteSearchConfig?: GoogleCloudDiscoveryengineV1betaAdvancedSiteSearchConfig; /** * Output only. Data size estimation for billing. */ readonly billingEstimation?: GoogleCloudDiscoveryengineV1betaDataStoreBillingEstimation; /** * Output only. CMEK-related information for the DataStore. */ readonly cmekConfig?: GoogleCloudDiscoveryengineV1betaCmekConfig; /** * Immutable. The content config of the data store. If this field is unset, * the server behavior defaults to ContentConfig.NO_CONTENT. */ contentConfig?: | "CONTENT_CONFIG_UNSPECIFIED" | "NO_CONTENT" | "CONTENT_REQUIRED" | "PUBLIC_WEBSITE" | "GOOGLE_WORKSPACE"; /** * Output only. Timestamp the DataStore was created at. */ readonly createTime?: Date; /** * Output only. The id of the default Schema asscociated to this data store. */ readonly defaultSchemaId?: string; /** * Required. The data store display name. This field must be a UTF-8 encoded * string with a length limit of 128 characters. Otherwise, an * INVALID_ARGUMENT error is returned. */ displayName?: string; /** * Configuration for Document understanding and enrichment. */ documentProcessingConfig?: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfig; /** * Immutable. The industry vertical that the data store registers. */ industryVertical?: | "INDUSTRY_VERTICAL_UNSPECIFIED" | "GENERIC" | "MEDIA" | "HEALTHCARE_FHIR"; /** * Input only. The KMS key to be used to protect this DataStore at creation * time. Must be set for requests that need to comply with CMEK Org Policy * protections. If this field is set and processed successfully, the DataStore * will be protected by the KMS key, as indicated in the cmek_config field. */ kmsKeyName?: string; /** * Language info for DataStore. */ languageInfo?: GoogleCloudDiscoveryengineV1betaLanguageInfo; /** * Immutable. The full resource name of the data store. Format: * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * Optional. Configuration for Natural Language Query Understanding. */ naturalLanguageQueryUnderstandingConfig?: GoogleCloudDiscoveryengineV1betaNaturalLanguageQueryUnderstandingConfig; /** * Optional. Stores serving config at DataStore level. */ servingConfigDataStore?: GoogleCloudDiscoveryengineV1betaDataStoreServingConfigDataStore; /** * The solutions that the data store enrolls. Available solutions for each * industry_vertical: * `MEDIA`: `SOLUTION_TYPE_RECOMMENDATION` and * `SOLUTION_TYPE_SEARCH`. * `SITE_SEARCH`: `SOLUTION_TYPE_SEARCH` is * automatically enrolled. Other solutions cannot be enrolled. */ solutionTypes?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"[]; /** * The start schema to use for this DataStore when provisioning it. If unset, * a default vertical specialized schema will be used. This field is only used * by CreateDataStore API, and will be ignored if used in other APIs. This * field will be omitted from all API responses including CreateDataStore API. * To retrieve a schema of a DataStore, use SchemaService.GetSchema API * instead. The provided schema will be validated against certain rules on * schema. Learn more from [this * doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema). */ startingSchema?: GoogleCloudDiscoveryengineV1betaSchema; /** * Config to store data store type configuration for workspace data. This * must be set when DataStore.content_config is set as * DataStore.ContentConfig.GOOGLE_WORKSPACE. */ workspaceConfig?: GoogleCloudDiscoveryengineV1betaWorkspaceConfig; } /** * Estimation of data size per data store. */ export interface GoogleCloudDiscoveryengineV1betaDataStoreBillingEstimation { /** * Data size for structured data in terms of bytes. */ structuredDataSize?: bigint; /** * Last updated timestamp for structured data. */ structuredDataUpdateTime?: Date; /** * Data size for unstructured data in terms of bytes. */ unstructuredDataSize?: bigint; /** * Last updated timestamp for unstructured data. */ unstructuredDataUpdateTime?: Date; /** * Data size for websites in terms of bytes. */ websiteDataSize?: bigint; /** * Last updated timestamp for websites. */ websiteDataUpdateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaDataStoreBillingEstimation(data: any): GoogleCloudDiscoveryengineV1betaDataStoreBillingEstimation { return { ...data, structuredDataSize: data["structuredDataSize"] !== undefined ? String(data["structuredDataSize"]) : undefined, structuredDataUpdateTime: data["structuredDataUpdateTime"] !== undefined ? data["structuredDataUpdateTime"].toISOString() : undefined, unstructuredDataSize: data["unstructuredDataSize"] !== undefined ? String(data["unstructuredDataSize"]) : undefined, unstructuredDataUpdateTime: data["unstructuredDataUpdateTime"] !== undefined ? data["unstructuredDataUpdateTime"].toISOString() : undefined, websiteDataSize: data["websiteDataSize"] !== undefined ? String(data["websiteDataSize"]) : undefined, websiteDataUpdateTime: data["websiteDataUpdateTime"] !== undefined ? data["websiteDataUpdateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaDataStoreBillingEstimation(data: any): GoogleCloudDiscoveryengineV1betaDataStoreBillingEstimation { return { ...data, structuredDataSize: data["structuredDataSize"] !== undefined ? BigInt(data["structuredDataSize"]) : undefined, structuredDataUpdateTime: data["structuredDataUpdateTime"] !== undefined ? new Date(data["structuredDataUpdateTime"]) : undefined, unstructuredDataSize: data["unstructuredDataSize"] !== undefined ? BigInt(data["unstructuredDataSize"]) : undefined, unstructuredDataUpdateTime: data["unstructuredDataUpdateTime"] !== undefined ? new Date(data["unstructuredDataUpdateTime"]) : undefined, websiteDataSize: data["websiteDataSize"] !== undefined ? BigInt(data["websiteDataSize"]) : undefined, websiteDataUpdateTime: data["websiteDataUpdateTime"] !== undefined ? new Date(data["websiteDataUpdateTime"]) : undefined, }; } /** * Stores information regarding the serving configurations at DataStore level. */ export interface GoogleCloudDiscoveryengineV1betaDataStoreServingConfigDataStore { /** * If set true, the DataStore will not be available for serving search * requests. */ disabledForServing?: boolean; } /** * Metadata related to the progress of the DataStoreService.DeleteDataStore * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1betaDeleteDataStoreMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaDeleteDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaDeleteDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the EngineService.DeleteEngine * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1betaDeleteEngineMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaDeleteEngineMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaDeleteEngineMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for DeleteSchema LRO. */ export interface GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.DeleteSitemap operation. This will be returned by the * google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaDeleteSitemapMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaDeleteSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaDeleteSitemapMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteSitemapMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.DeleteTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaDeleteTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaDeleteTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaDeleteTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaDeleteTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.DisableAdvancedSiteSearch operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaDisableAdvancedSiteSearchMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaDisableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1betaDisableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaDisableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1betaDisableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.DisableAdvancedSiteSearch * method. */ export interface GoogleCloudDiscoveryengineV1betaDisableAdvancedSiteSearchResponse { } /** * A singleton resource of DataStore. If it's empty when DataStore is created * and DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED, the default * parser will default to digital parser. */ export interface GoogleCloudDiscoveryengineV1betaDocumentProcessingConfig { /** * Whether chunking mode is enabled. */ chunkingConfig?: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigChunkingConfig; /** * Configurations for default Document parser. If not specified, we will * configure it as default DigitalParsingConfig, and the default parsing * config will be applied to all file types for Document parsing. */ defaultParsingConfig?: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfig; /** * The full resource name of the Document Processing Config. Format: * `projects/*\/locations/*\/collections/*\/dataStores/*\/documentProcessingConfig`. */ name?: string; /** * Map from file type to override the default parsing configuration based on * the file type. Supported keys: * `pdf`: Override parsing config for PDF * files, either digital parsing, ocr parsing or layout parsing is supported. * * `html`: Override parsing config for HTML files, only digital parsing and * layout parsing are supported. * `docx`: Override parsing config for DOCX * files, only digital parsing and layout parsing are supported. * `pptx`: * Override parsing config for PPTX files, only digital parsing and layout * parsing are supported. * `xlsm`: Override parsing config for XLSM files, * only digital parsing and layout parsing are supported. * `xlsx`: Override * parsing config for XLSX files, only digital parsing and layout parsing are * supported. */ parsingConfigOverrides?: { [key: string]: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfig }; } /** * Configuration for chunking config. */ export interface GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigChunkingConfig { /** * Configuration for the layout based chunking. */ layoutBasedChunkingConfig?: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig; } /** * Configuration for the layout based chunking. */ export interface GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig { /** * The token size limit for each chunk. Supported values: 100-500 * (inclusive). Default value: 500. */ chunkSize?: number; /** * Whether to include appending different levels of headings to chunks from * the middle of the document to prevent context loss. Default value: False. */ includeAncestorHeadings?: boolean; } /** * Related configurations applied to a specific type of document parser. */ export interface GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfig { /** * Configurations applied to digital parser. */ digitalParsingConfig?: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfigDigitalParsingConfig; /** * Configurations applied to layout parser. */ layoutParsingConfig?: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfigLayoutParsingConfig; /** * Configurations applied to OCR parser. Currently it only applies to PDFs. */ ocrParsingConfig?: GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfigOcrParsingConfig; } /** * The digital parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfigDigitalParsingConfig { } /** * The layout parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfigLayoutParsingConfig { } /** * The OCR parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1betaDocumentProcessingConfigParsingConfigOcrParsingConfig { /** * [DEPRECATED] This field is deprecated. To use the additional enhanced * document elements processing, please switch to `layout_parsing_config`. */ enhancedDocumentElements?: string[]; /** * If true, will use native text instead of OCR text on pages containing * native text. */ useNativeText?: boolean; } /** * Metadata related to the progress of the * SiteSearchEngineService.EnableAdvancedSiteSearch operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaEnableAdvancedSiteSearchMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaEnableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1betaEnableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaEnableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1betaEnableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for SiteSearchEngineService.EnableAdvancedSiteSearch * method. */ export interface GoogleCloudDiscoveryengineV1betaEnableAdvancedSiteSearchResponse { } /** * Metadata that describes the training and serving parameters of an Engine. */ export interface GoogleCloudDiscoveryengineV1betaEngine { /** * Configurations for the Chat Engine. Only applicable if solution_type is * SOLUTION_TYPE_CHAT. */ chatEngineConfig?: GoogleCloudDiscoveryengineV1betaEngineChatEngineConfig; /** * Output only. Additional information of the Chat Engine. Only applicable if * solution_type is SOLUTION_TYPE_CHAT. */ readonly chatEngineMetadata?: GoogleCloudDiscoveryengineV1betaEngineChatEngineMetadata; /** * Common config spec that specifies the metadata of the engine. */ commonConfig?: GoogleCloudDiscoveryengineV1betaEngineCommonConfig; /** * Output only. Timestamp the Recommendation Engine was created at. */ readonly createTime?: Date; /** * The data stores associated with this engine. For SOLUTION_TYPE_SEARCH and * SOLUTION_TYPE_RECOMMENDATION type of engines, they can only associate with * at most one data store. If solution_type is SOLUTION_TYPE_CHAT, multiple * DataStores in the same Collection can be associated here. Note that when * used in CreateEngineRequest, one DataStore id must be provided as the * system will use it for necessary initializations. */ dataStoreIds?: string[]; /** * Optional. Whether to disable analytics for searches performed on this * engine. */ disableAnalytics?: boolean; /** * Required. The display name of the engine. Should be human readable. UTF-8 * encoded string with limit of 1024 characters. */ displayName?: string; /** * The industry vertical that the engine registers. The restriction of the * Engine industry vertical is based on DataStore: If unspecified, default to * `GENERIC`. Vertical on Engine has to match vertical of the DataStore linked * to the engine. */ industryVertical?: | "INDUSTRY_VERTICAL_UNSPECIFIED" | "GENERIC" | "MEDIA" | "HEALTHCARE_FHIR"; /** * Immutable. The fully qualified resource name of the engine. This field * must be a UTF-8 encoded string with a length limit of 1024 characters. * Format: * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` * engine should be 1-63 characters, and valid characters are /a-z0-9*\/. * Otherwise, an INVALID_ARGUMENT error is returned. */ name?: string; /** * Configurations for the Search Engine. Only applicable if solution_type is * SOLUTION_TYPE_SEARCH. */ searchEngineConfig?: GoogleCloudDiscoveryengineV1betaEngineSearchEngineConfig; /** * Required. The solutions of the engine. */ solutionType?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"; /** * Output only. Timestamp the Recommendation Engine was last updated. */ readonly updateTime?: Date; } /** * Configurations for a Chat Engine. */ export interface GoogleCloudDiscoveryengineV1betaEngineChatEngineConfig { /** * The configurationt generate the Dialogflow agent that is associated to * this Engine. Note that these configurations are one-time consumed by and * passed to Dialogflow service. It means they cannot be retrieved using * EngineService.GetEngine or EngineService.ListEngines API after engine * creation. */ agentCreationConfig?: GoogleCloudDiscoveryengineV1betaEngineChatEngineConfigAgentCreationConfig; /** * The resource name of an exist Dialogflow agent to link to this Chat * Engine. Customers can either provide `agent_creation_config` to create * agent or provide an agent name that links the agent with the Chat engine. * Format: `projects//locations//agents/`. Note that the * `dialogflow_agent_to_link` are one-time consumed by and passed to * Dialogflow service. It means they cannot be retrieved using * EngineService.GetEngine or EngineService.ListEngines API after engine * creation. Use ChatEngineMetadata.dialogflow_agent for actual agent * association after Engine is created. */ dialogflowAgentToLink?: string; } /** * Configurations for generating a Dialogflow agent. Note that these * configurations are one-time consumed by and passed to Dialogflow service. It * means they cannot be retrieved using EngineService.GetEngine or * EngineService.ListEngines API after engine creation. */ export interface GoogleCloudDiscoveryengineV1betaEngineChatEngineConfigAgentCreationConfig { /** * Name of the company, organization or other entity that the agent * represents. Used for knowledge connector LLM prompt and for knowledge * search. */ business?: string; /** * Required. The default language of the agent as a language tag. See * [Language * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a * list of the currently supported language codes. */ defaultLanguageCode?: string; /** * Agent location for Agent creation, supported values: global/us/eu. If not * provided, us Engine will create Agent using us-central-1 by default; eu * Engine will create Agent using eu-west-1 by default. */ location?: string; /** * Required. The time zone of the agent from the [time zone * database](https://www.iana.org/time-zones), e.g., America/New_York, * Europe/Paris. */ timeZone?: string; } /** * Additional information of a Chat Engine. Fields in this message are output * only. */ export interface GoogleCloudDiscoveryengineV1betaEngineChatEngineMetadata { /** * The resource name of a Dialogflow agent, that this Chat Engine refers to. * Format: `projects//locations//agents/`. */ dialogflowAgent?: string; } /** * Common configurations for an Engine. */ export interface GoogleCloudDiscoveryengineV1betaEngineCommonConfig { /** * The name of the company, business or entity that is associated with the * engine. Setting this may help improve LLM related features. */ companyName?: string; } /** * Configurations for a Search Engine. */ export interface GoogleCloudDiscoveryengineV1betaEngineSearchEngineConfig { /** * The add-on that this search engine enables. */ searchAddOns?: | "SEARCH_ADD_ON_UNSPECIFIED" | "SEARCH_ADD_ON_LLM"[]; /** * The search feature tier of this engine. Different tiers might have * different pricing. To learn more, check the pricing documentation. Defaults * to SearchTier.SEARCH_TIER_STANDARD if not specified. */ searchTier?: | "SEARCH_TIER_UNSPECIFIED" | "SEARCH_TIER_STANDARD" | "SEARCH_TIER_ENTERPRISE"; } /** * An evaluation is a single execution (or run) of an evaluation process. It * encapsulates the state of the evaluation and the resulting data. */ export interface GoogleCloudDiscoveryengineV1betaEvaluation { /** * Output only. Timestamp the Evaluation was created at. */ readonly createTime?: Date; /** * Output only. Timestamp the Evaluation was completed at. */ readonly endTime?: Date; /** * Output only. The error that occurred during evaluation. Only populated * when the evaluation's state is FAILED. */ readonly error?: GoogleRpcStatus; /** * Output only. A sample of errors encountered while processing the request. */ readonly errorSamples?: GoogleRpcStatus[]; /** * Required. The specification of the evaluation. */ evaluationSpec?: GoogleCloudDiscoveryengineV1betaEvaluationEvaluationSpec; /** * Identifier. The full resource name of the Evaluation, in the format of * `projects/{project}/locations/{location}/evaluations/{evaluation}`. This * field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * Output only. The metrics produced by the evaluation, averaged across all * SampleQuerys in the SampleQuerySet. Only populated when the evaluation's * state is SUCCEEDED. */ readonly qualityMetrics?: GoogleCloudDiscoveryengineV1betaQualityMetrics; /** * Output only. The state of the evaluation. */ readonly state?: | "STATE_UNSPECIFIED" | "PENDING" | "RUNNING" | "SUCCEEDED" | "FAILED"; } /** * Describes the specification of the evaluation. */ export interface GoogleCloudDiscoveryengineV1betaEvaluationEvaluationSpec { /** * Required. The specification of the query set. */ querySetSpec?: GoogleCloudDiscoveryengineV1betaEvaluationEvaluationSpecQuerySetSpec; /** * Required. The search request that is used to perform the evaluation. Only * the following fields within SearchRequest are supported; if any other * fields are provided, an UNSUPPORTED error will be returned: * * SearchRequest.serving_config * SearchRequest.branch * * SearchRequest.canonical_filter * SearchRequest.query_expansion_spec * * SearchRequest.spell_correction_spec * SearchRequest.content_search_spec * * SearchRequest.user_pseudo_id */ searchRequest?: GoogleCloudDiscoveryengineV1betaSearchRequest; } /** * Describes the specification of the query set. */ export interface GoogleCloudDiscoveryengineV1betaEvaluationEvaluationSpecQuerySetSpec { /** * Required. The full resource name of the SampleQuerySet used for the * evaluation, in the format of * `projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}`. */ sampleQuerySet?: string; } /** * Response message for SiteSearchEngineService.FetchSitemaps method. */ export interface GoogleCloudDiscoveryengineV1betaFetchSitemapsResponse { /** * List of Sitemaps fetched. */ sitemapsMetadata?: GoogleCloudDiscoveryengineV1betaFetchSitemapsResponseSitemapMetadata[]; } /** * Contains a Sitemap and its metadata. */ export interface GoogleCloudDiscoveryengineV1betaFetchSitemapsResponseSitemapMetadata { /** * The Sitemap. */ sitemap?: GoogleCloudDiscoveryengineV1betaSitemap; } /** * Metadata related to the progress of the ImportCompletionSuggestions * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of CompletionSuggestions that failed to be imported. */ failureCount?: bigint; /** * Count of CompletionSuggestions successfully imported. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the CompletionService.ImportCompletionSuggestions method. If the * long running operation is done, this message is returned by the * google.longrunning.Operations.response field if the operation is successful. */ export interface GoogleCloudDiscoveryengineV1betaImportCompletionSuggestionsResponse { /** * The desired location of errors incurred during the Import. */ errorConfig?: GoogleCloudDiscoveryengineV1betaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Metadata related to the progress of the ImportDocuments operation. This is * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were processed successfully. */ successCount?: bigint; /** * Total count of entries that were processed. */ totalCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaImportDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? String(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaImportDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? BigInt(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the ImportDocumentsRequest. If the long running operation is * done, then this message is returned by the * google.longrunning.Operations.response field if the operation was successful. */ export interface GoogleCloudDiscoveryengineV1betaImportDocumentsResponse { /** * Echoes the destination for the complete errors in the request if set. */ errorConfig?: GoogleCloudDiscoveryengineV1betaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Configuration of destination for Import related errors. */ export interface GoogleCloudDiscoveryengineV1betaImportErrorConfig { /** * Cloud Storage prefix for import errors. This must be an empty, existing * Cloud Storage directory. Import errors are written to sharded files in this * directory, one per line, as a JSON-encoded `google.rpc.Status` message. */ gcsPrefix?: string; } /** * Metadata related to the progress of the ImportSampleQueries operation. This * will be returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaImportSampleQueriesMetadata { /** * ImportSampleQueries operation create time. */ createTime?: Date; /** * Count of SampleQuerys that failed to be imported. */ failureCount?: bigint; /** * Count of SampleQuerys successfully imported. */ successCount?: bigint; /** * Total count of SampleQuerys that were processed. */ totalCount?: bigint; /** * ImportSampleQueries operation last update time. If the operation is done, * this is also the finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaImportSampleQueriesMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportSampleQueriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? String(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaImportSampleQueriesMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportSampleQueriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? BigInt(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the SampleQueryService.ImportSampleQueries method. If the long * running operation is done, this message is returned by the * google.longrunning.Operations.response field if the operation is successful. */ export interface GoogleCloudDiscoveryengineV1betaImportSampleQueriesResponse { /** * The desired location of errors incurred during the Import. */ errorConfig?: GoogleCloudDiscoveryengineV1betaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Metadata related to the progress of the ImportSuggestionDenyListEntries * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for CompletionService.ImportSuggestionDenyListEntries * method. */ export interface GoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Count of deny list entries that failed to be imported. */ failedEntriesCount?: bigint; /** * Count of deny list entries successfully imported. */ importedEntriesCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesResponse { return { ...data, failedEntriesCount: data["failedEntriesCount"] !== undefined ? String(data["failedEntriesCount"]) : undefined, importedEntriesCount: data["importedEntriesCount"] !== undefined ? String(data["importedEntriesCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1betaImportSuggestionDenyListEntriesResponse { return { ...data, failedEntriesCount: data["failedEntriesCount"] !== undefined ? BigInt(data["failedEntriesCount"]) : undefined, importedEntriesCount: data["importedEntriesCount"] !== undefined ? BigInt(data["importedEntriesCount"]) : undefined, }; } /** * Metadata related to the progress of the Import operation. This is returned * by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were processed successfully. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaImportUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaImportUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the ImportUserEventsRequest. If the long running operation was * successful, then this message is returned by the * google.longrunning.Operations.response field if the operation was successful. */ export interface GoogleCloudDiscoveryengineV1betaImportUserEventsResponse { /** * Echoes the destination for the complete errors if this field was set in * the request. */ errorConfig?: GoogleCloudDiscoveryengineV1betaImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Count of user events imported with complete existing Documents. */ joinedEventsCount?: bigint; /** * Count of user events imported, but with Document information not found in * the existing Branch. */ unjoinedEventsCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1betaImportUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1betaImportUserEventsResponse { return { ...data, joinedEventsCount: data["joinedEventsCount"] !== undefined ? String(data["joinedEventsCount"]) : undefined, unjoinedEventsCount: data["unjoinedEventsCount"] !== undefined ? String(data["unjoinedEventsCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaImportUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1betaImportUserEventsResponse { return { ...data, joinedEventsCount: data["joinedEventsCount"] !== undefined ? BigInt(data["joinedEventsCount"]) : undefined, unjoinedEventsCount: data["unjoinedEventsCount"] !== undefined ? BigInt(data["unjoinedEventsCount"]) : undefined, }; } /** * A floating point interval. */ export interface GoogleCloudDiscoveryengineV1betaInterval { /** * Exclusive upper bound. */ exclusiveMaximum?: number; /** * Exclusive lower bound. */ exclusiveMinimum?: number; /** * Inclusive upper bound. */ maximum?: number; /** * Inclusive lower bound. */ minimum?: number; } /** * Language info for DataStore. */ export interface GoogleCloudDiscoveryengineV1betaLanguageInfo { /** * Output only. Language part of normalized_language_code. E.g.: `en-US` -> * `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. */ readonly language?: string; /** * The language code for the DataStore. */ languageCode?: string; /** * Output only. This is the normalized form of language_code. E.g.: * language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have * normalized_language_code of `en-GB`. */ readonly normalizedLanguageCode?: string; /** * Output only. Region part of normalized_language_code, if present. E.g.: * `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. */ readonly region?: string; } /** * Response message for SearchTuningService.ListCustomModels method. */ export interface GoogleCloudDiscoveryengineV1betaListCustomModelsResponse { /** * List of custom tuning models. */ models?: GoogleCloudDiscoveryengineV1betaCustomTuningModel[]; } function serializeGoogleCloudDiscoveryengineV1betaListCustomModelsResponse(data: any): GoogleCloudDiscoveryengineV1betaListCustomModelsResponse { return { ...data, models: data["models"] !== undefined ? data["models"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1betaCustomTuningModel(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaListCustomModelsResponse(data: any): GoogleCloudDiscoveryengineV1betaListCustomModelsResponse { return { ...data, models: data["models"] !== undefined ? data["models"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1betaCustomTuningModel(item))) : undefined, }; } /** * Configuration for Natural Language Query Understanding. */ export interface GoogleCloudDiscoveryengineV1betaNaturalLanguageQueryUnderstandingConfig { /** * Mode of Natural Language Query Understanding. If this field is unset, the * behavior defaults to NaturalLanguageQueryUnderstandingConfig.Mode.DISABLED. */ mode?: | "MODE_UNSPECIFIED" | "DISABLED" | "ENABLED"; } /** * Metadata and configurations for a Google Cloud project in the service. */ export interface GoogleCloudDiscoveryengineV1betaProject { /** * Output only. The timestamp when this project is created. */ readonly createTime?: Date; /** * Output only. Full resource name of the project, for example * `projects/{project}`. Note that when making requests, project number and * project id are both acceptable, but the server will always respond in * project number. */ readonly name?: string; /** * Output only. The timestamp when this project is successfully provisioned. * Empty value means this project is still provisioning and is not ready for * use. */ readonly provisionCompletionTime?: Date; /** * Output only. A map of terms of services. The key is the `id` of * ServiceTerms. */ readonly serviceTermsMap?: { [key: string]: GoogleCloudDiscoveryengineV1betaProjectServiceTerms }; } /** * Metadata about the terms of service. */ export interface GoogleCloudDiscoveryengineV1betaProjectServiceTerms { /** * The last time when the project agreed to the terms of service. */ acceptTime?: Date; /** * The last time when the project declined or revoked the agreement to terms * of service. */ declineTime?: Date; /** * The unique identifier of this terms of service. Available terms: * * `GA_DATA_USE_TERMS`: [Terms for data * use](https://cloud.google.com/retail/data-use-terms). When using this as * `id`, the acceptable version to provide is `2022-11-23`. */ id?: string; /** * Whether the project has accepted/rejected the service terms or it is still * pending. */ state?: | "STATE_UNSPECIFIED" | "TERMS_ACCEPTED" | "TERMS_PENDING" | "TERMS_DECLINED"; /** * The version string of the terms of service. For acceptable values, see the * comments for id above. */ version?: string; } function serializeGoogleCloudDiscoveryengineV1betaProjectServiceTerms(data: any): GoogleCloudDiscoveryengineV1betaProjectServiceTerms { return { ...data, acceptTime: data["acceptTime"] !== undefined ? data["acceptTime"].toISOString() : undefined, declineTime: data["declineTime"] !== undefined ? data["declineTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaProjectServiceTerms(data: any): GoogleCloudDiscoveryengineV1betaProjectServiceTerms { return { ...data, acceptTime: data["acceptTime"] !== undefined ? new Date(data["acceptTime"]) : undefined, declineTime: data["declineTime"] !== undefined ? new Date(data["declineTime"]) : undefined, }; } /** * Metadata associated with a project provision operation. */ export interface GoogleCloudDiscoveryengineV1betaProvisionProjectMetadata { } /** * Metadata related to the progress of the PurgeDocuments operation. This will * be returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were ignored as entries were not found. */ ignoredCount?: bigint; /** * Count of entries that were deleted successfully. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, ignoredCount: data["ignoredCount"] !== undefined ? String(data["ignoredCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, ignoredCount: data["ignoredCount"] !== undefined ? BigInt(data["ignoredCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for DocumentService.PurgeDocuments method. If the long * running operation is successfully done, then this message is returned by the * google.longrunning.Operations.response field. */ export interface GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse { /** * The total count of documents purged as a result of the operation. */ purgeCount?: bigint; /** * A sample of document names that will be deleted. Only populated if `force` * is set to false. A max of 100 names will be returned and the names are * chosen at random. */ purgeSample?: string[]; } function serializeGoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? String(data["purgeCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? BigInt(data["purgeCount"]) : undefined, }; } /** * Metadata related to the progress of the PurgeSuggestionDenyListEntries * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for CompletionService.PurgeSuggestionDenyListEntries * method. */ export interface GoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Number of suggestion deny list entries purged. */ purgeCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? String(data["purgeCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1betaPurgeSuggestionDenyListEntriesResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? BigInt(data["purgeCount"]) : undefined, }; } /** * Describes the metrics produced by the evaluation. */ export interface GoogleCloudDiscoveryengineV1betaQualityMetrics { /** * Normalized discounted cumulative gain (NDCG) per document, at various * top-k cutoff levels. NDCG measures the ranking quality, giving higher * relevance to top results. Example (top-3): Suppose SampleQuery with three * retrieved documents (D1, D2, D3) and binary relevance judgements (1 for * relevant, 0 for not relevant): Retrieved: [D3 (0), D1 (1), D2 (1)] Ideal: * [D1 (1), D2 (1), D3 (0)] Calculate NDCG@3 for each SampleQuery: * DCG@3: * 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13 * Ideal DCG@3: 1/log2(1+1) + * 1/log2(2+1) + 0/log2(3+1) = 1.63 * NDCG@3: 1.13/1.63 = 0.693 */ docNdcg?: GoogleCloudDiscoveryengineV1betaQualityMetricsTopkMetrics; /** * Precision per document, at various top-k cutoff levels. Precision is the * fraction of retrieved documents that are relevant. Example (top-5): * For a * single SampleQuery, If 4 out of 5 retrieved documents in the top-5 are * relevant, precision@5 = 4/5 = 0.8 */ docPrecision?: GoogleCloudDiscoveryengineV1betaQualityMetricsTopkMetrics; /** * Recall per document, at various top-k cutoff levels. Recall is the * fraction of relevant documents retrieved out of all relevant documents. * Example (top-5): * For a single SampleQuery, If 3 out of 5 relevant * documents are retrieved in the top-5, recall@5 = 3/5 = 0.6 */ docRecall?: GoogleCloudDiscoveryengineV1betaQualityMetricsTopkMetrics; /** * Normalized discounted cumulative gain (NDCG) per page, at various top-k * cutoff levels. NDCG measures the ranking quality, giving higher relevance * to top results. Example (top-3): Suppose SampleQuery with three retrieved * pages (P1, P2, P3) and binary relevance judgements (1 for relevant, 0 for * not relevant): Retrieved: [P3 (0), P1 (1), P2 (1)] Ideal: [P1 (1), P2 (1), * P3 (0)] Calculate NDCG@3 for SampleQuery: * DCG@3: 0/log2(1+1) + * 1/log2(2+1) + 1/log2(3+1) = 1.13 * Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + * 0/log2(3+1) = 1.63 * NDCG@3: 1.13/1.63 = 0.693 */ pageNdcg?: GoogleCloudDiscoveryengineV1betaQualityMetricsTopkMetrics; /** * Recall per page, at various top-k cutoff levels. Recall is the fraction of * relevant pages retrieved out of all relevant pages. Example (top-5): * For * a single SampleQuery, if 3 out of 5 relevant pages are retrieved in the * top-5, recall@5 = 3/5 = 0.6 */ pageRecall?: GoogleCloudDiscoveryengineV1betaQualityMetricsTopkMetrics; } /** * Stores the metric values at specific top-k levels. */ export interface GoogleCloudDiscoveryengineV1betaQualityMetricsTopkMetrics { /** * The top-1 value. */ top1?: number; /** * The top-10 value. */ top10?: number; /** * The top-3 value. */ top3?: number; /** * The top-5 value. */ top5?: number; } /** * Defines the structure and layout of a type of document data. */ export interface GoogleCloudDiscoveryengineV1betaSchema { /** * The JSON representation of the schema. */ jsonSchema?: string; /** * Immutable. The full resource name of the schema, in the format of * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * The structured representation of the schema. */ structSchema?: { [key: string]: any }; } /** * Promotion proto includes uri and other helping information to display the * promotion. */ export interface GoogleCloudDiscoveryengineV1betaSearchLinkPromotion { /** * Optional. The Promotion description. Maximum length: 200 characters. */ description?: string; /** * Optional. The enabled promotion will be returned for any serving configs * associated with the parent of the control this promotion is attached to. * This flag is used for basic site search only. */ enabled?: boolean; /** * Optional. The promotion thumbnail image url. */ imageUri?: string; /** * Required. The title of the promotion. Maximum length: 160 characters. */ title?: string; /** * Required. The URL for the page the user wants to promote. */ uri?: string; } /** * Request message for SearchService.Search method. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequest { /** * Boost specification to boost certain documents. For more information on * boosting, see * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) */ boostSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec; /** * The branch resource name, such as * `projects/*\/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. * Use `default_branch` as the branch ID or leave this field empty, to search * documents under the default branch. */ branch?: string; /** * The default filter that is applied when a user performs a search without * checking any filters on the search page. The filter applied to every search * request when quality improvement such as query expansion is needed. In the * case a query does not have a sufficient amount of results this filter will * be used to determine whether or not to enable the query expansion flow. The * original filter will still be used for the query expanded search. This * field is strongly recommended to achieve high search quality. For more * information about filter syntax, see SearchRequest.filter. */ canonicalFilter?: string; /** * A specification for configuring the behavior of content search. */ contentSearchSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec; /** * Specs defining DataStores to filter on in a search call and configurations * for those data stores. This is only considered for Engines with multiple * data stores. For engines with a single data store, the specs directly under * SearchRequest should be used. */ dataStoreSpecs?: GoogleCloudDiscoveryengineV1betaSearchRequestDataStoreSpec[]; /** * Uses the provided embedding to do additional semantic document retrieval. * The retrieval is based on the dot product of * SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document * embedding that is provided in * SearchRequest.EmbeddingSpec.EmbeddingVector.field_path. If * SearchRequest.EmbeddingSpec.EmbeddingVector.field_path is not provided, it * will use ServingConfig.EmbeddingConfig.field_path. */ embeddingSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec; /** * Facet specifications for faceted search. If empty, no facets are returned. * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error * is returned. */ facetSpecs?: GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec[]; /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. Filter * expression is case-sensitive. If this field is unrecognizable, an * `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by * mapping the LHS filter key to a key property defined in the Vertex AI * Search backend -- this mapping is defined by the customer in their schema. * For example a media customer might have a field 'name' in their schema. In * this case the filter would look like this: filter --> name:'ANY("king * kong")' For more information about filtering including syntax and filter * operators, see * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; /** * Raw image query. */ imageQuery?: GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery; /** * The BCP-47 language code, such as "en-US" or "sr-Latn". For more * information, see [Standard * fields](https://cloud.google.com/apis/design/standard_fields). This field * helps to better interpret the query. If a value isn't specified, the query * language code is automatically detected, which may not be accurate. */ languageCode?: string; /** * If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional * natural language query understanding will be done. */ naturalLanguageQueryUnderstandingSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestNaturalLanguageQueryUnderstandingSpec; /** * A 0-indexed integer that specifies the current offset (that is, starting * result location, amongst the Documents deemed by the API as relevant) in * search results. This field is only considered if page_token is unset. If * this field is negative, an `INVALID_ARGUMENT` is returned. */ offset?: number; /** * The maximum number of results to return for OneBox. This applies to each * OneBox type individually. Default number is 10. */ oneBoxPageSize?: number; /** * The order in which documents are returned. Documents can be ordered by a * field in an Document object. Leave it unset if ordered by relevance. * `order_by` expression is case-sensitive. For more information on ordering * the website search results, see [Order web search * results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). * For more information on ordering the healthcare search results, see [Order * healthcare search * results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. */ orderBy?: string; /** * Maximum number of Documents to return. The maximum allowed value depends * on the data type. Values above the maximum value are coerced to the maximum * value. * Websites with basic indexing: Default `10`, Maximum `25`. * * Websites with advanced indexing: Default `25`, Maximum `50`. * Other: * Default `50`, Maximum `100`. If this field is negative, an * `INVALID_ARGUMENT` is returned. */ pageSize?: number; /** * A page token received from a previous SearchService.Search call. Provide * this to retrieve the subsequent page. When paginating, all other parameters * provided to SearchService.Search must match the call that provided the page * token. Otherwise, an `INVALID_ARGUMENT` error is returned. */ pageToken?: string; /** * Additional search parameters. For public website search only, supported * values are: * `user_country_code`: string. Default empty. If set to * non-empty, results are restricted or boosted based on the location * provided. For example, `user_country_code: "au"` For available codes see * [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, which * enables image searching. For example, `search_type: 1` */ params?: { [key: string]: any }; /** * The specification for personalization. Notice that if both * ServingConfig.personalization_spec and SearchRequest.personalization_spec * are set, SearchRequest.personalization_spec overrides * ServingConfig.personalization_spec. */ personalizationSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestPersonalizationSpec; /** * Raw search query. */ query?: string; /** * The query expansion specification that specifies the conditions under * which query expansion occurs. */ queryExpansionSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec; /** * The ranking expression controls the customized ranking on retrieval * documents. This overrides ServingConfig.ranking_expression. The ranking * expression is a single function or multiple functions that are joined by * "+". * ranking_expression = function, { " + ", function }; Supported * functions: * double * relevance_score * double * * dotProduct(embedding_field_path) Function variables: * `relevance_score`: * pre-defined keywords, used for measure relevance between query and * document. * `embedding_field_path`: the document embedding field used with * query embedding vector. * `dotProduct`: embedding function between * embedding_field_path and query embedding vector. Example ranking * expression: If document has an embedding field doc_embedding, the ranking * expression could be `0.5 * relevance_score + 0.3 * * dotProduct(doc_embedding)`. */ rankingExpression?: string; /** * The Unicode country/region code (CLDR) of a location, such as "US" and * "419". For more information, see [Standard * fields](https://cloud.google.com/apis/design/standard_fields). If set, then * results will be boosted based on the region_code provided. */ regionCode?: string; /** * The relevance threshold of the search results. Default to Google defined * threshold, leveraging a balance of precision and recall to deliver both * highly accurate results and comprehensive coverage of relevant information. */ relevanceThreshold?: | "RELEVANCE_THRESHOLD_UNSPECIFIED" | "LOWEST" | "LOW" | "MEDIUM" | "HIGH"; /** * Whether to turn on safe search. This is only supported for website search. */ safeSearch?: boolean; /** * Search as you type configuration. Only supported for the * IndustryVertical.MEDIA vertical. */ searchAsYouTypeSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestSearchAsYouTypeSpec; /** * Required. The resource name of the Search serving config, such as * `projects/*\/locations/global/collections/default_collection/engines/*\/servingConfigs/default_serving_config`, * or * `projects/*\/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. * This field is used to identify the serving configuration name, set of * models used to make the search. */ servingConfig?: string; /** * The session resource name. Optional. Session allows users to do multi-turn * /search API calls or coordination between /search API calls and /answer API * calls. Example #1 (multi-turn /search API calls): 1. Call /search API with * the auto-session mode (see below). 2. Call /search API with the session ID * generated in the first call. Here, the previous search query gets * considered in query standing. I.e., if the first query is "How did Alphabet * do in 2022?" and the current query is "How about 2023?", the current query * will be interpreted as "How did Alphabet do in 2023?". Example #2 * (coordination between /search API calls and /answer API calls): 1. Call * /search API with the auto-session mode (see below). 2. Call /answer API * with the session ID generated in the first call. Here, the answer * generation happens in the context of the search results from the first * search call. Auto-session mode: when `projects/.../sessions/-` is used, a * new session gets automatically created. Otherwise, users can use the * create-session API to create a session manually. Multi-turn Search feature * is currently at private GA stage. Please use v1alpha or v1beta version * instead before we launch this feature to public GA. Or ask for allowlisting * through Google Support team. */ session?: string; /** * Session specification. Can be used only when `session` is set. */ sessionSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestSessionSpec; /** * The spell correction specification that specifies the mode under which * spell correction takes effect. */ spellCorrectionSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec; /** * Information about the end user. Highly recommended for analytics. * UserInfo.user_agent is used to deduce `device_type` for analytics. */ userInfo?: GoogleCloudDiscoveryengineV1betaUserInfo; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Google Cloud * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; /** * A unique identifier for tracking visitors. For example, this could be * implemented with an HTTP cookie, which should be able to uniquely identify * a visitor on a single device. This unique identifier should not change if * the visitor logs in or out of the website. This field should NOT have a * fixed value such as `unknown_visitor`. This should be the same identifier * as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The * field must be a UTF-8 encoded string with a length limit of 128 characters. * Otherwise, an `INVALID_ARGUMENT` error is returned. */ userPseudoId?: string; } /** * Boost specification to boost certain documents. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec { /** * Condition boost specifications. If a document matches multiple conditions * in the specifictions, boost scores from these specifications are all * applied and combined in a non-linear way. Maximum number of specifications * is 20. */ conditionBoostSpecs?: GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec[]; } /** * Boost applies to documents which match a condition. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec { /** * Strength of the condition boost, which should be in [-1, 1]. Negative * boost means demotion. Default is 0.0. Setting to 1.0 gives the document a * big promotion. However, it does not necessarily mean that the boosted * document will be the top result at all times, nor that other documents will * be excluded. Results could still be shown even when none of them matches * the condition. And results that are significantly more relevant to the * search query can still trump your heavily favored but irrelevant documents. * Setting to -1.0 gives the document a big demotion. However, results that * are deeply relevant might still be shown. The document will have an * upstream battle to get a fairly high ranking, but it is not blocked out * completely. Setting to 0.0 means no boost applied. The boosting condition * is ignored. Only one of the (condition, boost) combination or the * boost_control_spec below are set. If both are set then the global boost is * ignored and the more fine-grained boost_control_spec is applied. */ boost?: number; /** * Complex specification for custom ranking based on customer defined * attribute value. */ boostControlSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpecBoostControlSpec; /** * An expression which specifies a boost condition. The syntax and supported * fields are the same as a filter expression. See SearchRequest.filter for * detail syntax and limitations. Examples: * To boost documents with document * ID "doc_1" or "doc_2", and color "Red" or "Blue": `(document_id: * ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))` */ 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 GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpecBoostControlSpec { /** * 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"; /** * 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?: GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpecBoostControlSpecControlPoint[]; /** * The name of the field whose value will be used to determine the boost * amount. */ fieldName?: string; /** * 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 GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpecBoostControlSpecControlPoint { /** * 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; /** * The value between -1 to 1 by which to boost the score if the * attribute_value evaluates to the value specified above. */ boostAmount?: number; } /** * A specification for configuring the behavior of content search. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec { /** * Specifies the chunk spec to be returned from the search response. Only * available if the SearchRequest.ContentSearchSpec.search_result_mode is set * to CHUNKS */ chunkSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecChunkSpec; /** * If there is no extractive_content_spec provided, there will be no * extractive answer in the search response. */ extractiveContentSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec; /** * Specifies the search result mode. If unspecified, the search result mode * defaults to `DOCUMENTS`. */ searchResultMode?: | "SEARCH_RESULT_MODE_UNSPECIFIED" | "DOCUMENTS" | "CHUNKS"; /** * If `snippetSpec` is not specified, snippets are not included in the search * response. */ snippetSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec; /** * If `summarySpec` is not specified, summaries are not included in the * search response. */ summarySpec?: GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec; } /** * Specifies the chunk spec to be returned from the search response. Only * available if the SearchRequest.ContentSearchSpec.search_result_mode is set to * CHUNKS */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecChunkSpec { /** * The number of next chunks to be returned of the current chunk. The maximum * allowed value is 3. If not specified, no next chunks will be returned. */ numNextChunks?: number; /** * The number of previous chunks to be returned of the current chunk. The * maximum allowed value is 3. If not specified, no previous chunks will be * returned. */ numPreviousChunks?: number; } /** * A specification for configuring the extractive content in a search response. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec { /** * The maximum number of extractive answers returned in each search result. * An extractive answer is a verbatim answer extracted from the original * document, which provides a precise and contextually relevant answer to the * search query. If the number of matching answers is less than the * `max_extractive_answer_count`, return all of the answers. Otherwise, return * the `max_extractive_answer_count`. At most five answers are returned for * each SearchResult. */ maxExtractiveAnswerCount?: number; /** * The max number of extractive segments returned in each search result. Only * applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED * or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is * a text segment extracted from the original document that is relevant to the * search query, and, in general, more verbose than an extractive answer. The * segment could then be used as input for LLMs to generate summaries and * answers. If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. */ maxExtractiveSegmentCount?: number; /** * Return at most `num_next_segments` segments after each selected segments. */ numNextSegments?: number; /** * Specifies whether to also include the adjacent from each selected * segments. Return at most `num_previous_segments` segments before each * selected segments. */ numPreviousSegments?: number; /** * Specifies whether to return the confidence score from the extractive * segments in each search result. This feature is available only for new or * allowlisted data stores. To allowlist your data store, contact your * Customer Engineer. The default value is `false`. */ returnExtractiveSegmentScore?: boolean; } /** * A specification for configuring snippets in a search response. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec { /** * [DEPRECATED] This field is deprecated. To control snippet return, use * `return_snippet` field. For backwards compatibility, we will return snippet * if max_snippet_count > 0. */ maxSnippetCount?: number; /** * [DEPRECATED] This field is deprecated and will have no affect on the * snippet. */ referenceOnly?: boolean; /** * If `true`, then return snippet. If no snippet can be generated, we return * "No snippet is available for this page." A `snippet_status` with `SUCCESS` * or `NO_SNIPPET_AVAILABLE` will also be returned. */ returnSnippet?: boolean; } /** * A specification for configuring a summary returned in a search response. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec { /** * Specifies whether to filter out adversarial queries. The default value is * `false`. Google employs search-query classification to detect adversarial * queries. No summary is returned if the search query is classified as an * adversarial query. For example, a user might ask a question regarding * negative comments about the company or submit a query designed to generate * unsafe, policy-violating output. If this field is set to `true`, we skip * generating summaries for adversarial queries and return fallback messages * instead. */ ignoreAdversarialQuery?: boolean; /** * Optional. Specifies whether to filter out jail-breaking queries. The * default value is `false`. Google employs search-query classification to * detect jail-breaking queries. No summary is returned if the search query is * classified as a jail-breaking query. A user might add instructions to the * query to change the tone, style, language, content of the answer, or ask * the model to act as a different entity, e.g. "Reply in the tone of a * competing company's CEO". If this field is set to `true`, we skip * generating summaries for jail-breaking queries and return fallback messages * instead. */ ignoreJailBreakingQuery?: boolean; /** * Specifies whether to filter out queries that have low relevance. The * default value is `false`. If this field is set to `false`, all search * results are used regardless of relevance to generate answers. If set to * `true`, only queries with high relevance search results will generate * answers. */ ignoreLowRelevantContent?: boolean; /** * Specifies whether to filter out queries that are not summary-seeking. The * default value is `false`. Google employs search-query classification to * detect summary-seeking queries. No summary is returned if the search query * is classified as a non-summary seeking query. For example, `why is the sky * blue` and `Who is the best soccer player in the world?` are summary-seeking * queries, but `SFO airport` and `world cup 2026` are not. They are most * likely navigational queries. If this field is set to `true`, we skip * generating summaries for non-summary seeking queries and return fallback * messages instead. */ ignoreNonSummarySeekingQuery?: boolean; /** * Specifies whether to include citations in the summary. The default value * is `false`. When this field is set to `true`, summaries include in-line * citation numbers. Example summary including citations: BigQuery is Google * Cloud's fully managed and completely serverless enterprise data warehouse * [1]. BigQuery supports all data types, works across clouds, and has * built-in machine learning and business intelligence, all within a unified * platform [2, 3]. The citation numbers refer to the returned search results * and are 1-indexed. For example, [1] means that the sentence is attributed * to the first search result. [2, 3] means that the sentence is attributed to * both the second and third search results. */ includeCitations?: boolean; /** * Language code for Summary. Use language tags defined by * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an * experimental feature. */ languageCode?: string; /** * If specified, the spec will be used to modify the prompt provided to the * LLM. */ modelPromptSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpecModelPromptSpec; /** * If specified, the spec will be used to modify the model specification * provided to the LLM. */ modelSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpecModelSpec; /** * The number of top results to generate the summary from. If the number of * results returned is less than `summaryResultCount`, the summary is * generated from all of the results. At most 10 results for documents mode, * or 50 for chunks mode, can be used to generate a summary. The chunks mode * is used when SearchRequest.ContentSearchSpec.search_result_mode is set to * CHUNKS. */ summaryResultCount?: number; /** * If true, answer will be generated from most relevant chunks from top * search results. This feature will improve summary quality. Note that with * this feature enabled, not all top search results will be referenced and * included in the reference list, so the citation source index only points to * the search results listed in the reference list. */ useSemanticChunks?: boolean; } /** * Specification of the prompt to use with the model. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpecModelPromptSpec { /** * Text at the beginning of the prompt that instructs the assistant. Examples * are available in the user guide. */ preamble?: string; } /** * Specification of the model. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpecModelSpec { /** * The model version used to generate the summary. Supported values are: * * `stable`: string. Default value when no value is specified. Uses a * generally available, fine-tuned model. For more information, see [Answer * generation model versions and * lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * * `preview`: string. (Public preview) Uses a preview model. For more * information, see [Answer generation model versions and * lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). */ version?: string; } /** * A struct to define data stores to filter on in a search call and * configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error * is returned. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestDataStoreSpec { /** * Optional. Boost specification to boost certain documents. For more * information on boosting, see * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) */ boostSpec?: GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec; /** * Required. Full resource name of DataStore, such as * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. */ dataStore?: string; /** * Optional. Filter specification to filter documents in the data store * specified by data_store field. For more information on filtering, see * [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; } /** * The specification that uses customized query embedding vector to do semantic * document retrieval. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec { /** * The embedding vector used for retrieval. Limit to 1. */ embeddingVectors?: GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector[]; } /** * Embedding vector. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector { /** * Embedding field path in schema. */ fieldPath?: string; /** * Query embedding vector. */ vector?: number[]; } /** * A facet specification to perform faceted search. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec { /** * Enables dynamic position for this facet. If set to true, the position of * this facet among all facets in the response is determined automatically. If * dynamic facets are enabled, it is ordered together. If set to false, the * position of this facet in the response is the same as in the request, and * it is ranked before the facets with dynamic position enable and all dynamic * facets. For example, you may always want to have rating facet returned in * the response, but it's not necessarily to always display the rating facet * at the top. In that case, you can set enable_dynamic_position to true so * that the position of rating facet in response is determined automatically. * Another example, assuming you have the following facets in the request: * * "rating", enable_dynamic_position = true * "price", enable_dynamic_position * = false * "brands", enable_dynamic_position = false And also you have a * dynamic facets enabled, which generates a facet `gender`. Then the final * order of the facets in the response can be ("price", "brands", "rating", * "gender") or ("price", "brands", "gender", "rating") depends on how API * orders "gender" and "rating" facets. However, notice that "price" and * "brands" are always ranked at first and second position because their * enable_dynamic_position is false. */ enableDynamicPosition?: boolean; /** * List of keys to exclude when faceting. By default, FacetKey.key is not * excluded from the filter unless it is listed in this field. Listing a facet * key in this field allows its values to appear as facet results, even when * they are filtered out of search results. Using this field does not affect * what search results are returned. For example, suppose there are 100 * documents with the color facet "Red" and 200 documents with the color facet * "Blue". A query containing the filter "color:ANY("Red")" and having "color" * as FacetKey.key would by default return only "Red" documents in the search * results, and also return "Red" with count 100 as the only color facet. * Although there are also blue documents available, "Blue" would not be shown * as an available facet value. If "color" is listed in "excludedFilterKeys", * then the query returns the facet values "Red" with count 100 and "Blue" * with count 200, because the "color" key is now excluded from the filter. * Because this field doesn't affect search results, the search results are * still correctly filtered to return only "Red" documents. A maximum of 100 * values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. */ excludedFilterKeys?: string[]; /** * Required. The facet key specification. */ facetKey?: GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey; /** * Maximum facet values that are returned for this facet. If unspecified, * defaults to 20. The maximum allowed value is 300. Values above 300 are * coerced to 300. For aggregation in healthcare search, when the * [FacetKey.key] is "healthcare_aggregation_key", the limit will be * overridden to 10,000 internally, regardless of the value set here. If this * field is negative, an `INVALID_ARGUMENT` is returned. */ limit?: number; } /** * Specifies how a facet is computed. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey { /** * True to make facet keys case insensitive when getting faceting values with * prefixes or contains; false otherwise. */ caseInsensitive?: boolean; /** * Only get facet values that contain the given strings. For example, suppose * "category" has three values "Action > 2022", "Action > 2021" and "Sci-Fi > * 2022". If set "contains" to "2022", the "category" facet only contains * "Action > 2022" and "Sci-Fi > 2022". Only supported on textual fields. * Maximum is 10. */ contains?: string[]; /** * Set only if values should be bucketed into intervals. Must be set for * facets with numerical values. Must not be set for facet with text values. * Maximum number of intervals is 30. */ intervals?: GoogleCloudDiscoveryengineV1betaInterval[]; /** * Required. Supported textual and numerical facet keys in Document object, * over which the facet values are computed. Facet key is case-sensitive. */ key?: string; /** * The order in which documents are returned. Allowed values are: * "count * desc", which means order by SearchResponse.Facet.values.count descending. * * "value desc", which means order by SearchResponse.Facet.values.value * descending. Only applies to textual facets. If not set, textual values are * sorted in [natural * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical * intervals are sorted in the order given by FacetSpec.FacetKey.intervals. */ orderBy?: string; /** * Only get facet values that start with the given string prefix. For * example, suppose "category" has three values "Action > 2022", "Action > * 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the "category" * facet only contains "Action > 2022" and "Action > 2021". Only supported on * textual fields. Maximum is 10. */ prefixes?: string[]; /** * Only get facet for the given restricted values. Only supported on textual * fields. For example, suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "restricted_values" to "Action * > 2022", the "category" facet only contains "Action > 2022". Only supported * on textual fields. Maximum is 10. */ restrictedValues?: string[]; } /** * Specifies the image query input. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery { /** * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP. */ imageBytes?: string; } /** * Specification to enable natural language understanding capabilities for * search requests. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestNaturalLanguageQueryUnderstandingSpec { /** * The condition under which filter extraction should occur. Default to * Condition.DISABLED. */ filterExtractionCondition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "ENABLED"; /** * Field names used for location-based filtering, where geolocation filters * are detected in natural language search queries. Only valid when the * FilterExtractionCondition is set to `ENABLED`. If this field is set, it * overrides the field names set in * ServingConfig.geo_search_query_detection_field_names. */ geoSearchQueryDetectionFieldNames?: string[]; } /** * The specification for personalization. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestPersonalizationSpec { /** * The personalization mode of the search request. Defaults to Mode.AUTO. */ mode?: | "MODE_UNSPECIFIED" | "AUTO" | "DISABLED"; } /** * Specification to determine under which conditions query expansion should * occur. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec { /** * The condition under which query expansion should occur. Default to * Condition.DISABLED. */ condition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "AUTO"; /** * Whether to pin unexpanded results. If this field is set to true, * unexpanded products are always at the top of the search results, followed * by the expanded results. */ pinUnexpandedResults?: boolean; } /** * Specification for search as you type in search requests. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestSearchAsYouTypeSpec { /** * The condition under which search as you type should occur. Default to * Condition.DISABLED. */ condition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "ENABLED"; } /** * Session specification. Multi-turn Search feature is currently at private GA * stage. Please use v1alpha or v1beta version instead before we launch this * feature to public GA. Or ask for allowlisting through Google Support team. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestSessionSpec { /** * If set, the search result gets stored to the "turn" specified by this * query ID. Example: Let's say the session looks like this: session { name: * ".../sessions/xxx" turns { query { text: "What is foo?" query_id: * ".../questions/yyy" } answer: "Foo is ..." } turns { query { text: "How * about bar then?" query_id: ".../questions/zzz" } } } The user can call * /search API with a request like this: session: ".../sessions/xxx" * session_spec { query_id: ".../questions/zzz" } Then, the API stores the * search result, associated with the last turn. The stored search result can * be used by a subsequent /answer API call (with the session ID and the query * ID specified). Also, it is possible to call /search and /answer in parallel * with the same session ID & query ID. */ queryId?: string; /** * The number of top search results to persist. The persisted search results * can be used for the subsequent /answer api call. This field is simliar to * the `summary_result_count` field in * SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count. At most * 10 results for documents mode, or 50 for chunks mode. */ searchResultPersistenceCount?: number; } /** * The specification for query spell correction. */ export interface GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec { /** * The mode under which spell correction replaces the original search query. * Defaults to Mode.AUTO. */ mode?: | "MODE_UNSPECIFIED" | "SUGGESTION_ONLY" | "AUTO"; } /** * A sitemap for the SiteSearchEngine. */ export interface GoogleCloudDiscoveryengineV1betaSitemap { /** * Output only. The sitemap's creation time. */ readonly createTime?: Date; /** * Output only. The fully qualified resource name of the sitemap. * `projects/*\/locations/*\/collections/*\/dataStores/*\/siteSearchEngine/sitemaps/*` * The `sitemap_id` suffix is system-generated. */ readonly name?: string; /** * Public URI for the sitemap, e.g. `www.example.com/sitemap.xml`. */ uri?: string; } /** * Verification information for target sites in advanced site search. */ export interface GoogleCloudDiscoveryengineV1betaSiteVerificationInfo { /** * Site verification state indicating the ownership and validity. */ siteVerificationState?: | "SITE_VERIFICATION_STATE_UNSPECIFIED" | "VERIFIED" | "UNVERIFIED" | "EXEMPTED"; /** * Latest site verification time. */ verifyTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaSiteVerificationInfo(data: any): GoogleCloudDiscoveryengineV1betaSiteVerificationInfo { return { ...data, verifyTime: data["verifyTime"] !== undefined ? data["verifyTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaSiteVerificationInfo(data: any): GoogleCloudDiscoveryengineV1betaSiteVerificationInfo { return { ...data, verifyTime: data["verifyTime"] !== undefined ? new Date(data["verifyTime"]) : undefined, }; } /** * A target site for the SiteSearchEngine. */ export interface GoogleCloudDiscoveryengineV1betaTargetSite { /** * Input only. If set to false, a uri_pattern is generated to include all * pages whose address contains the provided_uri_pattern. If set to true, an * uri_pattern is generated to try to be an exact match of the * provided_uri_pattern or just the specific page if the provided_uri_pattern * is a specific one. provided_uri_pattern is always normalized to generate * the URI pattern to be used by the search engine. */ exactMatch?: boolean; /** * Output only. Failure reason. */ readonly failureReason?: GoogleCloudDiscoveryengineV1betaTargetSiteFailureReason; /** * Output only. This is system-generated based on the provided_uri_pattern. */ readonly generatedUriPattern?: string; /** * Output only. Indexing status. */ readonly indexingStatus?: | "INDEXING_STATUS_UNSPECIFIED" | "PENDING" | "FAILED" | "SUCCEEDED" | "DELETING"; /** * Output only. The fully qualified resource name of the target site. * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` * The `target_site_id` is system-generated. */ readonly name?: string; /** * Required. Input only. The user provided URI pattern from which the * `generated_uri_pattern` is generated. */ providedUriPattern?: string; /** * Output only. Root domain of the provided_uri_pattern. */ readonly rootDomainUri?: string; /** * Output only. Site ownership and validity verification status. */ readonly siteVerificationInfo?: GoogleCloudDiscoveryengineV1betaSiteVerificationInfo; /** * The type of the target site, e.g., whether the site is to be included or * excluded. */ type?: | "TYPE_UNSPECIFIED" | "INCLUDE" | "EXCLUDE"; /** * Output only. The target site's last updated time. */ readonly updateTime?: Date; } /** * Site search indexing failure reasons. */ export interface GoogleCloudDiscoveryengineV1betaTargetSiteFailureReason { /** * Failed due to insufficient quota. */ quotaFailure?: GoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure; } function serializeGoogleCloudDiscoveryengineV1betaTargetSiteFailureReason(data: any): GoogleCloudDiscoveryengineV1betaTargetSiteFailureReason { return { ...data, quotaFailure: data["quotaFailure"] !== undefined ? serializeGoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure(data["quotaFailure"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaTargetSiteFailureReason(data: any): GoogleCloudDiscoveryengineV1betaTargetSiteFailureReason { return { ...data, quotaFailure: data["quotaFailure"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure(data["quotaFailure"]) : undefined, }; } /** * Failed due to insufficient quota. */ export interface GoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure { /** * This number is an estimation on how much total quota this project needs to * successfully complete indexing. */ totalRequiredQuota?: bigint; } function serializeGoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure(data: any): GoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure { return { ...data, totalRequiredQuota: data["totalRequiredQuota"] !== undefined ? String(data["totalRequiredQuota"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure(data: any): GoogleCloudDiscoveryengineV1betaTargetSiteFailureReasonQuotaFailure { return { ...data, totalRequiredQuota: data["totalRequiredQuota"] !== undefined ? BigInt(data["totalRequiredQuota"]) : undefined, }; } /** * Metadata related to the progress of the TrainCustomModel operation. This is * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaTrainCustomModelMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaTrainCustomModelMetadata(data: any): GoogleCloudDiscoveryengineV1betaTrainCustomModelMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaTrainCustomModelMetadata(data: any): GoogleCloudDiscoveryengineV1betaTrainCustomModelMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response of the TrainCustomModelRequest. This message is returned by the * google.longrunning.Operations.response field. */ export interface GoogleCloudDiscoveryengineV1betaTrainCustomModelResponse { /** * Echoes the destination for the complete errors in the request if set. */ errorConfig?: GoogleCloudDiscoveryengineV1betaImportErrorConfig; /** * A sample of errors encountered while processing the data. */ errorSamples?: GoogleRpcStatus[]; /** * The metrics of the trained model. */ metrics?: { [key: string]: number }; /** * Fully qualified name of the CustomTuningModel. */ modelName?: string; /** * The trained model status. Possible values are: * **bad-data**: The * training data quality is bad. * **no-improvement**: Tuning didn't improve * performance. Won't deploy. * **in-progress**: Model training job creation * is in progress. * **training**: Model is actively training. * * **evaluating**: The model is evaluating trained metrics. * **indexing**: * The model trained metrics are indexing. * **ready**: The model is ready for * serving. */ modelStatus?: string; } /** * Metadata associated with a tune operation. */ export interface GoogleCloudDiscoveryengineV1betaTuneEngineMetadata { /** * Required. The resource name of the engine that this tune applies to. * Format: * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}` */ engine?: string; } /** * Response associated with a tune operation. */ export interface GoogleCloudDiscoveryengineV1betaTuneEngineResponse { } /** * Metadata for UpdateSchema LRO. */ export interface GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.UpdateTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1betaUpdateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1betaUpdateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaUpdateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1betaUpdateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1betaUpdateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Information of an end user. */ export interface GoogleCloudDiscoveryengineV1betaUserInfo { /** * User agent as included in the HTTP header. The field must be a UTF-8 * encoded string with a length limit of 1,000 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. This should not be set when using the * client side event reporting with GTM or JavaScript tag in * UserEventService.CollectUserEvent or if UserEvent.direct_user_request is * set. */ userAgent?: string; /** * Highly recommended for logged-in users. Unique identifier for logged-in * user, such as a user name. Don't set for anonymous users. Always use a * hashed value for this ID. Don't set the field to the same fixed ID for * different users. This mixes the event history of those users together, * which results in degraded model quality. The field must be a UTF-8 encoded * string with a length limit of 128 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ userId?: string; } /** * Config to store data store type configuration for workspace data */ export interface GoogleCloudDiscoveryengineV1betaWorkspaceConfig { /** * Obfuscated Dasher customer ID. */ dasherCustomerId?: string; /** * Optional. The super admin email address for the workspace that will be * used for access token generation. For now we only use it for Native Google * Drive connector data ingestion. */ superAdminEmailAddress?: string; /** * Optional. The super admin service account for the workspace that will be * used for access token generation. For now we only use it for Native Google * Drive connector data ingestion. */ superAdminServiceAccount?: string; /** * The Google Workspace data source. */ type?: | "TYPE_UNSPECIFIED" | "GOOGLE_DRIVE" | "GOOGLE_MAIL" | "GOOGLE_SITES" | "GOOGLE_CALENDAR" | "GOOGLE_CHAT" | "GOOGLE_GROUPS" | "GOOGLE_KEEP"; } /** * BigQuery source import data from. */ export interface GoogleCloudDiscoveryengineV1BigQuerySource { /** * The schema to use when parsing the data from the source. Supported values * for user event imports: * `user_event` (default): One UserEvent per row. * Supported values for document imports: * `document` (default): One Document * format per row. Each document must have a valid Document.id and one of * Document.json_data or Document.struct_data. * `custom`: One custom data per * row in arbitrary format that conforms to the defined Schema of the data * store. This can only be used by the GENERIC Data Store vertical. */ dataSchema?: string; /** * Required. The BigQuery data set to copy the data from with a length limit * of 1,024 characters. */ datasetId?: string; /** * Intermediate Cloud Storage directory used for the import with a length * limit of 2,000 characters. Can be specified if one wants to have the * BigQuery export to a specific Cloud Storage directory. */ gcsStagingDir?: string; /** * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. */ partitionDate?: GoogleTypeDate; /** * The project ID or the project number that contains the BigQuery source. * Has a length limit of 128 characters. If not specified, inherits the * project ID from the parent request. */ projectId?: string; /** * Required. The BigQuery table to copy the data from with a length limit of * 1,024 characters. */ tableId?: string; } /** * The Bigtable Options object that contains information to support the import. */ export interface GoogleCloudDiscoveryengineV1BigtableOptions { /** * The mapping from family names to an object that contains column families * level information for the given column family. If a family is not present * in this map it will be ignored. */ families?: { [key: string]: GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily }; /** * The field name used for saving row key value in the document. The name has * to match the pattern `a-zA-Z0-9*`. */ keyFieldName?: string; } function serializeGoogleCloudDiscoveryengineV1BigtableOptions(data: any): GoogleCloudDiscoveryengineV1BigtableOptions { return { ...data, families: data["families"] !== undefined ? Object.fromEntries(Object.entries(data["families"]).map(([k, v]: [string, any]) => ([k, serializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily(v)]))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1BigtableOptions(data: any): GoogleCloudDiscoveryengineV1BigtableOptions { return { ...data, families: data["families"] !== undefined ? Object.fromEntries(Object.entries(data["families"]).map(([k, v]: [string, any]) => ([k, deserializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily(v)]))) : undefined, }; } /** * The column of the Bigtable. */ export interface GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn { /** * The encoding mode of the values when the type is not `STRING`. Acceptable * encoding values are: * `TEXT`: indicates values are alphanumeric text * strings. * `BINARY`: indicates values are encoded using `HBase * Bytes.toBytes` family of functions. This can be overridden for a specific * column by listing that column in `columns` and specifying an encoding for * it. */ encoding?: | "ENCODING_UNSPECIFIED" | "TEXT" | "BINARY"; /** * The field name to use for this column in the document. The name has to * match the pattern `a-zA-Z0-9*`. If not set, it is parsed from the qualifier * bytes with best effort. However, due to different naming patterns, field * name collisions could happen, where parsing behavior is undefined. */ fieldName?: string; /** * Required. Qualifier of the column. If it cannot be decoded with utf-8, use * a base-64 encoded string instead. */ qualifier?: Uint8Array; /** * The type of values in this column family. The values are expected to be * encoded using `HBase Bytes.toBytes` function when the encoding value is set * to `BINARY`. */ type?: | "TYPE_UNSPECIFIED" | "STRING" | "NUMBER" | "INTEGER" | "VAR_INTEGER" | "BIG_NUMERIC" | "BOOLEAN" | "JSON"; } function serializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn(data: any): GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn { return { ...data, qualifier: data["qualifier"] !== undefined ? encodeBase64(data["qualifier"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn(data: any): GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn { return { ...data, qualifier: data["qualifier"] !== undefined ? decodeBase64(data["qualifier"] as string) : undefined, }; } /** * The column family of the Bigtable. */ export interface GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily { /** * The list of objects that contains column level information for each * column. If a column is not present in this list it will be ignored. */ columns?: GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn[]; /** * The encoding mode of the values when the type is not STRING. Acceptable * encoding values are: * `TEXT`: indicates values are alphanumeric text * strings. * `BINARY`: indicates values are encoded using `HBase * Bytes.toBytes` family of functions. This can be overridden for a specific * column by listing that column in `columns` and specifying an encoding for * it. */ encoding?: | "ENCODING_UNSPECIFIED" | "TEXT" | "BINARY"; /** * The field name to use for this column family in the document. The name has * to match the pattern `a-zA-Z0-9*`. If not set, it is parsed from the family * name with best effort. However, due to different naming patterns, field * name collisions could happen, where parsing behavior is undefined. */ fieldName?: string; /** * The type of values in this column family. The values are expected to be * encoded using `HBase Bytes.toBytes` function when the encoding value is set * to `BINARY`. */ type?: | "TYPE_UNSPECIFIED" | "STRING" | "NUMBER" | "INTEGER" | "VAR_INTEGER" | "BIG_NUMERIC" | "BOOLEAN" | "JSON"; } function serializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily(data: any): GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily { return { ...data, columns: data["columns"] !== undefined ? data["columns"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily(data: any): GoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumnFamily { return { ...data, columns: data["columns"] !== undefined ? data["columns"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1BigtableOptionsBigtableColumn(item))) : undefined, }; } /** * The Cloud Bigtable source for importing data. */ export interface GoogleCloudDiscoveryengineV1BigtableSource { /** * Required. Bigtable options that contains information needed when parsing * data into typed structures. For example, column type annotations. */ bigtableOptions?: GoogleCloudDiscoveryengineV1BigtableOptions; /** * Required. The instance ID of the Cloud Bigtable that needs to be imported. */ instanceId?: string; /** * The project ID that contains the Bigtable source. Has a length limit of * 128 characters. If not specified, inherits the project ID from the parent * request. */ projectId?: string; /** * Required. The table ID of the Cloud Bigtable that needs to be imported. */ tableId?: string; } function serializeGoogleCloudDiscoveryengineV1BigtableSource(data: any): GoogleCloudDiscoveryengineV1BigtableSource { return { ...data, bigtableOptions: data["bigtableOptions"] !== undefined ? serializeGoogleCloudDiscoveryengineV1BigtableOptions(data["bigtableOptions"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1BigtableSource(data: any): GoogleCloudDiscoveryengineV1BigtableSource { return { ...data, bigtableOptions: data["bigtableOptions"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1BigtableOptions(data["bigtableOptions"]) : undefined, }; } /** * Request message for GroundedGenerationService.CheckGrounding method. */ export interface GoogleCloudDiscoveryengineV1CheckGroundingRequest { /** * Answer candidate to check. It can have a maximum length of 4096 tokens. */ answerCandidate?: string; /** * List of facts for the grounding check. We support up to 200 facts. */ facts?: GoogleCloudDiscoveryengineV1GroundingFact[]; /** * Configuration of the grounding check. */ groundingSpec?: GoogleCloudDiscoveryengineV1CheckGroundingSpec; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Google Cloud * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; } /** * Response message for the GroundedGenerationService.CheckGrounding method. */ export interface GoogleCloudDiscoveryengineV1CheckGroundingResponse { /** * List of facts cited across all claims in the answer candidate. These are * derived from the facts supplied in the request. */ citedChunks?: GoogleCloudDiscoveryengineV1FactChunk[]; /** * List of facts cited across all claims in the answer candidate. These are * derived from the facts supplied in the request. */ citedFacts?: GoogleCloudDiscoveryengineV1CheckGroundingResponseCheckGroundingFactChunk[]; /** * Claim texts and citation info across all claims in the answer candidate. */ claims?: GoogleCloudDiscoveryengineV1CheckGroundingResponseClaim[]; /** * The support score for the input answer candidate. Higher the score, higher * is the fraction of claims that are supported by the provided facts. This is * always set when a response is returned. */ supportScore?: number; } /** * Fact chunk for grounding check. */ export interface GoogleCloudDiscoveryengineV1CheckGroundingResponseCheckGroundingFactChunk { /** * Text content of the fact chunk. Can be at most 10K characters long. */ chunkText?: string; } /** * Text and citation info for a claim in the answer candidate. */ export interface GoogleCloudDiscoveryengineV1CheckGroundingResponseClaim { /** * A list of indices (into 'cited_chunks') specifying the citations * associated with the claim. For instance [1,3,4] means that cited_chunks[1], * cited_chunks[3], cited_chunks[4] are the facts cited supporting for the * claim. A citation to a fact indicates that the claim is supported by the * fact. */ citationIndices?: number[]; /** * Text for the claim in the answer candidate. Always provided regardless of * whether citations or anti-citations are found. */ claimText?: string; /** * Position indicating the end of the claim in the answer candidate, * exclusive. */ endPos?: number; /** * Indicates that this claim required grounding check. When the system * decided this claim doesn't require attribution/grounding check, this field * will be set to false. In that case, no grounding check was done for the * claim and therefore citation_indices should not be returned. */ groundingCheckRequired?: boolean; /** * Position indicating the start of the claim in the answer candidate, * measured in bytes. */ startPos?: number; } /** * Specification for the grounding check. */ export interface GoogleCloudDiscoveryengineV1CheckGroundingSpec { /** * The threshold (in [0,1]) used for determining whether a fact must be cited * for a claim in the answer candidate. Choosing a higher threshold will lead * to fewer but very strong citations, while choosing a lower threshold may * lead to more but somewhat weaker citations. If unset, the threshold will * default to 0.6. */ citationThreshold?: number; } /** * Chunk captures all raw metadata information of items to be recommended or * searched in the chunk mode. */ export interface GoogleCloudDiscoveryengineV1Chunk { /** * Output only. Metadata of the current chunk. */ readonly chunkMetadata?: GoogleCloudDiscoveryengineV1ChunkChunkMetadata; /** * Content is a string from a document (parsed content). */ content?: string; /** * Output only. This field is OUTPUT_ONLY. It contains derived data that are * not in the original input document. */ readonly derivedStructData?: { [key: string]: any }; /** * Metadata of the document from the current chunk. */ documentMetadata?: GoogleCloudDiscoveryengineV1ChunkDocumentMetadata; /** * Unique chunk ID of the current chunk. */ id?: string; /** * The full resource name of the chunk. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * Page span of the chunk. */ pageSpan?: GoogleCloudDiscoveryengineV1ChunkPageSpan; /** * Output only. Represents the relevance score based on similarity. Higher * score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. * Only populated on SearchResponse. */ readonly relevanceScore?: number; } /** * Metadata of the current chunk. This field is only populated on * SearchService.Search API. */ export interface GoogleCloudDiscoveryengineV1ChunkChunkMetadata { /** * The next chunks of the current chunk. The number is controlled by * SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is * only populated on SearchService.Search API. */ nextChunks?: GoogleCloudDiscoveryengineV1Chunk[]; /** * The previous chunks of the current chunk. The number is controlled by * SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field * is only populated on SearchService.Search API. */ previousChunks?: GoogleCloudDiscoveryengineV1Chunk[]; } /** * Document metadata contains the information of the document of the current * chunk. */ export interface GoogleCloudDiscoveryengineV1ChunkDocumentMetadata { /** * Data representation. The structured JSON data for the document. It should * conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown. */ structData?: { [key: string]: any }; /** * Title of the document. */ title?: string; /** * Uri of the document. */ uri?: string; } /** * Page span of the chunk. */ export interface GoogleCloudDiscoveryengineV1ChunkPageSpan { /** * The end page of the chunk. */ pageEnd?: number; /** * The start page of the chunk. */ pageStart?: number; } /** * Cloud SQL source import data from. */ export interface GoogleCloudDiscoveryengineV1CloudSqlSource { /** * Required. The Cloud SQL database to copy the data from with a length limit * of 256 characters. */ databaseId?: string; /** * Intermediate Cloud Storage directory used for the import with a length * limit of 2,000 characters. Can be specified if one wants to have the Cloud * SQL export to a specific Cloud Storage directory. Ensure that the Cloud SQL * service account has the necessary Cloud Storage Admin permissions to access * the specified Cloud Storage directory. */ gcsStagingDir?: string; /** * Required. The Cloud SQL instance to copy the data from with a length limit * of 256 characters. */ instanceId?: string; /** * Option for serverless export. Enabling this option will incur additional * cost. More info can be found * [here](https://cloud.google.com/sql/pricing#serverless). */ offload?: boolean; /** * The project ID that contains the Cloud SQL source. Has a length limit of * 128 characters. If not specified, inherits the project ID from the parent * request. */ projectId?: string; /** * Required. The Cloud SQL table to copy the data from with a length limit of * 256 characters. */ tableId?: string; } /** * Configurations used to enable CMEK data encryption with Cloud KMS keys. */ export interface GoogleCloudDiscoveryengineV1CmekConfig { /** * Output only. The default CmekConfig for the Customer. */ readonly isDefault?: boolean; /** * Kms key resource name which will be used to encrypt resources * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{keyId}`. */ kmsKey?: string; /** * Kms key version resource name which will be used to encrypt resources * `/cryptoKeyVersions/{keyVersion}`. */ kmsKeyVersion?: string; /** * Output only. The timestamp of the last key rotation. */ readonly lastRotationTimestampMicros?: bigint; /** * Required. Name of the CmekConfig, of the form * `projects/{project}/locations/{location}/cmekConfig` or * `projects/{project}/locations/{location}/cmekConfigs/{cmekConfig}`. */ name?: string; /** * Output only. State of the CmekConfig. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "KEY_ISSUE" | "DELETING" | "UNUSABLE" | "ACTIVE_ROTATING"; } /** * Response message for CompletionService.CompleteQuery method. */ export interface GoogleCloudDiscoveryengineV1CompleteQueryResponse { /** * Results of the matched query suggestions. The result list is ordered and * the first result is a top suggestion. */ querySuggestions?: GoogleCloudDiscoveryengineV1CompleteQueryResponseQuerySuggestion[]; /** * True if the returned suggestions are all tail suggestions. For tail * matching to be triggered, include_tail_suggestions in the request must be * true and there must be no suggestions that match the full query. */ tailMatchTriggered?: boolean; } /** * Suggestions as search queries. */ export interface GoogleCloudDiscoveryengineV1CompleteQueryResponseQuerySuggestion { /** * The unique document field paths that serve as the source of this * suggestion if it was generated from completable fields. This field is only * populated for the document-completable model. */ completableFieldPaths?: string[]; /** * The suggestion for the query. */ suggestion?: string; } /** * Detailed completion information including completion attribution token and * clicked completion info. */ export interface GoogleCloudDiscoveryengineV1CompletionInfo { /** * End user selected CompleteQueryResponse.QuerySuggestion.suggestion * position, starting from 0. */ selectedPosition?: number; /** * End user selected CompleteQueryResponse.QuerySuggestion.suggestion. */ selectedSuggestion?: string; } /** * Autocomplete suggestions that are imported from Customer. */ export interface GoogleCloudDiscoveryengineV1CompletionSuggestion { /** * Alternative matching phrases for this suggestion. */ alternativePhrases?: string[]; /** * Frequency of this suggestion. Will be used to rank suggestions when score * is not available. */ frequency?: bigint; /** * Global score of this suggestion. Control how this suggestion would be * scored / ranked. */ globalScore?: number; /** * If two suggestions have the same groupId, they will not be returned * together. Instead the one ranked higher will be returned. This can be used * to deduplicate semantically identical suggestions. */ groupId?: string; /** * The score of this suggestion within its group. */ groupScore?: number; /** * BCP-47 language code of this suggestion. */ languageCode?: string; /** * Required. The suggestion text. */ suggestion?: string; } function serializeGoogleCloudDiscoveryengineV1CompletionSuggestion(data: any): GoogleCloudDiscoveryengineV1CompletionSuggestion { return { ...data, frequency: data["frequency"] !== undefined ? String(data["frequency"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1CompletionSuggestion(data: any): GoogleCloudDiscoveryengineV1CompletionSuggestion { return { ...data, frequency: data["frequency"] !== undefined ? BigInt(data["frequency"]) : undefined, }; } /** * Defines circumstances to be checked before allowing a behavior */ export interface GoogleCloudDiscoveryengineV1Condition { /** * Range of time(s) specifying when condition is active. Maximum of 10 time * ranges. */ activeTimeRange?: GoogleCloudDiscoveryengineV1ConditionTimeRange[]; /** * Optional. Query regex to match the whole search query. Cannot be set when * Condition.query_terms is set. This is currently supporting promotion use * case. */ queryRegex?: string; /** * Search only A list of terms to match the query on. Cannot be set when * Condition.query_regex is set. Maximum of 10 query terms. */ queryTerms?: GoogleCloudDiscoveryengineV1ConditionQueryTerm[]; } function serializeGoogleCloudDiscoveryengineV1Condition(data: any): GoogleCloudDiscoveryengineV1Condition { return { ...data, activeTimeRange: data["activeTimeRange"] !== undefined ? data["activeTimeRange"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1ConditionTimeRange(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1Condition(data: any): GoogleCloudDiscoveryengineV1Condition { return { ...data, activeTimeRange: data["activeTimeRange"] !== undefined ? data["activeTimeRange"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1ConditionTimeRange(item))) : undefined, }; } /** * Matcher for search request query */ export interface GoogleCloudDiscoveryengineV1ConditionQueryTerm { /** * Whether the search query needs to exactly match the query term. */ fullMatch?: boolean; /** * The specific query value to match against Must be lowercase, must be * UTF-8. Can have at most 3 space separated terms if full_match is true. * Cannot be an empty string. Maximum length of 5000 characters. */ value?: string; } /** * Used for time-dependent conditions. */ export interface GoogleCloudDiscoveryengineV1ConditionTimeRange { /** * End of time range. Range is inclusive. Must be in the future. */ endTime?: Date; /** * Start of time range. Range is inclusive. */ startTime?: Date; } function serializeGoogleCloudDiscoveryengineV1ConditionTimeRange(data: any): GoogleCloudDiscoveryengineV1ConditionTimeRange { return { ...data, endTime: data["endTime"] !== undefined ? data["endTime"].toISOString() : undefined, startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ConditionTimeRange(data: any): GoogleCloudDiscoveryengineV1ConditionTimeRange { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * Defines a conditioned behavior to employ during serving. Must be attached to * a ServingConfig to be considered at serving time. Permitted actions dependent * on `SolutionType`. */ export interface GoogleCloudDiscoveryengineV1Control { /** * Output only. List of all ServingConfig IDs this control is attached to. * May take up to 10 minutes to update after changes. */ readonly associatedServingConfigIds?: string[]; /** * Defines a boost-type control */ boostAction?: GoogleCloudDiscoveryengineV1ControlBoostAction; /** * Determines when the associated action will trigger. Omit to always apply * the action. Currently only a single condition may be specified. Otherwise * an INVALID ARGUMENT error is thrown. */ conditions?: GoogleCloudDiscoveryengineV1Condition[]; /** * Required. Human readable name. The identifier used in UI views. Must be * UTF-8 encoded string. Length limit is 128 characters. Otherwise an INVALID * ARGUMENT error is thrown. */ displayName?: string; /** * Defines a filter-type control Currently not supported by Recommendation */ filterAction?: GoogleCloudDiscoveryengineV1ControlFilterAction; /** * Immutable. Fully qualified name * `projects/*\/locations/global/dataStore/*\/controls/*` */ name?: string; /** * Promote certain links based on predefined trigger queries. This now only * supports basic site search. */ promoteAction?: GoogleCloudDiscoveryengineV1ControlPromoteAction; /** * Defines a redirect-type control. */ redirectAction?: GoogleCloudDiscoveryengineV1ControlRedirectAction; /** * Required. Immutable. What solution the control belongs to. Must be * compatible with vertical of resource. Otherwise an INVALID ARGUMENT error * is thrown. */ solutionType?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"; /** * Treats a group of terms as synonyms of one another. */ synonymsAction?: GoogleCloudDiscoveryengineV1ControlSynonymsAction; /** * Specifies the use case for the control. Affects what condition fields can * be set. Only applies to SOLUTION_TYPE_SEARCH. Currently only allow one use * case per control. Must be set when solution_type is * SolutionType.SOLUTION_TYPE_SEARCH. */ useCases?: | "SEARCH_USE_CASE_UNSPECIFIED" | "SEARCH_USE_CASE_SEARCH" | "SEARCH_USE_CASE_BROWSE"[]; } function serializeGoogleCloudDiscoveryengineV1Control(data: any): GoogleCloudDiscoveryengineV1Control { return { ...data, conditions: data["conditions"] !== undefined ? data["conditions"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1Condition(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1Control(data: any): GoogleCloudDiscoveryengineV1Control { return { ...data, conditions: data["conditions"] !== undefined ? data["conditions"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1Condition(item))) : undefined, }; } /** * Adjusts order of products in returned list. */ export interface GoogleCloudDiscoveryengineV1ControlBoostAction { /** * Required. Strength of the boost, which should be in [-1, 1]. Negative * boost means demotion. Default is 0.0 (No-op). */ boost?: number; /** * Required. Specifies which data store's documents can be boosted by this * control. Full data store name e.g. * projects/123/locations/global/collections/default_collection/dataStores/default_data_store */ dataStore?: string; /** * Required. Specifies which products to apply the boost to. If no filter is * provided all products will be boosted (No-op). Syntax documentation: * https://cloud.google.com/retail/docs/filter-and-order Maximum length is * 5000 characters. Otherwise an INVALID ARGUMENT error is thrown. */ filter?: string; } /** * Specified which products may be included in results. Uses same filter as * boost. */ export interface GoogleCloudDiscoveryengineV1ControlFilterAction { /** * Required. Specifies which data store's documents can be filtered by this * control. Full data store name e.g. * projects/123/locations/global/collections/default_collection/dataStores/default_data_store */ dataStore?: string; /** * Required. A filter to apply on the matching condition results. Required * Syntax documentation: https://cloud.google.com/retail/docs/filter-and-order * Maximum length is 5000 characters. Otherwise an INVALID ARGUMENT error is * thrown. */ filter?: string; } /** * Promote certain links based on some trigger queries. Example: Promote shoe * store link when searching for `shoe` keyword. The link can be outside of * associated data store. */ export interface GoogleCloudDiscoveryengineV1ControlPromoteAction { /** * Required. Data store with which this promotion is attached to. */ dataStore?: string; /** * Required. Promotion attached to this action. */ searchLinkPromotion?: GoogleCloudDiscoveryengineV1SearchLinkPromotion; } /** * Redirects a shopper to the provided URI. */ export interface GoogleCloudDiscoveryengineV1ControlRedirectAction { /** * Required. The URI to which the shopper will be redirected. Required. URI * must have length equal or less than 2000 characters. Otherwise an INVALID * ARGUMENT error is thrown. */ redirectUri?: string; } /** * Creates a set of terms that will act as synonyms of one another. Example: * "happy" will also be considered as "glad", "glad" will also be considered as * "happy". */ export interface GoogleCloudDiscoveryengineV1ControlSynonymsAction { /** * Defines a set of synonyms. Can specify up to 100 synonyms. Must specify at * least 2 synonyms. Otherwise an INVALID ARGUMENT error is thrown. */ synonyms?: string[]; } /** * External conversation proto definition. */ export interface GoogleCloudDiscoveryengineV1Conversation { /** * Output only. The time the conversation finished. */ readonly endTime?: Date; /** * Conversation messages. */ messages?: GoogleCloudDiscoveryengineV1ConversationMessage[]; /** * Immutable. Fully qualified name * `projects/{project}/locations/global/collections/{collection}/dataStore/*\/conversations/*` * or * `projects/{project}/locations/global/collections/{collection}/engines/*\/conversations/*`. */ name?: string; /** * Output only. The time the conversation started. */ readonly startTime?: Date; /** * The state of the Conversation. */ state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS" | "COMPLETED"; /** * A unique identifier for tracking users. */ userPseudoId?: string; } function serializeGoogleCloudDiscoveryengineV1Conversation(data: any): GoogleCloudDiscoveryengineV1Conversation { return { ...data, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1ConversationMessage(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1Conversation(data: any): GoogleCloudDiscoveryengineV1Conversation { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, messages: data["messages"] !== undefined ? data["messages"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1ConversationMessage(item))) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * Defines context of the conversation */ export interface GoogleCloudDiscoveryengineV1ConversationContext { /** * The current active document the user opened. It contains the document * resource reference. */ activeDocument?: string; /** * The current list of documents the user is seeing. It contains the document * resource references. */ contextDocuments?: string[]; } /** * Defines a conversation message. */ export interface GoogleCloudDiscoveryengineV1ConversationMessage { /** * Output only. Message creation timestamp. */ readonly createTime?: Date; /** * Search reply. */ reply?: GoogleCloudDiscoveryengineV1Reply; /** * User text input. */ userInput?: GoogleCloudDiscoveryengineV1TextInput; } function serializeGoogleCloudDiscoveryengineV1ConversationMessage(data: any): GoogleCloudDiscoveryengineV1ConversationMessage { return { ...data, reply: data["reply"] !== undefined ? serializeGoogleCloudDiscoveryengineV1Reply(data["reply"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ConversationMessage(data: any): GoogleCloudDiscoveryengineV1ConversationMessage { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, reply: data["reply"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1Reply(data["reply"]) : undefined, }; } /** * Request message for ConversationalSearchService.ConverseConversation method. */ export interface GoogleCloudDiscoveryengineV1ConverseConversationRequest { /** * Boost specification to boost certain documents in search results which may * affect the converse response. For more information on boosting, see * [Boosting](https://cloud.google.com/retail/docs/boosting#boost) */ boostSpec?: GoogleCloudDiscoveryengineV1SearchRequestBoostSpec; /** * The conversation to be used by auto session only. The name field will be * ignored as we automatically assign new name for the conversation in auto * session. */ conversation?: GoogleCloudDiscoveryengineV1Conversation; /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. Filter * expression is case-sensitive. This will be used to filter search results * which may affect the summary response. If this field is unrecognizable, an * `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by * mapping the LHS filter key to a key property defined in the Vertex AI * Search backend -- this mapping is defined by the customer in their schema. * For example a media customer might have a field 'name' in their schema. In * this case the filter would look like this: filter --> name:'ANY("king * kong")' For more information about filtering including syntax and filter * operators, see * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; /** * Required. Current user input. */ query?: GoogleCloudDiscoveryengineV1TextInput; /** * Whether to turn on safe search. */ safeSearch?: boolean; /** * The resource name of the Serving Config to use. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` * If this is not set, the default serving config will be used. */ servingConfig?: string; /** * A specification for configuring the summary returned in the response. */ summarySpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpec; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Google Cloud * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; } function serializeGoogleCloudDiscoveryengineV1ConverseConversationRequest(data: any): GoogleCloudDiscoveryengineV1ConverseConversationRequest { return { ...data, conversation: data["conversation"] !== undefined ? serializeGoogleCloudDiscoveryengineV1Conversation(data["conversation"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ConverseConversationRequest(data: any): GoogleCloudDiscoveryengineV1ConverseConversationRequest { return { ...data, conversation: data["conversation"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1Conversation(data["conversation"]) : undefined, }; } /** * Response message for ConversationalSearchService.ConverseConversation * method. */ export interface GoogleCloudDiscoveryengineV1ConverseConversationResponse { /** * Updated conversation including the answer. */ conversation?: GoogleCloudDiscoveryengineV1Conversation; /** * Answer to the current query. */ reply?: GoogleCloudDiscoveryengineV1Reply; /** * Search Results. */ searchResults?: GoogleCloudDiscoveryengineV1SearchResponseSearchResult[]; } function serializeGoogleCloudDiscoveryengineV1ConverseConversationResponse(data: any): GoogleCloudDiscoveryengineV1ConverseConversationResponse { return { ...data, conversation: data["conversation"] !== undefined ? serializeGoogleCloudDiscoveryengineV1Conversation(data["conversation"]) : undefined, reply: data["reply"] !== undefined ? serializeGoogleCloudDiscoveryengineV1Reply(data["reply"]) : undefined, searchResults: data["searchResults"] !== undefined ? data["searchResults"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1SearchResponseSearchResult(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ConverseConversationResponse(data: any): GoogleCloudDiscoveryengineV1ConverseConversationResponse { return { ...data, conversation: data["conversation"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1Conversation(data["conversation"]) : undefined, reply: data["reply"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1Reply(data["reply"]) : undefined, searchResults: data["searchResults"] !== undefined ? data["searchResults"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1SearchResponseSearchResult(item))) : undefined, }; } /** * Metadata related to the progress of the DataStoreService.CreateDataStore * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1CreateDataStoreMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1CreateDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1CreateDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1CreateDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1CreateDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the EngineService.CreateEngine * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1CreateEngineMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1CreateEngineMetadata(data: any): GoogleCloudDiscoveryengineV1CreateEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1CreateEngineMetadata(data: any): GoogleCloudDiscoveryengineV1CreateEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for Create Schema LRO. */ export interface GoogleCloudDiscoveryengineV1CreateSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1CreateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1CreateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1CreateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1CreateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.CreateTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1CreateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1CreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1CreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1CreateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1CreateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for SiteSearchEngineService.CreateTargetSite method. */ export interface GoogleCloudDiscoveryengineV1CreateTargetSiteRequest { /** * Required. Parent resource name of TargetSite, such as * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. */ parent?: string; /** * Required. The TargetSite to create. */ targetSite?: GoogleCloudDiscoveryengineV1TargetSite; } /** * A custom attribute that is not explicitly modeled in a resource, e.g. * UserEvent. */ export interface GoogleCloudDiscoveryengineV1CustomAttribute { /** * The numerical values of this custom attribute. For example, `[2.3, 15.4]` * when the key is "lengths_cm". Exactly one of CustomAttribute.text or * CustomAttribute.numbers should be set. Otherwise, an `INVALID_ARGUMENT` * error is returned. */ numbers?: number[]; /** * The textual values of this custom attribute. For example, `["yellow", * "green"]` when the key is "color". Empty string is not allowed. Otherwise, * an `INVALID_ARGUMENT` error is returned. Exactly one of * CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, * an `INVALID_ARGUMENT` error is returned. */ text?: string[]; } /** * Metadata that describes a custom tuned model. */ export interface GoogleCloudDiscoveryengineV1CustomTuningModel { /** * Deprecated: Timestamp the Model was created at. */ createTime?: Date; /** * The display name of the model. */ displayName?: string; /** * Currently this is only populated if the model state is * `INPUT_VALIDATION_FAILED`. */ errorMessage?: string; /** * The metrics of the trained model. */ metrics?: { [key: string]: number }; /** * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). */ modelState?: | "MODEL_STATE_UNSPECIFIED" | "TRAINING_PAUSED" | "TRAINING" | "TRAINING_COMPLETE" | "READY_FOR_SERVING" | "TRAINING_FAILED" | "NO_IMPROVEMENT" | "INPUT_VALIDATION_FAILED"; /** * The version of the model. */ modelVersion?: bigint; /** * Required. The fully qualified resource name of the model. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. * Model must be an alpha-numerical string with limit of 40 characters. */ name?: string; /** * Timestamp the model training was initiated. */ trainingStartTime?: Date; } function serializeGoogleCloudDiscoveryengineV1CustomTuningModel(data: any): GoogleCloudDiscoveryengineV1CustomTuningModel { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, modelVersion: data["modelVersion"] !== undefined ? String(data["modelVersion"]) : undefined, trainingStartTime: data["trainingStartTime"] !== undefined ? data["trainingStartTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1CustomTuningModel(data: any): GoogleCloudDiscoveryengineV1CustomTuningModel { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, modelVersion: data["modelVersion"] !== undefined ? BigInt(data["modelVersion"]) : undefined, trainingStartTime: data["trainingStartTime"] !== undefined ? new Date(data["trainingStartTime"]) : undefined, }; } /** * DataStore captures global settings and configs at the DataStore level. */ export interface GoogleCloudDiscoveryengineV1DataStore { /** * Optional. Configuration for advanced site search. */ advancedSiteSearchConfig?: GoogleCloudDiscoveryengineV1AdvancedSiteSearchConfig; /** * Output only. Data size estimation for billing. */ readonly billingEstimation?: GoogleCloudDiscoveryengineV1DataStoreBillingEstimation; /** * Output only. CMEK-related information for the DataStore. */ readonly cmekConfig?: GoogleCloudDiscoveryengineV1CmekConfig; /** * Immutable. The content config of the data store. If this field is unset, * the server behavior defaults to ContentConfig.NO_CONTENT. */ contentConfig?: | "CONTENT_CONFIG_UNSPECIFIED" | "NO_CONTENT" | "CONTENT_REQUIRED" | "PUBLIC_WEBSITE" | "GOOGLE_WORKSPACE"; /** * Output only. Timestamp the DataStore was created at. */ readonly createTime?: Date; /** * Output only. The id of the default Schema asscociated to this data store. */ readonly defaultSchemaId?: string; /** * Required. The data store display name. This field must be a UTF-8 encoded * string with a length limit of 128 characters. Otherwise, an * INVALID_ARGUMENT error is returned. */ displayName?: string; /** * Configuration for Document understanding and enrichment. */ documentProcessingConfig?: GoogleCloudDiscoveryengineV1DocumentProcessingConfig; /** * Immutable. The industry vertical that the data store registers. */ industryVertical?: | "INDUSTRY_VERTICAL_UNSPECIFIED" | "GENERIC" | "MEDIA" | "HEALTHCARE_FHIR"; /** * Input only. The KMS key to be used to protect this DataStore at creation * time. Must be set for requests that need to comply with CMEK Org Policy * protections. If this field is set and processed successfully, the DataStore * will be protected by the KMS key, as indicated in the cmek_config field. */ kmsKeyName?: string; /** * Immutable. The full resource name of the data store. Format: * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * Optional. Stores serving config at DataStore level. */ servingConfigDataStore?: GoogleCloudDiscoveryengineV1DataStoreServingConfigDataStore; /** * The solutions that the data store enrolls. Available solutions for each * industry_vertical: * `MEDIA`: `SOLUTION_TYPE_RECOMMENDATION` and * `SOLUTION_TYPE_SEARCH`. * `SITE_SEARCH`: `SOLUTION_TYPE_SEARCH` is * automatically enrolled. Other solutions cannot be enrolled. */ solutionTypes?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"[]; /** * The start schema to use for this DataStore when provisioning it. If unset, * a default vertical specialized schema will be used. This field is only used * by CreateDataStore API, and will be ignored if used in other APIs. This * field will be omitted from all API responses including CreateDataStore API. * To retrieve a schema of a DataStore, use SchemaService.GetSchema API * instead. The provided schema will be validated against certain rules on * schema. Learn more from [this * doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema). */ startingSchema?: GoogleCloudDiscoveryengineV1Schema; /** * Config to store data store type configuration for workspace data. This * must be set when DataStore.content_config is set as * DataStore.ContentConfig.GOOGLE_WORKSPACE. */ workspaceConfig?: GoogleCloudDiscoveryengineV1WorkspaceConfig; } /** * Estimation of data size per data store. */ export interface GoogleCloudDiscoveryengineV1DataStoreBillingEstimation { /** * Data size for structured data in terms of bytes. */ structuredDataSize?: bigint; /** * Last updated timestamp for structured data. */ structuredDataUpdateTime?: Date; /** * Data size for unstructured data in terms of bytes. */ unstructuredDataSize?: bigint; /** * Last updated timestamp for unstructured data. */ unstructuredDataUpdateTime?: Date; /** * Data size for websites in terms of bytes. */ websiteDataSize?: bigint; /** * Last updated timestamp for websites. */ websiteDataUpdateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1DataStoreBillingEstimation(data: any): GoogleCloudDiscoveryengineV1DataStoreBillingEstimation { return { ...data, structuredDataSize: data["structuredDataSize"] !== undefined ? String(data["structuredDataSize"]) : undefined, structuredDataUpdateTime: data["structuredDataUpdateTime"] !== undefined ? data["structuredDataUpdateTime"].toISOString() : undefined, unstructuredDataSize: data["unstructuredDataSize"] !== undefined ? String(data["unstructuredDataSize"]) : undefined, unstructuredDataUpdateTime: data["unstructuredDataUpdateTime"] !== undefined ? data["unstructuredDataUpdateTime"].toISOString() : undefined, websiteDataSize: data["websiteDataSize"] !== undefined ? String(data["websiteDataSize"]) : undefined, websiteDataUpdateTime: data["websiteDataUpdateTime"] !== undefined ? data["websiteDataUpdateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DataStoreBillingEstimation(data: any): GoogleCloudDiscoveryengineV1DataStoreBillingEstimation { return { ...data, structuredDataSize: data["structuredDataSize"] !== undefined ? BigInt(data["structuredDataSize"]) : undefined, structuredDataUpdateTime: data["structuredDataUpdateTime"] !== undefined ? new Date(data["structuredDataUpdateTime"]) : undefined, unstructuredDataSize: data["unstructuredDataSize"] !== undefined ? BigInt(data["unstructuredDataSize"]) : undefined, unstructuredDataUpdateTime: data["unstructuredDataUpdateTime"] !== undefined ? new Date(data["unstructuredDataUpdateTime"]) : undefined, websiteDataSize: data["websiteDataSize"] !== undefined ? BigInt(data["websiteDataSize"]) : undefined, websiteDataUpdateTime: data["websiteDataUpdateTime"] !== undefined ? new Date(data["websiteDataUpdateTime"]) : undefined, }; } /** * Stores information regarding the serving configurations at DataStore level. */ export interface GoogleCloudDiscoveryengineV1DataStoreServingConfigDataStore { /** * If set true, the DataStore will not be available for serving search * requests. */ disabledForServing?: boolean; } /** * Metadata related to the progress of the DataStoreService.DeleteDataStore * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1DeleteDataStoreMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1DeleteDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DeleteDataStoreMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteDataStoreMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the EngineService.DeleteEngine * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1DeleteEngineMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1DeleteEngineMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DeleteEngineMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteEngineMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for DeleteSchema LRO. */ export interface GoogleCloudDiscoveryengineV1DeleteSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1DeleteSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DeleteSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.DeleteTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1DeleteTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1DeleteTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DeleteTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1DeleteTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.DisableAdvancedSiteSearch operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for SiteSearchEngineService.DisableAdvancedSiteSearch * method. */ export interface GoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchRequest { } /** * Response message for SiteSearchEngineService.DisableAdvancedSiteSearch * method. */ export interface GoogleCloudDiscoveryengineV1DisableAdvancedSiteSearchResponse { } /** * Document captures all raw metadata information of items to be recommended or * searched. */ export interface GoogleCloudDiscoveryengineV1Document { /** * The unstructured data linked to this document. Content must be set if this * document is under a `CONTENT_REQUIRED` data store. */ content?: GoogleCloudDiscoveryengineV1DocumentContent; /** * Output only. This field is OUTPUT_ONLY. It contains derived data that are * not in the original input document. */ readonly derivedStructData?: { [key: string]: any }; /** * Immutable. The identifier of the document. Id should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. */ id?: string; /** * Output only. The index status of the document. * If document is indexed * successfully, the index_time field is populated. * Otherwise, if document * is not indexed due to errors, the error_samples field is populated. * * Otherwise, index_status is unset. */ readonly indexStatus?: GoogleCloudDiscoveryengineV1DocumentIndexStatus; /** * Output only. The last time the document was indexed. If this field is set, * the document could be returned in search results. This field is * OUTPUT_ONLY. If this field is not populated, it means the document has * never been indexed. */ readonly indexTime?: Date; /** * The JSON string representation of the document. It should conform to the * registered Schema or an `INVALID_ARGUMENT` error is thrown. */ jsonData?: string; /** * Immutable. The full resource name of the document. Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * The identifier of the parent document. Currently supports at most two * level document hierarchy. Id should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. */ parentDocumentId?: string; /** * The identifier of the schema located in the same data store. */ schemaId?: string; /** * The structured JSON data for the document. It should conform to the * registered Schema or an `INVALID_ARGUMENT` error is thrown. */ structData?: { [key: string]: any }; } function serializeGoogleCloudDiscoveryengineV1Document(data: any): GoogleCloudDiscoveryengineV1Document { return { ...data, content: data["content"] !== undefined ? serializeGoogleCloudDiscoveryengineV1DocumentContent(data["content"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1Document(data: any): GoogleCloudDiscoveryengineV1Document { return { ...data, content: data["content"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1DocumentContent(data["content"]) : undefined, indexStatus: data["indexStatus"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1DocumentIndexStatus(data["indexStatus"]) : undefined, indexTime: data["indexTime"] !== undefined ? new Date(data["indexTime"]) : undefined, }; } /** * Unstructured data linked to this document. */ export interface GoogleCloudDiscoveryengineV1DocumentContent { /** * The MIME type of the content. Supported types: * `application/pdf` (PDF, * only native PDFs are supported for now) * `text/html` (HTML) * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` * (DOCX) * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` * (PPTX) * `text/plain` (TXT) See * https://www.iana.org/assignments/media-types/media-types.xhtml. */ mimeType?: string; /** * The content represented as a stream of bytes. The maximum length is * 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this * field is represented as pure binary in Protocol Buffers and base64-encoded * string in JSON. For example, `abc123!?$*&()'-=@~` should be represented as * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See * https://developers.google.com/protocol-buffers/docs/proto3#json. */ rawBytes?: Uint8Array; /** * The URI of the content. Only Cloud Storage URIs (e.g. * `gs://bucket-name/path/to/file`) are supported. The maximum file size is * 2.5 MB for text-based formats, 200 MB for other formats. */ uri?: string; } function serializeGoogleCloudDiscoveryengineV1DocumentContent(data: any): GoogleCloudDiscoveryengineV1DocumentContent { return { ...data, rawBytes: data["rawBytes"] !== undefined ? encodeBase64(data["rawBytes"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DocumentContent(data: any): GoogleCloudDiscoveryengineV1DocumentContent { return { ...data, rawBytes: data["rawBytes"] !== undefined ? decodeBase64(data["rawBytes"] as string) : undefined, }; } /** * Index status of the document. */ export interface GoogleCloudDiscoveryengineV1DocumentIndexStatus { /** * A sample of errors encountered while indexing the document. If this field * is populated, the document is not indexed due to errors. */ errorSamples?: GoogleRpcStatus[]; /** * The time when the document was indexed. If this field is populated, it * means the document has been indexed. */ indexTime?: Date; } function serializeGoogleCloudDiscoveryengineV1DocumentIndexStatus(data: any): GoogleCloudDiscoveryengineV1DocumentIndexStatus { return { ...data, indexTime: data["indexTime"] !== undefined ? data["indexTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1DocumentIndexStatus(data: any): GoogleCloudDiscoveryengineV1DocumentIndexStatus { return { ...data, indexTime: data["indexTime"] !== undefined ? new Date(data["indexTime"]) : undefined, }; } /** * Detailed document information associated with a user event. */ export interface GoogleCloudDiscoveryengineV1DocumentInfo { /** * Optional. The conversion value associated with this Document. Must be set * if UserEvent.event_type is "conversion". For example, a value of 1000 * signifies that 1000 seconds were spent viewing a Document for the `watch` * conversion type. */ conversionValue?: number; /** * The Document resource ID. */ id?: string; /** * Output only. Whether the referenced Document can be found in the data * store. */ readonly joined?: boolean; /** * The Document resource full name, of the form: * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` */ name?: string; /** * The promotion IDs associated with this Document. Currently, this field is * restricted to at most one ID. */ promotionIds?: string[]; /** * Quantity of the Document associated with the user event. Defaults to 1. * For example, this field is 2 if two quantities of the same Document are * involved in a `add-to-cart` event. Required for events of the following * event types: * `add-to-cart` * `purchase` */ quantity?: number; /** * The Document URI - only allowed for website data stores. */ uri?: string; } /** * A singleton resource of DataStore. If it's empty when DataStore is created * and DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED, the default * parser will default to digital parser. */ export interface GoogleCloudDiscoveryengineV1DocumentProcessingConfig { /** * Whether chunking mode is enabled. */ chunkingConfig?: GoogleCloudDiscoveryengineV1DocumentProcessingConfigChunkingConfig; /** * Configurations for default Document parser. If not specified, we will * configure it as default DigitalParsingConfig, and the default parsing * config will be applied to all file types for Document parsing. */ defaultParsingConfig?: GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfig; /** * The full resource name of the Document Processing Config. Format: * `projects/*\/locations/*\/collections/*\/dataStores/*\/documentProcessingConfig`. */ name?: string; /** * Map from file type to override the default parsing configuration based on * the file type. Supported keys: * `pdf`: Override parsing config for PDF * files, either digital parsing, ocr parsing or layout parsing is supported. * * `html`: Override parsing config for HTML files, only digital parsing and * layout parsing are supported. * `docx`: Override parsing config for DOCX * files, only digital parsing and layout parsing are supported. * `pptx`: * Override parsing config for PPTX files, only digital parsing and layout * parsing are supported. * `xlsm`: Override parsing config for XLSM files, * only digital parsing and layout parsing are supported. * `xlsx`: Override * parsing config for XLSX files, only digital parsing and layout parsing are * supported. */ parsingConfigOverrides?: { [key: string]: GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfig }; } /** * Configuration for chunking config. */ export interface GoogleCloudDiscoveryengineV1DocumentProcessingConfigChunkingConfig { /** * Configuration for the layout based chunking. */ layoutBasedChunkingConfig?: GoogleCloudDiscoveryengineV1DocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig; } /** * Configuration for the layout based chunking. */ export interface GoogleCloudDiscoveryengineV1DocumentProcessingConfigChunkingConfigLayoutBasedChunkingConfig { /** * The token size limit for each chunk. Supported values: 100-500 * (inclusive). Default value: 500. */ chunkSize?: number; /** * Whether to include appending different levels of headings to chunks from * the middle of the document to prevent context loss. Default value: False. */ includeAncestorHeadings?: boolean; } /** * Related configurations applied to a specific type of document parser. */ export interface GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfig { /** * Configurations applied to digital parser. */ digitalParsingConfig?: GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfigDigitalParsingConfig; /** * Configurations applied to layout parser. */ layoutParsingConfig?: GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfigLayoutParsingConfig; /** * Configurations applied to OCR parser. Currently it only applies to PDFs. */ ocrParsingConfig?: GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfigOcrParsingConfig; } /** * The digital parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfigDigitalParsingConfig { } /** * The layout parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfigLayoutParsingConfig { } /** * The OCR parsing configurations for documents. */ export interface GoogleCloudDiscoveryengineV1DocumentProcessingConfigParsingConfigOcrParsingConfig { /** * [DEPRECATED] This field is deprecated. To use the additional enhanced * document elements processing, please switch to `layout_parsing_config`. */ enhancedDocumentElements?: string[]; /** * If true, will use native text instead of OCR text on pages containing * native text. */ useNativeText?: boolean; } /** * Metadata related to the progress of the * SiteSearchEngineService.EnableAdvancedSiteSearch operation. This will be * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchMetadata(data: any): GoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for SiteSearchEngineService.EnableAdvancedSiteSearch method. */ export interface GoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchRequest { } /** * Response message for SiteSearchEngineService.EnableAdvancedSiteSearch * method. */ export interface GoogleCloudDiscoveryengineV1EnableAdvancedSiteSearchResponse { } /** * Metadata that describes the training and serving parameters of an Engine. */ export interface GoogleCloudDiscoveryengineV1Engine { /** * Configurations for the Chat Engine. Only applicable if solution_type is * SOLUTION_TYPE_CHAT. */ chatEngineConfig?: GoogleCloudDiscoveryengineV1EngineChatEngineConfig; /** * Output only. Additional information of the Chat Engine. Only applicable if * solution_type is SOLUTION_TYPE_CHAT. */ readonly chatEngineMetadata?: GoogleCloudDiscoveryengineV1EngineChatEngineMetadata; /** * Common config spec that specifies the metadata of the engine. */ commonConfig?: GoogleCloudDiscoveryengineV1EngineCommonConfig; /** * Output only. Timestamp the Recommendation Engine was created at. */ readonly createTime?: Date; /** * The data stores associated with this engine. For SOLUTION_TYPE_SEARCH and * SOLUTION_TYPE_RECOMMENDATION type of engines, they can only associate with * at most one data store. If solution_type is SOLUTION_TYPE_CHAT, multiple * DataStores in the same Collection can be associated here. Note that when * used in CreateEngineRequest, one DataStore id must be provided as the * system will use it for necessary initializations. */ dataStoreIds?: string[]; /** * Optional. Whether to disable analytics for searches performed on this * engine. */ disableAnalytics?: boolean; /** * Required. The display name of the engine. Should be human readable. UTF-8 * encoded string with limit of 1024 characters. */ displayName?: string; /** * The industry vertical that the engine registers. The restriction of the * Engine industry vertical is based on DataStore: If unspecified, default to * `GENERIC`. Vertical on Engine has to match vertical of the DataStore linked * to the engine. */ industryVertical?: | "INDUSTRY_VERTICAL_UNSPECIFIED" | "GENERIC" | "MEDIA" | "HEALTHCARE_FHIR"; /** * Immutable. The fully qualified resource name of the engine. This field * must be a UTF-8 encoded string with a length limit of 1024 characters. * Format: * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` * engine should be 1-63 characters, and valid characters are /a-z0-9*\/. * Otherwise, an INVALID_ARGUMENT error is returned. */ name?: string; /** * Configurations for the Search Engine. Only applicable if solution_type is * SOLUTION_TYPE_SEARCH. */ searchEngineConfig?: GoogleCloudDiscoveryengineV1EngineSearchEngineConfig; /** * Required. The solutions of the engine. */ solutionType?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"; /** * Output only. Timestamp the Recommendation Engine was last updated. */ readonly updateTime?: Date; } /** * Configurations for a Chat Engine. */ export interface GoogleCloudDiscoveryengineV1EngineChatEngineConfig { /** * The configurationt generate the Dialogflow agent that is associated to * this Engine. Note that these configurations are one-time consumed by and * passed to Dialogflow service. It means they cannot be retrieved using * EngineService.GetEngine or EngineService.ListEngines API after engine * creation. */ agentCreationConfig?: GoogleCloudDiscoveryengineV1EngineChatEngineConfigAgentCreationConfig; /** * The resource name of an exist Dialogflow agent to link to this Chat * Engine. Customers can either provide `agent_creation_config` to create * agent or provide an agent name that links the agent with the Chat engine. * Format: `projects//locations//agents/`. Note that the * `dialogflow_agent_to_link` are one-time consumed by and passed to * Dialogflow service. It means they cannot be retrieved using * EngineService.GetEngine or EngineService.ListEngines API after engine * creation. Use ChatEngineMetadata.dialogflow_agent for actual agent * association after Engine is created. */ dialogflowAgentToLink?: string; } /** * Configurations for generating a Dialogflow agent. Note that these * configurations are one-time consumed by and passed to Dialogflow service. It * means they cannot be retrieved using EngineService.GetEngine or * EngineService.ListEngines API after engine creation. */ export interface GoogleCloudDiscoveryengineV1EngineChatEngineConfigAgentCreationConfig { /** * Name of the company, organization or other entity that the agent * represents. Used for knowledge connector LLM prompt and for knowledge * search. */ business?: string; /** * Required. The default language of the agent as a language tag. See * [Language * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a * list of the currently supported language codes. */ defaultLanguageCode?: string; /** * Agent location for Agent creation, supported values: global/us/eu. If not * provided, us Engine will create Agent using us-central-1 by default; eu * Engine will create Agent using eu-west-1 by default. */ location?: string; /** * Required. The time zone of the agent from the [time zone * database](https://www.iana.org/time-zones), e.g., America/New_York, * Europe/Paris. */ timeZone?: string; } /** * Additional information of a Chat Engine. Fields in this message are output * only. */ export interface GoogleCloudDiscoveryengineV1EngineChatEngineMetadata { /** * The resource name of a Dialogflow agent, that this Chat Engine refers to. * Format: `projects//locations//agents/`. */ dialogflowAgent?: string; } /** * Common configurations for an Engine. */ export interface GoogleCloudDiscoveryengineV1EngineCommonConfig { /** * The name of the company, business or entity that is associated with the * engine. Setting this may help improve LLM related features. */ companyName?: string; } /** * Configurations for a Search Engine. */ export interface GoogleCloudDiscoveryengineV1EngineSearchEngineConfig { /** * The add-on that this search engine enables. */ searchAddOns?: | "SEARCH_ADD_ON_UNSPECIFIED" | "SEARCH_ADD_ON_LLM"[]; /** * The search feature tier of this engine. Different tiers might have * different pricing. To learn more, check the pricing documentation. Defaults * to SearchTier.SEARCH_TIER_STANDARD if not specified. */ searchTier?: | "SEARCH_TIER_UNSPECIFIED" | "SEARCH_TIER_STANDARD" | "SEARCH_TIER_ENTERPRISE"; } /** * Fact Chunk. */ export interface GoogleCloudDiscoveryengineV1FactChunk { /** * Text content of the fact chunk. Can be at most 10K characters long. */ chunkText?: string; /** * The index of this chunk. Currently, only used for the streaming mode. */ index?: number; /** * Source from which this fact chunk was retrieved. If it was retrieved from * the GroundingFacts provided in the request then this field will contain the * index of the specific fact from which this chunk was retrieved. */ source?: string; /** * More fine-grained information for the source reference. */ sourceMetadata?: { [key: string]: string }; } /** * Response message for SiteSearchEngineService.FetchDomainVerificationStatus * method. */ export interface GoogleCloudDiscoveryengineV1FetchDomainVerificationStatusResponse { /** * A token that can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * List of TargetSites containing the site verification status. */ targetSites?: GoogleCloudDiscoveryengineV1TargetSite[]; /** * The total number of items matching the request. This will always be * populated in the response. */ totalSize?: number; } /** * Cloud FhirStore source import data from. */ export interface GoogleCloudDiscoveryengineV1FhirStoreSource { /** * Required. The full resource name of the FHIR store to import data from, in * the format of * `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}`. */ fhirStore?: string; /** * Intermediate Cloud Storage directory used for the import with a length * limit of 2,000 characters. Can be specified if one wants to have the * FhirStore export to a specific Cloud Storage directory. */ gcsStagingDir?: string; /** * The FHIR resource types to import. The resource types should be a subset * of all [supported FHIR resource * types](https://cloud.google.com/generative-ai-app-builder/docs/fhir-schema-reference#resource-level-specification). * Default to all supported FHIR resource types if empty. */ resourceTypes?: string[]; /** * Optional. Whether to update the DataStore schema to the latest predefined * schema. If true, the DataStore schema will be updated to include any FHIR * fields or resource types that have been added since the last import and * corresponding FHIR resources will be imported from the FHIR store. Note * this field cannot be used in conjunction with `resource_types`. It should * be used after initial import. */ updateFromLatestPredefinedSchema?: boolean; } /** * Firestore source import data from. */ export interface GoogleCloudDiscoveryengineV1FirestoreSource { /** * Required. The Firestore collection (or entity) to copy the data from with * a length limit of 1,500 characters. */ collectionId?: string; /** * Required. The Firestore database to copy the data from with a length limit * of 256 characters. */ databaseId?: string; /** * Intermediate Cloud Storage directory used for the import with a length * limit of 2,000 characters. Can be specified if one wants to have the * Firestore export to a specific Cloud Storage directory. Ensure that the * Firestore service account has the necessary Cloud Storage Admin permissions * to access the specified Cloud Storage directory. */ gcsStagingDir?: string; /** * The project ID that the Cloud SQL source is in with a length limit of 128 * characters. If not specified, inherits the project ID from the parent * request. */ projectId?: string; } /** * Cloud Storage location for input content. */ export interface GoogleCloudDiscoveryengineV1GcsSource { /** * The schema to use when parsing the data from the source. Supported values * for document imports: * `document` (default): One JSON Document per line. * Each document must have a valid Document.id. * `content`: Unstructured data * (e.g. PDF, HTML). Each file matched by `input_uris` becomes a document, * with the ID set to the first 128 bits of SHA256(URI) encoded as a hex * string. * `custom`: One custom data JSON per row in arbitrary format that * conforms to the defined Schema of the data store. This can only be used by * the GENERIC Data Store vertical. * `csv`: A CSV file with header conforming * to the defined Schema of the data store. Each entry after the header is * imported as a Document. This can only be used by the GENERIC Data Store * vertical. Supported values for user event imports: * `user_event` * (default): One JSON UserEvent per line. */ dataSchema?: string; /** * Required. Cloud Storage URIs to input files. Each URI can be up to 2000 * characters long. URIs can match the full object path (for example, * `gs://bucket/directory/object.json`) or a pattern matching one or more * files, such as `gs://bucket/directory/*.json`. A request can contain at * most 100 files (or 100,000 files if `data_schema` is `content`). Each file * can be up to 2 GB (or 100 MB if `data_schema` is `content`). */ inputUris?: string[]; } /** * Grounding Fact. */ export interface GoogleCloudDiscoveryengineV1GroundingFact { /** * Attributes associated with the fact. Common attributes include `source` * (indicating where the fact was sourced from), `author` (indicating the * author of the fact), and so on. */ attributes?: { [key: string]: string }; /** * Text content of the fact. Can be at most 10K characters long. */ factText?: string; } /** * Metadata related to the progress of the ImportCompletionSuggestions * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of CompletionSuggestions that failed to be imported. */ failureCount?: bigint; /** * Count of CompletionSuggestions successfully imported. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for CompletionService.ImportCompletionSuggestions method. */ export interface GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest { /** * BigQuery input source. */ bigquerySource?: GoogleCloudDiscoveryengineV1BigQuerySource; /** * The desired location of errors incurred during the Import. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * Cloud Storage location for the input content. */ gcsSource?: GoogleCloudDiscoveryengineV1GcsSource; /** * The Inline source for suggestion entries. */ inlineSource?: GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource; } function serializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest(data: any): GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest { return { ...data, inlineSource: data["inlineSource"] !== undefined ? serializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource(data["inlineSource"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest(data: any): GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequest { return { ...data, inlineSource: data["inlineSource"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource(data["inlineSource"]) : undefined, }; } /** * The inline source for CompletionSuggestions. */ export interface GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource { /** * Required. A list of all denylist entries to import. Max of 1000 items. */ suggestions?: GoogleCloudDiscoveryengineV1CompletionSuggestion[]; } function serializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource(data: any): GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource { return { ...data, suggestions: data["suggestions"] !== undefined ? data["suggestions"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1CompletionSuggestion(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource(data: any): GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsRequestInlineSource { return { ...data, suggestions: data["suggestions"] !== undefined ? data["suggestions"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1CompletionSuggestion(item))) : undefined, }; } /** * Response of the CompletionService.ImportCompletionSuggestions method. If the * long running operation is done, this message is returned by the * google.longrunning.Operations.response field if the operation is successful. */ export interface GoogleCloudDiscoveryengineV1ImportCompletionSuggestionsResponse { /** * The desired location of errors incurred during the Import. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Metadata related to the progress of the ImportDocuments operation. This is * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1ImportDocumentsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were processed successfully. */ successCount?: bigint; /** * Total count of entries that were processed. */ totalCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1ImportDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1ImportDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? String(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1ImportDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, totalCount: data["totalCount"] !== undefined ? BigInt(data["totalCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for Import methods. */ export interface GoogleCloudDiscoveryengineV1ImportDocumentsRequest { /** * AlloyDB input source. */ alloyDbSource?: GoogleCloudDiscoveryengineV1AlloyDbSource; /** * Whether to automatically generate IDs for the documents if absent. If set * to `true`, Document.ids are automatically generated based on the hash of * the payload, where IDs may not be consistent during multiple imports. In * which case ReconciliationMode.FULL is highly recommended to avoid duplicate * contents. If unset or set to `false`, Document.ids have to be specified * using id_field, otherwise, documents without IDs fail to be imported. * Supported data sources: * GcsSource. GcsSource.data_schema must be `custom` * or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * BigQuerySource. * BigQuerySource.data_schema must be `custom` or `csv`. Otherwise, an * INVALID_ARGUMENT error is thrown. * SpannerSource. * CloudSqlSource. * * FirestoreSource. * BigtableSource. */ autoGenerateIds?: boolean; /** * BigQuery input source. */ bigquerySource?: GoogleCloudDiscoveryengineV1BigQuerySource; /** * Cloud Bigtable input source. */ bigtableSource?: GoogleCloudDiscoveryengineV1BigtableSource; /** * Cloud SQL input source. */ cloudSqlSource?: GoogleCloudDiscoveryengineV1CloudSqlSource; /** * The desired location of errors incurred during the Import. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * FhirStore input source. */ fhirStoreSource?: GoogleCloudDiscoveryengineV1FhirStoreSource; /** * Firestore input source. */ firestoreSource?: GoogleCloudDiscoveryengineV1FirestoreSource; /** * Cloud Storage location for the input content. */ gcsSource?: GoogleCloudDiscoveryengineV1GcsSource; /** * The field indicates the ID field or column to be used as unique IDs of the * documents. For GcsSource it is the key of the JSON field. For instance, * `my_id` for JSON `{"my_id": "some_uuid"}`. For others, it may be the column * name of the table where the unique ids are stored. The values of the JSON * field or the table column are used as the Document.ids. The JSON field or * the table column must be of string type, and the values must be set as * valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) * with 1-63 characters. Otherwise, documents without valid IDs fail to be * imported. Only set this field when auto_generate_ids is unset or set as * `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is unset, a * default value `_id` is used when importing from the allowed data sources. * Supported data sources: * GcsSource. GcsSource.data_schema must be `custom` * or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * BigQuerySource. * BigQuerySource.data_schema must be `custom` or `csv`. Otherwise, an * INVALID_ARGUMENT error is thrown. * SpannerSource. * CloudSqlSource. * * FirestoreSource. * BigtableSource. */ idField?: string; /** * The Inline source for the input content for documents. */ inlineSource?: GoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource; /** * The mode of reconciliation between existing documents and the documents to * be imported. Defaults to ReconciliationMode.INCREMENTAL. */ reconciliationMode?: | "RECONCILIATION_MODE_UNSPECIFIED" | "INCREMENTAL" | "FULL"; /** * Spanner input source. */ spannerSource?: GoogleCloudDiscoveryengineV1SpannerSource; /** * Indicates which fields in the provided imported documents to update. If * not set, the default is to update all fields. */ updateMask?: string /* FieldMask */; } function serializeGoogleCloudDiscoveryengineV1ImportDocumentsRequest(data: any): GoogleCloudDiscoveryengineV1ImportDocumentsRequest { return { ...data, bigtableSource: data["bigtableSource"] !== undefined ? serializeGoogleCloudDiscoveryengineV1BigtableSource(data["bigtableSource"]) : undefined, inlineSource: data["inlineSource"] !== undefined ? serializeGoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource(data["inlineSource"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportDocumentsRequest(data: any): GoogleCloudDiscoveryengineV1ImportDocumentsRequest { return { ...data, bigtableSource: data["bigtableSource"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1BigtableSource(data["bigtableSource"]) : undefined, inlineSource: data["inlineSource"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource(data["inlineSource"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * The inline source for the input config for ImportDocuments method. */ export interface GoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource { /** * Required. A list of documents to update/create. Each document must have a * valid Document.id. Recommended max of 100 items. */ documents?: GoogleCloudDiscoveryengineV1Document[]; } function serializeGoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource(data: any): GoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource { return { ...data, documents: data["documents"] !== undefined ? data["documents"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1Document(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource(data: any): GoogleCloudDiscoveryengineV1ImportDocumentsRequestInlineSource { return { ...data, documents: data["documents"] !== undefined ? data["documents"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1Document(item))) : undefined, }; } /** * Response of the ImportDocumentsRequest. If the long running operation is * done, then this message is returned by the * google.longrunning.Operations.response field if the operation was successful. */ export interface GoogleCloudDiscoveryengineV1ImportDocumentsResponse { /** * Echoes the destination for the complete errors in the request if set. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; } /** * Configuration of destination for Import related errors. */ export interface GoogleCloudDiscoveryengineV1ImportErrorConfig { /** * Cloud Storage prefix for import errors. This must be an empty, existing * Cloud Storage directory. Import errors are written to sharded files in this * directory, one per line, as a JSON-encoded `google.rpc.Status` message. */ gcsPrefix?: string; } /** * Metadata related to the progress of the ImportSuggestionDenyListEntries * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for CompletionService.ImportSuggestionDenyListEntries * method. */ export interface GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesRequest { /** * Cloud Storage location for the input content. Only 1 file can be specified * that contains all entries to import. Supported values `gcs_source.schema` * for autocomplete suggestion deny list entry imports: * * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry] per * line. */ gcsSource?: GoogleCloudDiscoveryengineV1GcsSource; /** * The Inline source for the input content for suggestion deny list entries. */ inlineSource?: GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesRequestInlineSource; } /** * The inline source for SuggestionDenyListEntry. */ export interface GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesRequestInlineSource { /** * Required. A list of all denylist entries to import. Max of 1000 items. */ entries?: GoogleCloudDiscoveryengineV1SuggestionDenyListEntry[]; } /** * Response message for CompletionService.ImportSuggestionDenyListEntries * method. */ export interface GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Count of deny list entries that failed to be imported. */ failedEntriesCount?: bigint; /** * Count of deny list entries successfully imported. */ importedEntriesCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesResponse { return { ...data, failedEntriesCount: data["failedEntriesCount"] !== undefined ? String(data["failedEntriesCount"]) : undefined, importedEntriesCount: data["importedEntriesCount"] !== undefined ? String(data["importedEntriesCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1ImportSuggestionDenyListEntriesResponse { return { ...data, failedEntriesCount: data["failedEntriesCount"] !== undefined ? BigInt(data["failedEntriesCount"]) : undefined, importedEntriesCount: data["importedEntriesCount"] !== undefined ? BigInt(data["importedEntriesCount"]) : undefined, }; } /** * Metadata related to the progress of the Import operation. This is returned * by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1ImportUserEventsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were processed successfully. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1ImportUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportUserEventsMetadata(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for the ImportUserEvents request. */ export interface GoogleCloudDiscoveryengineV1ImportUserEventsRequest { /** * BigQuery input source. */ bigquerySource?: GoogleCloudDiscoveryengineV1BigQuerySource; /** * The desired location of errors incurred during the Import. Cannot be set * for inline user event imports. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * Cloud Storage location for the input content. */ gcsSource?: GoogleCloudDiscoveryengineV1GcsSource; /** * The Inline source for the input content for UserEvents. */ inlineSource?: GoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource; } function serializeGoogleCloudDiscoveryengineV1ImportUserEventsRequest(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsRequest { return { ...data, inlineSource: data["inlineSource"] !== undefined ? serializeGoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource(data["inlineSource"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportUserEventsRequest(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsRequest { return { ...data, inlineSource: data["inlineSource"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource(data["inlineSource"]) : undefined, }; } /** * The inline source for the input config for ImportUserEvents method. */ export interface GoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource { /** * Required. A list of user events to import. Recommended max of 10k items. */ userEvents?: GoogleCloudDiscoveryengineV1UserEvent[]; } function serializeGoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource { return { ...data, userEvents: data["userEvents"] !== undefined ? data["userEvents"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1UserEvent(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsRequestInlineSource { return { ...data, userEvents: data["userEvents"] !== undefined ? data["userEvents"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1UserEvent(item))) : undefined, }; } /** * Response of the ImportUserEventsRequest. If the long running operation was * successful, then this message is returned by the * google.longrunning.Operations.response field if the operation was successful. */ export interface GoogleCloudDiscoveryengineV1ImportUserEventsResponse { /** * Echoes the destination for the complete errors if this field was set in * the request. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Count of user events imported with complete existing Documents. */ joinedEventsCount?: bigint; /** * Count of user events imported, but with Document information not found in * the existing Branch. */ unjoinedEventsCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1ImportUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsResponse { return { ...data, joinedEventsCount: data["joinedEventsCount"] !== undefined ? String(data["joinedEventsCount"]) : undefined, unjoinedEventsCount: data["unjoinedEventsCount"] !== undefined ? String(data["unjoinedEventsCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ImportUserEventsResponse(data: any): GoogleCloudDiscoveryengineV1ImportUserEventsResponse { return { ...data, joinedEventsCount: data["joinedEventsCount"] !== undefined ? BigInt(data["joinedEventsCount"]) : undefined, unjoinedEventsCount: data["unjoinedEventsCount"] !== undefined ? BigInt(data["unjoinedEventsCount"]) : undefined, }; } /** * A floating point interval. */ export interface GoogleCloudDiscoveryengineV1Interval { /** * Exclusive upper bound. */ exclusiveMaximum?: number; /** * Exclusive lower bound. */ exclusiveMinimum?: number; /** * Inclusive upper bound. */ maximum?: number; /** * Inclusive lower bound. */ minimum?: number; } /** * Response for ListControls method. */ export interface GoogleCloudDiscoveryengineV1ListControlsResponse { /** * All the Controls for a given data store. */ controls?: GoogleCloudDiscoveryengineV1Control[]; /** * Pagination token, if not returned indicates the last page. */ nextPageToken?: string; } function serializeGoogleCloudDiscoveryengineV1ListControlsResponse(data: any): GoogleCloudDiscoveryengineV1ListControlsResponse { return { ...data, controls: data["controls"] !== undefined ? data["controls"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1Control(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ListControlsResponse(data: any): GoogleCloudDiscoveryengineV1ListControlsResponse { return { ...data, controls: data["controls"] !== undefined ? data["controls"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1Control(item))) : undefined, }; } /** * Response for ListConversations method. */ export interface GoogleCloudDiscoveryengineV1ListConversationsResponse { /** * All the Conversations for a given data store. */ conversations?: GoogleCloudDiscoveryengineV1Conversation[]; /** * Pagination token, if not returned indicates the last page. */ nextPageToken?: string; } function serializeGoogleCloudDiscoveryengineV1ListConversationsResponse(data: any): GoogleCloudDiscoveryengineV1ListConversationsResponse { return { ...data, conversations: data["conversations"] !== undefined ? data["conversations"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1Conversation(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ListConversationsResponse(data: any): GoogleCloudDiscoveryengineV1ListConversationsResponse { return { ...data, conversations: data["conversations"] !== undefined ? data["conversations"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1Conversation(item))) : undefined, }; } /** * Response message for SearchTuningService.ListCustomModels method. */ export interface GoogleCloudDiscoveryengineV1ListCustomModelsResponse { /** * List of custom tuning models. */ models?: GoogleCloudDiscoveryengineV1CustomTuningModel[]; } function serializeGoogleCloudDiscoveryengineV1ListCustomModelsResponse(data: any): GoogleCloudDiscoveryengineV1ListCustomModelsResponse { return { ...data, models: data["models"] !== undefined ? data["models"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1CustomTuningModel(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ListCustomModelsResponse(data: any): GoogleCloudDiscoveryengineV1ListCustomModelsResponse { return { ...data, models: data["models"] !== undefined ? data["models"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1CustomTuningModel(item))) : undefined, }; } /** * Response message for DataStoreService.ListDataStores method. */ export interface GoogleCloudDiscoveryengineV1ListDataStoresResponse { /** * All the customer's DataStores. */ dataStores?: GoogleCloudDiscoveryengineV1DataStore[]; /** * A token that can be sent as ListDataStoresRequest.page_token to retrieve * the next page. If this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * Response message for DocumentService.ListDocuments method. */ export interface GoogleCloudDiscoveryengineV1ListDocumentsResponse { /** * The Documents. */ documents?: GoogleCloudDiscoveryengineV1Document[]; /** * A token that can be sent as ListDocumentsRequest.page_token to retrieve * the next page. If this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } function serializeGoogleCloudDiscoveryengineV1ListDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1ListDocumentsResponse { return { ...data, documents: data["documents"] !== undefined ? data["documents"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1Document(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ListDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1ListDocumentsResponse { return { ...data, documents: data["documents"] !== undefined ? data["documents"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1Document(item))) : undefined, }; } /** * Response message for EngineService.ListEngines method. */ export interface GoogleCloudDiscoveryengineV1ListEnginesResponse { /** * All the customer's Engines. */ engines?: GoogleCloudDiscoveryengineV1Engine[]; /** * Not supported. */ nextPageToken?: string; } /** * Response message for SchemaService.ListSchemas method. */ export interface GoogleCloudDiscoveryengineV1ListSchemasResponse { /** * A token that can be sent as ListSchemasRequest.page_token to retrieve the * next page. If this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The Schemas. */ schemas?: GoogleCloudDiscoveryengineV1Schema[]; } /** * Response for ListSessions method. */ export interface GoogleCloudDiscoveryengineV1ListSessionsResponse { /** * Pagination token, if not returned indicates the last page. */ nextPageToken?: string; /** * All the Sessions for a given data store. */ sessions?: GoogleCloudDiscoveryengineV1Session[]; } /** * Response message for SiteSearchEngineService.ListTargetSites method. */ export interface GoogleCloudDiscoveryengineV1ListTargetSitesResponse { /** * A token that can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * List of TargetSites. */ targetSites?: GoogleCloudDiscoveryengineV1TargetSite[]; /** * The total number of items matching the request. This will always be * populated in the response. */ totalSize?: number; } /** * Media-specific user event information. */ export interface GoogleCloudDiscoveryengineV1MediaInfo { /** * The media progress time in seconds, if applicable. For example, if the end * user has finished 90 seconds of a playback video, then * MediaInfo.media_progress_duration.seconds should be set to 90. */ mediaProgressDuration?: number /* Duration */; /** * Media progress should be computed using only the media_progress_duration * relative to the media total length. This value must be between `[0, 1.0]` * inclusive. If this is not a playback or the progress cannot be computed * (e.g. ongoing livestream), this field should be unset. */ mediaProgressPercentage?: number; } function serializeGoogleCloudDiscoveryengineV1MediaInfo(data: any): GoogleCloudDiscoveryengineV1MediaInfo { return { ...data, mediaProgressDuration: data["mediaProgressDuration"] !== undefined ? data["mediaProgressDuration"] : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1MediaInfo(data: any): GoogleCloudDiscoveryengineV1MediaInfo { return { ...data, mediaProgressDuration: data["mediaProgressDuration"] !== undefined ? data["mediaProgressDuration"] : undefined, }; } /** * Detailed page information. */ export interface GoogleCloudDiscoveryengineV1PageInfo { /** * The most specific category associated with a category page. To represent * full path of category, use '>' sign to separate different hierarchies. If * '>' is part of the category name, replace it with other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. Required for * `view-category-page` events. Other event types should not set this field. * Otherwise, an `INVALID_ARGUMENT` error is returned. */ pageCategory?: string; /** * A unique ID of a web page view. This should be kept the same for all user * events triggered from the same pageview. For example, an item detail page * view could trigger multiple events as the user is browsing the page. The * `pageview_id` property should be kept the same for all these events so that * they can be grouped together properly. When using the client side event * reporting with JavaScript pixel and Google Tag Manager, this value is * filled in automatically. */ pageviewId?: string; /** * The referrer URL of the current page. When using the client side event * reporting with JavaScript pixel and Google Tag Manager, this value is * filled in automatically. However, some browser privacy restrictions may * cause this field to be empty. */ referrerUri?: string; /** * Complete URL (window.location.href) of the user's current page. When using * the client side event reporting with JavaScript pixel and Google Tag * Manager, this value is filled in automatically. Maximum length 5,000 * characters. */ uri?: string; } /** * Detailed panel information associated with a user event. */ export interface GoogleCloudDiscoveryengineV1PanelInfo { /** * The display name of the panel. */ displayName?: string; /** * Optional. The document IDs associated with this panel. */ documents?: GoogleCloudDiscoveryengineV1DocumentInfo[]; /** * Required. The panel ID. */ panelId?: string; /** * The ordered position of the panel, if shown to the user with other panels. * If set, then total_panels must also be set. */ panelPosition?: number; /** * The total number of panels, including this one, shown to the user. Must be * set if panel_position is set. */ totalPanels?: number; } /** * Metadata and configurations for a Google Cloud project in the service. */ export interface GoogleCloudDiscoveryengineV1Project { /** * Output only. The timestamp when this project is created. */ readonly createTime?: Date; /** * Output only. Full resource name of the project, for example * `projects/{project}`. Note that when making requests, project number and * project id are both acceptable, but the server will always respond in * project number. */ readonly name?: string; /** * Output only. The timestamp when this project is successfully provisioned. * Empty value means this project is still provisioning and is not ready for * use. */ readonly provisionCompletionTime?: Date; /** * Output only. A map of terms of services. The key is the `id` of * ServiceTerms. */ readonly serviceTermsMap?: { [key: string]: GoogleCloudDiscoveryengineV1ProjectServiceTerms }; } /** * Metadata about the terms of service. */ export interface GoogleCloudDiscoveryengineV1ProjectServiceTerms { /** * The last time when the project agreed to the terms of service. */ acceptTime?: Date; /** * The last time when the project declined or revoked the agreement to terms * of service. */ declineTime?: Date; /** * The unique identifier of this terms of service. Available terms: * * `GA_DATA_USE_TERMS`: [Terms for data * use](https://cloud.google.com/retail/data-use-terms). When using this as * `id`, the acceptable version to provide is `2022-11-23`. */ id?: string; /** * Whether the project has accepted/rejected the service terms or it is still * pending. */ state?: | "STATE_UNSPECIFIED" | "TERMS_ACCEPTED" | "TERMS_PENDING" | "TERMS_DECLINED"; /** * The version string of the terms of service. For acceptable values, see the * comments for id above. */ version?: string; } function serializeGoogleCloudDiscoveryengineV1ProjectServiceTerms(data: any): GoogleCloudDiscoveryengineV1ProjectServiceTerms { return { ...data, acceptTime: data["acceptTime"] !== undefined ? data["acceptTime"].toISOString() : undefined, declineTime: data["declineTime"] !== undefined ? data["declineTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1ProjectServiceTerms(data: any): GoogleCloudDiscoveryengineV1ProjectServiceTerms { return { ...data, acceptTime: data["acceptTime"] !== undefined ? new Date(data["acceptTime"]) : undefined, declineTime: data["declineTime"] !== undefined ? new Date(data["declineTime"]) : undefined, }; } /** * Metadata associated with a project provision operation. */ export interface GoogleCloudDiscoveryengineV1ProvisionProjectMetadata { } /** * Request for ProjectService.ProvisionProject method. */ export interface GoogleCloudDiscoveryengineV1ProvisionProjectRequest { /** * Required. Set to `true` to specify that caller has read and would like to * give consent to the [Terms for data * use](https://cloud.google.com/retail/data-use-terms). */ acceptDataUseTerms?: boolean; /** * Required. The version of the [Terms for data * use](https://cloud.google.com/retail/data-use-terms) that caller has read * and would like to give consent to. Acceptable version is `2022-11-23`, and * this may change over time. */ dataUseTermsVersion?: string; } /** * Metadata related to the progress of the PurgeCompletionSuggestions * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata(data: any): GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for CompletionService.PurgeCompletionSuggestions method. */ export interface GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsRequest { } /** * Response message for CompletionService.PurgeCompletionSuggestions method. */ export interface GoogleCloudDiscoveryengineV1PurgeCompletionSuggestionsResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Whether the completion suggestions were successfully purged. */ purgeSucceeded?: boolean; } /** * Metadata related to the progress of the PurgeDocuments operation. This will * be returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata { /** * Operation create time. */ createTime?: Date; /** * Count of entries that encountered errors while processing. */ failureCount?: bigint; /** * Count of entries that were ignored as entries were not found. */ ignoredCount?: bigint; /** * Count of entries that were deleted successfully. */ successCount?: bigint; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1PurgeDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, failureCount: data["failureCount"] !== undefined ? String(data["failureCount"]) : undefined, ignoredCount: data["ignoredCount"] !== undefined ? String(data["ignoredCount"]) : undefined, successCount: data["successCount"] !== undefined ? String(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1PurgeDocumentsMetadata(data: any): GoogleCloudDiscoveryengineV1PurgeDocumentsMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, failureCount: data["failureCount"] !== undefined ? BigInt(data["failureCount"]) : undefined, ignoredCount: data["ignoredCount"] !== undefined ? BigInt(data["ignoredCount"]) : undefined, successCount: data["successCount"] !== undefined ? BigInt(data["successCount"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for DocumentService.PurgeDocuments method. */ export interface GoogleCloudDiscoveryengineV1PurgeDocumentsRequest { /** * The desired location of errors incurred during the purge. */ errorConfig?: GoogleCloudDiscoveryengineV1PurgeErrorConfig; /** * Required. Filter matching documents to purge. Only currently supported * value is `*` (all items). */ filter?: string; /** * Actually performs the purge. If `force` is set to false, return the * expected purge count without deleting any documents. */ force?: boolean; /** * Cloud Storage location for the input content. Supported `data_schema`: * * `document_id`: One valid Document.id per line. */ gcsSource?: GoogleCloudDiscoveryengineV1GcsSource; /** * Inline source for the input content for purge. */ inlineSource?: GoogleCloudDiscoveryengineV1PurgeDocumentsRequestInlineSource; } /** * The inline source for the input config for DocumentService.PurgeDocuments * method. */ export interface GoogleCloudDiscoveryengineV1PurgeDocumentsRequestInlineSource { /** * Required. A list of full resource name of documents to purge. In the * format * `projects/*\/locations/*\/collections/*\/dataStores/*\/branches/*\/documents/*`. * Recommended max of 100 items. */ documents?: string[]; } /** * Response message for DocumentService.PurgeDocuments method. If the long * running operation is successfully done, then this message is returned by the * google.longrunning.Operations.response field. */ export interface GoogleCloudDiscoveryengineV1PurgeDocumentsResponse { /** * The total count of documents purged as a result of the operation. */ purgeCount?: bigint; /** * A sample of document names that will be deleted. Only populated if `force` * is set to false. A max of 100 names will be returned and the names are * chosen at random. */ purgeSample?: string[]; } function serializeGoogleCloudDiscoveryengineV1PurgeDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1PurgeDocumentsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? String(data["purgeCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1PurgeDocumentsResponse(data: any): GoogleCloudDiscoveryengineV1PurgeDocumentsResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? BigInt(data["purgeCount"]) : undefined, }; } /** * Configuration of destination for Purge related errors. */ export interface GoogleCloudDiscoveryengineV1PurgeErrorConfig { /** * Cloud Storage prefix for purge errors. This must be an empty, existing * Cloud Storage directory. Purge errors are written to sharded files in this * directory, one per line, as a JSON-encoded `google.rpc.Status` message. */ gcsPrefix?: string; } /** * Metadata related to the progress of the PurgeSuggestionDenyListEntries * operation. This is returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesMetadata(data: any): GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for CompletionService.PurgeSuggestionDenyListEntries method. */ export interface GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesRequest { } /** * Response message for CompletionService.PurgeSuggestionDenyListEntries * method. */ export interface GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesResponse { /** * A sample of errors encountered while processing the request. */ errorSamples?: GoogleRpcStatus[]; /** * Number of suggestion deny list entries purged. */ purgeCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? String(data["purgeCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesResponse(data: any): GoogleCloudDiscoveryengineV1PurgeSuggestionDenyListEntriesResponse { return { ...data, purgeCount: data["purgeCount"] !== undefined ? BigInt(data["purgeCount"]) : undefined, }; } /** * Request message for PurgeUserEvents method. */ export interface GoogleCloudDiscoveryengineV1PurgeUserEventsRequest { /** * Required. The filter string to specify the events to be deleted with a * length limit of 5,000 characters. The eligible fields for filtering are: * * `eventType`: Double quoted UserEvent.event_type string. * `eventTime`: in * ISO 8601 "zulu" format. * `userPseudoId`: Double quoted string. Specifying * this will delete all events associated with a visitor. * `userId`: Double * quoted string. Specifying this will delete all events associated with a * user. Note: This API only supports purging a max range of 30 days. * Examples: * Deleting all events in a time range: `eventTime > * "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"` * * Deleting specific eventType in a time range: `eventTime > * "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" eventType * = "search"` * Deleting all events for a specific visitor in a time range: * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < * "2012-04-23T18:30:43.511Z" userPseudoId = "visitor1024"` * Deleting the * past 30 days of events inside a DataStore: `*` The filtering fields are * assumed to have an implicit AND. */ filter?: string; /** * The `force` field is currently not supported. Purge user event requests * will permanently delete all purgeable events. Once the development is * complete: If `force` is set to false, the method will return the expected * purge count without deleting any user events. This field will default to * false if not included in the request. */ force?: boolean; } /** * Defines a user inputed query. */ export interface GoogleCloudDiscoveryengineV1Query { /** * Unique Id for the query. */ queryId?: string; /** * Plain text. */ text?: string; } /** * Record message for RankService.Rank method. */ export interface GoogleCloudDiscoveryengineV1RankingRecord { /** * The content of the record. Empty by default. At least one of title or * content should be set otherwise an INVALID_ARGUMENT error is thrown. */ content?: string; /** * The unique ID to represent the record. */ id?: string; /** * The score of this record based on the given query and selected model. The * score will be rounded to 2 decimal places. If the score is close to 0, it * will be rounded to 0.0001 to avoid returning unset. */ score?: number; /** * The title of the record. Empty by default. At least one of title or * content should be set otherwise an INVALID_ARGUMENT error is thrown. */ title?: string; } /** * Request message for RankService.Rank method. */ export interface GoogleCloudDiscoveryengineV1RankRequest { /** * If true, the response will contain only record ID and score. By default, * it is false, the response will contain record details. */ ignoreRecordDetailsInResponse?: boolean; /** * The identifier of the model to use. It is one of: * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input * token size 512. It is set to `semantic-ranker-512@latest` by default if * unspecified. */ model?: string; /** * The query to use. */ query?: string; /** * Required. A list of records to rank. At most 200 records to rank. */ records?: GoogleCloudDiscoveryengineV1RankingRecord[]; /** * The number of results to return. If this is unset or no bigger than zero, * returns all results. */ topN?: number; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Google Cloud * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; } /** * Response message for RankService.Rank method. */ export interface GoogleCloudDiscoveryengineV1RankResponse { /** * A list of records sorted by descending score. */ records?: GoogleCloudDiscoveryengineV1RankingRecord[]; } /** * Request message for Recommend method. */ export interface GoogleCloudDiscoveryengineV1RecommendRequest { /** * Filter for restricting recommendation results with a length limit of 5,000 * characters. Currently, only filter expressions on the `filter_tags` * attribute is supported. Examples: * `(filter_tags: ANY("Red", "Blue") OR * filter_tags: ANY("Hot", "Cold"))` * `(filter_tags: ANY("Red", "Blue")) AND * NOT (filter_tags: ANY("Green"))` If `attributeFilteringSyntax` is set to * true under the `params` field, then attribute-based expressions are * expected instead of the above described tag-based syntax. Examples: * * (language: ANY("en", "es")) AND NOT (categories: ANY("Movie")) * * (available: true) AND (language: ANY("en", "es")) OR (categories: * ANY("Movie")) If your filter blocks all results, the API returns generic * (unfiltered) popular Documents. If you only want results strictly matching * the filters, set `strictFiltering` to `true` in RecommendRequest.params to * receive empty results instead. Note that the API never returns Documents * with `storageStatus` as `EXPIRED` or `DELETED` regardless of filter * choices. */ filter?: string; /** * Maximum number of results to return. Set this property to the number of * recommendation results needed. If zero, the service chooses a reasonable * default. The maximum allowed value is 100. Values above 100 are set to 100. */ pageSize?: number; /** * Additional domain specific parameters for the recommendations. Allowed * values: * `returnDocument`: Boolean. If set to `true`, the associated * Document object is returned in * RecommendResponse.RecommendationResult.document. * `returnScore`: Boolean. * If set to true, the recommendation score corresponding to each returned * Document is set in RecommendResponse.RecommendationResult.metadata. The * given score indicates the probability of a Document conversion given the * user's context and history. * `strictFiltering`: Boolean. True by default. * If set to `false`, the service returns generic (unfiltered) popular * Documents instead of empty if your filter blocks all recommendation * results. * `diversityLevel`: String. Default empty. If set to be non-empty, * then it needs to be one of: * `no-diversity` * `low-diversity` * * `medium-diversity` * `high-diversity` * `auto-diversity` This gives * request-level control and adjusts recommendation results based on Document * category. * `attributeFilteringSyntax`: Boolean. False by default. If set * to true, the `filter` field is interpreted according to the new, * attribute-based syntax. */ params?: { [key: string]: any }; /** * Required. Context about the user, what they are looking at and what action * they took to trigger the Recommend request. Note that this user event * detail won't be ingested to userEvent logs. Thus, a separate userEvent * write request is required for event logging. Don't set * UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the same fixed * ID for different users. If you are trying to receive non-personalized * recommendations (not recommended; this can negatively impact model * performance), instead set UserEvent.user_pseudo_id to a random unique ID * and leave UserEvent.user_info.user_id unset. */ userEvent?: GoogleCloudDiscoveryengineV1UserEvent; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Requirements * for * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; /** * Use validate only mode for this recommendation query. If set to `true`, a * fake model is used that returns arbitrary Document IDs. Note that the * validate only mode should only be used for testing the API, or if the model * is not ready. */ validateOnly?: boolean; } function serializeGoogleCloudDiscoveryengineV1RecommendRequest(data: any): GoogleCloudDiscoveryengineV1RecommendRequest { return { ...data, userEvent: data["userEvent"] !== undefined ? serializeGoogleCloudDiscoveryengineV1UserEvent(data["userEvent"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1RecommendRequest(data: any): GoogleCloudDiscoveryengineV1RecommendRequest { return { ...data, userEvent: data["userEvent"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1UserEvent(data["userEvent"]) : undefined, }; } /** * Response message for Recommend method. */ export interface GoogleCloudDiscoveryengineV1RecommendResponse { /** * A unique attribution token. This should be included in the UserEvent logs * resulting from this recommendation, which enables accurate attribution of * recommendation model performance. */ attributionToken?: string; /** * IDs of documents in the request that were missing from the default Branch * associated with the requested ServingConfig. */ missingIds?: string[]; /** * A list of recommended Documents. The order represents the ranking (from * the most relevant Document to the least). */ results?: GoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult[]; /** * True if RecommendRequest.validate_only was set. */ validateOnly?: boolean; } function serializeGoogleCloudDiscoveryengineV1RecommendResponse(data: any): GoogleCloudDiscoveryengineV1RecommendResponse { return { ...data, results: data["results"] !== undefined ? data["results"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1RecommendResponse(data: any): GoogleCloudDiscoveryengineV1RecommendResponse { return { ...data, results: data["results"] !== undefined ? data["results"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult(item))) : undefined, }; } /** * RecommendationResult represents a generic recommendation result with * associated metadata. */ export interface GoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult { /** * Set if `returnDocument` is set to true in RecommendRequest.params. */ document?: GoogleCloudDiscoveryengineV1Document; /** * Resource ID of the recommended Document. */ id?: string; /** * Additional Document metadata or annotations. Possible values: * `score`: * Recommendation score in double value. Is set if `returnScore` is set to * true in RecommendRequest.params. */ metadata?: { [key: string]: any }; } function serializeGoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult(data: any): GoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult { return { ...data, document: data["document"] !== undefined ? serializeGoogleCloudDiscoveryengineV1Document(data["document"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult(data: any): GoogleCloudDiscoveryengineV1RecommendResponseRecommendationResult { return { ...data, document: data["document"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1Document(data["document"]) : undefined, }; } /** * Request message for SiteSearchEngineService.RecrawlUris method. */ export interface GoogleCloudDiscoveryengineV1RecrawlUrisRequest { /** * Optional. Full resource name of the SiteCredential, such as * `projects/*\/locations/*\/collections/*\/dataStores/*\/siteSearchEngine/siteCredentials/*`. * Only set to crawl private URIs. */ siteCredential?: string; /** * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise * an INVALID_ARGUMENT error is thrown. Each URI should match at least one * TargetSite in `site_search_engine`. */ uris?: string[]; } /** * Defines a reply message to user. */ export interface GoogleCloudDiscoveryengineV1Reply { /** * Summary based on search results. */ summary?: GoogleCloudDiscoveryengineV1SearchResponseSummary; } function serializeGoogleCloudDiscoveryengineV1Reply(data: any): GoogleCloudDiscoveryengineV1Reply { return { ...data, summary: data["summary"] !== undefined ? serializeGoogleCloudDiscoveryengineV1SearchResponseSummary(data["summary"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1Reply(data: any): GoogleCloudDiscoveryengineV1Reply { return { ...data, summary: data["summary"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1SearchResponseSummary(data["summary"]) : undefined, }; } /** * Defines the structure and layout of a type of document data. */ export interface GoogleCloudDiscoveryengineV1Schema { /** * The JSON representation of the schema. */ jsonSchema?: string; /** * Immutable. The full resource name of the schema, in the format of * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. */ name?: string; /** * The structured representation of the schema. */ structSchema?: { [key: string]: any }; } /** * Detailed search information. */ export interface GoogleCloudDiscoveryengineV1SearchInfo { /** * An integer that specifies the current offset for pagination (the 0-indexed * starting location, amongst the products deemed by the API as relevant). See * SearchRequest.offset for definition. If this field is negative, an * `INVALID_ARGUMENT` is returned. This can only be set for `search` events. * Other event types should not set this field. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ offset?: number; /** * The order in which products are returned, if applicable. See * SearchRequest.order_by for definition and syntax. The value must be a UTF-8 * encoded string with a length limit of 1,000 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. This can only be set for `search` * events. Other event types should not set this field. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ orderBy?: string; /** * The user's search query. See SearchRequest.query for definition. The value * must be a UTF-8 encoded string with a length limit of 5,000 characters. * Otherwise, an `INVALID_ARGUMENT` error is returned. At least one of * search_query or PageInfo.page_category is required for `search` events. * Other event types should not set this field. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ searchQuery?: string; } /** * Promotion proto includes uri and other helping information to display the * promotion. */ export interface GoogleCloudDiscoveryengineV1SearchLinkPromotion { /** * Optional. The Promotion description. Maximum length: 200 characters. */ description?: string; /** * Optional. The enabled promotion will be returned for any serving configs * associated with the parent of the control this promotion is attached to. * This flag is used for basic site search only. */ enabled?: boolean; /** * Optional. The promotion thumbnail image url. */ imageUri?: string; /** * Required. The title of the promotion. Maximum length: 160 characters. */ title?: string; /** * Required. The URL for the page the user wants to promote. */ uri?: string; } /** * Request message for SearchService.Search method. */ export interface GoogleCloudDiscoveryengineV1SearchRequest { /** * Boost specification to boost certain documents. For more information on * boosting, see * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) */ boostSpec?: GoogleCloudDiscoveryengineV1SearchRequestBoostSpec; /** * The branch resource name, such as * `projects/*\/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. * Use `default_branch` as the branch ID or leave this field empty, to search * documents under the default branch. */ branch?: string; /** * The default filter that is applied when a user performs a search without * checking any filters on the search page. The filter applied to every search * request when quality improvement such as query expansion is needed. In the * case a query does not have a sufficient amount of results this filter will * be used to determine whether or not to enable the query expansion flow. The * original filter will still be used for the query expanded search. This * field is strongly recommended to achieve high search quality. For more * information about filter syntax, see SearchRequest.filter. */ canonicalFilter?: string; /** * A specification for configuring the behavior of content search. */ contentSearchSpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpec; /** * Specs defining DataStores to filter on in a search call and configurations * for those data stores. This is only considered for Engines with multiple * data stores. For engines with a single data store, the specs directly under * SearchRequest should be used. */ dataStoreSpecs?: GoogleCloudDiscoveryengineV1SearchRequestDataStoreSpec[]; /** * Facet specifications for faceted search. If empty, no facets are returned. * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error * is returned. */ facetSpecs?: GoogleCloudDiscoveryengineV1SearchRequestFacetSpec[]; /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. Filter * expression is case-sensitive. If this field is unrecognizable, an * `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by * mapping the LHS filter key to a key property defined in the Vertex AI * Search backend -- this mapping is defined by the customer in their schema. * For example a media customer might have a field 'name' in their schema. In * this case the filter would look like this: filter --> name:'ANY("king * kong")' For more information about filtering including syntax and filter * operators, see * [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; /** * Raw image query. */ imageQuery?: GoogleCloudDiscoveryengineV1SearchRequestImageQuery; /** * The BCP-47 language code, such as "en-US" or "sr-Latn". For more * information, see [Standard * fields](https://cloud.google.com/apis/design/standard_fields). This field * helps to better interpret the query. If a value isn't specified, the query * language code is automatically detected, which may not be accurate. */ languageCode?: string; /** * A 0-indexed integer that specifies the current offset (that is, starting * result location, amongst the Documents deemed by the API as relevant) in * search results. This field is only considered if page_token is unset. If * this field is negative, an `INVALID_ARGUMENT` is returned. */ offset?: number; /** * The maximum number of results to return for OneBox. This applies to each * OneBox type individually. Default number is 10. */ oneBoxPageSize?: number; /** * The order in which documents are returned. Documents can be ordered by a * field in an Document object. Leave it unset if ordered by relevance. * `order_by` expression is case-sensitive. For more information on ordering * the website search results, see [Order web search * results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). * For more information on ordering the healthcare search results, see [Order * healthcare search * results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. */ orderBy?: string; /** * Maximum number of Documents to return. The maximum allowed value depends * on the data type. Values above the maximum value are coerced to the maximum * value. * Websites with basic indexing: Default `10`, Maximum `25`. * * Websites with advanced indexing: Default `25`, Maximum `50`. * Other: * Default `50`, Maximum `100`. If this field is negative, an * `INVALID_ARGUMENT` is returned. */ pageSize?: number; /** * A page token received from a previous SearchService.Search call. Provide * this to retrieve the subsequent page. When paginating, all other parameters * provided to SearchService.Search must match the call that provided the page * token. Otherwise, an `INVALID_ARGUMENT` error is returned. */ pageToken?: string; /** * Additional search parameters. For public website search only, supported * values are: * `user_country_code`: string. Default empty. If set to * non-empty, results are restricted or boosted based on the location * provided. For example, `user_country_code: "au"` For available codes see * [Country * Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, which * enables image searching. For example, `search_type: 1` */ params?: { [key: string]: any }; /** * Raw search query. */ query?: string; /** * The query expansion specification that specifies the conditions under * which query expansion occurs. */ queryExpansionSpec?: GoogleCloudDiscoveryengineV1SearchRequestQueryExpansionSpec; /** * Whether to turn on safe search. This is only supported for website search. */ safeSearch?: boolean; /** * Search as you type configuration. Only supported for the * IndustryVertical.MEDIA vertical. */ searchAsYouTypeSpec?: GoogleCloudDiscoveryengineV1SearchRequestSearchAsYouTypeSpec; /** * The session resource name. Optional. Session allows users to do multi-turn * /search API calls or coordination between /search API calls and /answer API * calls. Example #1 (multi-turn /search API calls): 1. Call /search API with * the auto-session mode (see below). 2. Call /search API with the session ID * generated in the first call. Here, the previous search query gets * considered in query standing. I.e., if the first query is "How did Alphabet * do in 2022?" and the current query is "How about 2023?", the current query * will be interpreted as "How did Alphabet do in 2023?". Example #2 * (coordination between /search API calls and /answer API calls): 1. Call * /search API with the auto-session mode (see below). 2. Call /answer API * with the session ID generated in the first call. Here, the answer * generation happens in the context of the search results from the first * search call. Auto-session mode: when `projects/.../sessions/-` is used, a * new session gets automatically created. Otherwise, users can use the * create-session API to create a session manually. Multi-turn Search feature * is currently at private GA stage. Please use v1alpha or v1beta version * instead before we launch this feature to public GA. Or ask for allowlisting * through Google Support team. */ session?: string; /** * Session specification. Can be used only when `session` is set. */ sessionSpec?: GoogleCloudDiscoveryengineV1SearchRequestSessionSpec; /** * The spell correction specification that specifies the mode under which * spell correction takes effect. */ spellCorrectionSpec?: GoogleCloudDiscoveryengineV1SearchRequestSpellCorrectionSpec; /** * Information about the end user. Highly recommended for analytics. * UserInfo.user_agent is used to deduce `device_type` for analytics. */ userInfo?: GoogleCloudDiscoveryengineV1UserInfo; /** * The user labels applied to a resource must meet the following * requirements: * Each resource can have multiple labels, up to a maximum of * 64. * Each label must be a key-value pair. * Keys have a minimum length of * 1 character and a maximum length of 63 characters and cannot be empty. * Values can be empty and have a maximum length of 63 characters. * Keys and * values can contain only lowercase letters, numeric characters, underscores, * and dashes. All characters must use UTF-8 encoding, and international * characters are allowed. * The key portion of a label must be unique. * However, you can use the same key with multiple resources. * Keys must * start with a lowercase letter or international character. See [Google Cloud * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) * for more details. */ userLabels?: { [key: string]: string }; /** * A unique identifier for tracking visitors. For example, this could be * implemented with an HTTP cookie, which should be able to uniquely identify * a visitor on a single device. This unique identifier should not change if * the visitor logs in or out of the website. This field should NOT have a * fixed value such as `unknown_visitor`. This should be the same identifier * as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The * field must be a UTF-8 encoded string with a length limit of 128 characters. * Otherwise, an `INVALID_ARGUMENT` error is returned. */ userPseudoId?: string; } /** * Boost specification to boost certain documents. */ export interface GoogleCloudDiscoveryengineV1SearchRequestBoostSpec { /** * Condition boost specifications. If a document matches multiple conditions * in the specifictions, boost scores from these specifications are all * applied and combined in a non-linear way. Maximum number of specifications * is 20. */ conditionBoostSpecs?: GoogleCloudDiscoveryengineV1SearchRequestBoostSpecConditionBoostSpec[]; } /** * Boost applies to documents which match a condition. */ export interface GoogleCloudDiscoveryengineV1SearchRequestBoostSpecConditionBoostSpec { /** * Strength of the condition boost, which should be in [-1, 1]. Negative * boost means demotion. Default is 0.0. Setting to 1.0 gives the document a * big promotion. However, it does not necessarily mean that the boosted * document will be the top result at all times, nor that other documents will * be excluded. Results could still be shown even when none of them matches * the condition. And results that are significantly more relevant to the * search query can still trump your heavily favored but irrelevant documents. * Setting to -1.0 gives the document a big demotion. However, results that * are deeply relevant might still be shown. The document will have an * upstream battle to get a fairly high ranking, but it is not blocked out * completely. Setting to 0.0 means no boost applied. The boosting condition * is ignored. Only one of the (condition, boost) combination or the * boost_control_spec below are set. If both are set then the global boost is * ignored and the more fine-grained boost_control_spec is applied. */ boost?: number; /** * Complex specification for custom ranking based on customer defined * attribute value. */ boostControlSpec?: GoogleCloudDiscoveryengineV1SearchRequestBoostSpecConditionBoostSpecBoostControlSpec; /** * An expression which specifies a boost condition. The syntax and supported * fields are the same as a filter expression. See SearchRequest.filter for * detail syntax and limitations. Examples: * To boost documents with document * ID "doc_1" or "doc_2", and color "Red" or "Blue": `(document_id: * ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))` */ 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 GoogleCloudDiscoveryengineV1SearchRequestBoostSpecConditionBoostSpecBoostControlSpec { /** * 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"; /** * 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?: GoogleCloudDiscoveryengineV1SearchRequestBoostSpecConditionBoostSpecBoostControlSpecControlPoint[]; /** * The name of the field whose value will be used to determine the boost * amount. */ fieldName?: string; /** * 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 GoogleCloudDiscoveryengineV1SearchRequestBoostSpecConditionBoostSpecBoostControlSpecControlPoint { /** * 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; /** * The value between -1 to 1 by which to boost the score if the * attribute_value evaluates to the value specified above. */ boostAmount?: number; } /** * A specification for configuring the behavior of content search. */ export interface GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpec { /** * Specifies the chunk spec to be returned from the search response. Only * available if the SearchRequest.ContentSearchSpec.search_result_mode is set * to CHUNKS */ chunkSpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecChunkSpec; /** * If there is no extractive_content_spec provided, there will be no * extractive answer in the search response. */ extractiveContentSpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecExtractiveContentSpec; /** * Specifies the search result mode. If unspecified, the search result mode * defaults to `DOCUMENTS`. */ searchResultMode?: | "SEARCH_RESULT_MODE_UNSPECIFIED" | "DOCUMENTS" | "CHUNKS"; /** * If `snippetSpec` is not specified, snippets are not included in the search * response. */ snippetSpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSnippetSpec; /** * If `summarySpec` is not specified, summaries are not included in the * search response. */ summarySpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpec; } /** * Specifies the chunk spec to be returned from the search response. Only * available if the SearchRequest.ContentSearchSpec.search_result_mode is set to * CHUNKS */ export interface GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecChunkSpec { /** * The number of next chunks to be returned of the current chunk. The maximum * allowed value is 3. If not specified, no next chunks will be returned. */ numNextChunks?: number; /** * The number of previous chunks to be returned of the current chunk. The * maximum allowed value is 3. If not specified, no previous chunks will be * returned. */ numPreviousChunks?: number; } /** * A specification for configuring the extractive content in a search response. */ export interface GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecExtractiveContentSpec { /** * The maximum number of extractive answers returned in each search result. * An extractive answer is a verbatim answer extracted from the original * document, which provides a precise and contextually relevant answer to the * search query. If the number of matching answers is less than the * `max_extractive_answer_count`, return all of the answers. Otherwise, return * the `max_extractive_answer_count`. At most five answers are returned for * each SearchResult. */ maxExtractiveAnswerCount?: number; /** * The max number of extractive segments returned in each search result. Only * applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED * or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is * a text segment extracted from the original document that is relevant to the * search query, and, in general, more verbose than an extractive answer. The * segment could then be used as input for LLMs to generate summaries and * answers. If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. */ maxExtractiveSegmentCount?: number; /** * Return at most `num_next_segments` segments after each selected segments. */ numNextSegments?: number; /** * Specifies whether to also include the adjacent from each selected * segments. Return at most `num_previous_segments` segments before each * selected segments. */ numPreviousSegments?: number; /** * Specifies whether to return the confidence score from the extractive * segments in each search result. This feature is available only for new or * allowlisted data stores. To allowlist your data store, contact your * Customer Engineer. The default value is `false`. */ returnExtractiveSegmentScore?: boolean; } /** * A specification for configuring snippets in a search response. */ export interface GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSnippetSpec { /** * [DEPRECATED] This field is deprecated. To control snippet return, use * `return_snippet` field. For backwards compatibility, we will return snippet * if max_snippet_count > 0. */ maxSnippetCount?: number; /** * [DEPRECATED] This field is deprecated and will have no affect on the * snippet. */ referenceOnly?: boolean; /** * If `true`, then return snippet. If no snippet can be generated, we return * "No snippet is available for this page." A `snippet_status` with `SUCCESS` * or `NO_SNIPPET_AVAILABLE` will also be returned. */ returnSnippet?: boolean; } /** * A specification for configuring a summary returned in a search response. */ export interface GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpec { /** * Specifies whether to filter out adversarial queries. The default value is * `false`. Google employs search-query classification to detect adversarial * queries. No summary is returned if the search query is classified as an * adversarial query. For example, a user might ask a question regarding * negative comments about the company or submit a query designed to generate * unsafe, policy-violating output. If this field is set to `true`, we skip * generating summaries for adversarial queries and return fallback messages * instead. */ ignoreAdversarialQuery?: boolean; /** * Optional. Specifies whether to filter out jail-breaking queries. The * default value is `false`. Google employs search-query classification to * detect jail-breaking queries. No summary is returned if the search query is * classified as a jail-breaking query. A user might add instructions to the * query to change the tone, style, language, content of the answer, or ask * the model to act as a different entity, e.g. "Reply in the tone of a * competing company's CEO". If this field is set to `true`, we skip * generating summaries for jail-breaking queries and return fallback messages * instead. */ ignoreJailBreakingQuery?: boolean; /** * Specifies whether to filter out queries that have low relevance. The * default value is `false`. If this field is set to `false`, all search * results are used regardless of relevance to generate answers. If set to * `true`, only queries with high relevance search results will generate * answers. */ ignoreLowRelevantContent?: boolean; /** * Specifies whether to filter out queries that are not summary-seeking. The * default value is `false`. Google employs search-query classification to * detect summary-seeking queries. No summary is returned if the search query * is classified as a non-summary seeking query. For example, `why is the sky * blue` and `Who is the best soccer player in the world?` are summary-seeking * queries, but `SFO airport` and `world cup 2026` are not. They are most * likely navigational queries. If this field is set to `true`, we skip * generating summaries for non-summary seeking queries and return fallback * messages instead. */ ignoreNonSummarySeekingQuery?: boolean; /** * Specifies whether to include citations in the summary. The default value * is `false`. When this field is set to `true`, summaries include in-line * citation numbers. Example summary including citations: BigQuery is Google * Cloud's fully managed and completely serverless enterprise data warehouse * [1]. BigQuery supports all data types, works across clouds, and has * built-in machine learning and business intelligence, all within a unified * platform [2, 3]. The citation numbers refer to the returned search results * and are 1-indexed. For example, [1] means that the sentence is attributed * to the first search result. [2, 3] means that the sentence is attributed to * both the second and third search results. */ includeCitations?: boolean; /** * Language code for Summary. Use language tags defined by * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an * experimental feature. */ languageCode?: string; /** * If specified, the spec will be used to modify the prompt provided to the * LLM. */ modelPromptSpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpecModelPromptSpec; /** * If specified, the spec will be used to modify the model specification * provided to the LLM. */ modelSpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpecModelSpec; /** * The number of top results to generate the summary from. If the number of * results returned is less than `summaryResultCount`, the summary is * generated from all of the results. At most 10 results for documents mode, * or 50 for chunks mode, can be used to generate a summary. The chunks mode * is used when SearchRequest.ContentSearchSpec.search_result_mode is set to * CHUNKS. */ summaryResultCount?: number; /** * If true, answer will be generated from most relevant chunks from top * search results. This feature will improve summary quality. Note that with * this feature enabled, not all top search results will be referenced and * included in the reference list, so the citation source index only points to * the search results listed in the reference list. */ useSemanticChunks?: boolean; } /** * Specification of the prompt to use with the model. */ export interface GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpecModelPromptSpec { /** * Text at the beginning of the prompt that instructs the assistant. Examples * are available in the user guide. */ preamble?: string; } /** * Specification of the model. */ export interface GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpecSummarySpecModelSpec { /** * The model version used to generate the summary. Supported values are: * * `stable`: string. Default value when no value is specified. Uses a * generally available, fine-tuned model. For more information, see [Answer * generation model versions and * lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * * `preview`: string. (Public preview) Uses a preview model. For more * information, see [Answer generation model versions and * lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). */ version?: string; } /** * A struct to define data stores to filter on in a search call and * configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error * is returned. */ export interface GoogleCloudDiscoveryengineV1SearchRequestDataStoreSpec { /** * Optional. Boost specification to boost certain documents. For more * information on boosting, see * [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) */ boostSpec?: GoogleCloudDiscoveryengineV1SearchRequestBoostSpec; /** * Required. Full resource name of DataStore, such as * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. */ dataStore?: string; /** * Optional. Filter specification to filter documents in the data store * specified by data_store field. For more information on filtering, see * [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */ filter?: string; } /** * A facet specification to perform faceted search. */ export interface GoogleCloudDiscoveryengineV1SearchRequestFacetSpec { /** * Enables dynamic position for this facet. If set to true, the position of * this facet among all facets in the response is determined automatically. If * dynamic facets are enabled, it is ordered together. If set to false, the * position of this facet in the response is the same as in the request, and * it is ranked before the facets with dynamic position enable and all dynamic * facets. For example, you may always want to have rating facet returned in * the response, but it's not necessarily to always display the rating facet * at the top. In that case, you can set enable_dynamic_position to true so * that the position of rating facet in response is determined automatically. * Another example, assuming you have the following facets in the request: * * "rating", enable_dynamic_position = true * "price", enable_dynamic_position * = false * "brands", enable_dynamic_position = false And also you have a * dynamic facets enabled, which generates a facet `gender`. Then the final * order of the facets in the response can be ("price", "brands", "rating", * "gender") or ("price", "brands", "gender", "rating") depends on how API * orders "gender" and "rating" facets. However, notice that "price" and * "brands" are always ranked at first and second position because their * enable_dynamic_position is false. */ enableDynamicPosition?: boolean; /** * List of keys to exclude when faceting. By default, FacetKey.key is not * excluded from the filter unless it is listed in this field. Listing a facet * key in this field allows its values to appear as facet results, even when * they are filtered out of search results. Using this field does not affect * what search results are returned. For example, suppose there are 100 * documents with the color facet "Red" and 200 documents with the color facet * "Blue". A query containing the filter "color:ANY("Red")" and having "color" * as FacetKey.key would by default return only "Red" documents in the search * results, and also return "Red" with count 100 as the only color facet. * Although there are also blue documents available, "Blue" would not be shown * as an available facet value. If "color" is listed in "excludedFilterKeys", * then the query returns the facet values "Red" with count 100 and "Blue" * with count 200, because the "color" key is now excluded from the filter. * Because this field doesn't affect search results, the search results are * still correctly filtered to return only "Red" documents. A maximum of 100 * values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. */ excludedFilterKeys?: string[]; /** * Required. The facet key specification. */ facetKey?: GoogleCloudDiscoveryengineV1SearchRequestFacetSpecFacetKey; /** * Maximum facet values that are returned for this facet. If unspecified, * defaults to 20. The maximum allowed value is 300. Values above 300 are * coerced to 300. For aggregation in healthcare search, when the * [FacetKey.key] is "healthcare_aggregation_key", the limit will be * overridden to 10,000 internally, regardless of the value set here. If this * field is negative, an `INVALID_ARGUMENT` is returned. */ limit?: number; } /** * Specifies how a facet is computed. */ export interface GoogleCloudDiscoveryengineV1SearchRequestFacetSpecFacetKey { /** * True to make facet keys case insensitive when getting faceting values with * prefixes or contains; false otherwise. */ caseInsensitive?: boolean; /** * Only get facet values that contain the given strings. For example, suppose * "category" has three values "Action > 2022", "Action > 2021" and "Sci-Fi > * 2022". If set "contains" to "2022", the "category" facet only contains * "Action > 2022" and "Sci-Fi > 2022". Only supported on textual fields. * Maximum is 10. */ contains?: string[]; /** * Set only if values should be bucketed into intervals. Must be set for * facets with numerical values. Must not be set for facet with text values. * Maximum number of intervals is 30. */ intervals?: GoogleCloudDiscoveryengineV1Interval[]; /** * Required. Supported textual and numerical facet keys in Document object, * over which the facet values are computed. Facet key is case-sensitive. */ key?: string; /** * The order in which documents are returned. Allowed values are: * "count * desc", which means order by SearchResponse.Facet.values.count descending. * * "value desc", which means order by SearchResponse.Facet.values.value * descending. Only applies to textual facets. If not set, textual values are * sorted in [natural * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical * intervals are sorted in the order given by FacetSpec.FacetKey.intervals. */ orderBy?: string; /** * Only get facet values that start with the given string prefix. For * example, suppose "category" has three values "Action > 2022", "Action > * 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the "category" * facet only contains "Action > 2022" and "Action > 2021". Only supported on * textual fields. Maximum is 10. */ prefixes?: string[]; /** * Only get facet for the given restricted values. Only supported on textual * fields. For example, suppose "category" has three values "Action > 2022", * "Action > 2021" and "Sci-Fi > 2022". If set "restricted_values" to "Action * > 2022", the "category" facet only contains "Action > 2022". Only supported * on textual fields. Maximum is 10. */ restrictedValues?: string[]; } /** * Specifies the image query input. */ export interface GoogleCloudDiscoveryengineV1SearchRequestImageQuery { /** * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP. */ imageBytes?: string; } /** * Specification to determine under which conditions query expansion should * occur. */ export interface GoogleCloudDiscoveryengineV1SearchRequestQueryExpansionSpec { /** * The condition under which query expansion should occur. Default to * Condition.DISABLED. */ condition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "AUTO"; /** * Whether to pin unexpanded results. If this field is set to true, * unexpanded products are always at the top of the search results, followed * by the expanded results. */ pinUnexpandedResults?: boolean; } /** * Specification for search as you type in search requests. */ export interface GoogleCloudDiscoveryengineV1SearchRequestSearchAsYouTypeSpec { /** * The condition under which search as you type should occur. Default to * Condition.DISABLED. */ condition?: | "CONDITION_UNSPECIFIED" | "DISABLED" | "ENABLED"; } /** * Session specification. Multi-turn Search feature is currently at private GA * stage. Please use v1alpha or v1beta version instead before we launch this * feature to public GA. Or ask for allowlisting through Google Support team. */ export interface GoogleCloudDiscoveryengineV1SearchRequestSessionSpec { /** * If set, the search result gets stored to the "turn" specified by this * query ID. Example: Let's say the session looks like this: session { name: * ".../sessions/xxx" turns { query { text: "What is foo?" query_id: * ".../questions/yyy" } answer: "Foo is ..." } turns { query { text: "How * about bar then?" query_id: ".../questions/zzz" } } } The user can call * /search API with a request like this: session: ".../sessions/xxx" * session_spec { query_id: ".../questions/zzz" } Then, the API stores the * search result, associated with the last turn. The stored search result can * be used by a subsequent /answer API call (with the session ID and the query * ID specified). Also, it is possible to call /search and /answer in parallel * with the same session ID & query ID. */ queryId?: string; /** * The number of top search results to persist. The persisted search results * can be used for the subsequent /answer api call. This field is simliar to * the `summary_result_count` field in * SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count. At most * 10 results for documents mode, or 50 for chunks mode. */ searchResultPersistenceCount?: number; } /** * The specification for query spell correction. */ export interface GoogleCloudDiscoveryengineV1SearchRequestSpellCorrectionSpec { /** * The mode under which spell correction replaces the original search query. * Defaults to Mode.AUTO. */ mode?: | "MODE_UNSPECIFIED" | "SUGGESTION_ONLY" | "AUTO"; } /** * Response message for SearchService.Search method. */ export interface GoogleCloudDiscoveryengineV1SearchResponse { /** * A unique search token. This should be included in the UserEvent logs * resulting from this search, which enables accurate attribution of search * model performance. This also helps to identify a request during the * customer support scenarios. */ attributionToken?: string; /** * Contains the spell corrected query, if found. If the spell correction type * is AUTOMATIC, then the search results are based on corrected_query. * Otherwise the original query is used for search. */ correctedQuery?: string; /** * Results of facets requested by user. */ facets?: GoogleCloudDiscoveryengineV1SearchResponseFacet[]; /** * A token that can be sent as SearchRequest.page_token to retrieve the next * page. If this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * Query expansion information for the returned results. */ queryExpansionInfo?: GoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo; /** * The URI of a customer-defined redirect page. If redirect action is * triggered, no search is performed, and only redirect_uri and * attribution_token are set in the response. */ redirectUri?: string; /** * A list of matched documents. The order represents the ranking. */ results?: GoogleCloudDiscoveryengineV1SearchResponseSearchResult[]; /** * Promotions for site search. */ searchLinkPromotions?: GoogleCloudDiscoveryengineV1SearchLinkPromotion[]; /** * Session information. Only set if SearchRequest.session is provided. See * its description for more details. */ sessionInfo?: GoogleCloudDiscoveryengineV1SearchResponseSessionInfo; /** * A summary as part of the search results. This field is only returned if * SearchRequest.ContentSearchSpec.summary_spec is set. */ summary?: GoogleCloudDiscoveryengineV1SearchResponseSummary; /** * The estimated total count of matched items irrespective of pagination. The * count of results returned by pagination may be less than the total_size * that matches. */ totalSize?: number; } function serializeGoogleCloudDiscoveryengineV1SearchResponse(data: any): GoogleCloudDiscoveryengineV1SearchResponse { return { ...data, facets: data["facets"] !== undefined ? data["facets"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1SearchResponseFacet(item))) : undefined, queryExpansionInfo: data["queryExpansionInfo"] !== undefined ? serializeGoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo(data["queryExpansionInfo"]) : undefined, results: data["results"] !== undefined ? data["results"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1SearchResponseSearchResult(item))) : undefined, summary: data["summary"] !== undefined ? serializeGoogleCloudDiscoveryengineV1SearchResponseSummary(data["summary"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponse(data: any): GoogleCloudDiscoveryengineV1SearchResponse { return { ...data, facets: data["facets"] !== undefined ? data["facets"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1SearchResponseFacet(item))) : undefined, queryExpansionInfo: data["queryExpansionInfo"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo(data["queryExpansionInfo"]) : undefined, results: data["results"] !== undefined ? data["results"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1SearchResponseSearchResult(item))) : undefined, summary: data["summary"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1SearchResponseSummary(data["summary"]) : undefined, }; } /** * A facet result. */ export interface GoogleCloudDiscoveryengineV1SearchResponseFacet { /** * Whether the facet is dynamically generated. */ dynamicFacet?: boolean; /** * The key for this facet. For example, `"colors"` or `"price"`. It matches * SearchRequest.FacetSpec.FacetKey.key. */ key?: string; /** * The facet values for this field. */ values?: GoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue[]; } function serializeGoogleCloudDiscoveryengineV1SearchResponseFacet(data: any): GoogleCloudDiscoveryengineV1SearchResponseFacet { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseFacet(data: any): GoogleCloudDiscoveryengineV1SearchResponseFacet { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue(item))) : undefined, }; } /** * A facet value which contains value names and their count. */ export interface GoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue { /** * Number of items that have this facet value. */ count?: bigint; /** * Interval value for a facet, such as 10, 20) for facet "price". It matches * [SearchRequest.FacetSpec.FacetKey.intervals. */ interval?: GoogleCloudDiscoveryengineV1Interval; /** * Text value of a facet, such as "Black" for facet "colors". */ value?: string; } function serializeGoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue(data: any): GoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue(data: any): GoogleCloudDiscoveryengineV1SearchResponseFacetFacetValue { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, }; } /** * Information describing query expansion including whether expansion has * occurred. */ export interface GoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo { /** * Bool describing whether query expansion has occurred. */ expandedQuery?: boolean; /** * Number of pinned results. This field will only be set when expansion * happens and SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set * to true. */ pinnedResultCount?: bigint; } function serializeGoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo(data: any): GoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo { return { ...data, pinnedResultCount: data["pinnedResultCount"] !== undefined ? String(data["pinnedResultCount"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo(data: any): GoogleCloudDiscoveryengineV1SearchResponseQueryExpansionInfo { return { ...data, pinnedResultCount: data["pinnedResultCount"] !== undefined ? BigInt(data["pinnedResultCount"]) : undefined, }; } /** * Represents the search results. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSearchResult { /** * The chunk data in the search response if the * SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS. */ chunk?: GoogleCloudDiscoveryengineV1Chunk; /** * The document data snippet in the search response. Only fields that are * marked as `retrievable` are populated. */ document?: GoogleCloudDiscoveryengineV1Document; /** * Document.id of the searched Document. */ id?: string; } function serializeGoogleCloudDiscoveryengineV1SearchResponseSearchResult(data: any): GoogleCloudDiscoveryengineV1SearchResponseSearchResult { return { ...data, document: data["document"] !== undefined ? serializeGoogleCloudDiscoveryengineV1Document(data["document"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseSearchResult(data: any): GoogleCloudDiscoveryengineV1SearchResponseSearchResult { return { ...data, document: data["document"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1Document(data["document"]) : undefined, }; } /** * Information about the session. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSessionInfo { /** * Name of the session. If the auto-session mode is used (when * SearchRequest.session ends with "-"), this field holds the newly generated * session name. */ name?: string; /** * Query ID that corresponds to this search API call. One session can have * multiple turns, each with a unique query ID. By specifying the session name * and this query ID in the Answer API call, the answer generation happens in * the context of the search results from this search call. */ queryId?: string; } /** * Summary of the top N search results specified by the summary spec. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummary { /** * A collection of Safety Attribute categories and their associated * confidence scores. */ safetyAttributes?: GoogleCloudDiscoveryengineV1SearchResponseSummarySafetyAttributes; /** * Additional summary-skipped reasons. This provides the reason for ignored * cases. If nothing is skipped, this field is not set. */ summarySkippedReasons?: | "SUMMARY_SKIPPED_REASON_UNSPECIFIED" | "ADVERSARIAL_QUERY_IGNORED" | "NON_SUMMARY_SEEKING_QUERY_IGNORED" | "OUT_OF_DOMAIN_QUERY_IGNORED" | "POTENTIAL_POLICY_VIOLATION" | "LLM_ADDON_NOT_ENABLED" | "NO_RELEVANT_CONTENT" | "JAIL_BREAKING_QUERY_IGNORED" | "CUSTOMER_POLICY_VIOLATION" | "NON_SUMMARY_SEEKING_QUERY_IGNORED_V2"[]; /** * The summary content. */ summaryText?: string; /** * Summary with metadata information. */ summaryWithMetadata?: GoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata; } function serializeGoogleCloudDiscoveryengineV1SearchResponseSummary(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummary { return { ...data, summaryWithMetadata: data["summaryWithMetadata"] !== undefined ? serializeGoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata(data["summaryWithMetadata"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseSummary(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummary { return { ...data, summaryWithMetadata: data["summaryWithMetadata"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata(data["summaryWithMetadata"]) : undefined, }; } /** * Citation info for a segment. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummaryCitation { /** * End of the attributed segment, exclusive. */ endIndex?: bigint; /** * Citation sources for the attributed segment. */ sources?: GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource[]; /** * Index indicates the start of the segment, measured in bytes/unicode. */ startIndex?: bigint; } function serializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitation(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummaryCitation { return { ...data, endIndex: data["endIndex"] !== undefined ? String(data["endIndex"]) : undefined, sources: data["sources"] !== undefined ? data["sources"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource(item))) : undefined, startIndex: data["startIndex"] !== undefined ? String(data["startIndex"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitation(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummaryCitation { return { ...data, endIndex: data["endIndex"] !== undefined ? BigInt(data["endIndex"]) : undefined, sources: data["sources"] !== undefined ? data["sources"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource(item))) : undefined, startIndex: data["startIndex"] !== undefined ? BigInt(data["startIndex"]) : undefined, }; } /** * Citation metadata. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata { /** * Citations for segments. */ citations?: GoogleCloudDiscoveryengineV1SearchResponseSummaryCitation[]; } function serializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata { return { ...data, citations: data["citations"] !== undefined ? data["citations"].map((item: any) => (serializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitation(item))) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata { return { ...data, citations: data["citations"] !== undefined ? data["citations"].map((item: any) => (deserializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitation(item))) : undefined, }; } /** * Citation source. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource { /** * Document reference index from SummaryWithMetadata.references. It is * 0-indexed and the value will be zero if the reference_index is not set * explicitly. */ referenceIndex?: bigint; } function serializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource { return { ...data, referenceIndex: data["referenceIndex"] !== undefined ? String(data["referenceIndex"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationSource { return { ...data, referenceIndex: data["referenceIndex"] !== undefined ? BigInt(data["referenceIndex"]) : undefined, }; } /** * Document reference. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummaryReference { /** * List of cited chunk contents derived from document content. */ chunkContents?: GoogleCloudDiscoveryengineV1SearchResponseSummaryReferenceChunkContent[]; /** * Required. Document.name of the document. Full resource name of the * referenced document, in the format * `projects/*\/locations/*\/collections/*\/dataStores/*\/branches/*\/documents/*`. */ document?: string; /** * Title of the document. */ title?: string; /** * Cloud Storage or HTTP uri for the document. */ uri?: string; } /** * Chunk content. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummaryReferenceChunkContent { /** * Chunk textual content. */ content?: string; /** * Page identifier. */ pageIdentifier?: string; } /** * Safety Attribute categories and their associated confidence scores. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummarySafetyAttributes { /** * The display names of Safety Attribute categories associated with the * generated content. Order matches the Scores. */ categories?: string[]; /** * The confidence scores of the each category, higher value means higher * confidence. Order matches the Categories. */ scores?: number[]; } /** * Summary with metadata information. */ export interface GoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata { /** * Citation metadata for given summary. */ citationMetadata?: GoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata; /** * Document References. */ references?: GoogleCloudDiscoveryengineV1SearchResponseSummaryReference[]; /** * Summary text with no citation information. */ summary?: string; } function serializeGoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata { return { ...data, citationMetadata: data["citationMetadata"] !== undefined ? serializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata(data["citationMetadata"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata(data: any): GoogleCloudDiscoveryengineV1SearchResponseSummarySummaryWithMetadata { return { ...data, citationMetadata: data["citationMetadata"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1SearchResponseSummaryCitationMetadata(data["citationMetadata"]) : undefined, }; } /** * Configures metadata that is used to generate serving time results (e.g. * search results or recommendation predictions). The ServingConfig is passed in * the search and predict request and generates results. */ export interface GoogleCloudDiscoveryengineV1ServingConfig { /** * Boost controls to use in serving path. All triggered boost controls will * be applied. Boost controls must be in the same data store as the serving * config. Maximum of 20 boost controls. */ boostControlIds?: string[]; /** * Output only. ServingConfig created timestamp. */ readonly createTime?: Date; /** * Required. The human readable serving config display name. Used in * Discovery UI. This field must be a UTF-8 encoded string with a length limit * of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. */ displayName?: string; /** * Condition do not associate specifications. If multiple do not associate * conditions match, all matching do not associate controls in the list will * execute. Order does not matter. Maximum number of specifications is 100. * Can only be set if SolutionType is SOLUTION_TYPE_SEARCH. */ dissociateControlIds?: string[]; /** * How much diversity to use in recommendation model results e.g. * `medium-diversity` or `high-diversity`. Currently supported values: * * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * * `auto-diversity` If not specified, we choose default based on * recommendation model type. Default value: `no-diversity`. Can only be set * if SolutionType is SOLUTION_TYPE_RECOMMENDATION. */ diversityLevel?: string; /** * Filter controls to use in serving path. All triggered filter controls will * be applied. Filter controls must be in the same data store as the serving * config. Maximum of 20 filter controls. */ filterControlIds?: string[]; /** * The GenericConfig of the serving configuration. */ genericConfig?: GoogleCloudDiscoveryengineV1ServingConfigGenericConfig; /** * Condition ignore specifications. If multiple ignore conditions match, all * matching ignore controls in the list will execute. Order does not matter. * Maximum number of specifications is 100. */ ignoreControlIds?: string[]; /** * The MediaConfig of the serving configuration. */ mediaConfig?: GoogleCloudDiscoveryengineV1ServingConfigMediaConfig; /** * The id of the model to use at serving time. Currently only * RecommendationModels are supported. Can be changed but only to a compatible * model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required * when SolutionType is SOLUTION_TYPE_RECOMMENDATION. */ modelId?: string; /** * Immutable. Fully qualified name * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` */ name?: string; /** * Condition oneway synonyms specifications. If multiple oneway synonyms * conditions match, all matching oneway synonyms controls in the list will * execute. Maximum number of specifications is 100. Can only be set if * SolutionType is SOLUTION_TYPE_SEARCH. */ onewaySynonymsControlIds?: string[]; /** * Condition promote specifications. Maximum number of specifications is 100. */ promoteControlIds?: string[]; /** * The ranking expression controls the customized ranking on retrieval * documents. To leverage this, document embedding is required. The ranking * expression setting in ServingConfig applies to all search requests served * by the serving config. However, if SearchRequest.ranking_expression is * specified, it overrides the ServingConfig ranking expression. The ranking * expression is a single function or multiple functions that are joined by * "+". * ranking_expression = function, { " + ", function }; Supported * functions: * double * relevance_score * double * * dotProduct(embedding_field_path) Function variables: * `relevance_score`: * pre-defined keywords, used for measure relevance between query and * document. * `embedding_field_path`: the document embedding field used with * query embedding vector. * `dotProduct`: embedding function between * embedding_field_path and query embedding vector. Example ranking * expression: If document has an embedding field doc_embedding, the ranking * expression could be `0.5 * relevance_score + 0.3 * * dotProduct(doc_embedding)`. */ rankingExpression?: string; /** * IDs of the redirect controls. Only the first triggered redirect action is * applied, even if multiple apply. Maximum number of specifications is 100. * Can only be set if SolutionType is SOLUTION_TYPE_SEARCH. */ redirectControlIds?: string[]; /** * Condition replacement specifications. Applied according to the order in * the list. A previously replaced term can not be re-replaced. Maximum number * of specifications is 100. Can only be set if SolutionType is * SOLUTION_TYPE_SEARCH. */ replacementControlIds?: string[]; /** * Required. Immutable. Specifies the solution type that a serving config can * be associated with. */ solutionType?: | "SOLUTION_TYPE_UNSPECIFIED" | "SOLUTION_TYPE_RECOMMENDATION" | "SOLUTION_TYPE_SEARCH" | "SOLUTION_TYPE_CHAT" | "SOLUTION_TYPE_GENERATIVE_CHAT"; /** * Condition synonyms specifications. If multiple synonyms conditions match, * all matching synonyms controls in the list will execute. Maximum number of * specifications is 100. Can only be set if SolutionType is * SOLUTION_TYPE_SEARCH. */ synonymsControlIds?: string[]; /** * Output only. ServingConfig updated timestamp. */ readonly updateTime?: Date; } /** * Specifies the configurations needed for Generic Discovery.Currently we * support: * `content_search_spec`: configuration for generic content search. */ export interface GoogleCloudDiscoveryengineV1ServingConfigGenericConfig { /** * Specifies the expected behavior of content search. Only valid for * content-search enabled data store. */ contentSearchSpec?: GoogleCloudDiscoveryengineV1SearchRequestContentSearchSpec; } /** * Specifies the configurations needed for Media Discovery. Currently we * support: * `demote_content_watched`: Threshold for watched content demotion. * Customers can specify if using watched content demotion or use viewed detail * page. Using the content watched demotion, customers need to specify the * watched minutes or percentage exceeds the threshold, the content will be * demoted in the recommendation result. * `promote_fresh_content`: cutoff days * for fresh content promotion. Customers can specify if using content freshness * promotion. If the content was published within the cutoff days, the content * will be promoted in the recommendation result. Can only be set if * SolutionType is SOLUTION_TYPE_RECOMMENDATION. */ export interface GoogleCloudDiscoveryengineV1ServingConfigMediaConfig { /** * Specifies the content freshness used for recommendation result. Contents * will be demoted if contents were published for more than content freshness * cutoff days. */ contentFreshnessCutoffDays?: number; /** * Specifies the content watched percentage threshold for demotion. Threshold * value must be between [0, 1.0] inclusive. */ contentWatchedPercentageThreshold?: number; /** * Specifies the content watched minutes threshold for demotion. */ contentWatchedSecondsThreshold?: number; /** * Optional. Specifies the number of days to look back for demoting watched * content. If set to zero or unset, defaults to the maximum of 365 days. */ demoteContentWatchedPastDays?: number; /** * Specifies the event type used for demoting recommendation result. * Currently supported values: * `view-item`: Item viewed. * `media-play`: * Start/resume watching a video, playing a song, etc. * `media-complete`: * Finished or stopped midway through a video, song, etc. If unset, watch * history demotion will not be applied. Content freshness demotion will still * be applied. */ demotionEventType?: string; } /** * External session proto definition. */ export interface GoogleCloudDiscoveryengineV1Session { /** * Optional. The display name of the session. This field is used to identify * the session in the UI. By default, the display name is the first turn query * text in the session. */ displayName?: string; /** * Output only. The time the session finished. */ readonly endTime?: Date; /** * Optional. Whether the session is pinned, pinned session will be displayed * on the top of the session list. */ isPinned?: boolean; /** * Immutable. Fully qualified name * `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` */ name?: string; /** * Output only. The time the session started. */ readonly startTime?: Date; /** * The state of the session. */ state?: | "STATE_UNSPECIFIED" | "IN_PROGRESS"; /** * Turns. */ turns?: GoogleCloudDiscoveryengineV1SessionTurn[]; /** * A unique identifier for tracking users. */ userPseudoId?: string; } /** * Represents a turn, including a query from the user and a answer from * service. */ export interface GoogleCloudDiscoveryengineV1SessionTurn { /** * The resource name of the answer to the user query. Only set if the answer * generation (/answer API call) happened in this turn. */ answer?: string; /** * Output only. In ConversationalSearchService.GetSession API, if * GetSessionRequest.include_answer_details is set to true, this field will be * populated when getting answer query session. */ readonly detailedAnswer?: GoogleCloudDiscoveryengineV1Answer; /** * The user query. */ query?: GoogleCloudDiscoveryengineV1Query; } /** * SiteSearchEngine captures DataStore level site search persisting * configurations. It is a singleton value per data store. */ export interface GoogleCloudDiscoveryengineV1SiteSearchEngine { /** * The fully qualified resource name of the site search engine. Format: * `projects/*\/locations/*\/dataStores/*\/siteSearchEngine` */ name?: string; } /** * Verification information for target sites in advanced site search. */ export interface GoogleCloudDiscoveryengineV1SiteVerificationInfo { /** * Site verification state indicating the ownership and validity. */ siteVerificationState?: | "SITE_VERIFICATION_STATE_UNSPECIFIED" | "VERIFIED" | "UNVERIFIED" | "EXEMPTED"; /** * Latest site verification time. */ verifyTime?: Date; } function serializeGoogleCloudDiscoveryengineV1SiteVerificationInfo(data: any): GoogleCloudDiscoveryengineV1SiteVerificationInfo { return { ...data, verifyTime: data["verifyTime"] !== undefined ? data["verifyTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1SiteVerificationInfo(data: any): GoogleCloudDiscoveryengineV1SiteVerificationInfo { return { ...data, verifyTime: data["verifyTime"] !== undefined ? new Date(data["verifyTime"]) : undefined, }; } /** * The Spanner source for importing data */ export interface GoogleCloudDiscoveryengineV1SpannerSource { /** * Required. The database ID of the source Spanner table. */ databaseId?: string; /** * Whether to apply data boost on Spanner export. Enabling this option will * incur additional cost. More info can be found * [here](https://cloud.google.com/spanner/docs/databoost/databoost-overview#billing_and_quotas). */ enableDataBoost?: boolean; /** * Required. The instance ID of the source Spanner table. */ instanceId?: string; /** * The project ID that contains the Spanner source. Has a length limit of 128 * characters. If not specified, inherits the project ID from the parent * request. */ projectId?: string; /** * Required. The table name of the Spanner database that needs to be * imported. */ tableId?: string; } /** * Suggestion deny list entry identifying the phrase to block from suggestions * and the applied operation for the phrase. */ export interface GoogleCloudDiscoveryengineV1SuggestionDenyListEntry { /** * Required. Phrase to block from suggestions served. Can be maximum 125 * characters. */ blockPhrase?: string; /** * Required. The match operator to apply for this phrase. Whether to block * the exact phrase, or block any suggestions containing this phrase. */ matchOperator?: | "MATCH_OPERATOR_UNSPECIFIED" | "EXACT_MATCH" | "CONTAINS"; } /** * A target site for the SiteSearchEngine. */ export interface GoogleCloudDiscoveryengineV1TargetSite { /** * Input only. If set to false, a uri_pattern is generated to include all * pages whose address contains the provided_uri_pattern. If set to true, an * uri_pattern is generated to try to be an exact match of the * provided_uri_pattern or just the specific page if the provided_uri_pattern * is a specific one. provided_uri_pattern is always normalized to generate * the URI pattern to be used by the search engine. */ exactMatch?: boolean; /** * Output only. Failure reason. */ readonly failureReason?: GoogleCloudDiscoveryengineV1TargetSiteFailureReason; /** * Output only. This is system-generated based on the provided_uri_pattern. */ readonly generatedUriPattern?: string; /** * Output only. Indexing status. */ readonly indexingStatus?: | "INDEXING_STATUS_UNSPECIFIED" | "PENDING" | "FAILED" | "SUCCEEDED" | "DELETING"; /** * Output only. The fully qualified resource name of the target site. * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` * The `target_site_id` is system-generated. */ readonly name?: string; /** * Required. Input only. The user provided URI pattern from which the * `generated_uri_pattern` is generated. */ providedUriPattern?: string; /** * Output only. Root domain of the provided_uri_pattern. */ readonly rootDomainUri?: string; /** * Output only. Site ownership and validity verification status. */ readonly siteVerificationInfo?: GoogleCloudDiscoveryengineV1SiteVerificationInfo; /** * The type of the target site, e.g., whether the site is to be included or * excluded. */ type?: | "TYPE_UNSPECIFIED" | "INCLUDE" | "EXCLUDE"; /** * Output only. The target site's last updated time. */ readonly updateTime?: Date; } /** * Site search indexing failure reasons. */ export interface GoogleCloudDiscoveryengineV1TargetSiteFailureReason { /** * Failed due to insufficient quota. */ quotaFailure?: GoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure; } function serializeGoogleCloudDiscoveryengineV1TargetSiteFailureReason(data: any): GoogleCloudDiscoveryengineV1TargetSiteFailureReason { return { ...data, quotaFailure: data["quotaFailure"] !== undefined ? serializeGoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure(data["quotaFailure"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1TargetSiteFailureReason(data: any): GoogleCloudDiscoveryengineV1TargetSiteFailureReason { return { ...data, quotaFailure: data["quotaFailure"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure(data["quotaFailure"]) : undefined, }; } /** * Failed due to insufficient quota. */ export interface GoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure { /** * This number is an estimation on how much total quota this project needs to * successfully complete indexing. */ totalRequiredQuota?: bigint; } function serializeGoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure(data: any): GoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure { return { ...data, totalRequiredQuota: data["totalRequiredQuota"] !== undefined ? String(data["totalRequiredQuota"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure(data: any): GoogleCloudDiscoveryengineV1TargetSiteFailureReasonQuotaFailure { return { ...data, totalRequiredQuota: data["totalRequiredQuota"] !== undefined ? BigInt(data["totalRequiredQuota"]) : undefined, }; } /** * Defines text input. */ export interface GoogleCloudDiscoveryengineV1TextInput { /** * Conversation context of the input. */ context?: GoogleCloudDiscoveryengineV1ConversationContext; /** * Text input. */ input?: string; } /** * Metadata related to the progress of the TrainCustomModel operation. This is * returned by the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1TrainCustomModelMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1TrainCustomModelMetadata(data: any): GoogleCloudDiscoveryengineV1TrainCustomModelMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1TrainCustomModelMetadata(data: any): GoogleCloudDiscoveryengineV1TrainCustomModelMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for SearchTuningService.TrainCustomModel method. */ export interface GoogleCloudDiscoveryengineV1TrainCustomModelRequest { /** * The desired location of errors incurred during the data ingestion and * training. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * Cloud Storage training input. */ gcsTrainingInput?: GoogleCloudDiscoveryengineV1TrainCustomModelRequestGcsTrainingInput; /** * If not provided, a UUID will be generated. */ modelId?: string; /** * Model to be trained. Supported values are: * **search-tuning**: Fine * tuning the search system based on data provided. */ modelType?: string; } /** * Cloud Storage training data input. */ export interface GoogleCloudDiscoveryengineV1TrainCustomModelRequestGcsTrainingInput { /** * The Cloud Storage corpus data which could be associated in train data. The * data path format is `gs:///`. A newline delimited jsonl/ndjson file. For * search-tuning model, each line should have the _id, title and text. * Example: `{"_id": "doc1", title: "relevant doc", "text": "relevant text"}` */ corpusDataPath?: string; /** * The gcs query data which could be associated in train data. The data path * format is `gs:///`. A newline delimited jsonl/ndjson file. For * search-tuning model, each line should have the _id and text. Example: * {"_id": "query1", "text": "example query"} */ queryDataPath?: string; /** * Cloud Storage test data. Same format as train_data_path. If not provided, * a random 80/20 train/test split will be performed on train_data_path. */ testDataPath?: string; /** * Cloud Storage training data path whose format should be `gs:///`. The file * should be in tsv format. Each line should have the doc_id and query_id and * score (number). For search-tuning model, it should have the query-id * corpus-id score as tsv file header. The score should be a number in `[0, * inf+)`. The larger the number is, the more relevant the pair is. Example: * * `query-id\tcorpus-id\tscore` * `query1\tdoc1\t1` */ trainDataPath?: string; } /** * Response of the TrainCustomModelRequest. This message is returned by the * google.longrunning.Operations.response field. */ export interface GoogleCloudDiscoveryengineV1TrainCustomModelResponse { /** * Echoes the destination for the complete errors in the request if set. */ errorConfig?: GoogleCloudDiscoveryengineV1ImportErrorConfig; /** * A sample of errors encountered while processing the data. */ errorSamples?: GoogleRpcStatus[]; /** * The metrics of the trained model. */ metrics?: { [key: string]: number }; /** * Fully qualified name of the CustomTuningModel. */ modelName?: string; /** * The trained model status. Possible values are: * **bad-data**: The * training data quality is bad. * **no-improvement**: Tuning didn't improve * performance. Won't deploy. * **in-progress**: Model training job creation * is in progress. * **training**: Model is actively training. * * **evaluating**: The model is evaluating trained metrics. * **indexing**: * The model trained metrics are indexing. * **ready**: The model is ready for * serving. */ modelStatus?: string; } /** * A transaction represents the entire purchase transaction. */ export interface GoogleCloudDiscoveryengineV1TransactionInfo { /** * All the costs associated with the products. These can be manufacturing * costs, shipping expenses not borne by the end user, or any other costs, * such that: * Profit = value - tax - cost */ cost?: number; /** * Required. Currency code. Use three-character ISO-4217 code. */ currency?: string; /** * The total discount(s) value applied to this transaction. This figure * should be excluded from TransactionInfo.value For example, if a user paid * TransactionInfo.value amount, then nominal (pre-discount) value of the * transaction is the sum of TransactionInfo.value and * TransactionInfo.discount_value This means that profit is calculated the * same way, regardless of the discount value, and that * TransactionInfo.discount_value can be larger than TransactionInfo.value: * * Profit = value - tax - cost */ discountValue?: number; /** * All the taxes associated with the transaction. */ tax?: number; /** * The transaction ID with a length limit of 128 characters. */ transactionId?: string; /** * Required. Total non-zero value associated with the transaction. This value * may include shipping, tax, or other adjustments to the total value that you * want to include. */ value?: number; } /** * Metadata related to the progress of the CmekConfigService.UpdateCmekConfig * operation. This will be returned by the google.longrunning.Operation.metadata * field. */ export interface GoogleCloudDiscoveryengineV1UpdateCmekConfigMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1UpdateCmekConfigMetadata(data: any): GoogleCloudDiscoveryengineV1UpdateCmekConfigMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1UpdateCmekConfigMetadata(data: any): GoogleCloudDiscoveryengineV1UpdateCmekConfigMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata for UpdateSchema LRO. */ export interface GoogleCloudDiscoveryengineV1UpdateSchemaMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1UpdateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1UpdateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1UpdateSchemaMetadata(data: any): GoogleCloudDiscoveryengineV1UpdateSchemaMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Metadata related to the progress of the * SiteSearchEngineService.UpdateTargetSite operation. This will be returned by * the google.longrunning.Operation.metadata field. */ export interface GoogleCloudDiscoveryengineV1UpdateTargetSiteMetadata { /** * Operation create time. */ createTime?: Date; /** * Operation last update time. If the operation is done, this is also the * finish time. */ updateTime?: Date; } function serializeGoogleCloudDiscoveryengineV1UpdateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1UpdateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1UpdateTargetSiteMetadata(data: any): GoogleCloudDiscoveryengineV1UpdateTargetSiteMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * UserEvent captures all metadata information Discovery Engine API needs to * know about how end users interact with your website. */ export interface GoogleCloudDiscoveryengineV1UserEvent { /** * Extra user event features to include in the recommendation model. These * attributes must NOT contain data that needs to be parsed or processed * further, e.g. JSON or other encodings. If you provide custom attributes for * ingested user events, also include them in the user events that you * associate with prediction requests. Custom attribute formatting must be * consistent between imported events and events provided with prediction * requests. This lets the Discovery Engine API use those custom attributes * when training models and serving predictions, which helps improve * recommendation quality. This field needs to pass all below criteria, * otherwise an `INVALID_ARGUMENT` error is returned: * The key must be a * UTF-8 encoded string with a length limit of 5,000 characters. * For text * attributes, at most 400 values are allowed. Empty values are not allowed. * Each value must be a UTF-8 encoded string with a length limit of 256 * characters. * For number attributes, at most 400 values are allowed. For * product recommendations, an example of extra user information is * `traffic_channel`, which is how a user arrives at the site. Users can * arrive at the site by coming to the site directly, coming through Google * search, or in other ways. */ attributes?: { [key: string]: GoogleCloudDiscoveryengineV1CustomAttribute }; /** * Token to attribute an API response to user action(s) to trigger the event. * Highly recommended for user events that are the result of * RecommendationService.Recommend. This field enables accurate attribution of * recommendation model performance. The value must be one of: * * RecommendResponse.attribution_token for events that are the result of * RecommendationService.Recommend. * SearchResponse.attribution_token for * events that are the result of SearchService.Search. This token enables us * to accurately attribute page view or conversion completion back to the * event and the particular predict response containing this clicked/purchased * product. If user clicks on product K in the recommendation results, pass * RecommendResponse.attribution_token as a URL parameter to product K's page. * When recording events on product K's page, log the * RecommendResponse.attribution_token to this field. */ attributionToken?: string; /** * CompletionService.CompleteQuery details related to the event. This field * should be set for `search` event when autocomplete function is enabled and * the user clicks a suggestion for search. */ completionInfo?: GoogleCloudDiscoveryengineV1CompletionInfo; /** * Optional. Conversion type. Required if UserEvent.event_type is * `conversion`. This is a customer-defined conversion name in lowercase * letters or numbers separated by "-", such as "watch", "good-visit" etc. Do * not set the field if UserEvent.event_type is not `conversion`. This mixes * the custom conversion event with predefined events like `search`, * `view-item` etc. */ conversionType?: string; /** * The DataStore resource full name, of the form * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. * Optional. Only required for user events whose data store can't by * determined by UserEvent.engine or UserEvent.documents. If data store is set * in the parent of write/import/collect user event requests, this field can * be omitted. */ dataStore?: string; /** * Should set to true if the request is made directly from the end user, in * which case the UserEvent.user_info.user_agent can be populated from the * HTTP request. This flag should be set only if the API request is made * directly from the end user such as a mobile app (and not if a gateway or a * server is processing and pushing the user events). This should not be set * when using the JavaScript tag in UserEventService.CollectUserEvent. */ directUserRequest?: boolean; /** * List of Documents associated with this user event. This field is optional * except for the following event types: * `view-item` * `add-to-cart` * * `purchase` * `media-play` * `media-complete` In a `search` event, this * field represents the documents returned to the end user on the current page * (the end user may have not finished browsing the whole page yet). When a * new page is returned to the end user, after pagination/filtering/ordering * even for the same query, a new `search` event with different * UserEvent.documents is desired. */ documents?: GoogleCloudDiscoveryengineV1DocumentInfo[]; /** * The Engine resource name, in the form of * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * Optional. Only required for Engine produced user events. For example, user * events from blended search. */ engine?: string; /** * Only required for UserEventService.ImportUserEvents method. Timestamp of * when the user event happened. */ eventTime?: Date; /** * Required. User event type. Allowed values are: Generic values: * `search`: * Search for Documents. * `view-item`: Detailed page view of a Document. * * `view-item-list`: View of a panel or ordered list of Documents. * * `view-home-page`: View of the home page. * `view-category-page`: View of a * category page, e.g. Home > Men > Jeans * `add-feedback`: Add a user * feedback. Retail-related values: * `add-to-cart`: Add an item(s) to cart, * e.g. in Retail online shopping * `purchase`: Purchase an item(s) * Media-related values: * `media-play`: Start/resume watching a video, * playing a song, etc. * `media-complete`: Finished or stopped midway through * a video, song, etc. Custom conversion value: * `conversion`: Customer * defined conversion event. */ eventType?: string; /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the documents being filtered. One * example is for `search` events, the associated SearchRequest may contain a * filter expression in SearchRequest.filter conforming to * https://google.aip.dev/160#filtering. Similarly, for `view-item-list` * events that are generated from a RecommendRequest, this field may be * populated directly from RecommendRequest.filter conforming to * https://google.aip.dev/160#filtering. The value must be a UTF-8 encoded * string with a length limit of 1,000 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ filter?: string; /** * Media-specific info. */ mediaInfo?: GoogleCloudDiscoveryengineV1MediaInfo; /** * Page metadata such as categories and other critical information for * certain event types such as `view-category-page`. */ pageInfo?: GoogleCloudDiscoveryengineV1PageInfo; /** * Panel metadata associated with this user event. */ panel?: GoogleCloudDiscoveryengineV1PanelInfo; /** * Optional. List of panels associated with this event. Used for page-level * impression data. */ panels?: GoogleCloudDiscoveryengineV1PanelInfo[]; /** * The promotion IDs if this is an event associated with promotions. * Currently, this field is restricted to at most one ID. */ promotionIds?: string[]; /** * SearchService.Search details related to the event. This field should be * set for `search` event. */ searchInfo?: GoogleCloudDiscoveryengineV1SearchInfo; /** * A unique identifier for tracking a visitor session with a length limit of * 128 bytes. A session is an aggregation of an end user behavior in a time * span. A general guideline to populate the session_id: 1. If user has no * activity for 30 min, a new session_id should be assigned. 2. The session_id * should be unique across users, suggest use uuid or add * UserEvent.user_pseudo_id as prefix. */ sessionId?: string; /** * A list of identifiers for the independent experiment groups this user * event belongs to. This is used to distinguish between user events * associated with different experiment setups. */ tagIds?: string[]; /** * The transaction metadata (if any) associated with this user event. */ transactionInfo?: GoogleCloudDiscoveryengineV1TransactionInfo; /** * Information about the end user. */ userInfo?: GoogleCloudDiscoveryengineV1UserInfo; /** * Required. A unique identifier for tracking visitors. For example, this * could be implemented with an HTTP cookie, which should be able to uniquely * identify a visitor on a single device. This unique identifier should not * change if the visitor log in/out of the website. Do not set the field to * the same fixed ID for different users. This mixes the event history of * those users together, which results in degraded model quality. The field * must be a UTF-8 encoded string with a length limit of 128 characters. * Otherwise, an `INVALID_ARGUMENT` error is returned. The field should not * contain PII or user-data. We recommend to use Google Analytics [Client * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) * for this field. */ userPseudoId?: string; } function serializeGoogleCloudDiscoveryengineV1UserEvent(data: any): GoogleCloudDiscoveryengineV1UserEvent { return { ...data, eventTime: data["eventTime"] !== undefined ? data["eventTime"].toISOString() : undefined, mediaInfo: data["mediaInfo"] !== undefined ? serializeGoogleCloudDiscoveryengineV1MediaInfo(data["mediaInfo"]) : undefined, }; } function deserializeGoogleCloudDiscoveryengineV1UserEvent(data: any): GoogleCloudDiscoveryengineV1UserEvent { return { ...data, eventTime: data["eventTime"] !== undefined ? new Date(data["eventTime"]) : undefined, mediaInfo: data["mediaInfo"] !== undefined ? deserializeGoogleCloudDiscoveryengineV1MediaInfo(data["mediaInfo"]) : undefined, }; } /** * Information of an end user. */ export interface GoogleCloudDiscoveryengineV1UserInfo { /** * User agent as included in the HTTP header. The field must be a UTF-8 * encoded string with a length limit of 1,000 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. This should not be set when using the * client side event reporting with GTM or JavaScript tag in * UserEventService.CollectUserEvent or if UserEvent.direct_user_request is * set. */ userAgent?: string; /** * Highly recommended for logged-in users. Unique identifier for logged-in * user, such as a user name. Don't set for anonymous users. Always use a * hashed value for this ID. Don't set the field to the same fixed ID for * different users. This mixes the event history of those users together, * which results in degraded model quality. The field must be a UTF-8 encoded * string with a length limit of 128 characters. Otherwise, an * `INVALID_ARGUMENT` error is returned. */ userId?: string; } /** * Config to store data store type configuration for workspace data */ export interface GoogleCloudDiscoveryengineV1WorkspaceConfig { /** * Obfuscated Dasher customer ID. */ dasherCustomerId?: string; /** * Optional. The super admin email address for the workspace that will be * used for access token generation. For now we only use it for Native Google * Drive connector data ingestion. */ superAdminEmailAddress?: string; /** * Optional. The super admin service account for the workspace that will be * used for access token generation. For now we only use it for Native Google * Drive connector data ingestion. */ superAdminServiceAccount?: string; /** * The Google Workspace data source. */ type?: | "TYPE_UNSPECIFIED" | "GOOGLE_DRIVE" | "GOOGLE_MAIL" | "GOOGLE_SITES" | "GOOGLE_CALENDAR" | "GOOGLE_CHAT" | "GOOGLE_GROUPS" | "GOOGLE_KEEP"; } /** * The request message for Operations.CancelOperation. */ export interface GoogleLongrunningCancelOperationRequest { } /** * The response message for Operations.ListOperations. */ export interface GoogleLongrunningListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string; /** * A list of operations that matches the specified filter in the request. */ operations?: GoogleLongrunningOperation[]; } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface GoogleLongrunningOperation { /** * 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?: GoogleRpcStatus; /** * 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 }; } /** * A single data point in a time series. */ export interface GoogleMonitoringV3Point { /** * The time interval to which the data point applies. For `GAUGE` metrics, * the start time is optional, but if it is supplied, it must equal the end * time. For `DELTA` metrics, the start and end time should specify a non-zero * interval, with subsequent points specifying contiguous and non-overlapping * intervals. For `CUMULATIVE` metrics, the start and end time should specify * a non-zero interval, with subsequent points specifying the same start time * and increasing end times, until an event resets the cumulative value to * zero and sets a new start time for the following points. */ interval?: GoogleMonitoringV3TimeInterval; /** * The value of the data point. */ value?: GoogleMonitoringV3TypedValue; } function serializeGoogleMonitoringV3Point(data: any): GoogleMonitoringV3Point { return { ...data, interval: data["interval"] !== undefined ? serializeGoogleMonitoringV3TimeInterval(data["interval"]) : undefined, value: data["value"] !== undefined ? serializeGoogleMonitoringV3TypedValue(data["value"]) : undefined, }; } function deserializeGoogleMonitoringV3Point(data: any): GoogleMonitoringV3Point { return { ...data, interval: data["interval"] !== undefined ? deserializeGoogleMonitoringV3TimeInterval(data["interval"]) : undefined, value: data["value"] !== undefined ? deserializeGoogleMonitoringV3TypedValue(data["value"]) : undefined, }; } /** * A time interval extending just after a start time through an end time. If * the start time is the same as the end time, then the interval represents a * single point in time. */ export interface GoogleMonitoringV3TimeInterval { /** * Required. The end of the time interval. */ endTime?: Date; /** * Optional. The beginning of the time interval. The default value for the * start time is the end time. The start time must not be later than the end * time. */ startTime?: Date; } function serializeGoogleMonitoringV3TimeInterval(data: any): GoogleMonitoringV3TimeInterval { return { ...data, endTime: data["endTime"] !== undefined ? data["endTime"].toISOString() : undefined, startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined, }; } function deserializeGoogleMonitoringV3TimeInterval(data: any): GoogleMonitoringV3TimeInterval { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * A collection of data points that describes the time-varying values of a * metric. A time series is identified by a combination of a fully-specified * monitored resource and a fully-specified metric. This type is used for both * listing and creating time series. */ export interface GoogleMonitoringV3TimeSeries { /** * Input only. A detailed description of the time series that will be * associated with the google.api.MetricDescriptor for the metric. Once set, * this field cannot be changed through CreateTimeSeries. */ description?: string; /** * Output only. The associated monitored resource metadata. When reading a * time series, this field will include metadata labels that are explicitly * named in the reduction. When creating a time series, this field is ignored. */ metadata?: GoogleApiMonitoredResourceMetadata; /** * The associated metric. A fully-specified metric used to identify the time * series. */ metric?: GoogleApiMetric; /** * The metric kind of the time series. When listing time series, this metric * kind might be different from the metric kind of the associated metric if * this time series is an alignment or reduction of other time series. When * creating a time series, this field is optional. If present, it must be the * same as the metric kind of the associated metric. If the associated * metric's descriptor must be auto-created, then this field specifies the * metric kind of the new descriptor and must be either `GAUGE` (the default) * or `CUMULATIVE`. */ metricKind?: | "METRIC_KIND_UNSPECIFIED" | "GAUGE" | "DELTA" | "CUMULATIVE"; /** * The data points of this time series. When listing time series, points are * returned in reverse time order. When creating a time series, this field * must contain exactly one point and the point's type must be the same as the * value type of the associated metric. If the associated metric's descriptor * must be auto-created, then the value type of the descriptor is determined * by the point's type, which must be `BOOL`, `INT64`, `DOUBLE`, or * `DISTRIBUTION`. */ points?: GoogleMonitoringV3Point[]; /** * The associated monitored resource. Custom metrics can use only certain * monitored resource types in their time series data. For more information, * see [Monitored resources for custom * metrics](https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). */ resource?: GoogleApiMonitoredResource; /** * The units in which the metric value is reported. It is only applicable if * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. This field can only * be changed through CreateTimeSeries when it is empty. */ unit?: string; /** * The value type of the time series. When listing time series, this value * type might be different from the value type of the associated metric if * this time series is an alignment or reduction of other time series. When * creating a time series, this field is optional. If present, it must be the * same as the type of the data in the `points` field. */ valueType?: | "VALUE_TYPE_UNSPECIFIED" | "BOOL" | "INT64" | "DOUBLE" | "STRING" | "DISTRIBUTION" | "MONEY"; } function serializeGoogleMonitoringV3TimeSeries(data: any): GoogleMonitoringV3TimeSeries { return { ...data, points: data["points"] !== undefined ? data["points"].map((item: any) => (serializeGoogleMonitoringV3Point(item))) : undefined, }; } function deserializeGoogleMonitoringV3TimeSeries(data: any): GoogleMonitoringV3TimeSeries { return { ...data, points: data["points"] !== undefined ? data["points"].map((item: any) => (deserializeGoogleMonitoringV3Point(item))) : undefined, }; } /** * A single strongly-typed value. */ export interface GoogleMonitoringV3TypedValue { /** * A Boolean value: `true` or `false`. */ boolValue?: boolean; /** * A distribution value. */ distributionValue?: GoogleApiDistribution; /** * A 64-bit double-precision floating-point number. Its magnitude is * approximately ±10±300 and it has 16 significant digits of precision. */ doubleValue?: number; /** * A 64-bit integer. Its range is approximately ±9.2x1018. */ int64Value?: bigint; /** * A variable-length string value. */ stringValue?: string; } function serializeGoogleMonitoringV3TypedValue(data: any): GoogleMonitoringV3TypedValue { return { ...data, distributionValue: data["distributionValue"] !== undefined ? serializeGoogleApiDistribution(data["distributionValue"]) : undefined, int64Value: data["int64Value"] !== undefined ? String(data["int64Value"]) : undefined, }; } function deserializeGoogleMonitoringV3TypedValue(data: any): GoogleMonitoringV3TypedValue { return { ...data, distributionValue: data["distributionValue"] !== undefined ? deserializeGoogleApiDistribution(data["distributionValue"]) : undefined, int64Value: data["int64Value"] !== undefined ? BigInt(data["int64Value"]) : undefined, }; } /** * 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 GoogleProtobufEmpty { } /** * 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 GoogleRpcStatus { /** * 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; } /** * Represents a whole or partial calendar date, such as a birthday. The time of * day and time zone are either specified elsewhere or are insignificant. The * date is relative to the Gregorian Calendar. This can represent one of the * following: * A full date, with non-zero year, month, and day values. * A * month and day, with a zero year (for example, an anniversary). * A year on * its own, with a zero month and a zero day. * A year and month, with a zero * day (for example, a credit card expiration date). Related types: * * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp */ export interface GoogleTypeDate { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or * 0 to specify a year by itself or a year and month where the day isn't * significant. */ day?: number; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a * month and day. */ month?: number; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a * year. */ year?: number; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataConnectorOperationsList. */ export interface ProjectsLocationsCollectionsDataConnectorOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresBranchesBatchGetDocumentsMetadata. */ export interface ProjectsLocationsCollectionsDataStoresBranchesBatchGetDocumentsMetadataOptions { /** * Required. The FHIR resources to match by. Format: * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} */ ["matcher.fhirMatcher.fhirResources"]?: string; /** * The exact URIs to match by. */ ["matcher.urisMatcher.uris"]?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresBranchesDocumentsCreate. */ export interface ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateOptions { /** * Required. The ID to use for the Document, which becomes the final * component of the Document.name. If the caller does not have permission to * create the Document, regardless of whether or not it exists, a * `PERMISSION_DENIED` error is returned. This field must be unique among all * Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is * returned. This field must conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. */ documentId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresBranchesDocumentsList. */ export interface ProjectsLocationsCollectionsDataStoresBranchesDocumentsListOptions { /** * Maximum number of Documents to return. If unspecified, defaults to 100. * The maximum allowed value is 1000. Values above 1000 are set to 1000. If * this field is negative, an `INVALID_ARGUMENT` error is returned. */ pageSize?: number; /** * A page token ListDocumentsResponse.next_page_token, received from a * previous DocumentService.ListDocuments call. Provide this to retrieve the * subsequent page. When paginating, all other parameters provided to * DocumentService.ListDocuments must match the call that provided the page * token. Otherwise, an `INVALID_ARGUMENT` error is returned. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresBranchesDocumentsPatch. */ export interface ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchOptions { /** * If set to `true` and the Document is not found, a new Document is be * created. */ allowMissing?: boolean; /** * Indicates which fields in the provided imported 'document' to update. If * not set, by default updates all fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresBranchesOperationsList. */ export interface ProjectsLocationsCollectionsDataStoresBranchesOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresCompleteQuery. */ export interface ProjectsLocationsCollectionsDataStoresCompleteQueryOptions { /** * Indicates if tail suggestions should be returned if there are no * suggestions that match the full query. Even if set to true, if there are * suggestions that match the full query, those are returned and no tail * suggestions are returned. */ includeTailSuggestions?: boolean; /** * Required. The typeahead input used to fetch suggestions. Maximum length is * 128 characters. */ query?: string; /** * Specifies the autocomplete data model. This overrides any model specified * in the Configuration > Autocomplete section of the Cloud console. Currently * supported values: * `document` - Using suggestions generated from * user-imported documents. * `search-history` - Using suggestions generated * from the past history of SearchService.Search API calls. Do not use it when * there is no traffic for Search API. * `user-event` - Using suggestions * generated from user-imported search events. * `document-completable` - * Using suggestions taken directly from user-imported document fields marked * as completable. Default values: * `document` is the default model for * regular dataStores. * `search-history` is the default model for site search * dataStores. */ queryModel?: string; /** * A unique identifier for tracking visitors. For example, this could be * implemented with an HTTP cookie, which should be able to uniquely identify * a visitor on a single device. This unique identifier should not change if * the visitor logs in or out of the website. This field should NOT have a * fixed value such as `unknown_visitor`. This should be the same identifier * as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field * must be a UTF-8 encoded string with a length limit of 128 characters. * Otherwise, an `INVALID_ARGUMENT` error is returned. */ userPseudoId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresControlsCreate. */ export interface ProjectsLocationsCollectionsDataStoresControlsCreateOptions { /** * Required. The ID to use for the Control, which will become the final * component of the Control's resource name. This value must be within 1-63 * characters. Valid characters are /a-z-_/. */ controlId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresControlsList. */ export interface ProjectsLocationsCollectionsDataStoresControlsListOptions { /** * Optional. A filter to apply on the list results. Supported features: * * List all the products under the parent branch if filter is unset. Currently * this field is unsupported. */ filter?: string; /** * Optional. Maximum number of results to return. If unspecified, defaults to * 50. Max allowed value is 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListControls` call. * Provide this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresControlsPatch. */ export interface ProjectsLocationsCollectionsDataStoresControlsPatchOptions { /** * Optional. Indicates which fields in the provided Control to update. The * following are NOT supported: * Control.name * Control.solution_type If not * set or empty, all supported fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsDataStoresControlsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresControlsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsDataStoresControlsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresControlsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresConversationsList. */ export interface ProjectsLocationsCollectionsDataStoresConversationsListOptions { /** * A filter to apply on the list results. The supported features are: * user_pseudo_id, state. Example: "user_pseudo_id = some_id" */ filter?: string; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. Supported fields: * * `update_time` * `create_time` * `conversation_name` Example: "update_time * desc" "create_time" */ orderBy?: string; /** * Maximum number of results to return. If unspecified, defaults to 50. Max * allowed value is 1000. */ pageSize?: number; /** * A page token, received from a previous `ListConversations` call. Provide * this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresConversationsPatch. */ export interface ProjectsLocationsCollectionsDataStoresConversationsPatchOptions { /** * Indicates which fields in the provided Conversation to update. The * following are NOT supported: * Conversation.name If not set or empty, all * supported fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsDataStoresConversationsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresConversationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsDataStoresConversationsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresConversationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresCreate. */ export interface ProjectsLocationsCollectionsDataStoresCreateOptions { /** * Resource name of the CmekConfig to use for protecting this DataStore. */ cmekConfigName?: string; /** * A boolean flag indicating whether user want to directly create an advanced * data store for site search. If the data store is not configured as site * search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will * be ignored. */ createAdvancedSiteSearch?: boolean; /** * Required. The ID to use for the DataStore, which will become the final * component of the DataStore's resource name. This field must conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned. */ dataStoreId?: string; /** * DataStore without CMEK protections. If a default CmekConfig is set for the * project, setting this field will override the default CmekConfig as well. */ disableCmek?: boolean; /** * A boolean flag indicating whether to skip the default schema creation for * the data store. Only enable this flag if you are certain that the default * schema is incompatible with your use case. If set to true, you must * manually create a schema for the data store before any documents can be * ingested. This flag cannot be specified if `data_store.starting_schema` is * specified. */ skipDefaultSchemaCreation?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresList. */ export interface ProjectsLocationsCollectionsDataStoresListOptions { /** * Filter by solution type . For example: `filter = * 'solution_type:SOLUTION_TYPE_SEARCH'` */ filter?: string; /** * Maximum number of DataStores to return. If unspecified, defaults to 10. * The maximum allowed value is 50. Values above 50 will be coerced to 50. If * this field is negative, an INVALID_ARGUMENT is returned. */ pageSize?: number; /** * A page token ListDataStoresResponse.next_page_token, received from a * previous DataStoreService.ListDataStores call. Provide this to retrieve the * subsequent page. When paginating, all other parameters provided to * DataStoreService.ListDataStores must match the call that provided the page * token. Otherwise, an INVALID_ARGUMENT error is returned. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresModelsOperationsList. */ export interface ProjectsLocationsCollectionsDataStoresModelsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresOperationsList. */ export interface ProjectsLocationsCollectionsDataStoresOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresPatch. */ export interface ProjectsLocationsCollectionsDataStoresPatchOptions { /** * Indicates which fields in the provided DataStore to update. If an * unsupported or unknown field is provided, an INVALID_ARGUMENT error is * returned. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsDataStoresPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsDataStoresPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSchemasCreate. */ export interface ProjectsLocationsCollectionsDataStoresSchemasCreateOptions { /** * Required. The ID to use for the Schema, which becomes the final component * of the Schema.name. This field should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. */ schemaId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSchemasList. */ export interface ProjectsLocationsCollectionsDataStoresSchemasListOptions { /** * The maximum number of Schemas to return. The service may return fewer than * this value. If unspecified, at most 100 Schemas are returned. The maximum * value is 1000; values above 1000 are set to 1000. */ pageSize?: number; /** * A page token, received from a previous SchemaService.ListSchemas call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to SchemaService.ListSchemas must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSchemasOperationsList. */ export interface ProjectsLocationsCollectionsDataStoresSchemasOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSchemasPatch. */ export interface ProjectsLocationsCollectionsDataStoresSchemasPatchOptions { /** * If set to true, and the Schema is not found, a new Schema is created. In * this situation, `update_mask` is ignored. */ allowMissing?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresServingConfigsPatch. */ export interface ProjectsLocationsCollectionsDataStoresServingConfigsPatchOptions { /** * Indicates which fields in the provided ServingConfig to update. The * following are NOT supported: * ServingConfig.name If not set, all supported * fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsDataStoresServingConfigsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresServingConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsDataStoresServingConfigsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresServingConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSessionsGet. */ export interface ProjectsLocationsCollectionsDataStoresSessionsGetOptions { /** * Optional. If set to true, the full session including all answer details * will be returned. */ includeAnswerDetails?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSessionsList. */ export interface ProjectsLocationsCollectionsDataStoresSessionsListOptions { /** * A filter to apply on the list results. The supported features are: * user_pseudo_id, state. Example: "user_pseudo_id = some_id" */ filter?: string; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. Supported fields: * * `update_time` * `create_time` * `session_name` Example: "update_time desc" * "create_time" */ orderBy?: string; /** * Maximum number of results to return. If unspecified, defaults to 50. Max * allowed value is 1000. */ pageSize?: number; /** * A page token, received from a previous `ListSessions` call. Provide this * to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSessionsPatch. */ export interface ProjectsLocationsCollectionsDataStoresSessionsPatchOptions { /** * Indicates which fields in the provided Session to update. The following * are NOT supported: * Session.name If not set or empty, all supported fields * are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsDataStoresSessionsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresSessionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsDataStoresSessionsPatchOptions(data: any): ProjectsLocationsCollectionsDataStoresSessionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSiteSearchEngineFetchDomainVerificationStatus. */ export interface ProjectsLocationsCollectionsDataStoresSiteSearchEngineFetchDomainVerificationStatusOptions { /** * Requested page size. Server may return fewer items than requested. If * unspecified, server will pick an appropriate default. The maximum value is * 1000; values above 1000 will be coerced to 1000. If this field is negative, * an INVALID_ARGUMENT error is returned. */ pageSize?: number; /** * A page token, received from a previous `FetchDomainVerificationStatus` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `FetchDomainVerificationStatus` must match the * call that provided the page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSiteSearchEngineOperationsList. */ export interface ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesList. */ export interface ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesListOptions { /** * Requested page size. Server may return fewer items than requested. If * unspecified, server will pick an appropriate default. The maximum value is * 1000; values above 1000 will be coerced to 1000. If this field is negative, * an INVALID_ARGUMENT error is returned. */ pageSize?: number; /** * A page token, received from a previous `ListTargetSites` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters * provided to `ListTargetSites` must match the call that provided the page * token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsList. */ export interface ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresUserEventsCollect. */ export interface ProjectsLocationsCollectionsDataStoresUserEventsCollectOptions { /** * The event timestamp in milliseconds. This prevents browser caching of * otherwise identical get requests. The name is abbreviated to reduce the * payload bytes. */ ets?: bigint; /** * The URL including cgi-parameters but excluding the hash fragment with a * length limit of 5,000 characters. This is often more useful than the * referer URL, because many browsers only send the domain for third-party * requests. */ uri?: string; /** * Required. URL encoded UserEvent proto with a length limit of 2,000,000 * characters. */ userEvent?: string; } function serializeProjectsLocationsCollectionsDataStoresUserEventsCollectOptions(data: any): ProjectsLocationsCollectionsDataStoresUserEventsCollectOptions { return { ...data, ets: data["ets"] !== undefined ? String(data["ets"]) : undefined, }; } function deserializeProjectsLocationsCollectionsDataStoresUserEventsCollectOptions(data: any): ProjectsLocationsCollectionsDataStoresUserEventsCollectOptions { return { ...data, ets: data["ets"] !== undefined ? BigInt(data["ets"]) : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsDataStoresUserEventsWrite. */ export interface ProjectsLocationsCollectionsDataStoresUserEventsWriteOptions { /** * If set to true, the user event is written asynchronously after validation, * and the API responds without waiting for the write. */ writeAsync?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesControlsCreate. */ export interface ProjectsLocationsCollectionsEnginesControlsCreateOptions { /** * Required. The ID to use for the Control, which will become the final * component of the Control's resource name. This value must be within 1-63 * characters. Valid characters are /a-z-_/. */ controlId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesControlsList. */ export interface ProjectsLocationsCollectionsEnginesControlsListOptions { /** * Optional. A filter to apply on the list results. Supported features: * * List all the products under the parent branch if filter is unset. Currently * this field is unsupported. */ filter?: string; /** * Optional. Maximum number of results to return. If unspecified, defaults to * 50. Max allowed value is 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListControls` call. * Provide this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesControlsPatch. */ export interface ProjectsLocationsCollectionsEnginesControlsPatchOptions { /** * Optional. Indicates which fields in the provided Control to update. The * following are NOT supported: * Control.name * Control.solution_type If not * set or empty, all supported fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsEnginesControlsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesControlsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsEnginesControlsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesControlsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesConversationsList. */ export interface ProjectsLocationsCollectionsEnginesConversationsListOptions { /** * A filter to apply on the list results. The supported features are: * user_pseudo_id, state. Example: "user_pseudo_id = some_id" */ filter?: string; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. Supported fields: * * `update_time` * `create_time` * `conversation_name` Example: "update_time * desc" "create_time" */ orderBy?: string; /** * Maximum number of results to return. If unspecified, defaults to 50. Max * allowed value is 1000. */ pageSize?: number; /** * A page token, received from a previous `ListConversations` call. Provide * this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesConversationsPatch. */ export interface ProjectsLocationsCollectionsEnginesConversationsPatchOptions { /** * Indicates which fields in the provided Conversation to update. The * following are NOT supported: * Conversation.name If not set or empty, all * supported fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsEnginesConversationsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesConversationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsEnginesConversationsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesConversationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesCreate. */ export interface ProjectsLocationsCollectionsEnginesCreateOptions { /** * Required. The ID to use for the Engine, which will become the final * component of the Engine's resource name. This field must conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned. */ engineId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesList. */ export interface ProjectsLocationsCollectionsEnginesListOptions { /** * Optional. Filter by solution type. For example: * solution_type=SOLUTION_TYPE_SEARCH */ filter?: string; /** * Optional. Not supported. */ pageSize?: number; /** * Optional. Not supported. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesOperationsList. */ export interface ProjectsLocationsCollectionsEnginesOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesPatch. */ export interface ProjectsLocationsCollectionsEnginesPatchOptions { /** * Indicates which fields in the provided Engine to update. If an unsupported * or unknown field is provided, an INVALID_ARGUMENT error is returned. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsEnginesPatchOptions(data: any): ProjectsLocationsCollectionsEnginesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsEnginesPatchOptions(data: any): ProjectsLocationsCollectionsEnginesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesServingConfigsPatch. */ export interface ProjectsLocationsCollectionsEnginesServingConfigsPatchOptions { /** * Indicates which fields in the provided ServingConfig to update. The * following are NOT supported: * ServingConfig.name If not set, all supported * fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsEnginesServingConfigsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesServingConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsEnginesServingConfigsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesServingConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesSessionsGet. */ export interface ProjectsLocationsCollectionsEnginesSessionsGetOptions { /** * Optional. If set to true, the full session including all answer details * will be returned. */ includeAnswerDetails?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesSessionsList. */ export interface ProjectsLocationsCollectionsEnginesSessionsListOptions { /** * A filter to apply on the list results. The supported features are: * user_pseudo_id, state. Example: "user_pseudo_id = some_id" */ filter?: string; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. Supported fields: * * `update_time` * `create_time` * `session_name` Example: "update_time desc" * "create_time" */ orderBy?: string; /** * Maximum number of results to return. If unspecified, defaults to 50. Max * allowed value is 1000. */ pageSize?: number; /** * A page token, received from a previous `ListSessions` call. Provide this * to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsEnginesSessionsPatch. */ export interface ProjectsLocationsCollectionsEnginesSessionsPatchOptions { /** * Indicates which fields in the provided Session to update. The following * are NOT supported: * Session.name If not set or empty, all supported fields * are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsCollectionsEnginesSessionsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesSessionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsCollectionsEnginesSessionsPatchOptions(data: any): ProjectsLocationsCollectionsEnginesSessionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsCollectionsOperationsList. */ export interface ProjectsLocationsCollectionsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresBranchesBatchGetDocumentsMetadata. */ export interface ProjectsLocationsDataStoresBranchesBatchGetDocumentsMetadataOptions { /** * Required. The FHIR resources to match by. Format: * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} */ ["matcher.fhirMatcher.fhirResources"]?: string; /** * The exact URIs to match by. */ ["matcher.urisMatcher.uris"]?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresBranchesDocumentsCreate. */ export interface ProjectsLocationsDataStoresBranchesDocumentsCreateOptions { /** * Required. The ID to use for the Document, which becomes the final * component of the Document.name. If the caller does not have permission to * create the Document, regardless of whether or not it exists, a * `PERMISSION_DENIED` error is returned. This field must be unique among all * Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is * returned. This field must conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. */ documentId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresBranchesDocumentsList. */ export interface ProjectsLocationsDataStoresBranchesDocumentsListOptions { /** * Maximum number of Documents to return. If unspecified, defaults to 100. * The maximum allowed value is 1000. Values above 1000 are set to 1000. If * this field is negative, an `INVALID_ARGUMENT` error is returned. */ pageSize?: number; /** * A page token ListDocumentsResponse.next_page_token, received from a * previous DocumentService.ListDocuments call. Provide this to retrieve the * subsequent page. When paginating, all other parameters provided to * DocumentService.ListDocuments must match the call that provided the page * token. Otherwise, an `INVALID_ARGUMENT` error is returned. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresBranchesDocumentsPatch. */ export interface ProjectsLocationsDataStoresBranchesDocumentsPatchOptions { /** * If set to `true` and the Document is not found, a new Document is be * created. */ allowMissing?: boolean; /** * Indicates which fields in the provided imported 'document' to update. If * not set, by default updates all fields. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataStoresBranchesDocumentsPatchOptions(data: any): ProjectsLocationsDataStoresBranchesDocumentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataStoresBranchesDocumentsPatchOptions(data: any): ProjectsLocationsDataStoresBranchesDocumentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresBranchesOperationsList. */ export interface ProjectsLocationsDataStoresBranchesOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresCompleteQuery. */ export interface ProjectsLocationsDataStoresCompleteQueryOptions { /** * Indicates if tail suggestions should be returned if there are no * suggestions that match the full query. Even if set to true, if there are * suggestions that match the full query, those are returned and no tail * suggestions are returned. */ includeTailSuggestions?: boolean; /** * Required. The typeahead input used to fetch suggestions. Maximum length is * 128 characters. */ query?: string; /** * Specifies the autocomplete data model. This overrides any model specified * in the Configuration > Autocomplete section of the Cloud console. Currently * supported values: * `document` - Using suggestions generated from * user-imported documents. * `search-history` - Using suggestions generated * from the past history of SearchService.Search API calls. Do not use it when * there is no traffic for Search API. * `user-event` - Using suggestions * generated from user-imported search events. * `document-completable` - * Using suggestions taken directly from user-imported document fields marked * as completable. Default values: * `document` is the default model for * regular dataStores. * `search-history` is the default model for site search * dataStores. */ queryModel?: string; /** * A unique identifier for tracking visitors. For example, this could be * implemented with an HTTP cookie, which should be able to uniquely identify * a visitor on a single device. This unique identifier should not change if * the visitor logs in or out of the website. This field should NOT have a * fixed value such as `unknown_visitor`. This should be the same identifier * as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field * must be a UTF-8 encoded string with a length limit of 128 characters. * Otherwise, an `INVALID_ARGUMENT` error is returned. */ userPseudoId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresControlsCreate. */ export interface ProjectsLocationsDataStoresControlsCreateOptions { /** * Required. The ID to use for the Control, which will become the final * component of the Control's resource name. This value must be within 1-63 * characters. Valid characters are /a-z-_/. */ controlId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresControlsList. */ export interface ProjectsLocationsDataStoresControlsListOptions { /** * Optional. A filter to apply on the list results. Supported features: * * List all the products under the parent branch if filter is unset. Currently * this field is unsupported. */ filter?: string; /** * Optional. Maximum number of results to return. If unspecified, defaults to * 50. Max allowed value is 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListControls` call. * Provide this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresControlsPatch. */ export interface ProjectsLocationsDataStoresControlsPatchOptions { /** * Optional. Indicates which fields in the provided Control to update. The * following are NOT supported: * Control.name * Control.solution_type If not * set or empty, all supported fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataStoresControlsPatchOptions(data: any): ProjectsLocationsDataStoresControlsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataStoresControlsPatchOptions(data: any): ProjectsLocationsDataStoresControlsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresConversationsList. */ export interface ProjectsLocationsDataStoresConversationsListOptions { /** * A filter to apply on the list results. The supported features are: * user_pseudo_id, state. Example: "user_pseudo_id = some_id" */ filter?: string; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. Supported fields: * * `update_time` * `create_time` * `conversation_name` Example: "update_time * desc" "create_time" */ orderBy?: string; /** * Maximum number of results to return. If unspecified, defaults to 50. Max * allowed value is 1000. */ pageSize?: number; /** * A page token, received from a previous `ListConversations` call. Provide * this to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresConversationsPatch. */ export interface ProjectsLocationsDataStoresConversationsPatchOptions { /** * Indicates which fields in the provided Conversation to update. The * following are NOT supported: * Conversation.name If not set or empty, all * supported fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataStoresConversationsPatchOptions(data: any): ProjectsLocationsDataStoresConversationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataStoresConversationsPatchOptions(data: any): ProjectsLocationsDataStoresConversationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for DiscoveryEngine#projectsLocationsDataStoresCreate. */ export interface ProjectsLocationsDataStoresCreateOptions { /** * Resource name of the CmekConfig to use for protecting this DataStore. */ cmekConfigName?: string; /** * A boolean flag indicating whether user want to directly create an advanced * data store for site search. If the data store is not configured as site * search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will * be ignored. */ createAdvancedSiteSearch?: boolean; /** * Required. The ID to use for the DataStore, which will become the final * component of the DataStore's resource name. This field must conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned. */ dataStoreId?: string; /** * DataStore without CMEK protections. If a default CmekConfig is set for the * project, setting this field will override the default CmekConfig as well. */ disableCmek?: boolean; /** * A boolean flag indicating whether to skip the default schema creation for * the data store. Only enable this flag if you are certain that the default * schema is incompatible with your use case. If set to true, you must * manually create a schema for the data store before any documents can be * ingested. This flag cannot be specified if `data_store.starting_schema` is * specified. */ skipDefaultSchemaCreation?: boolean; } /** * Additional options for DiscoveryEngine#projectsLocationsDataStoresList. */ export interface ProjectsLocationsDataStoresListOptions { /** * Filter by solution type . For example: `filter = * 'solution_type:SOLUTION_TYPE_SEARCH'` */ filter?: string; /** * Maximum number of DataStores to return. If unspecified, defaults to 10. * The maximum allowed value is 50. Values above 50 will be coerced to 50. If * this field is negative, an INVALID_ARGUMENT is returned. */ pageSize?: number; /** * A page token ListDataStoresResponse.next_page_token, received from a * previous DataStoreService.ListDataStores call. Provide this to retrieve the * subsequent page. When paginating, all other parameters provided to * DataStoreService.ListDataStores must match the call that provided the page * token. Otherwise, an INVALID_ARGUMENT error is returned. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresModelsOperationsList. */ export interface ProjectsLocationsDataStoresModelsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresOperationsList. */ export interface ProjectsLocationsDataStoresOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for DiscoveryEngine#projectsLocationsDataStoresPatch. */ export interface ProjectsLocationsDataStoresPatchOptions { /** * Indicates which fields in the provided DataStore to update. If an * unsupported or unknown field is provided, an INVALID_ARGUMENT error is * returned. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataStoresPatchOptions(data: any): ProjectsLocationsDataStoresPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataStoresPatchOptions(data: any): ProjectsLocationsDataStoresPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresSchemasCreate. */ export interface ProjectsLocationsDataStoresSchemasCreateOptions { /** * Required. The ID to use for the Schema, which becomes the final component * of the Schema.name. This field should conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length * limit of 63 characters. */ schemaId?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresSchemasList. */ export interface ProjectsLocationsDataStoresSchemasListOptions { /** * The maximum number of Schemas to return. The service may return fewer than * this value. If unspecified, at most 100 Schemas are returned. The maximum * value is 1000; values above 1000 are set to 1000. */ pageSize?: number; /** * A page token, received from a previous SchemaService.ListSchemas call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to SchemaService.ListSchemas must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresSchemasPatch. */ export interface ProjectsLocationsDataStoresSchemasPatchOptions { /** * If set to true, and the Schema is not found, a new Schema is created. In * this situation, `update_mask` is ignored. */ allowMissing?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresServingConfigsPatch. */ export interface ProjectsLocationsDataStoresServingConfigsPatchOptions { /** * Indicates which fields in the provided ServingConfig to update. The * following are NOT supported: * ServingConfig.name If not set, all supported * fields are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataStoresServingConfigsPatchOptions(data: any): ProjectsLocationsDataStoresServingConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataStoresServingConfigsPatchOptions(data: any): ProjectsLocationsDataStoresServingConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresSessionsGet. */ export interface ProjectsLocationsDataStoresSessionsGetOptions { /** * Optional. If set to true, the full session including all answer details * will be returned. */ includeAnswerDetails?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresSessionsList. */ export interface ProjectsLocationsDataStoresSessionsListOptions { /** * A filter to apply on the list results. The supported features are: * user_pseudo_id, state. Example: "user_pseudo_id = some_id" */ filter?: string; /** * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. Supported fields: * * `update_time` * `create_time` * `session_name` Example: "update_time desc" * "create_time" */ orderBy?: string; /** * Maximum number of results to return. If unspecified, defaults to 50. Max * allowed value is 1000. */ pageSize?: number; /** * A page token, received from a previous `ListSessions` call. Provide this * to retrieve the subsequent page. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresSessionsPatch. */ export interface ProjectsLocationsDataStoresSessionsPatchOptions { /** * Indicates which fields in the provided Session to update. The following * are NOT supported: * Session.name If not set or empty, all supported fields * are updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsDataStoresSessionsPatchOptions(data: any): ProjectsLocationsDataStoresSessionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsDataStoresSessionsPatchOptions(data: any): ProjectsLocationsDataStoresSessionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresSiteSearchEngineTargetSitesList. */ export interface ProjectsLocationsDataStoresSiteSearchEngineTargetSitesListOptions { /** * Requested page size. Server may return fewer items than requested. If * unspecified, server will pick an appropriate default. The maximum value is * 1000; values above 1000 will be coerced to 1000. If this field is negative, * an INVALID_ARGUMENT error is returned. */ pageSize?: number; /** * A page token, received from a previous `ListTargetSites` call. Provide * this to retrieve the subsequent page. When paginating, all other parameters * provided to `ListTargetSites` must match the call that provided the page * token. */ pageToken?: string; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresUserEventsCollect. */ export interface ProjectsLocationsDataStoresUserEventsCollectOptions { /** * The event timestamp in milliseconds. This prevents browser caching of * otherwise identical get requests. The name is abbreviated to reduce the * payload bytes. */ ets?: bigint; /** * The URL including cgi-parameters but excluding the hash fragment with a * length limit of 5,000 characters. This is often more useful than the * referer URL, because many browsers only send the domain for third-party * requests. */ uri?: string; /** * Required. URL encoded UserEvent proto with a length limit of 2,000,000 * characters. */ userEvent?: string; } function serializeProjectsLocationsDataStoresUserEventsCollectOptions(data: any): ProjectsLocationsDataStoresUserEventsCollectOptions { return { ...data, ets: data["ets"] !== undefined ? String(data["ets"]) : undefined, }; } function deserializeProjectsLocationsDataStoresUserEventsCollectOptions(data: any): ProjectsLocationsDataStoresUserEventsCollectOptions { return { ...data, ets: data["ets"] !== undefined ? BigInt(data["ets"]) : undefined, }; } /** * Additional options for * DiscoveryEngine#projectsLocationsDataStoresUserEventsWrite. */ export interface ProjectsLocationsDataStoresUserEventsWriteOptions { /** * If set to true, the user event is written asynchronously after validation, * and the API responds without waiting for the write. */ writeAsync?: boolean; } /** * Additional options for * DiscoveryEngine#projectsLocationsIdentityMappingStoresOperationsList. */ export interface ProjectsLocationsIdentityMappingStoresOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for DiscoveryEngine#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } /** * Additional options for DiscoveryEngine#projectsLocationsUserEventsCollect. */ export interface ProjectsLocationsUserEventsCollectOptions { /** * The event timestamp in milliseconds. This prevents browser caching of * otherwise identical get requests. The name is abbreviated to reduce the * payload bytes. */ ets?: bigint; /** * The URL including cgi-parameters but excluding the hash fragment with a * length limit of 5,000 characters. This is often more useful than the * referer URL, because many browsers only send the domain for third-party * requests. */ uri?: string; /** * Required. URL encoded UserEvent proto with a length limit of 2,000,000 * characters. */ userEvent?: string; } function serializeProjectsLocationsUserEventsCollectOptions(data: any): ProjectsLocationsUserEventsCollectOptions { return { ...data, ets: data["ets"] !== undefined ? String(data["ets"]) : undefined, }; } function deserializeProjectsLocationsUserEventsCollectOptions(data: any): ProjectsLocationsUserEventsCollectOptions { return { ...data, ets: data["ets"] !== undefined ? BigInt(data["ets"]) : undefined, }; } /** * Additional options for DiscoveryEngine#projectsLocationsUserEventsWrite. */ export interface ProjectsLocationsUserEventsWriteOptions { /** * If set to true, the user event is written asynchronously after validation, * and the API responds without waiting for the write. */ writeAsync?: boolean; } /** * Additional options for DiscoveryEngine#projectsOperationsList. */ export interface ProjectsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: 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; }