1#[derive(thiserror::Error, Debug)]
3pub enum Error {
4 #[error("Unknown model provider {0}")]
6 UnknownProvider(String),
7
8 #[error("No default provider for model {0}")]
10 NoDefault(String),
11
12 #[error("Alias {0} references nonexistent provider {1}")]
14 NoAliasProvider(String, String),
15
16 #[error("Alias {0} has no associated models")]
18 AliasEmpty(String),
19
20 #[error("Alias {0} references nonexistent API key {1}")]
22 NoAliasApiKey(String, String),
23
24 #[error("Unknown API key name {0}")]
26 NoApiKey(String),
27
28 #[error("Request is missing model name")]
30 ModelNotSpecified,
31
32 #[error("Model provider returned an error")]
34 ModelError,
35
36 #[error("API key not provided")]
38 MissingApiKey,
39
40 #[error("Did not find environment variable {1} for API key {0}")]
42 MissingApiKeyEnv(String, String),
43
44 #[error("Failed to parse model provider's output")]
46 ResultParseError,
47
48 #[error("Failed to read configuration file")]
50 ReadingConfig,
51
52 #[error("Failed to load from the database")]
54 LoadingDatabase,
55
56 #[error("Failed to parse header value {0}: Expected a {1}")]
58 ReadingHeader(String, &'static str),
59
60 #[error("Did not see {0} in response stream")]
62 MissingStreamInformation(&'static str),
63}