mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Centralize the reasoning_content delta shape (optional assistant role) used by claude/gemini/kiro/codex/commandcode response translators. Keeps the cross-format convention consistent for future translators. Output byte-for-byte identical; golden + gate clean. Ollama left as-is (mutates existing delta object). Co-authored-by: Cursor <cursoragent@cursor.com>
7 lines
248 B
JavaScript
7 lines
248 B
JavaScript
// Build OpenAI delta carrying reasoning_content (optional leading assistant role)
|
|
export function reasoningDelta(text, withRole = false) {
|
|
return withRole
|
|
? { role: "assistant", reasoning_content: text }
|
|
: { reasoning_content: text };
|
|
}
|