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
//! Production-ready Chipp API client
//!
//! Provides async HTTP client for interacting with the Chipp API (<https://chipp.ai>).
//! Supports both non-streaming and streaming (SSE) responses with automatic retry logic.
//!
//! # Features
//!
//! - **Non-streaming chat**: Simple request/response with `chat()`
//! - **Streaming chat**: Server-Sent Events (SSE) with `chat_stream()`
//! - **Session management**: Automatic `chatSessionId` tracking for conversation continuity
//! - **Retry logic**: Exponential backoff for transient failures (5xx, network errors)
//! - **Configurable timeouts**: Per-request timeout configuration
//! - **Correlation IDs**: Automatic UUID generation for request tracing
//!
//! # API Reference
//!
//! See: <https://chipp.ai/docs/api/reference>
//!
//! # Non-Streaming Example
//!
//! ```no_run
//! use chipp::{ChippClient, ChippConfig, ChippSession, ChippMessage};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let config = ChippConfig::builder()
//! .api_key("YOUR_API_KEY_HERE")
//! .model("myapp-123")
//! .build()?;
//!
//! let client = ChippClient::new(config)?;
//! let mut session = ChippSession::new();
//!
//! let response = client.chat(&mut session, &[ChippMessage::user("What is Chipp?")]).await?;
//! println!("Response: {}", response);
//! # Ok(())
//! # }
//! ```
//!
//! # Streaming Example
//!
//! ```no_run
//! use chipp::{ChippClient, ChippConfig, ChippSession, ChippMessage};
//! use futures::StreamExt;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let config = ChippConfig::builder()
//! .api_key("YOUR_API_KEY_HERE")
//! .model("myapp-123")
//! .build()?;
//!
//! let client = ChippClient::new(config)?;
//! let mut session = ChippSession::new();
//!
//! let mut stream = client.chat_stream(&mut session, &[ChippMessage::user("Tell me a story")]).await?;
//!
//! while let Some(chunk) = stream.next().await {
//! match chunk {
//! Ok(text) => print!("{}", text),
//! Err(e) => eprintln!("Stream error: {}", e),
//! }
//! }
//! # Ok(())
//! # }
//! ```
// Re-export public API
pub use ChippClient;
pub use ;
pub use ;
pub use ChippStream;
pub use ;