feat(llm): 统一思考模式配置,支持显式禁用状态

This commit is contained in:
2026-06-01 17:39:36 +08:00
parent 928ebb61b4
commit 7636d0b5a6
4 changed files with 41 additions and 19 deletions

View File

@@ -273,13 +273,13 @@ impl KimiClient {
async fn chat_completion(&self, messages: Vec<Message>) -> Result<String> {
let url = format!("{}/chat/completions", self.base_url);
let thinking = if self.thinking_enabled {
Some(ThinkingConfig {
thinking_type: "enabled".to_string(),
})
} else {
None
};
let thinking = Some(ThinkingConfig {
thinking_type: if self.thinking_enabled {
"enabled".to_string()
} else {
"disabled".to_string()
},
});
// 对于 kimi-k2.6 等支持思考模式的模型,使用默认 temperature 即可
// 思考模式下不显式指定 temperature