Module prelude

Source
Expand description

Prelude module for common imports

use agents_sdk::prelude::*;

Structs§

AgentMessage
Core message structure exchanged between runtimes, planners, and tools.
AgentStateSnapshot
Snapshot of agent state shared between runtime, planners, and tools.
ConfigurableAgentBuilder
Builder API to assemble a DeepAgent in a single fluent flow, mirroring the Python create_configurable_agent experience. Prefer this for ergonomic construction.
ToolBuilder
Builder for creating tools from async functions
ToolInvocation
Payload passed into tools when invoked by the runtime.

Enums§

MessageContent
MessageRole

Traits§

AgentHandle
Abstraction for hosting a fully configured agent (planner + tools + prompts).
Checkpointer
Trait for persisting and retrieving agent state between conversation runs. This mirrors the LangGraph Checkpointer interface used in the Python implementation.
PlannerHandle
Planner interface responsible for deciding which actions to take.

Functions§

get_default_model
Returns the default language model configured Uses OpenAI GPT-4o-mini for cost-effective operation. This model provides excellent performance at a fraction of the cost compared to larger models.
tool
Quick helper to create a simple async tool
tool_sync
Quick helper to create a simple sync tool

Type Aliases§

ThreadId
Unique identifier for a conversation thread/session.

Attribute Macros§

tool
Converts a Rust function into an AI agent tool with automatic schema generation.