strands_agents/
lib.rs

1//! # Strands Agents - A Rust AI Agents SDK
2//!
3//! Strands is a model-agnostic SDK for building AI agents.
4//!
5//! ## Quick Start
6//!
7//! ```rust,no_run
8//! use strands_agents::{Agent, AgentBuilder};
9//! use strands_agents::models::BedrockModel;
10//!
11//! #[tokio::main]
12//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
13//!     let mut agent = Agent::builder()
14//!         .model(BedrockModel::new("anthropic.claude-3-sonnet-20240229-v1:0"))
15//!         .system_prompt("You are a helpful assistant")
16//!         .build()?;
17//!     
18//!     let result = agent.invoke_async("Hello!").await?;
19//!     println!("{}", result);
20//!     Ok(())
21//! }
22//! ```
23
24pub mod agent;
25pub mod async_utils;
26pub mod conversation;
27pub mod event_loop;
28pub mod handlers;
29pub mod hooks;
30pub mod identifier;
31pub mod models;
32pub mod multiagent;
33pub mod session;
34pub mod streaming;
35pub mod telemetry;
36pub mod tools;
37pub mod types;
38
39pub use agent::{Agent, AgentBuilder, AgentResult, AgentState};
40pub use multiagent::{Graph, GraphBuilder, Swarm, MultiAgentBase, MultiAgentResult};
41pub use types::content::{ContentBlock, Message, Messages, Role};
42pub use types::errors::StrandsError;
43pub use types::tools::{ToolResult, ToolSpec, ToolUse};
44
45#[cfg(feature = "macros")]
46pub use strands_agents_macros::tool;
47
48/// Prelude module for convenient imports.
49pub mod prelude {
50    pub use crate::agent::{Agent, AgentBuilder, AgentResult};
51    pub use crate::models::Model;
52    pub use crate::tools::AgentTool;
53    pub use crate::types::content::{ContentBlock, Message, Role};
54    pub use crate::types::errors::StrandsError;
55    pub use crate::types::tools::{ToolContext, ToolResult, ToolSpec};
56
57    #[cfg(feature = "macros")]
58    pub use strands_agents_macros::tool;
59}