Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/orange-peaches-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ai-sdk/azure': patch
---

Support idempotent doGenerate/doStream with pre-supplied result chunks in Responses API tests.

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions packages/azure/src/__fixtures__/azure-code-interpreter-tool.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"id": "resp_02ffbc38ae6fca1a0068ec87605cfc819793efdf27e5496675",
"object": "response",
"created_at": 1760331616,
"status": "completed",
"background": false,
"content_filters": null,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-5-mini",
"output": [
{
"id": "rs_02ffbc38ae6fca1a0068ec8762f61881979bf5191564930c23",
"type": "reasoning",
"summary": []
},
{
"id": "ci_02ffbc38ae6fca1a0068ec876654a08197af4d648fe8bba210",
"type": "code_interpreter_call",
"status": "completed",
"code": "import random\n\n# Generate five random numbers between 1 and 100 with two decimal places\nnumbers = [round(random.uniform(1, 100), 2) for _ in range(5)]\n\n# Print the program and its execution results\nprint(\"Program: Generate five random numbers between 1 and 100 with two decimal places\")\nprint(\"Generated numbers:\")\nfor i, num in enumerate(numbers, start=1):\n print(f\"{i}: {num:.2f}\")",
"container_id": "cntr_68ec87613e58819097ec47888dc686d8088a1d37157e7565",
"outputs": [
{
"type": "logs",
"logs": "Program: Generate five random numbers between 1 and 100 with two decimal places\nGenerated numbers:\n1: 74.07\n2: 94.14\n3: 53.74\n4: 77.29\n5: 87.68\n"
}
]
},
{
"id": "msg_02ffbc38ae6fca1a0068ec8768f35c81979428e19fa11468f1",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "I ran the program and produced five random numbers between 1 and 100 with two decimal places. Results shown above:\n\n1: 74.07\n2: 94.14\n3: 53.74\n4: 77.29\n5: 87.68\n\nIf you want the code to be saved to a file, run multiple sets, or use a fixed seed for reproducible results, tell me and I can adjust."
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": {
"effort": "medium",
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [
{
"type": "code_interpreter",
"container": {
"type": "auto"
}
}
],
"top_logprobs": 0,
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 1750,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 400,
"output_tokens_details": {
"reasoning_tokens": 192
},
"total_tokens": 2150
},
"user": null,
"metadata": {}
}

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions packages/azure/src/__fixtures__/openai-file-search-tool.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"id": "resp_0a098396a8feca410068caae39e7648196b346e99fa8ec494c",
"object": "response",
"created_at": 1758113338,
"status": "completed",
"background": false,
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"max_tool_calls": null,
"model": "gpt-5-mini-2025-08-07",
"output": [
{
"id": "rs_0a098396a8feca410068caae3b47208196957fe59419daad70",
"type": "reasoning",
"summary": []
},
{
"id": "fs_0a098396a8feca410068caae3cab5c8196a54fd00498464e62",
"type": "file_search_call",
"status": "completed",
"queries": [
"What is an embedding model according to this document?",
"What is an embedding model?",
"definition of embedding model in the document",
"embedding model description"
],
"results": null
},
{
"id": "rs_0a098396a8feca410068caae3e21a081968e7ac588401c4a6a",
"type": "reasoning",
"summary": []
},
{
"id": "msg_0a098396a8feca410068caae457c508196b2fcd079d1d3ec74",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [
{
"type": "file_citation",
"file_id": "file-Ebzhf8H4DPGPr9pUhr7n7v",
"filename": "ai.pdf",
"index": 438
}
],
"logprobs": [],
"text": "According to the document, an embedding model is used to convert complex data (like words or images) into a dense vector (a list of numbers) representation called an embedding, which captures semantic and syntactic relationships. Unlike generative models, embedding models do not generate new text or data; instead, they provide these vector representations to be used as input for other models or other natural language processing tasks ."
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"prompt_cache_key": null,
"reasoning": { "effort": "medium", "summary": null },
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1,
"text": { "format": { "type": "text" }, "verbosity": "medium" },
"tool_choice": "auto",
"tools": [
{
"type": "file_search",
"filters": null,
"max_num_results": 20,
"ranking_options": { "ranker": "auto", "score_threshold": 0 },
"vector_store_ids": ["vs_68caad8bd5d88191ab766cf043d89a18"]
}
],
"top_logprobs": 0,
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 3700,
"input_tokens_details": { "cached_tokens": 2560 },
"output_tokens": 741,
"output_tokens_details": { "reasoning_tokens": 640 },
"total_tokens": 4441
},
"user": null,
"metadata": {}
}
Loading
Loading