use async_trait::async_trait;
pub mod anthropic;
pub mod github;
pub mod ollama;
pub mod otel;
pub use anthropic::AnthropicService;
pub use github::GitHubService as ExternalGitHubService;
pub use ollama::OllamaService;
pub use otel::OtelService;
#[async_trait]
pub trait ExternalService {
type Request;
type Response;
async fn call(&self, req: Self::Request) -> Result<Self::Response, ServiceError>;
}
#[derive(Debug, thiserror::Error)]
pub enum ServiceError {
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("API error: {code} - {message}")]
Api { code: i32, message: String },
#[error("Rate limited, retry after {retry_after_ms}ms")]
RateLimited { retry_after_ms: u64 },
#[error("Timeout after {0}ms")]
Timeout(u64),
}