Skip to main content

omni_dev/claude/ai/
mod.rs

1//! AI client trait and metadata definitions
2
3pub mod bedrock;
4pub mod claude;
5pub mod openai;
6
7use anyhow::Result;
8use std::future::Future;
9use std::pin::Pin;
10
11/// Metadata about an AI client implementation
12#[derive(Clone, Debug)]
13pub struct AiClientMetadata {
14    /// Service provider name
15    pub provider: String,
16    /// Model identifier
17    pub model: String,
18    /// Maximum context length supported
19    pub max_context_length: usize,
20    /// Maximum token response length supported
21    pub max_response_length: usize,
22}
23
24/// Trait for AI service clients
25pub trait AiClient: Send + Sync {
26    /// Send a request to the AI service and return the raw response
27    fn send_request<'a>(
28        &'a self,
29        system_prompt: &'a str,
30        user_prompt: &'a str,
31    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>;
32
33    /// Get metadata about the AI client implementation
34    fn get_metadata(&self) -> AiClientMetadata;
35}