Agent class

An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.

Constructors

Agent({List<Callback>? afterAgentCallbacks, List<Callback>? afterModelCallbacks, List<Callback>? afterToolCallbacks, List<Callback>? beforeAgentCallbacks, List<Callback>? beforeModelCallbacks, List<Callback>? beforeToolCallbacks, List<String>? childAgents, String? createTime, String? description, String? displayName, String? etag, String? generatedSummary, List<String>? guardrails, String? instruction, AgentLlmAgent? llmAgent, ModelSettings? modelSettings, String? name, AgentRemoteDialogflowAgent? remoteDialogflowAgent, List<String>? tools, List<AgentAgentToolset>? toolsets, List<TransferRule>? transferRules, String? updateTime, List<String>? validationErrors})
Agent.fromJson(Map json_)

Properties

afterAgentCallbacks ↔ List<Callback>?
The callbacks to execute after the agent is called.
getter/setter pair
afterModelCallbacks ↔ List<Callback>?
The callbacks to execute after the model is called.
getter/setter pair
afterToolCallbacks ↔ List<Callback>?
The callbacks to execute after the tool is invoked.
getter/setter pair
beforeAgentCallbacks ↔ List<Callback>?
The callbacks to execute before the agent is called.
getter/setter pair
beforeModelCallbacks ↔ List<Callback>?
The callbacks to execute before the model is called.
getter/setter pair
beforeToolCallbacks ↔ List<Callback>?
The callbacks to execute before the tool is invoked.
getter/setter pair
childAgents ↔ List<String>?
List of child agents in the agent tree.
getter/setter pair
createTime ↔ String?
Timestamp when the agent was created.
getter/setter pair
description ↔ String?
Human-readable description of the agent.
getter/setter pair
displayName ↔ String?
Display name of the agent.
getter/setter pair
etag ↔ String?
Etag used to ensure the object hasn't changed during a read-modify-write operation.
getter/setter pair
generatedSummary ↔ String?
If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
getter/setter pair
guardrails ↔ List<String>?
List of guardrails for the agent.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
instruction ↔ String?
Instructions for the LLM model to guide the agent's behavior.
getter/setter pair
llmAgent ↔ AgentLlmAgent?
The default agent type.
getter/setter pair
modelSettings ↔ ModelSettings?
Configurations for the LLM model.
getter/setter pair
name ↔ String?
Identifier.
getter/setter pair
remoteDialogflowAgent ↔ AgentRemoteDialogflowAgent?
The remote Dialogflow agent to be used for the agent execution.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tools ↔ List<String>?
List of available tools for the agent.
getter/setter pair
toolsets ↔ List<AgentAgentToolset>?
List of toolsets for the agent.
getter/setter pair
transferRules ↔ List<TransferRule>?
Agent transfer rules.
getter/setter pair
updateTime ↔ String?
Timestamp when the agent was last updated.
getter/setter pair
validationErrors ↔ List<String>?
Misconfigurations or errors in the agent that may affect agent quality.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited