import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Playbook is the basic building block to instruct the LLM how to execute a certain task. * * To get more information about Playbook, see: * * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.playbooks) * * How-to Guides * * [Official CX Documentation](https://cloud.google.com/dialogflow/cx/docs) * * ## Example Usage * * ### Dialogflowcx Playbook Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const agent = new gcp.diagflow.CxAgent("agent", { * displayName: "dialogflowcx-agent-basic", * location: "global", * defaultLanguageCode: "en", * timeZone: "America/New_York", * description: "Example description.", * }); * const my_playbook = new gcp.diagflow.CxPlaybook("my-playbook", { * parent: agent.id, * displayName: "Example Display Name", * goal: "Example Goal", * playbookType: "ROUTINE", * instruction: { * steps: [ * { * text: "step 1", * steps: JSON.stringify([ * { * text: "step 1 1", * }, * { * text: "step 1 2", * steps: [ * { * text: "step 1 2 1", * }, * { * text: "step 1 2 2", * }, * ], * }, * { * text: "step 1 3", * }, * ]), * }, * { * text: "step 2", * }, * { * text: "step 3", * }, * ], * }, * }); * ``` * ### Dialogflowcx Playbook Fulfillment * * ```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 bucket = new gcp.storage.Bucket("bucket", { * name: "dialogflowcx-bucket", * location: "US", * uniformBucketLevelAccess: true, * }); * const myWebhook = new gcp.diagflow.CxWebhook("my_webhook", { * parent: agent.id, * displayName: "MyWebhook", * genericWebService: { * uri: "https://example.com", * }, * }); * const myTool = new gcp.diagflow.CxTool("my_tool", { * parent: agent.id, * displayName: "Example Tool", * description: "Example Description", * }); * const myGenerator = new gcp.diagflow.CxGenerator("my_generator", { * parent: agent.id, * 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, * }, * }); * const my_playbook = new gcp.diagflow.CxPlaybook("my-playbook", { * parent: agent.id, * displayName: "Playbook Example with Fulfillment", * goal: "Example Goal", * instruction: { * guidelines: "Example Guidelines", * steps: [ * { * text: "step 1", * steps: JSON.stringify([ * { * text: "step 1 1", * }, * { * text: "step 1 2", * steps: [ * { * text: "step 1 2 1", * }, * { * text: "step 1 2 2", * }, * ], * }, * { * text: "step 1 3", * }, * ]), * }, * { * text: "step 2", * }, * { * text: "step 3", * }, * ], * }, * llmModelSettings: { * model: "gemini-2.0-flash-001", * promptText: "Return me some great results", * }, * referencedTools: [myTool.id], * }); * ``` * * ## Import * * Playbook can be imported using any of these accepted formats: * * * `{{parent}}/playbooks/{{name}}` * * `{{parent}}/{{name}}` * * When using the `pulumi import` command, Playbook can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:diagflow/cxPlaybook:CxPlaybook default {{parent}}/playbooks/{{name}} * $ pulumi import gcp:diagflow/cxPlaybook:CxPlaybook default {{parent}}/{{name}} * ``` */ export declare class CxPlaybook extends pulumi.CustomResource { /** * Get an existing CxPlaybook 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, state?: CxPlaybookState, opts?: pulumi.CustomResourceOptions): CxPlaybook; /** * Returns true if the given object is an instance of CxPlaybook. 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 CxPlaybook; /** * The timestamp of initial playbook creation. * Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30". */ readonly createTime: pulumi.Output; /** * The human-readable name of the playbook, unique within an agent. */ readonly displayName: pulumi.Output; /** * High level description of the goal the playbook intend to accomplish. A goal should be concise since it's visible to other playbooks that may reference this playbook. */ readonly goal: pulumi.Output; /** * Instruction to accomplish target goal. * Structure is documented below. */ readonly instruction: pulumi.Output; /** * Llm model settings for the playbook. * Structure is documented below. */ readonly llmModelSettings: pulumi.Output; /** * The unique identifier of the Playbook. * Format: projects//locations//agents//playbooks/. */ readonly name: pulumi.Output; /** * The agent to create a Playbook for. * Format: projects//locations//agents/. */ readonly parent: pulumi.Output; /** * Type of the playbook. * Possible values are: `PLAYBOOK_TYPE_UNSPECIFIED`, `TASK`, `ROUTINE`. */ readonly playbookType: pulumi.Output; /** * The resource name of flows referenced by the current playbook in the instructions. */ readonly referencedFlows: pulumi.Output; /** * The resource name of other playbooks referenced by the current playbook in the instructions. */ readonly referencedPlaybooks: pulumi.Output; /** * The resource name of tools referenced by the current playbook in the instructions. If not provided explicitly, they are will be implied using the tool being referenced in goal and steps. */ readonly referencedTools: pulumi.Output; /** * Estimated number of tokes current playbook takes when sent to the LLM. */ readonly tokenCount: pulumi.Output; /** * Last time the playbook version was updated. * Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30". */ readonly updateTime: pulumi.Output; /** * Create a CxPlaybook 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: CxPlaybookArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CxPlaybook resources. */ export interface CxPlaybookState { /** * The timestamp of initial playbook creation. * Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30". */ createTime?: pulumi.Input; /** * The human-readable name of the playbook, unique within an agent. */ displayName?: pulumi.Input; /** * High level description of the goal the playbook intend to accomplish. A goal should be concise since it's visible to other playbooks that may reference this playbook. */ goal?: pulumi.Input; /** * Instruction to accomplish target goal. * Structure is documented below. */ instruction?: pulumi.Input; /** * Llm model settings for the playbook. * Structure is documented below. */ llmModelSettings?: pulumi.Input; /** * The unique identifier of the Playbook. * Format: projects//locations//agents//playbooks/. */ name?: pulumi.Input; /** * The agent to create a Playbook for. * Format: projects//locations//agents/. */ parent?: pulumi.Input; /** * Type of the playbook. * Possible values are: `PLAYBOOK_TYPE_UNSPECIFIED`, `TASK`, `ROUTINE`. */ playbookType?: pulumi.Input; /** * The resource name of flows referenced by the current playbook in the instructions. */ referencedFlows?: pulumi.Input[]>; /** * The resource name of other playbooks referenced by the current playbook in the instructions. */ referencedPlaybooks?: pulumi.Input[]>; /** * The resource name of tools referenced by the current playbook in the instructions. If not provided explicitly, they are will be implied using the tool being referenced in goal and steps. */ referencedTools?: pulumi.Input[]>; /** * Estimated number of tokes current playbook takes when sent to the LLM. */ tokenCount?: pulumi.Input; /** * Last time the playbook version was updated. * Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30". */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a CxPlaybook resource. */ export interface CxPlaybookArgs { /** * The human-readable name of the playbook, unique within an agent. */ displayName: pulumi.Input; /** * High level description of the goal the playbook intend to accomplish. A goal should be concise since it's visible to other playbooks that may reference this playbook. */ goal: pulumi.Input; /** * Instruction to accomplish target goal. * Structure is documented below. */ instruction?: pulumi.Input; /** * Llm model settings for the playbook. * Structure is documented below. */ llmModelSettings?: pulumi.Input; /** * The agent to create a Playbook for. * Format: projects//locations//agents/. */ parent?: pulumi.Input; /** * Type of the playbook. * Possible values are: `PLAYBOOK_TYPE_UNSPECIFIED`, `TASK`, `ROUTINE`. */ playbookType?: pulumi.Input; /** * The resource name of tools referenced by the current playbook in the instructions. If not provided explicitly, they are will be implied using the tool being referenced in goal and steps. */ referencedTools?: pulumi.Input[]>; }