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
//! LLM integration module.
//!
//! This module provides a unified interface for working with various LLM providers
//! including Anthropic, `OpenAI`, and `Ollama`. It implements the `ChatModel` trait
//! which abstracts over different provider APIs while providing a consistent interface.
//!
//! # Features
//!
//! - **Unified API**: Single `ChatModel` trait for all providers
//! - **Streaming support**: Real-time token streaming via `MessageChunk`
//! - **Tool calling**: Native support for function/tool calling
//! - **Error handling**: Comprehensive error types with retry logic
//! - **Provider-specific**: Optimized implementations for each provider
//!
//! # Example
//!
//! ```ignore
//! use juncture::llm::{ChatModel, ChatAnthropic};
//! use juncture::Message;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let model = ChatAnthropic::from_env()?;
//! let messages = vec![
//! Message::human("Hello, how are you?"),
//! ];
//!
//! let response = model.invoke(&messages, None).await?;
//! // Process response
//! Ok(())
//! }
//! ```
//!
//! # Module Structure
//!
//! - `trait_`: Core `ChatModel` trait and error types
//! - `message`: Message type definitions and re-exports
//! - `anthropic`: Anthropic Claude provider implementation
//! - `openai`: `OpenAI` GPT provider implementation
//! - `ollama`: Ollama local model provider implementation
//! - `mock`: Mock implementation for testing
//! - `pricing`: Model pricing information
//! - `retry`: Retry wrapper for resilient LLM calls
//! - `structured`: Structured output extraction
// Re-export core types from juncture-core
pub use ;
// Provider implementations (feature-gated)
// Public exports
pub use *;
pub use *;
pub use *;
pub use MockChatModel;
pub use ;
pub use RetryingModel;
pub use *;
// Provider exports
pub use ChatAnthropic;
pub use ChatOpenAI;
pub use ChatOllama;
pub use StructuredOutputModel;
// Rust guideline compliant 2026-05-19