1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct Config {
7 pub providers: Vec<ProviderConfig>,
8}
9
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct ProviderConfig {
12 pub name: String,
13 pub api_key: Option<String>,
14 pub base_url: Option<String>,
15}
16
17#[derive(Debug, thiserror::Error)]
18pub enum Error {
19 #[error("provider not configured: {0}")]
20 ProviderNotConfigured(String),
21 #[error("authentication failed: {0}")]
22 AuthFailed(String),
23 #[error("request failed: {0}")]
24 RequestFailed(String),
25}
26
27pub type Result<T> = std::result::Result<T, Error>;