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
//! aither-claude
//!
//! Claude provider integration for aither.
//!
//! This crate provides the necessary components to interact with the Anthropic Claude API
//! through the aither framework. It includes a client for making requests, error handling,
//! and full support for Claude's capabilities.
//!
//! ## Features
//!
//! - **Streaming**: Full SSE streaming support for real-time responses
//! - **Tool Use**: Function calling with automatic iteration loop
//! - **Vision**: Image understanding via base64 or URL references
//! - **Extended Thinking**: Support for Claude's reasoning/thinking mode
//!
//! ## Getting Started
//!
//! ```ignore
//! use aither_claude::Claude;
//! use aither_core::{LanguageModel, llm::oneshot};
//!
//! let client = Claude::new(std::env::var("ANTHROPIC_API_KEY")?);
//!
//! // Simple chat
//! let response = client.respond(oneshot(
//! "You are a helpful assistant.",
//! "Explain Rust ownership in one paragraph."
//! )).await?;
//!
//! println!("{response}");
//! ```
//!
//! ## Custom Configuration
//!
//! ```no_run
//! use aither_claude::{Claude, CLAUDE_OPUS_4_0};
//!
//! let client = Claude::builder("your-api-key")
//! .model(CLAUDE_OPUS_4_0)
//! .max_tokens(8192)
//! .build();
//! ```
//!
//! ## Vision Support
//!
//! Claude can analyze images passed as attachments:
//!
//! ```ignore
//! use aither_claude::Claude;
//! use aither_core::{LanguageModel, llm::{LLMRequest, Message}};
//!
//! let client = Claude::new(std::env::var("ANTHROPIC_API_KEY")?);
//!
//! let message = Message::user("What's in this image?")
//! .with_attachment("https://example.com/image.jpg");
//!
//! let response = client.respond(LLMRequest::new([message])).await?;
//! ```
pub use ;
pub use *;
pub use ClaudeError;
pub use ClaudeProvider;
/// Provider tag stamped on reasoning state produced by this crate.
///
/// Reasoning state is only ever replayed to the provider that signed it, so
/// this string must stay stable across releases; changing it silently
/// invalidates state stored in existing transcripts.
pub const PROVIDER_NAME: &str = "anthropic";