1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! agent-diva-nano — minimal "create an agent" library.
//!
//! Add to your project:
//! ```toml
//! [dependencies]
//! agent-diva-nano = "0.4.11"
//! tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
//! ```
//!
//! # Quick start
//!
//! ```rust,no_run
//! use agent_diva_nano::{chat, NanoConfig};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let config = NanoConfig {
//! model: "deepseek-chat".to_string(),
//! api_key: std::env::var("NANO_API_KEY")?,
//! ..Default::default()
//! };
//!
//! let reply = chat("What is Rust ownership?", &config).await?;
//! println!("{}", reply);
//! # Ok(())
//! # }
//! ```
//!
//! # Stateful agent
//!
//! For multi-turn conversations, use [`Agent`] directly:
//!
//! ```rust,no_run
//! use agent_diva_nano::{Agent, NanoConfig};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let config = NanoConfig {
//! model: "deepseek-chat".to_string(),
//! api_key: std::env::var("NANO_API_KEY")?,
//! ..Default::default()
//! };
//!
//! let mut agent = Agent::new(config).build().await?;
//! agent.start().await?;
//!
//! let r1 = agent.send("Hello").await?;
//! let r2 = agent.send("Tell me more").await?;
//!
//! agent.stop().await;
//! # Ok(())
//! # }
//! ```
//!
//! # Flexible tool assembly
//!
//! Use [`ToolAssembly`] for fine-grained control over which tools are available:
//!
//! ```rust,no_run
//! use agent_diva_nano::{AgentBuilder, ToolAssembly, BuiltInToolsConfig};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Create agent with minimal tools (only filesystem)
//! let assembly = ToolAssembly::new(std::path::PathBuf::from("./workspace"))
//! .builtin(BuiltInToolsConfig::minimal())
//! .build();
//!
//! // Or create agent with custom tools only
//! let assembly = ToolAssembly::new(std::path::PathBuf::from("./workspace"))
//! .builtin(BuiltInToolsConfig::none())
//! .with_tool(my_custom_tool);
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use NanoError;
pub use ;
pub use ;
/// Re-export tool types for custom tool creation.
pub use ;
/// Re-export core event types so consumers don't need to depend on `agent-diva-core`.
pub use AgentEvent;
/// Re-export provider registry so consumers can resolve provider names from model identifiers.
pub use ProviderRegistry;
/// Re-export FileManager when files feature is enabled.
pub use FileManager;