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/openai.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/client/openai.rs') diff --git a/src/client/openai.rs b/src/client/openai.rs index 56cc53c..c996ed0 100644 --- a/src/client/openai.rs +++ b/src/client/openai.rs @@ -1,4 +1,4 @@ -use super::{ExtraConfig, Model, OpenAIClient, PromptType, SendData, TokensCountFactors}; +use super::{ExtraConfig, Model, OpenAIClient, PromptType, SendData}; use crate::{render::ReplyHandler, utils::PromptKind}; @@ -24,8 +24,6 @@ const MODELS: [(&str, usize, &str); 8] = [ ("gpt-4-32k", 32768, "text"), ]; -pub const OPENAI_TOKENS_COUNT_FACTORS: TokensCountFactors = (5, 2); - #[derive(Debug, Clone, Deserialize, Default)] pub struct OpenAIConfig { pub name: Option, @@ -52,7 +50,6 @@ impl OpenAIClient { 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() } -- cgit v1.2.3