Skip to main content

hanzo_agent/
lib.rs

1//! Hanzo Agent SDK - Core agent functionality
2//!
3//! This crate provides the core agent framework for building AI agents with tools, handoffs,
4//! and structured output support.
5//!
6//! # Example
7//!
8//! ```no_run
9//! use hanzo_agent::{Agent, RunConfig};
10//!
11//! #[tokio::main]
12//! async fn main() -> anyhow::Result<()> {
13//!     let agent = Agent::builder("assistant")
14//!         .instructions("You are a helpful assistant.")
15//!         .model("gpt-4")
16//!         .build();
17//!
18//!     let result = agent.run("Hello!", &RunConfig::default()).await?;
19//!     println!("Response: {}", result.final_output);
20//!     Ok(())
21//! }
22//! ```
23
24pub mod agent;
25pub mod context;
26pub mod errors;
27pub mod result;
28pub mod runner;
29pub mod tool;
30pub mod types;
31
32pub use agent::{Agent, AgentBuilder};
33pub use context::RunContext;
34pub use errors::AgentError;
35pub use result::{RunResult, RunResultStreaming};
36pub use runner::{RunConfig, Runner};
37pub use tool::{FunctionTool, Tool};
38pub use types::{InputItem, ModelResponse, RunItem};
39
40/// Re-export commonly used types
41pub mod prelude {
42    pub use crate::types::Usage;
43    pub use crate::{
44        Agent, AgentBuilder, AgentError, FunctionTool, RunConfig, RunContext, RunResult, Runner,
45        Tool,
46    };
47}