Skip to main content

Module agent

Module agent 

Source
Expand description

Agents: reusable configurations of the generation loop.

Agent is the abstraction; ToolLoopAgent is the built-in implementation that delegates to generate_text and stream_text. Applications may implement Agent themselves to combine models or add planning logic; an agent can also serve as the executor of a tool (sub-agent pattern), typically returning GenerateTextResult::text() as the tool output.

Structs§

AgentCall
Parameters of one agent call.
AgentStreamCall
Parameters of one streaming agent call.
PrepareCallInput
Input of PrepareCall.
PreparedCall
The effective settings of one call, as seen by PrepareCall.
ToolLoopAgent
An agent that runs the tool loop of generate_text/stream_text with fixed settings. Build with ToolLoopAgent::builder.
ToolLoopAgentBuilder
Builder for ToolLoopAgent. Besides the methods below it accepts every call setting of generate_text (prompt-independent ones).

Enums§

AgentInput
What the agent is asked about.

Constants§

AGENT_USER_AGENT
User-Agent product appended to agent requests.

Traits§

Agent
An agent: a model plus configuration that answers prompts, possibly over several tool-calling steps.
PrepareCall
Rewrites the settings of a call from its options (templated instructions, per-tenant tools, …).