From 3b5843fe2e6b4e3725bbc1b269c23115c953b2b0 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 11 Apr 2024 05:03:58 +0800 Subject: refactor: all clients use openai token counter (#402) --- src/client/mistral.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/client/mistral.rs') diff --git a/src/client/mistral.rs b/src/client/mistral.rs index 0ebb631..611c25c 100644 --- a/src/client/mistral.rs +++ b/src/client/mistral.rs @@ -1,4 +1,4 @@ -use super::openai::{openai_build_body, OPENAI_TOKENS_COUNT_FACTORS}; +use super::openai::openai_build_body; use super::{ExtraConfig, MistralClient, Model, PromptType, SendData}; use crate::utils::PromptKind; @@ -44,7 +44,6 @@ impl MistralClient { Model::new(client_name, name) .set_capabilities(capabilities.into()) .set_max_input_tokens(Some(max_input_tokens)) - .set_tokens_count_factors(OPENAI_TOKENS_COUNT_FACTORS) }) .collect() } @@ -52,8 +51,7 @@ impl MistralClient { fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result { let api_key = self.get_api_key().ok(); - let mut body = openai_build_body(data, self.model.name.clone()); - self.model.merge_extra_fields(&mut body); + let body = openai_build_body(data, self.model.name.clone()); let url = API_URL; -- cgit v1.2.3