summaryrefslogtreecommitdiffstats
path: root/src/client/azure_openai.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/azure_openai.rs')
-rw-r--r--src/client/azure_openai.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/azure_openai.rs b/src/client/azure_openai.rs
index 3a48145..5603666 100644
--- a/src/client/azure_openai.rs
+++ b/src/client/azure_openai.rs
@@ -1,4 +1,4 @@
-use super::openai::{openai_build_body, openai_tokens_formula};
+use super::openai::{openai_build_body, OPENAI_TOKENS_COUNT_FACTORS};
use super::{AzureOpenAIClient, ExtraConfig, ModelInfo, PromptKind, PromptType, SendData};
use anyhow::{anyhow, Result};
@@ -46,7 +46,11 @@ impl AzureOpenAIClient {
local_config
.models
.iter()
- .map(|v| openai_tokens_formula(ModelInfo::new(index, client, &v.name).set_max_tokens(v.max_tokens)))
+ .map(|v| {
+ ModelInfo::new(index, client, &v.name)
+ .set_max_tokens(v.max_tokens)
+ .set_tokens_count_factors(OPENAI_TOKENS_COUNT_FACTORS)
+ })
.collect()
}