@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
158 lines • 6.6 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.CxGenerativeSettings = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(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
* $ 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, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:diagflow/cxGenerativeSettings:CxGenerativeSettings';
/**
* 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?.fallbackSettings;
resourceInputs["generativeSafetySettings"] = state?.generativeSafetySettings;
resourceInputs["knowledgeConnectorSettings"] = state?.knowledgeConnectorSettings;
resourceInputs["languageCode"] = state?.languageCode;
resourceInputs["llmModelSettings"] = state?.llmModelSettings;
resourceInputs["name"] = state?.name;
resourceInputs["parent"] = state?.parent;
}
else {
const args = argsOrState;
if (args?.languageCode === undefined && !opts.urn) {
throw new Error("Missing required property 'languageCode'");
}
resourceInputs["fallbackSettings"] = args?.fallbackSettings;
resourceInputs["generativeSafetySettings"] = args?.generativeSafetySettings;
resourceInputs["knowledgeConnectorSettings"] = args?.knowledgeConnectorSettings;
resourceInputs["languageCode"] = args?.languageCode;
resourceInputs["llmModelSettings"] = args?.llmModelSettings;
resourceInputs["parent"] = args?.parent;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CxGenerativeSettings.__pulumiType, name, resourceInputs, opts);
}
}
exports.CxGenerativeSettings = CxGenerativeSettings;
//# sourceMappingURL=cxGenerativeSettings.js.map