summaryrefslogtreecommitdiffstats
path: root/src/client/localai.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-11-07 10:56:28 +0800
committerGitHub <noreply@github.com>2023-11-07 10:56:28 +0800
commit9a8b302432a3f9bfa1e467dde027fc92dacce3e2 (patch)
treeee18de8b077980619ff9a1dee24464a1d13b801d /src/client/localai.rs
parent87aec71e080dc9c15f3dd0059dbc91686f3de4e6 (diff)
downloadaichat-9a8b302432a3f9bfa1e467dde027fc92dacce3e2.tar.gz
refactor: remove Model.client_index, match client by name (#218)
Diffstat (limited to 'src/client/localai.rs')
-rw-r--r--src/client/localai.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/localai.rs b/src/client/localai.rs
index ecb0e63..93853dc 100644
--- a/src/client/localai.rs
+++ b/src/client/localai.rs
@@ -41,14 +41,14 @@ impl LocalAIClient {
),
];
- pub fn list_models(local_config: &LocalAIConfig, client_index: usize) -> Vec<Model> {
+ pub fn list_models(local_config: &LocalAIConfig) -> Vec<Model> {
let client_name = Self::name(local_config);
local_config
.models
.iter()
.map(|v| {
- Model::new(client_index, client_name, &v.name)
+ Model::new(client_name, &v.name)
.set_max_tokens(v.max_tokens)
.set_tokens_count_factors(OPENAI_TOKENS_COUNT_FACTORS)
})