summaryrefslogtreecommitdiffstats
path: root/src/client/moonshot.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-11 05:03:58 +0800
committerGitHub <noreply@github.com>2024-04-11 05:03:58 +0800
commit3b5843fe2e6b4e3725bbc1b269c23115c953b2b0 (patch)
treea1d2c36dbccf0c82079f774d1efe08c993ee31f2 /src/client/moonshot.rs
parent01ebc8734838e13fb533022c1d24e7003ed42935 (diff)
downloadaichat-3b5843fe2e6b4e3725bbc1b269c23115c953b2b0.tar.gz
refactor: all clients use openai token counter (#402)
Diffstat (limited to 'src/client/moonshot.rs')
-rw-r--r--src/client/moonshot.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/moonshot.rs b/src/client/moonshot.rs
index a105e01..18cf0f2 100644
--- a/src/client/moonshot.rs
+++ b/src/client/moonshot.rs
@@ -1,4 +1,4 @@
-use super::openai::{openai_build_body, OPENAI_TOKENS_COUNT_FACTORS};
+use super::openai::openai_build_body;
use super::{ExtraConfig, MoonshotClient, Model, PromptType, SendData};
use crate::utils::PromptKind;
@@ -42,7 +42,6 @@ impl MoonshotClient {
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()
}
@@ -50,8 +49,7 @@ impl MoonshotClient {
fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result<RequestBuilder> {
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;