| 31 | |
| 32 | #[async_trait] |
| 33 | pub trait Provider: Send + Sync { |
| 34 | fn id(&self) -> &str; |
| 35 | fn name(&self) -> &str; |
| 36 | |
| 37 | fn models(&self) -> Vec<ModelInfo>; |
| 38 | fn get_model(&self, id: &str) -> Option<&ModelInfo>; |
| 39 | |
| 40 | async fn chat(&self, request: ChatRequest) -> Result<ChatResponse, ProviderError>; |
| 41 | async fn chat_stream(&self, request: ChatRequest) -> Result<StreamResult, ProviderError>; |
| 42 | } |
| 43 | |
| 44 | #[derive(Debug, thiserror::Error)] |
| 45 | pub enum ProviderError { |
nothing calls this directly
no outgoing calls
no test coverage detected