UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

207 lines • 8.42 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ChatEngine = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Vertex chat and Conversation Engine Chat type * * To get more information about ChatEngine, see: * * * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines) * * How-to Guides * * [Vertex AI Conversation](https://cloud.google.com/dialogflow/cx/docs/concept/generative) * * ## Example Usage * * ### Discoveryengine Chat Engine Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const testDataStore = new gcp.discoveryengine.DataStore("test_data_store", { * location: "global", * dataStoreId: "data-store", * displayName: "Structured datastore", * industryVertical: "GENERIC", * contentConfig: "NO_CONTENT", * solutionTypes: ["SOLUTION_TYPE_CHAT"], * }); * const testDataStore2 = new gcp.discoveryengine.DataStore("test_data_store_2", { * location: testDataStore.location, * dataStoreId: "data-store-2", * displayName: "Structured datastore 2", * industryVertical: "GENERIC", * contentConfig: "NO_CONTENT", * solutionTypes: ["SOLUTION_TYPE_CHAT"], * }); * const primary = new gcp.discoveryengine.ChatEngine("primary", { * engineId: "chat-engine-id", * collectionId: "default_collection", * location: testDataStore.location, * displayName: "Chat engine", * industryVertical: "GENERIC", * dataStoreIds: [ * testDataStore.dataStoreId, * testDataStore2.dataStoreId, * ], * commonConfig: { * companyName: "test-company", * }, * chatEngineConfig: { * agentCreationConfig: { * business: "test business name", * defaultLanguageCode: "en", * timeZone: "America/Los_Angeles", * }, * }, * }); * ``` * ### Discoveryengine Chat Engine Existing Dialogflow Agent * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const testDataStore = new gcp.discoveryengine.DataStore("test_data_store", { * location: "eu", * dataStoreId: "data-store", * displayName: "Structured datastore", * industryVertical: "GENERIC", * contentConfig: "NO_CONTENT", * solutionTypes: ["SOLUTION_TYPE_CHAT"], * }); * const agent = new gcp.diagflow.CxAgent("agent", { * displayName: "dialogflowcx-agent", * location: "europe-west3", * defaultLanguageCode: "en", * timeZone: "America/Los_Angeles", * }); * const primary = new gcp.discoveryengine.ChatEngine("primary", { * engineId: "chat-engine-id", * collectionId: "default_collection", * location: testDataStore.location, * displayName: "Chat engine", * industryVertical: "GENERIC", * dataStoreIds: [testDataStore.dataStoreId], * commonConfig: { * companyName: "test-company", * }, * chatEngineConfig: { * dialogflowAgentToLink: agent.id, * allowCrossRegion: true, * }, * }); * ``` * * ## Import * * ChatEngine can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}` * * * `{{project}}/{{location}}/{{collection_id}}/{{engine_id}}` * * * `{{location}}/{{collection_id}}/{{engine_id}}` * * When using the `pulumi import` command, ChatEngine can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:discoveryengine/chatEngine:ChatEngine default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}} * ``` * * ```sh * $ pulumi import gcp:discoveryengine/chatEngine:ChatEngine default {{project}}/{{location}}/{{collection_id}}/{{engine_id}} * ``` * * ```sh * $ pulumi import gcp:discoveryengine/chatEngine:ChatEngine default {{location}}/{{collection_id}}/{{engine_id}} * ``` */ class ChatEngine extends pulumi.CustomResource { /** * Get an existing ChatEngine resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new ChatEngine(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ChatEngine. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ChatEngine.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["chatEngineConfig"] = state?.chatEngineConfig; resourceInputs["chatEngineMetadatas"] = state?.chatEngineMetadatas; resourceInputs["collectionId"] = state?.collectionId; resourceInputs["commonConfig"] = state?.commonConfig; resourceInputs["createTime"] = state?.createTime; resourceInputs["dataStoreIds"] = state?.dataStoreIds; resourceInputs["displayName"] = state?.displayName; resourceInputs["engineId"] = state?.engineId; resourceInputs["industryVertical"] = state?.industryVertical; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.chatEngineConfig === undefined && !opts.urn) { throw new Error("Missing required property 'chatEngineConfig'"); } if (args?.collectionId === undefined && !opts.urn) { throw new Error("Missing required property 'collectionId'"); } if (args?.dataStoreIds === undefined && !opts.urn) { throw new Error("Missing required property 'dataStoreIds'"); } if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.engineId === undefined && !opts.urn) { throw new Error("Missing required property 'engineId'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["chatEngineConfig"] = args?.chatEngineConfig; resourceInputs["collectionId"] = args?.collectionId; resourceInputs["commonConfig"] = args?.commonConfig; resourceInputs["dataStoreIds"] = args?.dataStoreIds; resourceInputs["displayName"] = args?.displayName; resourceInputs["engineId"] = args?.engineId; resourceInputs["industryVertical"] = args?.industryVertical; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["chatEngineMetadatas"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ChatEngine.__pulumiType, name, resourceInputs, opts); } } exports.ChatEngine = ChatEngine; /** @internal */ ChatEngine.__pulumiType = 'gcp:discoveryengine/chatEngine:ChatEngine'; //# sourceMappingURL=chatEngine.js.map