UNPKG

@pulumi/gcp

Version:

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

241 lines • 9.72 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Generators contain prompt to be sent to the LLM model to generate text. The prompt can contain parameters which will be resolved before calling the model. It can optionally contain banned phrases to ensure the model responses are safe. * * To get more information about Generator, see: * * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.generators) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs) * * ## Example Usage * * ### Dialogflowcx Generator Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const agent = new gcp.diagflow.CxAgent("agent", { * displayName: "dialogflowcx-agent-fucntion", * location: "global", * defaultLanguageCode: "en", * supportedLanguageCodes: [ * "fr", * "de", * "es", * ], * timeZone: "America/New_York", * description: "Example description.", * }); * const generator = new gcp.diagflow.CxGenerator("generator", { * parent: agent.id, * languageCode: "fr", * displayName: "TF Prompt generator", * llmModelSettings: { * model: "gemini-2.0-flash-001", * promptText: "Return me some great results", * }, * promptText: { * text: "Send me great results in french", * }, * modelParameter: { * temperature: 0.55, * }, * }); * ``` * * ## Import * * Generator can be imported using any of these accepted formats: * * * `{{parent}}/generators/{{name}}` * * `{{parent}}/{{name}}` * * When using the `pulumi import` command, Generator can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:diagflow/cxGenerator:CxGenerator default {{parent}}/generators/{{name}} * $ pulumi import gcp:diagflow/cxGenerator:CxGenerator default {{parent}}/{{name}} * ``` */ export declare class CxGenerator extends pulumi.CustomResource { /** * Get an existing CxGenerator 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: string, id: pulumi.Input<pulumi.ID>, state?: CxGeneratorState, opts?: pulumi.CustomResourceOptions): CxGenerator; /** * Returns true if the given object is an instance of CxGenerator. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is CxGenerator; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ readonly deletionPolicy: pulumi.Output<string>; /** * The human-readable name of the generator, unique within the agent. */ readonly displayName: pulumi.Output<string>; /** * The language to create generators for the following fields: * * Generator.prompt_text.text * If not specified, the agent's default language is used. */ readonly languageCode: pulumi.Output<string | undefined>; /** * The LLM model settings. * Structure is documented below. */ readonly llmModelSettings: pulumi.Output<outputs.diagflow.CxGeneratorLlmModelSettings | undefined>; /** * Parameters passed to the LLM to configure its behavior. * Structure is documented below. */ readonly modelParameter: pulumi.Output<outputs.diagflow.CxGeneratorModelParameter | undefined>; /** * The unique identifier of the Generator. * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>. */ readonly name: pulumi.Output<string>; /** * The agent to create a Generator for. * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. */ readonly parent: pulumi.Output<string | undefined>; /** * List of custom placeholders in the prompt text. * Structure is documented below. */ readonly placeholders: pulumi.Output<outputs.diagflow.CxGeneratorPlaceholder[] | undefined>; /** * Prompt for the LLM model. * Structure is documented below. */ readonly promptText: pulumi.Output<outputs.diagflow.CxGeneratorPromptText>; /** * Create a CxGenerator resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CxGeneratorArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CxGenerator resources. */ export interface CxGeneratorState { /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * The human-readable name of the generator, unique within the agent. */ displayName?: pulumi.Input<string | undefined>; /** * The language to create generators for the following fields: * * Generator.prompt_text.text * If not specified, the agent's default language is used. */ languageCode?: pulumi.Input<string | undefined>; /** * The LLM model settings. * Structure is documented below. */ llmModelSettings?: pulumi.Input<inputs.diagflow.CxGeneratorLlmModelSettings | undefined>; /** * Parameters passed to the LLM to configure its behavior. * Structure is documented below. */ modelParameter?: pulumi.Input<inputs.diagflow.CxGeneratorModelParameter | undefined>; /** * The unique identifier of the Generator. * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>. */ name?: pulumi.Input<string | undefined>; /** * The agent to create a Generator for. * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. */ parent?: pulumi.Input<string | undefined>; /** * List of custom placeholders in the prompt text. * Structure is documented below. */ placeholders?: pulumi.Input<pulumi.Input<inputs.diagflow.CxGeneratorPlaceholder>[] | undefined>; /** * Prompt for the LLM model. * Structure is documented below. */ promptText?: pulumi.Input<inputs.diagflow.CxGeneratorPromptText | undefined>; } /** * The set of arguments for constructing a CxGenerator resource. */ export interface CxGeneratorArgs { /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * The human-readable name of the generator, unique within the agent. */ displayName: pulumi.Input<string>; /** * The language to create generators for the following fields: * * Generator.prompt_text.text * If not specified, the agent's default language is used. */ languageCode?: pulumi.Input<string | undefined>; /** * The LLM model settings. * Structure is documented below. */ llmModelSettings?: pulumi.Input<inputs.diagflow.CxGeneratorLlmModelSettings | undefined>; /** * Parameters passed to the LLM to configure its behavior. * Structure is documented below. */ modelParameter?: pulumi.Input<inputs.diagflow.CxGeneratorModelParameter | undefined>; /** * The agent to create a Generator for. * Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. */ parent?: pulumi.Input<string | undefined>; /** * List of custom placeholders in the prompt text. * Structure is documented below. */ placeholders?: pulumi.Input<pulumi.Input<inputs.diagflow.CxGeneratorPlaceholder>[] | undefined>; /** * Prompt for the LLM model. * Structure is documented below. */ promptText: pulumi.Input<inputs.diagflow.CxGeneratorPromptText>; } //# sourceMappingURL=cxGenerator.d.ts.map