From cb54f8643a965fbc35b1f07eb3ea026692eb8091 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 26 Feb 2025 21:06:11 +0800 Subject: refactor: several improvements (#1203) --- src/client/openai.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/client/openai.rs') diff --git a/src/client/openai.rs b/src/client/openai.rs index c002f52..e5f4d23 100644 --- a/src/client/openai.rs +++ b/src/client/openai.rs @@ -300,7 +300,11 @@ pub fn openai_build_chat_completions_body(data: ChatCompletionsData, model: &Mod }); if let Some(v) = model.max_tokens_param() { - if model.patch().and_then(|v| v.get("body").and_then(|v| v.get("max_tokens"))) == Some(&Value::Null) { + if model + .patch() + .and_then(|v| v.get("body").and_then(|v| v.get("max_tokens"))) + == Some(&Value::Null) + { body["max_completion_tokens"] = v.into(); } else { body["max_tokens"] = v.into(); -- cgit v1.2.3