use crate::errors::LlmError;
use crate::ProviderType;
pub mod keys {
pub const PROVIDER: &str = "provider";
pub const MODEL: &str = "model";
pub const TASK: &str = "task";
pub const ERROR_TYPE: &str = "error_type";
}
pub fn provider_label(provider: ProviderType) -> &'static str {
match provider {
ProviderType::Anthropic => "anthropic",
ProviderType::OpenAI => "openai",
ProviderType::Mistral => "mistral",
ProviderType::Google => "google",
ProviderType::Ollama => "ollama",
ProviderType::LMStudio => "lmstudio",
ProviderType::Groq => "groq",
ProviderType::Cohere => "cohere",
ProviderType::TogetherAI => "togetherai",
ProviderType::Perplexity => "perplexity",
}
}
pub fn error_type_label(error: &LlmError) -> &'static str {
match error {
LlmError::RequestError(_) => "request_error",
LlmError::ApiError(_) => "api_error",
LlmError::RateLimit(_) => "rate_limit",
LlmError::ParseError(_) => "parse_error",
LlmError::ProviderDisabled(_) => "provider_disabled",
LlmError::ConfigError(_) => "config_error",
}
}