UNPKG

@pulumi/gcp

Version:

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

139 lines 5.85 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.CxGenerativeSettings = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Settings for Generative AI. * * To get more information about GenerativeSettings, see: * * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents/getGenerativeSettings) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs) * * ## Example Usage * * ### Dialogflowcx Generative Settings Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const agent = new gcp.diagflow.CxAgent("agent", { * displayName: "dialogflowcx-agent", * location: "global", * defaultLanguageCode: "en", * timeZone: "America/New_York", * description: "Example description.", * }); * const fullGenerativeSettings = new gcp.diagflow.CxGenerativeSettings("full_generative_settings", { * parent: agent.id, * fallbackSettings: { * selectedPrompt: "example prompt", * promptTemplates: [{ * displayName: "example prompt", * promptText: "example prompt text", * frozen: false, * }], * }, * generativeSafetySettings: { * defaultBannedPhraseMatchStrategy: "PARTIAL_MATCH", * bannedPhrases: [{ * text: "example text", * languageCode: "en", * }], * }, * knowledgeConnectorSettings: { * business: "example business", * agent: "example agent", * agentIdentity: "virtual agent", * businessDescription: "a family company selling freshly roasted coffee beans", * agentScope: "Example company website", * disableDataStoreFallback: false, * }, * languageCode: "en", * llmModelSettings: { * model: "gemini-2.0-flash-001", * promptText: "example prompt text", * }, * }); * ``` * * ## Import * * GenerativeSettings can be imported using any of these accepted formats: * * * `{{parent}}/generativeSettings` * * * `{{parent}}` * * When using the `pulumi import` command, GenerativeSettings can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:diagflow/cxGenerativeSettings:CxGenerativeSettings default {{parent}}/generativeSettings * ``` * * ```sh * $ pulumi import gcp:diagflow/cxGenerativeSettings:CxGenerativeSettings default {{parent}} * ``` */ class CxGenerativeSettings extends pulumi.CustomResource { /** * Get an existing CxGenerativeSettings 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 CxGenerativeSettings(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CxGenerativeSettings. 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'] === CxGenerativeSettings.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["fallbackSettings"] = state ? state.fallbackSettings : undefined; resourceInputs["generativeSafetySettings"] = state ? state.generativeSafetySettings : undefined; resourceInputs["knowledgeConnectorSettings"] = state ? state.knowledgeConnectorSettings : undefined; resourceInputs["languageCode"] = state ? state.languageCode : undefined; resourceInputs["llmModelSettings"] = state ? state.llmModelSettings : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["parent"] = state ? state.parent : undefined; } else { const args = argsOrState; if ((!args || args.languageCode === undefined) && !opts.urn) { throw new Error("Missing required property 'languageCode'"); } resourceInputs["fallbackSettings"] = args ? args.fallbackSettings : undefined; resourceInputs["generativeSafetySettings"] = args ? args.generativeSafetySettings : undefined; resourceInputs["knowledgeConnectorSettings"] = args ? args.knowledgeConnectorSettings : undefined; resourceInputs["languageCode"] = args ? args.languageCode : undefined; resourceInputs["llmModelSettings"] = args ? args.llmModelSettings : undefined; resourceInputs["parent"] = args ? args.parent : undefined; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CxGenerativeSettings.__pulumiType, name, resourceInputs, opts); } } exports.CxGenerativeSettings = CxGenerativeSettings; /** @internal */ CxGenerativeSettings.__pulumiType = 'gcp:diagflow/cxGenerativeSettings:CxGenerativeSettings'; //# sourceMappingURL=cxGenerativeSettings.js.map