mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 21:20:44 +00:00
Merge pull request #1415 from QwenLM/fix/openai-reasoning-config
fix(core): don’t force reasoning/topP defaults for OpenAI-compatible APIs
This commit is contained in:
commit
2c8be05029
2 changed files with 15 additions and 10 deletions
|
|
@ -317,15 +317,22 @@ export class ContentGenerationPipeline {
|
|||
}
|
||||
|
||||
private buildReasoningConfig(): Record<string, unknown> {
|
||||
const reasoning = this.contentGeneratorConfig.reasoning;
|
||||
// Reasoning configuration for OpenAI-compatible endpoints is highly fragmented.
|
||||
// For example, across common providers and models:
|
||||
//
|
||||
// - deepseek-reasoner — thinking is enabled by default and cannot be disabled
|
||||
// - glm-4.7 — thinking is enabled by default; can be disabled via `extra_body.thinking.enabled`
|
||||
// - kimi-k2-thinking — thinking is enabled by default and cannot be disabled
|
||||
// - gpt-5.x series — thinking is enabled by default; can be disabled via `reasoning.effort`
|
||||
// - qwen3 series — model-dependent; can be manually disabled via `extra_body.enable_thinking`
|
||||
//
|
||||
// Given this inconsistency, we choose not to set any reasoning config here and
|
||||
// instead rely on each model’s default behavior.
|
||||
|
||||
if (reasoning === false) {
|
||||
return {};
|
||||
}
|
||||
// We plan to introduce provider- and model-specific settings to enable more
|
||||
// fine-grained control over reasoning configuration.
|
||||
|
||||
return {
|
||||
reasoning_effort: reasoning?.effort ?? 'medium',
|
||||
};
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -58,8 +58,6 @@ export class DefaultOpenAICompatibleProvider
|
|||
}
|
||||
|
||||
getDefaultGenerationConfig(): GenerateContentConfig {
|
||||
return {
|
||||
topP: 0.95,
|
||||
};
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue