diff options
| author | sigoden <sigoden@gmail.com> | 2024-04-23 18:14:47 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-23 18:14:47 +0800 |
| commit | 9c6c9f10a27d0993636b453f39d8934c95c5c2b2 (patch) | |
| tree | 268598294b234c7eac87fc70d1e2d1b32ac88a78 /src/client/ollama.rs | |
| parent | d1aafa11153ab689c21c2c57c47da52337d8e8d1 (diff) | |
| download | aichat-9c6c9f10a27d0993636b453f39d8934c95c5c2b2.tar.gz | |
feat: builtin models can be overwrited by models config (#429)
Diffstat (limited to 'src/client/ollama.rs')
| -rw-r--r-- | src/client/ollama.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/client/ollama.rs b/src/client/ollama.rs index 1692942..de658c1 100644 --- a/src/client/ollama.rs +++ b/src/client/ollama.rs @@ -1,6 +1,6 @@ use super::{ - convert_models, message::*, patch_system_message, Client, ExtraConfig, Model, ModelConfig, - OllamaClient, PromptType, ReplyHandler, SendData, + message::*, patch_system_message, Client, ExtraConfig, Model, ModelConfig, OllamaClient, + PromptType, ReplyHandler, SendData, }; use crate::utils::PromptKind; @@ -43,6 +43,7 @@ impl Client for OllamaClient { } impl OllamaClient { + list_models_fn!(OllamaConfig); config_get_fn!(api_key, get_api_key); pub const PROMPTS: [PromptType<'static>; 4] = [ @@ -57,11 +58,6 @@ impl OllamaClient { ), ]; - pub fn list_models(local_config: &OllamaConfig) -> Vec<Model> { - let client_name = Self::name(local_config); - convert_models(client_name, &local_config.models) - } - fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result<RequestBuilder> { let api_key = self.get_api_key().ok(); |
