diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-05 09:10:12 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-05 09:10:12 +0800 |
| commit | a732291f3321f2feb31fb7b1105e223e2fa33976 (patch) | |
| tree | 30ba7028ba5b18a383d7d3ed8cadd8e5f881c99f /src/client | |
| parent | 1ec6abfaee2fdc189b348b7e3a8145bd9a84da74 (diff) | |
| download | aichat-a732291f3321f2feb31fb7b1105e223e2fa33976.tar.gz | |
refactor: rename `pass_max_tokens` to `require_max_tokens` (#562)
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/model.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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<isize> { - 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<isize>, - 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<isize>, #[serde(default)] - pub pass_max_tokens: bool, + pub require_max_tokens: bool, #[serde(default)] pub supports_vision: bool, #[serde(default)] |
