From 470eeb2efc8b5c9f20ec275d3b2ced1d92e1642d Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 4 Feb 2025 10:38:07 +0800 Subject: feat: add model field `supports_reasoning` (#1145) --- src/client/openai.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/client/openai.rs') diff --git a/src/client/openai.rs b/src/client/openai.rs index 928a600..7989c34 100644 --- a/src/client/openai.rs +++ b/src/client/openai.rs @@ -301,6 +301,9 @@ pub fn openai_build_chat_completions_body(data: ChatCompletionsData, model: &Mod if let Some(v) = model.max_tokens_param() { body["max_tokens"] = v.into(); } + if model.client_name().starts_with("openrouter") && model.supports_reasoning() { + body["include_reasoning"] = true.into(); + } if let Some(v) = temperature { body["temperature"] = v.into(); } -- cgit v1.2.3