mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
Add helpers/chunkBuilder.js; apply to claude/gemini/kiro/ollama/commandcode/ openai-responses response translators. Caller supplies id/created/model so each keeps exact id-generation + usage semantics. Extend golden response stream to openai-responses (codex). No behavior change; gate: no regression. Co-authored-by: Cursor <cursoragent@cursor.com>
12 lines
397 B
JavaScript
12 lines
397 B
JavaScript
// Build OpenAI chat.completion.chunk. Caller supplies id/created/model so each
|
|
// translator keeps its exact id-generation + created semantics (no Date.now here).
|
|
export function buildChunk({ id, created, model }, delta, finishReason = null) {
|
|
return {
|
|
id,
|
|
object: "chat.completion.chunk",
|
|
created,
|
|
model,
|
|
choices: [{ index: 0, delta, finish_reason: finishReason }],
|
|
};
|
|
}
|