diff options
| author | sigoden <sigoden@gmail.com> | 2023-11-07 10:56:28 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-07 10:56:28 +0800 |
| commit | 9a8b302432a3f9bfa1e467dde027fc92dacce3e2 (patch) | |
| tree | ee18de8b077980619ff9a1dee24464a1d13b801d /src/client/openai.rs | |
| parent | 87aec71e080dc9c15f3dd0059dbc91686f3de4e6 (diff) | |
| download | aichat-9a8b302432a3f9bfa1e467dde027fc92dacce3e2.tar.gz | |
refactor: remove Model.client_index, match client by name (#218)
Diffstat (limited to 'src/client/openai.rs')
| -rw-r--r-- | src/client/openai.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/openai.rs b/src/client/openai.rs index 7c10a4d..6b5edab 100644 --- a/src/client/openai.rs +++ b/src/client/openai.rs @@ -44,12 +44,12 @@ impl OpenAIClient { pub const PROMPTS: [PromptType<'static>; 1] = [("api_key", "API Key:", true, PromptKind::String)]; - pub fn list_models(local_config: &OpenAIConfig, client_index: usize) -> Vec<Model> { + pub fn list_models(local_config: &OpenAIConfig) -> Vec<Model> { let client_name = Self::name(local_config); MODELS .into_iter() .map(|(name, max_tokens)| { - Model::new(client_index, client_name, name) + Model::new(client_name, name) .set_max_tokens(Some(max_tokens)) .set_tokens_count_factors(OPENAI_TOKENS_COUNT_FACTORS) }) |
