test(open-sse): extend golden response stream to kiro/ollama (T0.5)
Lock chunk/usage/tool/thinking/finish behavior for kiro + ollama before chunkBuilder refactor. Sanitize volatile stream/tool ids. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -302,3 +302,146 @@ exports[`GOLDEN response stream: Gemini → OpenAI > text + thought(no-sig) + fu
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`GOLDEN response stream: Kiro → OpenAI > text + reasoning + toolUse + usage + stop 1`] = `
|
||||
[
|
||||
{
|
||||
"choices": [
|
||||
{
|
||||
"delta": {
|
||||
"content": "Hello",
|
||||
"role": "assistant",
|
||||
},
|
||||
"finish_reason": null,
|
||||
"index": 0,
|
||||
},
|
||||
],
|
||||
"created": 0,
|
||||
"id": "chatcmpl-<TS>",
|
||||
"model": "kiro",
|
||||
"object": "chat.completion.chunk",
|
||||
},
|
||||
{
|
||||
"choices": [
|
||||
{
|
||||
"delta": {
|
||||
"reasoning_content": "thinking",
|
||||
},
|
||||
"finish_reason": null,
|
||||
"index": 0,
|
||||
},
|
||||
],
|
||||
"created": 0,
|
||||
"id": "chatcmpl-<TS>",
|
||||
"model": "kiro",
|
||||
"object": "chat.completion.chunk",
|
||||
},
|
||||
{
|
||||
"choices": [
|
||||
{
|
||||
"delta": {
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{"city":"NYC"}",
|
||||
"name": "get_weather",
|
||||
},
|
||||
"id": "tu_1",
|
||||
"index": 0,
|
||||
"type": "function",
|
||||
},
|
||||
],
|
||||
},
|
||||
"finish_reason": null,
|
||||
"index": 0,
|
||||
},
|
||||
],
|
||||
"created": 0,
|
||||
"id": "chatcmpl-<TS>",
|
||||
"model": "kiro",
|
||||
"object": "chat.completion.chunk",
|
||||
},
|
||||
{
|
||||
"choices": [
|
||||
{
|
||||
"delta": {},
|
||||
"finish_reason": "stop",
|
||||
"index": 0,
|
||||
},
|
||||
],
|
||||
"created": 0,
|
||||
"id": "chatcmpl-<TS>",
|
||||
"model": "kiro",
|
||||
"object": "chat.completion.chunk",
|
||||
"usage": {
|
||||
"completion_tokens": 5,
|
||||
"prompt_tokens": 10,
|
||||
"total_tokens": 15,
|
||||
},
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`GOLDEN response stream: Ollama → OpenAI > content + thinking + tool_calls + done usage 1`] = `
|
||||
[
|
||||
{
|
||||
"choices": [
|
||||
{
|
||||
"delta": {
|
||||
"content": "Hi",
|
||||
"reasoning_content": "reason",
|
||||
},
|
||||
"finish_reason": null,
|
||||
"index": 0,
|
||||
},
|
||||
],
|
||||
"created": 0,
|
||||
"id": "chatcmpl-<TS>",
|
||||
"model": "qwen3",
|
||||
"object": "chat.completion.chunk",
|
||||
},
|
||||
{
|
||||
"choices": [
|
||||
{
|
||||
"delta": {
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{"q":"x"}",
|
||||
"name": "search",
|
||||
},
|
||||
"id": "call_0_<TS>",
|
||||
"index": 0,
|
||||
"type": "function",
|
||||
},
|
||||
],
|
||||
},
|
||||
"finish_reason": null,
|
||||
"index": 0,
|
||||
},
|
||||
],
|
||||
"created": 0,
|
||||
"id": "chatcmpl-<TS>",
|
||||
"model": "qwen3",
|
||||
"object": "chat.completion.chunk",
|
||||
},
|
||||
{
|
||||
"choices": [
|
||||
{
|
||||
"delta": {},
|
||||
"finish_reason": "tool_calls",
|
||||
"index": 0,
|
||||
},
|
||||
],
|
||||
"created": 0,
|
||||
"id": "chatcmpl-<TS>",
|
||||
"model": "qwen3",
|
||||
"object": "chat.completion.chunk",
|
||||
"usage": {
|
||||
"completion_tokens": 4,
|
||||
"prompt_tokens": 8,
|
||||
"total_tokens": 12,
|
||||
},
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user