@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
224 lines • 9.57 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatEngine = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(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}}
* $ pulumi import gcp:discoveryengine/chatEngine:ChatEngine default {{project}}/{{location}}/{{collection_id}}/{{engine_id}}
* $ 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 });
}
/** @internal */
static __pulumiType = 'gcp:discoveryengine/chatEngine:ChatEngine';
/**
* 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["deletionPolicy"] = state?.deletionPolicy;
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["deletionPolicy"] = args?.deletionPolicy;
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;
//# sourceMappingURL=chatEngine.js.map