diff options
| author | sigoden <sigoden@gmail.com> | 2024-04-25 10:15:54 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-25 10:15:54 +0800 |
| commit | 4db9b309803796bc5f996d0b3713344eb44207ec (patch) | |
| tree | a0ba8f3a2da32e5392e22272c641e3939de49be6 /src/client/mistral.rs | |
| parent | 8dacea4deb0fe67c0cdbe15bd47e6e50c1dd12a1 (diff) | |
| download | aichat-4db9b309803796bc5f996d0b3713344eb44207ec.tar.gz | |
refactor: rewrite list models of all clients (#436)
Diffstat (limited to 'src/client/mistral.rs')
| -rw-r--r-- | src/client/mistral.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/mistral.rs b/src/client/mistral.rs index 9dbd831..23bf1f2 100644 --- a/src/client/mistral.rs +++ b/src/client/mistral.rs @@ -10,13 +10,6 @@ use serde::Deserialize; const API_URL: &str = "https://api.mistral.ai/v1/chat/completions"; -const MODELS: [(&str, usize, &str); 3] = [ - // https://docs.mistral.ai/platform/endpoints/ - ("open-mixtral-8x22b", 64000, "text"), - ("mistral-small-latest", 32000, "text"), - ("mistral-large-latest", 32000, "text"), -]; - #[derive(Debug, Clone, Deserialize)] pub struct MistralConfig { pub name: Option<String>, @@ -29,7 +22,15 @@ pub struct MistralConfig { openai_compatible_client!(MistralClient); impl MistralClient { - list_models_fn!(MistralConfig, &MODELS); + list_models_fn!( + MistralConfig, + [ + // https://docs.mistral.ai/platform/endpoints/ + ("open-mixtral-8x22b", "text", 64000), + ("mistral-small-latest", "text", 32000), + ("mistral-large-latest", "text", 32000), + ] + ); config_get_fn!(api_key, get_api_key); pub const PROMPTS: [PromptType<'static>; 1] = |
