Expand description
§Core components of AI Agents
This module contains core components that you can use in your AI Agents
To read more about Agents look into crate::agent::Agent
To read more about structured output look into crate::structured_output
To read more about tool look into crate::tool
Structs§
- Agent
- The
Agentstruct represents an agent that interacts with a chat model. - Agent
Request - A prepared run of an
Agent, created byAgent::runorAgent::run_stream. - Agent
Result - The result of a successful run.
- Agent
Stream - Stream of
AgentEvents of one run, returned by awaitingAgent::run_stream. - Chat
Options - Model options sent with every request: temperature, max tokens, tool choice, reasoning effort, …
- Complete
- Mode of an
AgentRequestcreated byAgent::run: awaiting it returns aAgentResult. - LlmError
- Error of the LLM client: a failed request, or a client that could not be built.
- RunOptions
- Settings that replace the
Agentconfiguration for one run. - Streaming
- Mode of an
AgentRequestcreated byAgent::run_stream: awaiting it returns anAgentStream. - Usage
- Tokens used by a run. See
AgentResult::usage.
Enums§
- Agent
Error - Errors returned by
Agent. - Agent
Event - Something that happened during a streamed run, see
Agent::run_stream. - Provider
- LLM provider for
Agent::new_with_provider. - Reasoning
Effort - How much a model should reason. See
ChatOptions::reasoning_effort. - Stop
Reason - Why the model stopped writing. See
AgentResult::stop_reason. - Tool
Choice - Whether and which tools the model must call. See
ChatOptions::tool_choice.
Constants§
- DEFAULT_
MAX_ ITERATIONS - Default number of model calls in one run.