Expand description
What an agent’s source file usually wants: use adam::prelude::*;.
Macros§
Structs§
- Agent
Def - An agent as its files describe it, before it is tied to tools, state and a model.
- Assembly
- The agents an
AgentDefmakes: the root and oneLlmAgentfor each local subagent definition, ready to register on a runtime. - Bound
Def - An agent definition whose tools are bound and whose prompts are rendered, waiting for the
state its tools need and for a model. Made by
AgentDef::bind. - FnTool
- A
Toolmade from a name, a description, an argument schema and a closure: for tools whose shape is known only at run time (a tool discovered from another service, say) or that are too small to deserve a type. - Json
- Returns
Tto the model as compact JSON text. - Limits
- Bounds on one run. A run that reaches
max_turnsormax_tool_callsgets one closing model call in which it may call no tool, and ends with that answer markedlimited(the output’slimitedandlimit); if the closing call says nothing the run fails with a message naming the limit (RunView::error). The history limit shortens old tool outputs instead (seemax_history_tokens). - LlmAgent
- A durable LLM tool-calling agent: instructions + a model + a toolset.
- State
- Shared state as a tool sees it: a cheap-to-clone handle to a
Tthat the agent was given withLlmAgentBuilder::state. Derefs toT. - ToolCtx
- What a tool sees of the run it executes in.
- Tool
Output - What a successful tool call returns.
- ToolSet
- An ordered group of tools, built once and handed to an agent.
Enums§
- Assembly
Error - Why an
AgentDefcould not be bound to agents. - Build
Error - Why
LlmAgentBuilder::try_buildrefused to build an agent. - Tool
Error - Why a tool call did not produce an output.
Traits§
- Into
Tool Output - A value a tool can return as its output.
- Into
Tool Result - What a tool function returns, as the
Tool::callresult: anyIntoToolOutput, or aResultof one with an error that isInto<ToolError>. - Tool
- A capability the model may call.
Attribute Macros§
- tool
#[tool]: anasync fnbecomes aTool. See the crate docs. Turns anasync fninto a tool: keeps the function, and generates a unit struct (the function’s name inUpperCamelCase) that implementsadam::Tool.