diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/model.rs | 10 | ||||
| -rw-r--r-- | src/client/openai.rs | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/client/model.rs b/src/client/model.rs index bcd474f..94332f5 100644 --- a/src/client/model.rs +++ b/src/client/model.rs @@ -131,6 +131,7 @@ impl Model { output_price, supports_vision, supports_function_calling, + supports_reasoning, .. } = &self.data; let max_input_tokens = stringify_option_value(max_input_tokens); @@ -144,6 +145,9 @@ impl Model { if *supports_function_calling { capabilities.push('⚒'); }; + if *supports_reasoning { + capabilities.push('🄡'); + } let capabilities: String = capabilities .into_iter() .map(|v| format!("{v} ")) @@ -178,6 +182,10 @@ impl Model { self.data.max_output_tokens } + pub fn supports_reasoning(&self) -> bool { + self.data.supports_reasoning + } + pub fn no_stream(&self) -> bool { self.data.no_stream } @@ -302,6 +310,8 @@ pub struct ModelData { #[serde(default, skip_serializing_if = "std::ops::Not::not")] pub supports_function_calling: bool, #[serde(default, skip_serializing_if = "std::ops::Not::not")] + supports_reasoning: bool, + #[serde(default, skip_serializing_if = "std::ops::Not::not")] no_stream: bool, #[serde(default, skip_serializing_if = "std::ops::Not::not")] no_system_message: bool, 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(); } |
