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, "instruction": { object ( |
Fields | |
---|---|
name |
The unique identifier of the playbook. Format: |
displayName |
Required. The human-readable name of the playbook, unique within an agent. |
goal |
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. |
instruction |
Instruction to accomplish target goal. |
tokenCount |
Output only. Estimated number of tokes current playbook takes when sent to the LLM. |
createTime |
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: |
updateTime |
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: |
referencedPlaybooks[] |
Output only. The resource name of other playbooks referenced by the current playbook in the instructions. |
referencedFlows[] |
Output only. The resource name of flows referenced by the current playbook in the instructions. |
referencedTools[] |
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 |
Optional. Llm model settings for the playbook. |
handlers[] |
Optional. A list of registered handlers to execuate based on the specified triggers. |
Instruction
Message of the Instruction of the playbook.
JSON representation |
---|
{
"guidelines": string,
"steps": [
{
object ( |
Fields | |
---|---|
guidelines |
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[] |
Ordered list of step by step execution instructions to accomplish target goal. |
Step
Message of single step execution.
JSON representation |
---|
{ "steps": [ { object ( |
Fields | |
---|---|
steps[] |
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 |
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 |
Fields | |
---|---|
Union field handler . Specifies the type of handler to invoke. handler can be only one of the following: |
|
eventHandler |
A handler triggered by event. |
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 ( |
Fields | |
---|---|
event |
Required. The name of the event that triggers this handler. |
condition |
Optional. The condition that must be satisfied to trigger this handler. |
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 ( |
Fields | |
---|---|
lifecycleStage |
Required. The name of the lifecycle stage that triggers this handler. Supported values: * |
condition |
Optional. The condition that must be satisfied to trigger this handler. |
fulfillment |
Required. The fulfillment to call when this handler is triggered. |
Methods |
|
---|---|
|
Creates a playbook in a specified agent. |
|
Deletes a specified playbook. |
|
Exports the specified playbook to a binary file. |
|
Retrieves the specified Playbook. |
|
Imports the specified playbook to the specified agent from a binary file. |
|
Returns a list of playbooks in the specified agent. |
|
Updates the specified Playbook. |