mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-08-25 20:46:31 +00:00
docs(providers): restore the DeepSeek legacy reasoning-format contract
The openai-compat consolidation dropped the comment warning that DeepSeek needs the legacy top-level "reasoning_effort" string form; without it a maintainer could add openai.WithModernReasoningFormat() to the shared opts and silently break DeepSeek thinking mode. Restore it at the shared opts choke point. Also fix two stale pointers: glm/qwen config.yml cited WithPreserveReasoningContent() "in glm.go/qwen.go", but it moved to openaicompat.go during that same consolidation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a87ac2db18
commit
9876c13ea8
@@ -10,7 +10,7 @@
|
||||
# on the standard API endpoint Z.AI defaults to clearing reasoning_content between
|
||||
# turns, which hurts agent loops with tool calls. Setting clear_thinking=false
|
||||
# preserves reasoning_content across turns, improving reasoning continuity and cache
|
||||
# hit rates. Required together with WithPreserveReasoningContent() in glm.go so that
|
||||
# hit rates. Required together with WithPreserveReasoningContent() in openaicompat.go so that
|
||||
# langchaingo serializes reasoning_content back to the API.
|
||||
#
|
||||
# Note: langchaingo's IsReasoningModel matches glm-4.5/4.6/4.7 prefixes and force-
|
||||
|
||||
@@ -60,6 +60,10 @@ func New(
|
||||
openai.WithBaseURL(spec.ServerURL),
|
||||
openai.WithHTTPClient(httpClient),
|
||||
}
|
||||
// Do NOT add openai.WithModernReasoningFormat() to these shared opts: DeepSeek's
|
||||
// API requires the legacy top-level "reasoning_effort" string, which langchaingo
|
||||
// emits only while ModernReasoningFormat is off (the default). The modern
|
||||
// "reasoning":{} object form breaks DeepSeek thinking mode.
|
||||
if spec.PreserveReasoning {
|
||||
opts = append(opts, openai.WithPreserveReasoningContent())
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# - preserve_thinking=true: keeps reasoning_content from previous assistant turns
|
||||
# in subsequent requests. Supported ONLY by qwen3.7-max and qwen3.6-plus families.
|
||||
# Required for agent loops with tool calls to preserve reasoning continuity.
|
||||
# Works together with WithPreserveReasoningContent() in qwen.go.
|
||||
# Works together with WithPreserveReasoningContent() in openaicompat.go.
|
||||
# - qwen3-coder-* (coder, installer) are NOT hybrid thinking models — no thinking
|
||||
# control needed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user