REST Resource: projects.locations.agents.playbooks

Resource: Playbook

Playbook is the basic building block to instruct the LLM how to execute a certain task.

A playbook consists of a goal to accomplish, an optional list of step by step instructions (the step instruction may refers to name of the custom or default plugin tools to use) to perform the task, a list of contextual input data to be passed in at the beginning of the invoked, and a list of output parameters to store the playbook result.

JSON representation
{
  "name": string,
  "displayName": string,
  "goal": string,
  "inputParameterDefinitions": [
    {
      object (ParameterDefinition)
    }
  ],
  "outputParameterDefinitions": [
    {
      object (ParameterDefinition)
    }
  ],
  "instruction": {
    object (Instruction)
  },
  "tokenCount": string,
  "createTime": string,
  "updateTime": string,
  "referencedPlaybooks": [
    string
  ],
  "referencedFlows": [
    string
  ],
  "referencedTools": [
    string
  ],
  "llmModelSettings": {
    object (LlmModelSettings)
  },
  "speechSettings": {
    object (SpeechSettings)
  },
  "handlers": [
    {
      object (Handler)
    }
  ]
}
Fields
name

string

The unique identifier of the playbook. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>.

displayName

string

Required. The human-readable name of the playbook, unique within an agent.

goal

string

Required. 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.

inputParameterDefinitions[]

object (ParameterDefinition)

Optional. Defined structured input parameters for this playbook.

outputParameterDefinitions[]

object (ParameterDefinition)

Optional. Defined structured output parameters for this playbook.

instruction

object (Instruction)

Instruction to accomplish target goal.

tokenCount

string (int64 format)

Output only. Estimated number of tokes current playbook takes when sent to the LLM.

createTime

string (Timestamp format)

Output only. 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".

updateTime

string (Timestamp format)

Output only. 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".

referencedPlaybooks[]

string

Output only. The resource name of other playbooks referenced by the current playbook in the instructions.

referencedFlows[]

string

Output only. The resource name of flows referenced by the current playbook in the instructions.

referencedTools[]

string

Optional. 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.

llmModelSettings

object (LlmModelSettings)

Optional. Llm model settings for the playbook.

speechSettings

object (SpeechSettings)

Optional. Playbook level Settings for speech to text detection.

handlers[]

object (Handler)

Optional. A list of registered handlers to execute based on the specified triggers.

ParameterDefinition

Defines the properties of a parameter. Used to define parameters used in the agent and the input / output parameters for each fulfillment.

JSON representation
{
  "name": string,
  "type": enum (ParameterType),
  "typeSchema": {
    object (TypeSchema)
  },
  "description": string
}
Fields
name

string

Required. Name of parameter.

type
(deprecated)

enum (ParameterType)

Type of parameter.

typeSchema

object (TypeSchema)

Optional. Type schema of parameter.

description

string

Human-readable description of the parameter. Limited to 300 characters.

ParameterType

Parameter types are used for validation. These types are consistent with google.protobuf.Value.

Enums
PARAMETER_TYPE_UNSPECIFIED Not specified. No validation will be performed.
STRING Represents any string value.
NUMBER Represents any number value.
BOOLEAN Represents a boolean value.
NULL Represents a null value.
OBJECT Represents any object value.
LIST Represents a repeated value.

TypeSchema

Encapsulates different type schema variations: either a reference to an a schema that's already defined by a tool, or an inline definition.

JSON representation
{

  // Union field schema can be only one of the following:
  "inlineSchema": {
    object (InlineSchema)
  },
  "schemaReference": {
    object (SchemaReference)
  }
  // End of list of possible types for union field schema.
}
Fields
Union field schema. The encapsulated schema. schema can be only one of the following:
inlineSchema

object (InlineSchema)

Set if this is an inline schema definition.

schemaReference

object (SchemaReference)

Set if this is a schema reference.

InlineSchema

A type schema object that's specified inline.

JSON representation
{
  "type": enum (DataType),
  "items": {
    object (TypeSchema)
  }
}
Fields
type

enum (DataType)

Data type of the schema.

items

object (TypeSchema)

Schema of the elements if this is an ARRAY type.

DataType

Defines data types that are supported for inlined schemas. These types are consistent with google.protobuf.Value.

Enums
DATA_TYPE_UNSPECIFIED Not specified.
STRING Represents any string value.
NUMBER Represents any number value.
BOOLEAN Represents a boolean value.
ARRAY Represents a repeated value.

SchemaReference

A reference to the schema of an existing tool.

JSON representation
{
  "tool": string,
  "schema": string
}
Fields
tool

string

The tool that contains this schema definition. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>.

schema

string

The name of the schema.

Instruction

Message of the Instruction of the playbook.

JSON representation
{
  "guidelines": string,
  "steps": [
    {
      object (Step)
    }
  ]
}
Fields
guidelines

string

General guidelines for the playbook. These are unstructured instructions that are not directly part of the goal, e.g. "Always be polite". It's valid for this text to be long and used instead of steps altogether.

steps[]

object (Step)

Ordered list of step by step execution instructions to accomplish target goal.

Step

Message of single step execution.

JSON representation
{
  "steps": [
    {
      object (Step)
    }
  ],

  // Union field instruction can be only one of the following:
  "text": string
  // End of list of possible types for union field instruction.
}
Fields
steps[]

object (Step)

Sub-processing needed to execute the current step.

Union field instruction. Instruction on how to execute current step. instruction can be only one of the following:
text

string

Step instruction in text format.

Handler

Handler can be used to define custom logic to be executed based on the user-specified triggers.

JSON representation
{

  // Union field handler can be only one of the following:
  "eventHandler": {
    object (EventHandler)
  },
  "lifecycleHandler": {
    object (LifecycleHandler)
  }
  // End of list of possible types for union field handler.
}
Fields
Union field handler. Specifies the type of handler to invoke. handler can be only one of the following:
eventHandler

object (EventHandler)

A handler triggered by event.

lifecycleHandler

object (LifecycleHandler)

A handler triggered during specific lifecycle of the playbook execution.

EventHandler

A handler that is triggered by the specified event.

JSON representation
{
  "event": string,
  "condition": string,
  "fulfillment": {
    object (Fulfillment)
  }
}
Fields
event

string

Required. The name of the event that triggers this handler.

condition

string

Optional. The condition that must be satisfied to trigger this handler.

fulfillment

object (Fulfillment)

Required. The fulfillment to call when the event occurs.

LifecycleHandler

A handler that is triggered on the specific lifecycleStage of the playbook execution.

JSON representation
{
  "lifecycleStage": string,
  "condition": string,
  "fulfillment": {
    object (Fulfillment)
  }
}
Fields
lifecycleStage

string

Required. The name of the lifecycle stage that triggers this handler. Supported values: * playbook-start * pre-action-selection * pre-action-execution

condition

string

Optional. The condition that must be satisfied to trigger this handler.

fulfillment

object (Fulfillment)

Required. The fulfillment to call when this handler is triggered.

Methods

create

Creates a playbook in a specified agent.

delete

Deletes a specified playbook.

get

Retrieves the specified Playbook.

list

Returns a list of playbooks in the specified agent.

patch

Updates the specified Playbook.