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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//! # LLM Auto Optimizer - Integrations
//!
//! Production-ready integrations with external services for the LLM Auto Optimizer.
//!
//! ## Features
//!
//! ### Jira Integration
//!
//! - Full CRUD operations for issues
//! - Project and board management
//! - JQL query support
//! - Webhook event handling
//! - OAuth 2.0 and Basic authentication
//! - Rate limiting and retry logic
//!
//! ### Anthropic Claude Integration
//!
//! - Message/completion endpoints
//! - Streaming support via Server-Sent Events
//! - Token counting and validation
//! - Cost tracking and estimation
//! - Rate limiting
//! - Multiple Claude model support
//!
//! ## Examples
//!
//! ### Jira Client
//!
//! ```no_run
//! use integrations::jira::{JiraClient, JiraConfig, JiraAuth};
//!
//! # async fn example() -> anyhow::Result<()> {
//! let config = JiraConfig {
//! base_url: "https://your-domain.atlassian.net".to_string(),
//! auth: JiraAuth::Basic {
//! email: "your-email@example.com".to_string(),
//! api_token: "your-api-token".to_string(),
//! },
//! timeout_secs: 30,
//! max_retries: 3,
//! rate_limit_per_minute: 100,
//! };
//!
//! let client = JiraClient::new(config).await?;
//! let projects = client.get_projects().await?;
//!
//! for project in projects {
//! println!("{}: {}", project.key, project.name);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ### Anthropic Client
//!
//! ```no_run
//! use integrations::anthropic::{AnthropicClient, AnthropicConfig, ClaudeModel};
//!
//! # async fn example() -> anyhow::Result<()> {
//! let config = AnthropicConfig {
//! api_key: "your-api-key".to_string(),
//! base_url: "https://api.anthropic.com".to_string(),
//! timeout_secs: 60,
//! max_retries: 3,
//! rate_limit_per_minute: 50,
//! api_version: "2023-06-01".to_string(),
//! };
//!
//! let client = AnthropicClient::new(config).await?;
//!
//! let response = client.complete(
//! ClaudeModel::Claude3Haiku,
//! "What is the capital of France?",
//! 100,
//! ).await?;
//!
//! println!("Response: {}", response);
//!
//! // Get cost statistics
//! let stats = client.get_cost_stats().await;
//! println!("Total cost: ${:.4}", stats.total_cost);
//! # Ok(())
//! # }
//! ```
//!
//! ## Architecture
//!
//! The integrations are designed with:
//!
//! - **Modularity**: Each integration is independent and self-contained
//! - **Type Safety**: Comprehensive type definitions with Serde support
//! - **Error Handling**: Detailed error types and context
//! - **Observability**: Built-in logging and tracing
//! - **Resilience**: Automatic retries, rate limiting, and circuit breakers
//! - **Testing**: Comprehensive unit and integration tests
//!
//! ## Production Readiness
//!
//! All integrations include:
//!
//! - Authentication and authorization
//! - Rate limiting and backoff strategies
//! - Comprehensive error handling
//! - Request/response logging
//! - Input validation
//! - Cost tracking (where applicable)
//! - Full test coverage
/// Jira REST API integration
/// Anthropic Claude API integration
// Re-export commonly used types
pub use ;
pub use ;
/// Library version
pub const VERSION: &str = env!;
/// Get the library version