REST Resource: projects.locations.agents.playbooks.examples

Resource: Example

Example represents a sample execution of the playbook in the conversation.

An example consists of a list of ordered actions performed by end user or Dialogflow agent according the playbook instructions to fulfill the task.

JSON representation
{
  "name": string,
  "playbookInput": {
    object (PlaybookInput)
  },
  "playbookOutput": {
    object (PlaybookOutput)
  },
  "actions": [
    {
      object (Action)
    }
  ],
  "displayName": string,
  "description": string,
  "tokenCount": string,
  "createTime": string,
  "updateTime": string,
  "conversationState": enum (OutputState),
  "languageCode": string
}
Fields
name

string

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

playbookInput

object (PlaybookInput)

Optional. The input to the playbook in the example.

playbookOutput

object (PlaybookOutput)

Optional. The output of the playbook in the example.

actions[]

object (Action)

Required. The ordered list of actions performed by the end user and the Dialogflow agent.

displayName

string

Required. The display name of the example.

description

string

Optional. The high level concise description of the example. The max number of characters is 200.

tokenCount

string (int64 format)

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

createTime

string (Timestamp format)

Output only. The timestamp of initial example creation.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. Last time the example was updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

conversationState

enum (OutputState)

Required. Example's output state.

languageCode

string

Optional. The language code of the example. If not specified, the agent's default language is used. Note: languages must be enabled in the agent before they can be used. Note: example's language code is not currently used in dialogflow agents.

PlaybookInput

Input of the playbook.

JSON representation
{
  "precedingConversationSummary": string,
  "actionParameters": {
    object
  }
}
Fields
precedingConversationSummary

string

Optional. Summary string of the preceding conversation for the child playbook invocation.

actionParameters

object (Struct format)

Optional. A list of input parameters for the action.

PlaybookOutput

Output of the playbook.

JSON representation
{
  "executionSummary": string,
  "actionParameters": {
    object
  }
}
Fields
executionSummary

string

Optional. Summary string of the execution result of the child playbook.

actionParameters

object (Struct format)

Optional. A Struct object of output parameters for the action.

Action

Action performed by end user or Dialogflow agent in the conversation.

JSON representation
{

  // Union field action can be only one of the following:
  "userUtterance": {
    object (UserUtterance)
  },
  "agentUtterance": {
    object (AgentUtterance)
  },
  "toolUse": {
    object (ToolUse)
  },
  "playbookInvocation": {
    object (PlaybookInvocation)
  },
  "flowInvocation": {
    object (FlowInvocation)
  }
  // End of list of possible types for union field action.
}
Fields
Union field action. Action details. action can be only one of the following:
userUtterance

object (UserUtterance)

Optional. Agent obtained a message from the customer.

agentUtterance

object (AgentUtterance)

Optional. Action performed by the agent as a message.

toolUse

object (ToolUse)

Optional. Action performed on behalf of the agent by calling a plugin tool.

playbookInvocation

object (PlaybookInvocation)

Optional. Action performed on behalf of the agent by invoking a child playbook.

flowInvocation

object (FlowInvocation)

Optional. Action performed on behalf of the agent by invoking a CX flow.

UserUtterance

UserUtterance represents one message sent by the customer.

JSON representation
{
  "text": string
}
Fields
text

string

Required. Message content in text.

AgentUtterance

AgentUtterance represents one message sent by the agent.

JSON representation
{
  "text": string
}
Fields
text

string

Required. Message content in text.

ToolUse

Stores metadata of the invocation of an action supported by a tool.

JSON representation
{
  "tool": string,
  "action": string,
  "inputActionParameters": {
    object
  },
  "outputActionParameters": {
    object
  }
}
Fields
tool

string

Required. The tool that should be used. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/tools/<ToolID>.

action

string

Optional. Name of the action to be called during the tool use.

inputActionParameters

object (Struct format)

Optional. A list of input parameters for the action.

outputActionParameters

object (Struct format)

Optional. A list of output parameters generated by the action.

PlaybookInvocation

Stores metadata of the invocation of a child playbook. Next Id: 5

JSON representation
{
  "playbook": string,
  "playbookInput": {
    object (PlaybookInput)
  },
  "playbookOutput": {
    object (PlaybookOutput)
  },
  "playbookState": enum (OutputState)
}
Fields
playbook

string

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

playbookInput

object (PlaybookInput)

Optional. Input of the child playbook invocation.

playbookOutput

object (PlaybookOutput)

Optional. Output of the child playbook invocation.

playbookState

enum (OutputState)

Required. Playbook invocation's output state.

OutputState

Output state.

Enums
OUTPUT_STATE_UNSPECIFIED Unspecified output.
OUTPUT_STATE_OK Succeeded.
OUTPUT_STATE_CANCELLED Cancelled.
OUTPUT_STATE_FAILED Failed.
OUTPUT_STATE_ESCALATED Escalated.
OUTPUT_STATE_PENDING Pending.

FlowInvocation

Stores metadata of the invocation of a CX flow. Next Id: 7

JSON representation
{
  "flow": string,
  "inputActionParameters": {
    object
  },
  "outputActionParameters": {
    object
  },
  "flowState": enum (OutputState)
}
Fields
flow

string

Required. The unique identifier of the flow. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>.

inputActionParameters

object (Struct format)

Optional. A list of input parameters for the flow.

outputActionParameters

object (Struct format)

Optional. A list of output parameters generated by the flow invocation.

flowState

enum (OutputState)

Required. Flow invocation's output state.

Methods

create

Creates an example in the specified playbook.

delete

Deletes the specified example.

get

Retrieves the specified example.

list

Returns a list of examples in the specified playbook.

patch

Update the specified example.