From 8e5d4e55b1a5158a1f35adaf044dec545159f426 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 6 Mar 2024 08:35:40 +0800 Subject: refactor: rename model's `max_tokens` to `max_input_tokens` (#339) BREAKING CHANGE: rename model's `max_tokens` to `max_input_tokens` --- src/config/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index 4a37378..909e751 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -750,7 +750,7 @@ impl Config { pub fn prepare_send_data(&self, input: &Input, stream: bool) -> Result { let messages = self.build_messages(input)?; - self.model.max_tokens_limit(&messages)?; + self.model.max_input_tokens_limit(&messages)?; Ok(SendData { messages, temperature: self.get_temperature(), @@ -773,8 +773,8 @@ impl Config { output.insert("client_name", self.model.client_name.clone()); output.insert("model_name", self.model.name.clone()); output.insert( - "max_tokens", - self.model.max_tokens.unwrap_or_default().to_string(), + "max_input_tokens", + self.model.max_input_tokens.unwrap_or_default().to_string(), ); if let Some(temperature) = self.temperature { if temperature != 0.0 { -- cgit v1.2.3