UNPKG

@pulumi/gcp

Version:

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

407 lines • 15 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! *** 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.Tool = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Description * * ## Example Usage * * ### Ces Tool Client Function Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const my_app = new gcp.ces.App("my-app", { * location: "us", * displayName: "my-app", * appId: "app-id", * timeZoneSettings: { * timeZone: "America/Los_Angeles", * }, * }); * const cesToolClientFunctionBasic = new gcp.ces.Tool("ces_tool_client_function_basic", { * location: "us", * app: my_app.name, * toolId: "ces_tool_basic1", * executionType: "SYNCHRONOUS", * clientFunction: { * name: "ces_tool_client_function_basic", * description: "example-description", * parameters: { * additionalProperties: JSON.stringify({ * type: "BOOLEAN", * }), * anyOf: JSON.stringify([{ * type: "STRING", * description: "any_of option 1: string", * }]), * "default": JSON.stringify(false), * defs: JSON.stringify({ * SimpleString: { * type: "STRING", * description: "A simple string definition", * }, * }), * description: "schema description", * enums: [ * "VALUE_A", * "VALUE_B", * ], * items: JSON.stringify({ * type: "ARRAY", * description: "An array", * }), * maxItems: 32, * maximum: 64, * minItems: 1, * minimum: 2, * nullable: true, * prefixItems: JSON.stringify([{ * type: "ARRAY", * description: "prefix item 1", * }]), * properties: JSON.stringify({ * name: { * type: "STRING", * description: "A name", * }, * }), * ref: "#/defs/MyDefinition", * requireds: ["some_property"], * title: "Title", * type: "ARRAY", * uniqueItems: true, * }, * response: { * additionalProperties: JSON.stringify({ * type: "BOOLEAN", * }), * anyOf: JSON.stringify([{ * type: "STRING", * description: "any_of option 1: string", * }]), * "default": JSON.stringify(false), * defs: JSON.stringify({ * SimpleString: { * type: "STRING", * description: "A simple string definition", * }, * }), * description: "schema description", * enums: [ * "VALUE_A", * "VALUE_B", * ], * items: JSON.stringify({ * type: "ARRAY", * description: "An array", * }), * maxItems: 32, * maximum: 64, * minItems: 1, * minimum: 2, * nullable: true, * prefixItems: JSON.stringify([{ * type: "ARRAY", * description: "prefix item 1", * }]), * properties: JSON.stringify({ * name: { * type: "STRING", * description: "A name", * }, * }), * ref: "#/defs/MyDefinition", * requireds: ["some_property"], * title: "Title", * type: "ARRAY", * uniqueItems: true, * }, * }, * }); * ``` * ### Ces Tool Data Store Tool Engine Source Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basic = new gcp.discoveryengine.DataStore("basic", { * location: "global", * dataStoreId: "tool_data_store_id", * displayName: "tf-test-structured-datastore", * industryVertical: "GENERIC", * contentConfig: "NO_CONTENT", * solutionTypes: ["SOLUTION_TYPE_SEARCH"], * createAdvancedSiteSearch: false, * }); * const basicSearchEngine = new gcp.discoveryengine.SearchEngine("basic", { * engineId: "tool_engine_id", * collectionId: "default_collection", * location: basic.location, * displayName: "Example Display Name", * dataStoreIds: [basic.dataStoreId], * searchEngineConfig: {}, * }); * const my_app = new gcp.ces.App("my-app", { * location: "us", * displayName: "my-app", * appId: "app-id", * timeZoneSettings: { * timeZone: "America/Los_Angeles", * }, * }); * const cesToolDataStoreToolEngineSourceBasic = new gcp.ces.Tool("ces_tool_data_store_tool_engine_source_basic", { * location: "us", * app: my_app.name, * toolId: "ces_tool_basic2", * executionType: "SYNCHRONOUS", * dataStoreTool: { * name: "example-tool", * description: "example-description", * boostSpecs: [{ * dataStores: [basic.name], * specs: [{ * conditionBoostSpecs: [{ * condition: "(lang_code: ANY(\"en\", \"fr\"))", * boost: 1, * boostControlSpec: { * fieldName: "example-field", * attributeType: "NUMERICAL", * interpolationType: "LINEAR", * controlPoints: [{ * attributeValue: "1", * boostAmount: 1, * }], * }, * }], * }], * }], * modalityConfigs: [{ * modalityType: "TEXT", * rewriterConfig: { * modelSettings: { * model: "gemini-3.0-flash-001", * temperature: 1, * }, * prompt: "example-prompt", * disabled: false, * }, * summarizationConfig: { * modelSettings: { * model: "gemini-3.0-flash-001", * temperature: 1, * }, * prompt: "example-prompt", * disabled: false, * }, * groundingConfig: { * groundingLevel: 3, * disabled: false, * }, * }], * engineSource: { * engine: basicSearchEngine.name, * dataStoreSources: [{ * filter: "example_field: ANY(\"specific_example\")", * dataStore: { * name: basic.name, * }, * }], * filter: "example_field: ANY(\"specific_example\")", * }, * }, * }); * ``` * ### Ces Tool Google Search Tool Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const my_app = new gcp.ces.App("my-app", { * location: "us", * displayName: "my-app", * appId: "app-id", * timeZoneSettings: { * timeZone: "America/Los_Angeles", * }, * }); * const cesToolGoogleSearchToolBasic = new gcp.ces.Tool("ces_tool_google_search_tool_basic", { * location: "us", * app: my_app.name, * toolId: "ces_tool_basic3", * executionType: "SYNCHRONOUS", * googleSearchTool: { * name: "example-tool", * contextUrls: [ * "example.com", * "example2.com", * ], * description: "example-description", * excludeDomains: [ * "example.com", * "example2.com", * ], * preferredDomains: [ * "example3.com", * "example4.com", * ], * }, * }); * ``` * ### Ces Tool Python Function Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const my_app = new gcp.ces.App("my-app", { * location: "us", * displayName: "my-app", * appId: "app-id", * timeZoneSettings: { * timeZone: "America/Los_Angeles", * }, * }); * const cesToolPythonFunctionBasic = new gcp.ces.Tool("ces_tool_python_function_basic", { * location: "us", * app: my_app.name, * toolId: "ces_tool_basic4", * executionType: "SYNCHRONOUS", * pythonFunction: { * name: "example_function", * pythonCode: "def example_function() -> int: return 0", * }, * }); * ``` * * ## Import * * Tool can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/apps/{{app}}/tools/{{name}}` * * `{{project}}/{{location}}/{{app}}/{{name}}` * * `{{location}}/{{app}}/{{name}}` * * When using the `pulumi import` command, Tool can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:ces/tool:Tool default projects/{{project}}/locations/{{location}}/apps/{{app}}/tools/{{name}} * $ pulumi import gcp:ces/tool:Tool default {{project}}/{{location}}/{{app}}/{{name}} * $ pulumi import gcp:ces/tool:Tool default {{location}}/{{app}}/{{name}} * ``` */ class Tool extends pulumi.CustomResource { /** * Get an existing Tool 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 Tool(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:ces/tool:Tool'; /** * Returns true if the given object is an instance of Tool. 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'] === Tool.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["app"] = state?.app; resourceInputs["clientFunction"] = state?.clientFunction; resourceInputs["createTime"] = state?.createTime; resourceInputs["dataStoreTool"] = state?.dataStoreTool; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["displayName"] = state?.displayName; resourceInputs["etag"] = state?.etag; resourceInputs["executionType"] = state?.executionType; resourceInputs["generatedSummary"] = state?.generatedSummary; resourceInputs["googleSearchTool"] = state?.googleSearchTool; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["openApiTools"] = state?.openApiTools; resourceInputs["project"] = state?.project; resourceInputs["pythonFunction"] = state?.pythonFunction; resourceInputs["systemTools"] = state?.systemTools; resourceInputs["toolId"] = state?.toolId; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.app === undefined && !opts.urn) { throw new Error("Missing required property 'app'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.toolId === undefined && !opts.urn) { throw new Error("Missing required property 'toolId'"); } resourceInputs["app"] = args?.app; resourceInputs["clientFunction"] = args?.clientFunction; resourceInputs["dataStoreTool"] = args?.dataStoreTool; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["executionType"] = args?.executionType; resourceInputs["googleSearchTool"] = args?.googleSearchTool; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["pythonFunction"] = args?.pythonFunction; resourceInputs["toolId"] = args?.toolId; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["displayName"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["generatedSummary"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["openApiTools"] = undefined /*out*/; resourceInputs["systemTools"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Tool.__pulumiType, name, resourceInputs, opts); } } exports.Tool = Tool; //# sourceMappingURL=tool.js.map