Gemini Enterprise for Customer Experience API . projects . locations . apps . agents

Instance Methods

close()

Close httplib2 connections.

create(parent, agentId=None, body=None, x__xgafv=None)

Creates a new agent in the given app.

delete(name, etag=None, force=None, x__xgafv=None)

Deletes the specified agent.

get(name, x__xgafv=None)

Gets details of the specified agent.

list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)

Lists agents in the given app.

list_next()

Retrieves the next page of results.

patch(name, body=None, updateMask=None, x__xgafv=None)

Updates the specified agent.

Method Details

close()
Close httplib2 connections.
create(parent, agentId=None, body=None, x__xgafv=None)
Creates a new agent in the given app.

Args:
  parent: string, Required. The resource name of the app to create an agent in. (required)
  body: object, The request body.
    The object takes the form of:

{ # An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.
  "afterAgentCallbacks": [ # Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterModelCallbacks": [ # Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterToolCallbacks": [ # Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeAgentCallbacks": [ # Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeModelCallbacks": [ # Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeToolCallbacks": [ # Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "childAgents": [ # Optional. List of child agents in the agent tree. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
    "A String",
  ],
  "createTime": "A String", # Output only. Timestamp when the agent was created.
  "description": "A String", # Optional. Human-readable description of the agent.
  "displayName": "A String", # Required. Display name of the agent.
  "etag": "A String", # Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
  "generatedSummary": "A String", # Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
  "guardrails": [ # Optional. List of guardrails for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`
    "A String",
  ],
  "instruction": "A String", # Optional. Instructions for the LLM model to guide the agent's behavior.
  "llmAgent": { # Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model. # Optional. The default agent type.
  },
  "modelSettings": { # Model settings contains various configurations for the LLM model. # Optional. Configurations for the LLM model.
    "model": "A String", # Optional. The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
    "temperature": 3.14, # Optional. If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
  },
  "name": "A String", # Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
  "remoteDialogflowAgent": { # The agent which will transfer execution to a remote [Dialogflow CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. The Dialogflow agent will process subsequent user queries until the session ends or flow ends, and the control is transferred back to the parent CES agent. # Optional. The remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant `roles/dialogflow.client` to the CES service agent `service-@gcp-sa-ces.iam.gserviceaccount.com`.
    "agent": "A String", # Required. The [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent resource name. Format: `projects/{project}/locations/{location}/agents/{agent}`
    "environmentId": "A String", # Optional. The environment ID of the Dialogflow agent to be used for the agent execution. If not specified, the draft environment will be used.
    "flowId": "A String", # Optional. The flow ID of the flow in the Dialogflow agent.
    "inputVariableMapping": { # Optional. The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
      "a_key": "A String",
    },
    "outputVariableMapping": { # Optional. The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
      "a_key": "A String",
    },
    "respectResponseInterruptionSettings": True or False, # Optional. Indicates whether to respect the message-level interruption settings configured in the Dialogflow agent. * If false: all response messages from the Dialogflow agent follow the app-level barge-in settings. * If true: only response messages with [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) set to true will be interruptable, all other messages follow the app-level barge-in settings.
  },
  "tools": [ # Optional. List of available tools for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
    "A String",
  ],
  "toolsets": [ # Optional. List of toolsets for the agent.
    { # A toolset with a selection of its tools.
      "toolIds": [ # Optional. The tools IDs to filter the toolset.
        "A String",
      ],
      "toolset": "A String", # Required. The resource name of the toolset. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
    },
  ],
  "transferRules": [ # Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
    { # Rule for transferring to a specific agent.
      "childAgent": "A String", # Required. The resource name of the child agent the rule applies to. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
      "deterministicTransfer": { # Deterministic transfer rule. When the condition evaluates to true, the transfer occurs. # Optional. A rule that immediately transfers to the target agent when the condition is met.
        "expressionCondition": { # Expression condition based on session state. # Optional. A rule that evaluates a session state condition. If the condition evaluates to true, the transfer occurs.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
        "pythonCodeCondition": { # Python code block to evaluate the condition. # Optional. A rule that uses Python code block to evaluate the conditions. If the condition evaluates to true, the transfer occurs.
          "pythonCode": "A String", # Required. The python code to execute.
        },
      },
      "direction": "A String", # Required. The direction of the transfer.
      "disablePlannerTransfer": { # A rule that prevents the planner from transferring to the target agent. # Optional. Rule that prevents the planner from transferring to the target agent.
        "expressionCondition": { # Expression condition based on session state. # Required. If the condition evaluates to true, planner will not be allowed to transfer to the target agent.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
      },
    },
  ],
  "updateTime": "A String", # Output only. Timestamp when the agent was last updated.
}

  agentId: string, Optional. The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.
  "afterAgentCallbacks": [ # Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterModelCallbacks": [ # Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterToolCallbacks": [ # Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeAgentCallbacks": [ # Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeModelCallbacks": [ # Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeToolCallbacks": [ # Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "childAgents": [ # Optional. List of child agents in the agent tree. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
    "A String",
  ],
  "createTime": "A String", # Output only. Timestamp when the agent was created.
  "description": "A String", # Optional. Human-readable description of the agent.
  "displayName": "A String", # Required. Display name of the agent.
  "etag": "A String", # Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
  "generatedSummary": "A String", # Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
  "guardrails": [ # Optional. List of guardrails for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`
    "A String",
  ],
  "instruction": "A String", # Optional. Instructions for the LLM model to guide the agent's behavior.
  "llmAgent": { # Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model. # Optional. The default agent type.
  },
  "modelSettings": { # Model settings contains various configurations for the LLM model. # Optional. Configurations for the LLM model.
    "model": "A String", # Optional. The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
    "temperature": 3.14, # Optional. If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
  },
  "name": "A String", # Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
  "remoteDialogflowAgent": { # The agent which will transfer execution to a remote [Dialogflow CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. The Dialogflow agent will process subsequent user queries until the session ends or flow ends, and the control is transferred back to the parent CES agent. # Optional. The remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant `roles/dialogflow.client` to the CES service agent `service-@gcp-sa-ces.iam.gserviceaccount.com`.
    "agent": "A String", # Required. The [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent resource name. Format: `projects/{project}/locations/{location}/agents/{agent}`
    "environmentId": "A String", # Optional. The environment ID of the Dialogflow agent to be used for the agent execution. If not specified, the draft environment will be used.
    "flowId": "A String", # Optional. The flow ID of the flow in the Dialogflow agent.
    "inputVariableMapping": { # Optional. The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
      "a_key": "A String",
    },
    "outputVariableMapping": { # Optional. The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
      "a_key": "A String",
    },
    "respectResponseInterruptionSettings": True or False, # Optional. Indicates whether to respect the message-level interruption settings configured in the Dialogflow agent. * If false: all response messages from the Dialogflow agent follow the app-level barge-in settings. * If true: only response messages with [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) set to true will be interruptable, all other messages follow the app-level barge-in settings.
  },
  "tools": [ # Optional. List of available tools for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
    "A String",
  ],
  "toolsets": [ # Optional. List of toolsets for the agent.
    { # A toolset with a selection of its tools.
      "toolIds": [ # Optional. The tools IDs to filter the toolset.
        "A String",
      ],
      "toolset": "A String", # Required. The resource name of the toolset. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
    },
  ],
  "transferRules": [ # Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
    { # Rule for transferring to a specific agent.
      "childAgent": "A String", # Required. The resource name of the child agent the rule applies to. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
      "deterministicTransfer": { # Deterministic transfer rule. When the condition evaluates to true, the transfer occurs. # Optional. A rule that immediately transfers to the target agent when the condition is met.
        "expressionCondition": { # Expression condition based on session state. # Optional. A rule that evaluates a session state condition. If the condition evaluates to true, the transfer occurs.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
        "pythonCodeCondition": { # Python code block to evaluate the condition. # Optional. A rule that uses Python code block to evaluate the conditions. If the condition evaluates to true, the transfer occurs.
          "pythonCode": "A String", # Required. The python code to execute.
        },
      },
      "direction": "A String", # Required. The direction of the transfer.
      "disablePlannerTransfer": { # A rule that prevents the planner from transferring to the target agent. # Optional. Rule that prevents the planner from transferring to the target agent.
        "expressionCondition": { # Expression condition based on session state. # Required. If the condition evaluates to true, planner will not be allowed to transfer to the target agent.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
      },
    },
  ],
  "updateTime": "A String", # Output only. Timestamp when the agent was last updated.
}
delete(name, etag=None, force=None, x__xgafv=None)
Deletes the specified agent.

Args:
  name: string, Required. The resource name of the agent to delete. (required)
  etag: string, Optional. The current etag of the agent. If an etag is not provided, the deletion will overwrite any concurrent changes. If an etag is provided and does not match the current etag of the agent, deletion will be blocked and an ABORTED error will be returned.
  force: boolean, Optional. Indicates whether to forcefully delete the agent, even if it is still referenced by other app/agents/examples. * If `force = false`, the deletion fails if other agents/examples reference it. * If `force = true`, delete the agent and remove it from all referencing apps/agents/examples.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}
get(name, x__xgafv=None)
Gets details of the specified agent.

Args:
  name: string, Required. The resource name of the agent to retrieve. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.
  "afterAgentCallbacks": [ # Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterModelCallbacks": [ # Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterToolCallbacks": [ # Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeAgentCallbacks": [ # Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeModelCallbacks": [ # Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeToolCallbacks": [ # Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "childAgents": [ # Optional. List of child agents in the agent tree. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
    "A String",
  ],
  "createTime": "A String", # Output only. Timestamp when the agent was created.
  "description": "A String", # Optional. Human-readable description of the agent.
  "displayName": "A String", # Required. Display name of the agent.
  "etag": "A String", # Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
  "generatedSummary": "A String", # Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
  "guardrails": [ # Optional. List of guardrails for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`
    "A String",
  ],
  "instruction": "A String", # Optional. Instructions for the LLM model to guide the agent's behavior.
  "llmAgent": { # Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model. # Optional. The default agent type.
  },
  "modelSettings": { # Model settings contains various configurations for the LLM model. # Optional. Configurations for the LLM model.
    "model": "A String", # Optional. The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
    "temperature": 3.14, # Optional. If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
  },
  "name": "A String", # Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
  "remoteDialogflowAgent": { # The agent which will transfer execution to a remote [Dialogflow CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. The Dialogflow agent will process subsequent user queries until the session ends or flow ends, and the control is transferred back to the parent CES agent. # Optional. The remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant `roles/dialogflow.client` to the CES service agent `service-@gcp-sa-ces.iam.gserviceaccount.com`.
    "agent": "A String", # Required. The [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent resource name. Format: `projects/{project}/locations/{location}/agents/{agent}`
    "environmentId": "A String", # Optional. The environment ID of the Dialogflow agent to be used for the agent execution. If not specified, the draft environment will be used.
    "flowId": "A String", # Optional. The flow ID of the flow in the Dialogflow agent.
    "inputVariableMapping": { # Optional. The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
      "a_key": "A String",
    },
    "outputVariableMapping": { # Optional. The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
      "a_key": "A String",
    },
    "respectResponseInterruptionSettings": True or False, # Optional. Indicates whether to respect the message-level interruption settings configured in the Dialogflow agent. * If false: all response messages from the Dialogflow agent follow the app-level barge-in settings. * If true: only response messages with [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) set to true will be interruptable, all other messages follow the app-level barge-in settings.
  },
  "tools": [ # Optional. List of available tools for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
    "A String",
  ],
  "toolsets": [ # Optional. List of toolsets for the agent.
    { # A toolset with a selection of its tools.
      "toolIds": [ # Optional. The tools IDs to filter the toolset.
        "A String",
      ],
      "toolset": "A String", # Required. The resource name of the toolset. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
    },
  ],
  "transferRules": [ # Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
    { # Rule for transferring to a specific agent.
      "childAgent": "A String", # Required. The resource name of the child agent the rule applies to. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
      "deterministicTransfer": { # Deterministic transfer rule. When the condition evaluates to true, the transfer occurs. # Optional. A rule that immediately transfers to the target agent when the condition is met.
        "expressionCondition": { # Expression condition based on session state. # Optional. A rule that evaluates a session state condition. If the condition evaluates to true, the transfer occurs.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
        "pythonCodeCondition": { # Python code block to evaluate the condition. # Optional. A rule that uses Python code block to evaluate the conditions. If the condition evaluates to true, the transfer occurs.
          "pythonCode": "A String", # Required. The python code to execute.
        },
      },
      "direction": "A String", # Required. The direction of the transfer.
      "disablePlannerTransfer": { # A rule that prevents the planner from transferring to the target agent. # Optional. Rule that prevents the planner from transferring to the target agent.
        "expressionCondition": { # Expression condition based on session state. # Required. If the condition evaluates to true, planner will not be allowed to transfer to the target agent.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
      },
    },
  ],
  "updateTime": "A String", # Output only. Timestamp when the agent was last updated.
}
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists agents in the given app.

Args:
  parent: string, Required. The resource name of the app to list agents from. (required)
  filter: string, Optional. Filter to be applied when listing the agents. See https://google.aip.dev/160 for more details.
  orderBy: string, Optional. Field to sort by. Only "name" and "create_time" is supported. See https://google.aip.dev/132#ordering for more details.
  pageSize: integer, Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  pageToken: string, Optional. The next_page_token value returned from a previous list AgentService.ListAgents call.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for AgentService.ListAgents.
  "agents": [ # The list of agents.
    { # An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.
      "afterAgentCallbacks": [ # Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
        { # A callback defines the custom logic to be executed at various stages of agent interaction.
          "description": "A String", # Optional. Human-readable description of the callback.
          "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
          "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
          "pythonCode": "A String", # Required. The python code to execute for the callback.
        },
      ],
      "afterModelCallbacks": [ # Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
        { # A callback defines the custom logic to be executed at various stages of agent interaction.
          "description": "A String", # Optional. Human-readable description of the callback.
          "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
          "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
          "pythonCode": "A String", # Required. The python code to execute for the callback.
        },
      ],
      "afterToolCallbacks": [ # Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
        { # A callback defines the custom logic to be executed at various stages of agent interaction.
          "description": "A String", # Optional. Human-readable description of the callback.
          "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
          "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
          "pythonCode": "A String", # Required. The python code to execute for the callback.
        },
      ],
      "beforeAgentCallbacks": [ # Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
        { # A callback defines the custom logic to be executed at various stages of agent interaction.
          "description": "A String", # Optional. Human-readable description of the callback.
          "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
          "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
          "pythonCode": "A String", # Required. The python code to execute for the callback.
        },
      ],
      "beforeModelCallbacks": [ # Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
        { # A callback defines the custom logic to be executed at various stages of agent interaction.
          "description": "A String", # Optional. Human-readable description of the callback.
          "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
          "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
          "pythonCode": "A String", # Required. The python code to execute for the callback.
        },
      ],
      "beforeToolCallbacks": [ # Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
        { # A callback defines the custom logic to be executed at various stages of agent interaction.
          "description": "A String", # Optional. Human-readable description of the callback.
          "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
          "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
          "pythonCode": "A String", # Required. The python code to execute for the callback.
        },
      ],
      "childAgents": [ # Optional. List of child agents in the agent tree. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
        "A String",
      ],
      "createTime": "A String", # Output only. Timestamp when the agent was created.
      "description": "A String", # Optional. Human-readable description of the agent.
      "displayName": "A String", # Required. Display name of the agent.
      "etag": "A String", # Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
      "generatedSummary": "A String", # Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
      "guardrails": [ # Optional. List of guardrails for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`
        "A String",
      ],
      "instruction": "A String", # Optional. Instructions for the LLM model to guide the agent's behavior.
      "llmAgent": { # Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model. # Optional. The default agent type.
      },
      "modelSettings": { # Model settings contains various configurations for the LLM model. # Optional. Configurations for the LLM model.
        "model": "A String", # Optional. The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
        "temperature": 3.14, # Optional. If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
      },
      "name": "A String", # Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
      "remoteDialogflowAgent": { # The agent which will transfer execution to a remote [Dialogflow CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. The Dialogflow agent will process subsequent user queries until the session ends or flow ends, and the control is transferred back to the parent CES agent. # Optional. The remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant `roles/dialogflow.client` to the CES service agent `service-@gcp-sa-ces.iam.gserviceaccount.com`.
        "agent": "A String", # Required. The [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent resource name. Format: `projects/{project}/locations/{location}/agents/{agent}`
        "environmentId": "A String", # Optional. The environment ID of the Dialogflow agent to be used for the agent execution. If not specified, the draft environment will be used.
        "flowId": "A String", # Optional. The flow ID of the flow in the Dialogflow agent.
        "inputVariableMapping": { # Optional. The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
          "a_key": "A String",
        },
        "outputVariableMapping": { # Optional. The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
          "a_key": "A String",
        },
        "respectResponseInterruptionSettings": True or False, # Optional. Indicates whether to respect the message-level interruption settings configured in the Dialogflow agent. * If false: all response messages from the Dialogflow agent follow the app-level barge-in settings. * If true: only response messages with [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) set to true will be interruptable, all other messages follow the app-level barge-in settings.
      },
      "tools": [ # Optional. List of available tools for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
        "A String",
      ],
      "toolsets": [ # Optional. List of toolsets for the agent.
        { # A toolset with a selection of its tools.
          "toolIds": [ # Optional. The tools IDs to filter the toolset.
            "A String",
          ],
          "toolset": "A String", # Required. The resource name of the toolset. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
        },
      ],
      "transferRules": [ # Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
        { # Rule for transferring to a specific agent.
          "childAgent": "A String", # Required. The resource name of the child agent the rule applies to. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
          "deterministicTransfer": { # Deterministic transfer rule. When the condition evaluates to true, the transfer occurs. # Optional. A rule that immediately transfers to the target agent when the condition is met.
            "expressionCondition": { # Expression condition based on session state. # Optional. A rule that evaluates a session state condition. If the condition evaluates to true, the transfer occurs.
              "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
            },
            "pythonCodeCondition": { # Python code block to evaluate the condition. # Optional. A rule that uses Python code block to evaluate the conditions. If the condition evaluates to true, the transfer occurs.
              "pythonCode": "A String", # Required. The python code to execute.
            },
          },
          "direction": "A String", # Required. The direction of the transfer.
          "disablePlannerTransfer": { # A rule that prevents the planner from transferring to the target agent. # Optional. Rule that prevents the planner from transferring to the target agent.
            "expressionCondition": { # Expression condition based on session state. # Required. If the condition evaluates to true, planner will not be allowed to transfer to the target agent.
              "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
            },
          },
        },
      ],
      "updateTime": "A String", # Output only. Timestamp when the agent was last updated.
    },
  ],
  "nextPageToken": "A String", # A token that can be sent as ListAgentsRequest.page_token to retrieve the next page. Absence of this field indicates there are no subsequent pages.
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.
        
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates the specified agent.

Args:
  name: string, Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` (required)
  body: object, The request body.
    The object takes the form of:

{ # An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.
  "afterAgentCallbacks": [ # Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterModelCallbacks": [ # Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterToolCallbacks": [ # Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeAgentCallbacks": [ # Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeModelCallbacks": [ # Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeToolCallbacks": [ # Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "childAgents": [ # Optional. List of child agents in the agent tree. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
    "A String",
  ],
  "createTime": "A String", # Output only. Timestamp when the agent was created.
  "description": "A String", # Optional. Human-readable description of the agent.
  "displayName": "A String", # Required. Display name of the agent.
  "etag": "A String", # Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
  "generatedSummary": "A String", # Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
  "guardrails": [ # Optional. List of guardrails for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`
    "A String",
  ],
  "instruction": "A String", # Optional. Instructions for the LLM model to guide the agent's behavior.
  "llmAgent": { # Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model. # Optional. The default agent type.
  },
  "modelSettings": { # Model settings contains various configurations for the LLM model. # Optional. Configurations for the LLM model.
    "model": "A String", # Optional. The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
    "temperature": 3.14, # Optional. If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
  },
  "name": "A String", # Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
  "remoteDialogflowAgent": { # The agent which will transfer execution to a remote [Dialogflow CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. The Dialogflow agent will process subsequent user queries until the session ends or flow ends, and the control is transferred back to the parent CES agent. # Optional. The remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant `roles/dialogflow.client` to the CES service agent `service-@gcp-sa-ces.iam.gserviceaccount.com`.
    "agent": "A String", # Required. The [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent resource name. Format: `projects/{project}/locations/{location}/agents/{agent}`
    "environmentId": "A String", # Optional. The environment ID of the Dialogflow agent to be used for the agent execution. If not specified, the draft environment will be used.
    "flowId": "A String", # Optional. The flow ID of the flow in the Dialogflow agent.
    "inputVariableMapping": { # Optional. The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
      "a_key": "A String",
    },
    "outputVariableMapping": { # Optional. The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
      "a_key": "A String",
    },
    "respectResponseInterruptionSettings": True or False, # Optional. Indicates whether to respect the message-level interruption settings configured in the Dialogflow agent. * If false: all response messages from the Dialogflow agent follow the app-level barge-in settings. * If true: only response messages with [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) set to true will be interruptable, all other messages follow the app-level barge-in settings.
  },
  "tools": [ # Optional. List of available tools for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
    "A String",
  ],
  "toolsets": [ # Optional. List of toolsets for the agent.
    { # A toolset with a selection of its tools.
      "toolIds": [ # Optional. The tools IDs to filter the toolset.
        "A String",
      ],
      "toolset": "A String", # Required. The resource name of the toolset. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
    },
  ],
  "transferRules": [ # Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
    { # Rule for transferring to a specific agent.
      "childAgent": "A String", # Required. The resource name of the child agent the rule applies to. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
      "deterministicTransfer": { # Deterministic transfer rule. When the condition evaluates to true, the transfer occurs. # Optional. A rule that immediately transfers to the target agent when the condition is met.
        "expressionCondition": { # Expression condition based on session state. # Optional. A rule that evaluates a session state condition. If the condition evaluates to true, the transfer occurs.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
        "pythonCodeCondition": { # Python code block to evaluate the condition. # Optional. A rule that uses Python code block to evaluate the conditions. If the condition evaluates to true, the transfer occurs.
          "pythonCode": "A String", # Required. The python code to execute.
        },
      },
      "direction": "A String", # Required. The direction of the transfer.
      "disablePlannerTransfer": { # A rule that prevents the planner from transferring to the target agent. # Optional. Rule that prevents the planner from transferring to the target agent.
        "expressionCondition": { # Expression condition based on session state. # Required. If the condition evaluates to true, planner will not be allowed to transfer to the target agent.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
      },
    },
  ],
  "updateTime": "A String", # Output only. Timestamp when the agent was last updated.
}

  updateMask: string, Optional. Field mask is used to control which fields get updated. If the mask is not present, all fields will be updated.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.
  "afterAgentCallbacks": [ # Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterModelCallbacks": [ # Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "afterToolCallbacks": [ # Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeAgentCallbacks": [ # Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeModelCallbacks": [ # Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "beforeToolCallbacks": [ # Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped.
    { # A callback defines the custom logic to be executed at various stages of agent interaction.
      "description": "A String", # Optional. Human-readable description of the callback.
      "disabled": True or False, # Optional. Whether the callback is disabled. Disabled callbacks are ignored by the agent.
      "proactiveExecutionEnabled": True or False, # Optional. If enabled, the callback will also be executed on intermediate model outputs. This setting only affects after model callback. **ENABLE WITH CAUTION**. Typically after model callback only needs to be executed after receiving all model responses. Enabling proactive execution may have negative implication on the execution cost and latency, and should only be enabled in rare situations.
      "pythonCode": "A String", # Required. The python code to execute for the callback.
    },
  ],
  "childAgents": [ # Optional. List of child agents in the agent tree. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
    "A String",
  ],
  "createTime": "A String", # Output only. Timestamp when the agent was created.
  "description": "A String", # Optional. Human-readable description of the agent.
  "displayName": "A String", # Required. Display name of the agent.
  "etag": "A String", # Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.
  "generatedSummary": "A String", # Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
  "guardrails": [ # Optional. List of guardrails for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`
    "A String",
  ],
  "instruction": "A String", # Optional. Instructions for the LLM model to guide the agent's behavior.
  "llmAgent": { # Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model. # Optional. The default agent type.
  },
  "modelSettings": { # Model settings contains various configurations for the LLM model. # Optional. Configurations for the LLM model.
    "model": "A String", # Optional. The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
    "temperature": 3.14, # Optional. If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
  },
  "name": "A String", # Identifier. The unique identifier of the agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
  "remoteDialogflowAgent": { # The agent which will transfer execution to a remote [Dialogflow CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. The Dialogflow agent will process subsequent user queries until the session ends or flow ends, and the control is transferred back to the parent CES agent. # Optional. The remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent to be used for the agent execution. If this field is set, all other agent level properties will be ignored. Note: If the Dialogflow agent is in a different project from the app, you should grant `roles/dialogflow.client` to the CES service agent `service-@gcp-sa-ces.iam.gserviceaccount.com`.
    "agent": "A String", # Required. The [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent resource name. Format: `projects/{project}/locations/{location}/agents/{agent}`
    "environmentId": "A String", # Optional. The environment ID of the Dialogflow agent to be used for the agent execution. If not specified, the draft environment will be used.
    "flowId": "A String", # Optional. The flow ID of the flow in the Dialogflow agent.
    "inputVariableMapping": { # Optional. The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
      "a_key": "A String",
    },
    "outputVariableMapping": { # Optional. The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
      "a_key": "A String",
    },
    "respectResponseInterruptionSettings": True or False, # Optional. Indicates whether to respect the message-level interruption settings configured in the Dialogflow agent. * If false: all response messages from the Dialogflow agent follow the app-level barge-in settings. * If true: only response messages with [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) set to true will be interruptable, all other messages follow the app-level barge-in settings.
  },
  "tools": [ # Optional. List of available tools for the agent. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
    "A String",
  ],
  "toolsets": [ # Optional. List of toolsets for the agent.
    { # A toolset with a selection of its tools.
      "toolIds": [ # Optional. The tools IDs to filter the toolset.
        "A String",
      ],
      "toolset": "A String", # Required. The resource name of the toolset. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
    },
  ],
  "transferRules": [ # Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used.
    { # Rule for transferring to a specific agent.
      "childAgent": "A String", # Required. The resource name of the child agent the rule applies to. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
      "deterministicTransfer": { # Deterministic transfer rule. When the condition evaluates to true, the transfer occurs. # Optional. A rule that immediately transfers to the target agent when the condition is met.
        "expressionCondition": { # Expression condition based on session state. # Optional. A rule that evaluates a session state condition. If the condition evaluates to true, the transfer occurs.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
        "pythonCodeCondition": { # Python code block to evaluate the condition. # Optional. A rule that uses Python code block to evaluate the conditions. If the condition evaluates to true, the transfer occurs.
          "pythonCode": "A String", # Required. The python code to execute.
        },
      },
      "direction": "A String", # Required. The direction of the transfer.
      "disablePlannerTransfer": { # A rule that prevents the planner from transferring to the target agent. # Optional. Rule that prevents the planner from transferring to the target agent.
        "expressionCondition": { # Expression condition based on session state. # Required. If the condition evaluates to true, planner will not be allowed to transfer to the target agent.
          "expression": "A String", # Required. The string representation of cloud.api.Expression condition.
        },
      },
    },
  ],
  "updateTime": "A String", # Output only. Timestamp when the agent was last updated.
}