use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, Serialize, Deserialize, Builder)]
#[builder(setter(into), default)]
pub struct AnthropicProviderSettings {
pub provider_name: String,
pub base_url: String,
pub api_key: String,
pub path: Option<String>,
#[serde(skip)]
#[builder(setter(skip))]
pub headers: Option<HashMap<String, String>>,
#[serde(skip)]
#[builder(setter(skip))]
pub body: Option<serde_json::Map<String, serde_json::Value>>,
}
impl Default for AnthropicProviderSettings {
fn default() -> Self {
Self {
provider_name: "anthropic".to_string(),
base_url: "https://api.anthropic.com/v1/".to_string(),
api_key: std::env::var("ANTHROPIC_API_KEY").unwrap_or_default(),
path: None,
headers: None,
body: None,
}
}
}
impl AnthropicProviderSettings {
pub fn builder() -> AnthropicProviderSettingsBuilder {
AnthropicProviderSettingsBuilder::default()
}
}