pub struct Agent { /* private fields */ }Expand description
A built agent definition plus the client that executes its model calls.
Construct with Agent::builder.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn builder() -> AgentBuilder
pub fn builder() -> AgentBuilder
Starts building an agent.
Sourcepub fn def_hash(&self) -> &str
pub fn def_hash(&self) -> &str
The content hash of this definition, as recorded in RunStarted.
Computed once at build time; see the module docs for what it covers.
Sourcepub fn system_prompt(&self) -> Option<&str>
pub fn system_prompt(&self) -> Option<&str>
The system prompt, when one is set.
Sourcepub fn max_response_tokens(&self) -> u32
pub fn max_response_tokens(&self) -> u32
The max_tokens cap sent with each model request.
Sourcepub fn record_prompts(&self) -> bool
pub fn record_prompts(&self) -> bool
Whether runs of this agent record the full model request body into the
durable log. Off by default; see AgentBuilder::record_prompts. This
is operator/transport policy, not part of the definition, so it is
deliberately excluded from def_hash: flipping it
must not orphan an agent’s recorded runs.
Sourcepub fn labels(&self) -> Option<&BTreeMap<String, String>>
pub fn labels(&self) -> Option<&BTreeMap<String, String>>
Correlation tags to stamp on every fresh run of this agent, when set
with AgentBuilder::labels. Like record_prompts,
this is operator/deployment metadata, not part of the definition, so
it is deliberately excluded from def_hash:
relabeling an agent must not orphan its recorded runs.
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
A short human label for this agent, when set with
AgentBuilder::name — a display name the control plane’s agent
registry (GET /v1/agents/{hash}) can hand back to a caller that only
has the hash. Like labels and
record_prompts, this is descriptive
metadata, not part of the definition, so it is deliberately excluded
from def_hash: renaming an agent must not mint a
new identity or orphan its recorded runs.