omni_dev/claude/
ai_client.rs

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