fix(openai_compat): clarify DeepSeek reasoning replay rules
This commit is contained in:
parent
ee3c815aff
commit
85f9d21151
1 changed files with 4 additions and 0 deletions
|
|
@ -270,6 +270,10 @@ func filterDeepSeekReasoningTurn(messages []Message) []Message {
|
||||||
}
|
}
|
||||||
|
|
||||||
cloned := msg
|
cloned := msg
|
||||||
|
// DeepSeek thinking-mode replay only requires reasoning_content for
|
||||||
|
// turns that participate in a tool interaction round. For plain
|
||||||
|
// assistant turns between two user messages, the docs say the API will
|
||||||
|
// ignore reasoning_content on replay, so we strip it here.
|
||||||
if cloned.Role == "assistant" && strings.TrimSpace(cloned.ReasoningContent) != "" && !hasToolInteraction {
|
if cloned.Role == "assistant" && strings.TrimSpace(cloned.ReasoningContent) != "" && !hasToolInteraction {
|
||||||
cloned.ReasoningContent = ""
|
cloned.ReasoningContent = ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue