From a732291f3321f2feb31fb7b1105e223e2fa33976 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 5 Jun 2024 09:10:12 +0800 Subject: refactor: rename `pass_max_tokens` to `require_max_tokens` (#562) --- src/client/model.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/model.rs') diff --git a/src/client/model.rs b/src/client/model.rs index e16cb4e..22ad4d9 100644 --- a/src/client/model.rs +++ b/src/client/model.rs @@ -153,7 +153,7 @@ impl Model { } pub fn max_tokens_param(&self) -> Option { - if self.data.pass_max_tokens { + if self.data.require_max_tokens { self.data.max_output_tokens } else { None @@ -163,13 +163,13 @@ impl Model { pub fn set_max_tokens( &mut self, max_output_tokens: Option, - pass_max_tokens: bool, + require_max_tokens: bool, ) -> &mut Self { match max_output_tokens { None | Some(0) => self.data.max_output_tokens = None, _ => self.data.max_output_tokens = max_output_tokens, } - self.data.pass_max_tokens = pass_max_tokens; + self.data.require_max_tokens = require_max_tokens; self } @@ -227,7 +227,7 @@ pub struct ModelData { // chat-only properties pub max_output_tokens: Option, #[serde(default)] - pub pass_max_tokens: bool, + pub require_max_tokens: bool, #[serde(default)] pub supports_vision: bool, #[serde(default)] -- cgit v1.2.3