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
//! # baochuan — 宝船
//!
//! **baochuan** (Bǎochuán, 宝船 — "Treasure Ship") is a multi-provider AI API
//! client for Rust. Just as Admiral Zheng He's colossal treasure ships sailed
//! from China to connect civilizations across the Indian Ocean, baochuan carries
//! your Rust code to every major AI provider through a single, unified interface.
//!
//! The companion Java library,
//! [ZhengHe](https://github.com/simonhochrein/zhenghe), is named after the
//! explorer who introduced China to Java (the island) — a fitting metaphor for
//! connecting Java to the DeepSeek API. baochuan continues that voyage, this
//! time in Rust, with a fleet of providers.
//!
//! ## Quickstart
//!
//! ```rust,no_run
//! use baochuan::{providers::DeepSeekProvider, ChatMessage, ChatRequestBuilder, Provider};
//!
//! #[tokio::main]
//! async fn main() {
//! let provider = DeepSeekProvider::new(
//! std::env::var("DEEPSEEK_API_KEY").expect("DEEPSEEK_API_KEY not set"),
//! );
//!
//! let request = ChatRequestBuilder::new("deepseek-chat")
//! .message(ChatMessage::user("Tell me about the treasure ships of Zheng He."))
//! .max_tokens(512)
//! .build()
//! .unwrap();
//!
//! let response = provider.chat(&request).await.unwrap();
//! println!("{}", response.content().unwrap_or(""));
//! }
//! ```
// Top-level re-exports for ergonomic use
pub use BaochuanError;
pub use Provider;
pub use ;