From 95ca8a2aaf0c742774c6fd4114919e3f6bca9442 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Wed, 30 Sep 2026 11:31:01 -0500 Subject: [PATCH] refactor(ai): reuse shared OpenRouter Responses implementation --- packages/ai/README.md | 8 +- packages/ai/src/protocols/openai-responses.ts | 2 +- packages/ai/src/protocols/utils/openrouter.ts | 89 ++++++++++--------- packages/ai/src/providers/openrouter.ts | 40 +++------ .../openrouter-gpt-4o-mini-text.json | 4 +- .../openrouter-gpt-4o-mini-tool-call.json | 4 +- .../openrouter-gpt-4o-mini-tool-loop.json | 8 +- .../openrouter-gpt-5-5-tool-loop.json | 8 +- .../openrouter-grok-4-3-tool-loop.json | 8 +- .../openrouter-muse-spark-1-3-tool-loop.json | 10 +-- ...preserves-native-hosted-search-events.json | 32 +++++++ .../openrouter-native.recorded.test.ts | 75 +++++++++++++--- packages/ai/test/provider/openrouter.test.ts | 45 +++++++--- 13 files changed, 215 insertions(+), 118 deletions(-) create mode 100644 packages/ai/test/fixtures/recordings/openrouter-responses/preserves-native-hosted-search-events.json diff --git a/packages/ai/README.md b/packages/ai/README.md index b2d54a86a56..3d1b6b9b5e3 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1210,10 +1210,10 @@ LLM.request({ Normalized cache usage is read back into `response.usage.cacheReadInputTokens` and `cacheWriteInputTokens` across every provider. OpenRouter selects its wire API by model family: `openai/*`, `x-ai/*`, and `meta/*` use Responses; `anthropic/*` uses -Anthropic Messages; other families use Chat Completions. All three Responses families share the provider-neutral -Responses serializer and stream parser; there are no per-vendor OpenRouter protocols. Leading-`~` model aliases follow -the same routing. Explicit `openrouter.chat(id)`, `.responses(id)`, and `.messages(id)` selectors are available for -API-specific integrations. +Anthropic Messages; other families use Chat Completions. All three Responses families share the existing OpenAI-shaped +Responses implementation, including namespace tools and hosted-tool events; there are no per-vendor OpenRouter +protocols. Leading-`~` model aliases follow the same routing. Explicit `openrouter.chat(id)`, `.responses(id)`, and +`.messages(id)` selectors are available for API-specific integrations. Qwen retains Chat's explicit system/conversation cache markers, while Claude uses native Messages cache blocks. OpenRouter Responses is stateless (`store: false`); every request includes full history, not `previous_response_id`. Meta currently accepts only automatic tool selection on both its Chat and Responses upstreams; forced/disabled tool diff --git a/packages/ai/src/protocols/openai-responses.ts b/packages/ai/src/protocols/openai-responses.ts index e36496954b9..babb2fc70d2 100644 --- a/packages/ai/src/protocols/openai-responses.ts +++ b/packages/ai/src/protocols/openai-responses.ts @@ -124,7 +124,7 @@ const OpenAIResponsesCoreFields = { ), } -const OpenAIResponsesBody = Schema.Struct({ +export const OpenAIResponsesBody = Schema.Struct({ ...OpenAIResponsesCoreFields, stream: Schema.Literal(true), }) diff --git a/packages/ai/src/protocols/utils/openrouter.ts b/packages/ai/src/protocols/utils/openrouter.ts index e114902710d..c77017309e6 100644 --- a/packages/ai/src/protocols/utils/openrouter.ts +++ b/packages/ai/src/protocols/utils/openrouter.ts @@ -2,9 +2,7 @@ export * as OpenRouterWire from "./openrouter.js" import { Option, Schema } from "effect" import { LLMRequest, Message, type ContentPart, type ReasoningPart } from "../../schema/index.js" -import { resolveEffortUpdates } from "../../effort-updates.js" -import type { OpenResponses } from "../open-responses.js" -import { OpenResponsesOptions } from "./open-responses-options.js" +import type { OpenAIResponses } from "../openai-responses.js" import { isRecord, ProviderShared } from "../shared.js" const ReplayDetail = Schema.Struct({ @@ -18,11 +16,13 @@ const decodeReplayDetail = Schema.decodeUnknownOption(ReplayDetail) // OpenRouter's generic Responses API supports chronological effort updates only on eligible models. export function supportsEffortUpdates(request: LLMRequest) { + if (request.providerOptions?.contextManagement !== undefined) return false if (request.providerOptions?.truncation === "auto" || request.http?.body?.truncation === "auto") return false if (Schema.is(Schema.Struct({ mode: Schema.Literal("pro") }))(request.providerOptions?.reasoning)) return false if (Schema.is(Schema.Struct({ mode: Schema.Literal("pro") }))(request.http?.body?.reasoning)) return false return ( - request.model.compatibility?.supportsEffortUpdates ?? /^~?openai\/gpt-6-(?:astra|sol|luna)$/i.test(request.model.id) + request.model.compatibility?.supportsEffortUpdates ?? + /^~?openai\/(?:gpt-6-(?:astra|sol|luna)|gpt-6\.1-sol)$/i.test(request.model.id) ) } @@ -32,17 +32,13 @@ export function nativeRequest(request: LLMRequest, format: "responses" | "messag ? fitReasoning(options.reasoning, request.generation?.maxTokens) : undefined const disabled = reasoning?.enabled === false || reasoning?.effort === "none" - const updates = resolveEffortUpdates( - request, - OpenResponsesOptions.resolve(request).reasoningEffort ?? - (typeof reasoning?.effort === "string" ? reasoning.effort : undefined), - ) return LLMRequest.update(request, { providerOptions: format === "responses" ? { ...options, - reasoningEffort: updates.effort, + reasoningEffort: + options.reasoningEffort ?? (typeof reasoning?.effort === "string" ? reasoning.effort : undefined), } : { ...options, @@ -58,7 +54,7 @@ export function nativeRequest(request: LLMRequest, format: "responses" | "messag return { type: "adaptive", ...(reasoning.exclude === true ? { display: "omitted" } : {}) } })(), }, - messages: (format === "responses" ? updates.request : request).messages.map((message) => { + messages: request.messages.map((message) => { if ( !message.content.some( (part) => part.type === "reasoning" && part.providerMetadata?.openrouter?.reasoningDetails !== undefined, @@ -94,29 +90,21 @@ export function nativeRequest(request: LLMRequest, format: "responses" | "messag ] } const blocks = replay.flatMap((detail) => { - if (detail.type === "reasoning.text" && detail.signature) - return [ - { - ...part, - text: detail.text ?? part.text, - providerMetadata: { - ...part.providerMetadata, - openrouter: { ...part.providerMetadata?.openrouter, signature: detail.signature }, - }, + const metadata = (() => { + if (detail.type === "reasoning.text" && detail.signature) return { signature: detail.signature } + if (detail.type === "reasoning.encrypted" && detail.data) return { redactedData: detail.data } + })() + if (!metadata) return [] + return [ + { + ...part, + text: metadata.signature ? (detail.text ?? part.text) : "", + providerMetadata: { + ...part.providerMetadata, + openrouter: { ...part.providerMetadata?.openrouter, ...metadata }, }, - ] - if (detail.type === "reasoning.encrypted" && detail.data) - return [ - { - ...part, - text: "", - providerMetadata: { - ...part.providerMetadata, - openrouter: { ...part.providerMetadata?.openrouter, redactedData: detail.data }, - }, - }, - ] - return [] + }, + ] }) return blocks.length > 0 ? blocks : [part] }), @@ -125,24 +113,44 @@ export function nativeRequest(request: LLMRequest, format: "responses" | "messag }) } -export function responsesOptions>( - request: LLMRequest, - body: Body, -) { +export function responsesOptions(request: LLMRequest, body: OpenAIResponses.OpenAIResponsesBody) { const { usage: _, ...options } = bodyOptions(request.providerOptions, request.generation?.maxTokens) return { ...options, ...body, store: false as const, // Native lowering may freeze effort at the history baseline; keep it instead of the current effort. - ...(options.reasoning || body.reasoning ? { reasoning: { ...options.reasoning, ...body.reasoning } } : {}), + ...(options.reasoning || body.reasoning + ? { + reasoning: { + ...options.reasoning, + ...body.reasoning, + effort: body.reasoning?.effort, + summary: + body.reasoning?.summary ?? + (typeof options.reasoning?.summary === "string" ? options.reasoning.summary : undefined), + }, + } + : {}), + ...(options.text || body.text ? { text: { ...options.text, ...body.text } } : {}), } } export const bodyOptions = (input: unknown, maxTokens: number | undefined) => { const openrouter = isRecord(input) ? input : {} - const { usage, models, provider, plugins, web_search_options, debug, user, reasoning, promptCacheKey, ...options } = - openrouter + const { + usage, + models, + provider, + plugins, + web_search_options, + debug, + user, + reasoning, + text, + promptCacheKey, + ...options + } = openrouter return { ...options, ...(usage === undefined || usage === true @@ -159,6 +167,7 @@ export const bodyOptions = (input: unknown, maxTokens: number | undefined) => { ...(isRecord(debug) ? { debug } : {}), ...(typeof user === "string" ? { user } : {}), ...(isRecord(reasoning) ? { reasoning: fitReasoning(reasoning, maxTokens) } : {}), + ...(isRecord(text) ? { text } : {}), } } diff --git a/packages/ai/src/providers/openrouter.ts b/packages/ai/src/providers/openrouter.ts index f92acab7af1..b99690bd9f9 100644 --- a/packages/ai/src/providers/openrouter.ts +++ b/packages/ai/src/providers/openrouter.ts @@ -7,10 +7,10 @@ import { HttpOptions, ProviderID, type CacheHint, type ModelID, type OpenString import type { ProviderPackage } from "../provider-package.js" import { SystemOne } from "../experimental/system-one.js" import { OpenAIChat } from "../protocols/openai-chat.js" -import { OpenResponses } from "../protocols/open-responses.js" +import { OpenAIResponses } from "../protocols/openai-responses.js" import { AnthropicMessages } from "../protocols/anthropic-messages.js" import { Framing } from "../route/framing.js" -import { ProviderShared } from "../protocols/shared.js" +import { JsonObject } from "../protocols/shared.js" import { newBreakpoints, ttlBucket } from "../protocols/utils/cache.js" import { OpenRouterWire } from "../protocols/utils/openrouter.js" @@ -58,6 +58,7 @@ export interface OpenRouterOptions { readonly plugins?: ReadonlyArray readonly provider?: OpenRouterProviderRouting readonly reasoning?: Readonly<{ + [key: string]: unknown enabled?: boolean exclude?: boolean effort?: OpenString<"none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"> @@ -99,29 +100,16 @@ const OpenRouterBody = Schema.StructWithRest(Schema.Struct(OpenAIChat.bodyFields ]) export type OpenRouterBody = Schema.Schema.Type -const ResponsesReasoning = Schema.StructWithRest( - Schema.Struct({ - enabled: Schema.optional(Schema.Boolean), - exclude: Schema.optional(Schema.Boolean), - effort: Schema.optional(Schema.String), - max_tokens: Schema.optional(Schema.Number), - summary: Schema.optional(Schema.String), - }), - [Schema.Record(Schema.String, Schema.Unknown)], -) const OpenRouterResponsesBody = Schema.StructWithRest( Schema.Struct({ - ...OpenResponses.coreFields, - input: Schema.Array(Schema.Union([OpenResponses.InputItem, OpenResponses.ConfigurationUpdate])), - stream: Schema.Literal(true), + ...OpenAIResponses.OpenAIResponsesBody.fields, store: Schema.Literal(false), - reasoning: Schema.optional(ResponsesReasoning), + reasoning: Schema.optional(JsonObject), + text: Schema.optional(JsonObject), }), - [Schema.Record(Schema.String, Schema.Unknown)], + [JsonObject], ) -const OpenRouterMessagesBody = Schema.StructWithRest(AnthropicMessages.AnthropicMessagesBody, [ - Schema.Record(Schema.String, Schema.Unknown), -]) +const OpenRouterMessagesBody = Schema.StructWithRest(AnthropicMessages.AnthropicMessagesBody, [JsonObject]) type OpenRouterMessagesBody = Schema.Schema.Type export const protocol = Protocol.make({ @@ -161,19 +149,15 @@ export const protocol = Protocol.make({ }) const responsesProtocol = Protocol.make({ - ...OpenResponses.protocol, + ...OpenAIResponses.protocol, id: "openrouter-responses", supportsEffortUpdates: OpenRouterWire.supportsEffortUpdates, body: { schema: OpenRouterResponsesBody, from: (request) => - OpenResponses.fromRequestWithAdapter(OpenRouterWire.nativeRequest(request, "responses"), { - id: "openrouter-responses", - name: "OpenRouter Responses", - }).pipe( - Effect.map((body) => OpenRouterWire.responsesOptions(request, body)), - Effect.flatMap(ProviderShared.validateWith(Schema.decodeUnknownEffect(OpenRouterResponsesBody))), - ), + OpenAIResponses.protocol.body + .from(OpenRouterWire.nativeRequest(request, "responses")) + .pipe(Effect.map((body) => OpenRouterWire.responsesOptions(request, body))), }, }) const messagesProtocol = Protocol.make({ diff --git a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-text.json b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-text.json index 899d254c548..9f944361e3d 100644 --- a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-text.json +++ b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-text.json @@ -12,7 +12,7 @@ "golden" ], "name": "openrouter-responses/openrouter-gpt-4o-mini-text", - "recordedAt": "2026-09-30T04:48:47.207Z" + "recordedAt": "2026-09-30T16:23:26.190Z" }, "interactions": [ { @@ -30,7 +30,7 @@ "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743725-CVE8eRBKqzoJqJHXU1ur\",\"object\":\"response\",\"created_at\":1790743725,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":40,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"You are concise.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743725-CVE8eRBKqzoJqJHXU1ur\",\"object\":\"response\",\"created_at\":1790743725,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":40,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"You are concise.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_ilrlnvtd9l9\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_ilrlnvtd9l9\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_ilrlnvtd9l9\",\"content_index\":0,\"delta\":\"Hello\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_ilrlnvtd9l9\",\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_ilrlnvtd9l9\",\"content_index\":0,\"text\":\"Hello!\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_ilrlnvtd9l9\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Hello!\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_ilrlnvtd9l9\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello!\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":8}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743725-CVE8eRBKqzoJqJHXU1ur\",\"object\":\"response\",\"created_at\":1790743725,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790743727,\"output\":[{\"id\":\"msg_tmp_ilrlnvtd9l9\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello!\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":40,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"You are concise.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":21,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":2,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":23,\"cost\":0.00000435,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00000435,\"upstream_inference_input_cost\":0.00000315,\"upstream_inference_output_cost\":0.0000012}}},\"sequence_number\":9}\n\ndata: [DONE]\n\n" + "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785405-TibUw8IxcUdeh1aIMexG\",\"object\":\"response\",\"created_at\":1790785405,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":40,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"You are concise.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785405-TibUw8IxcUdeh1aIMexG\",\"object\":\"response\",\"created_at\":1790785405,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":40,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"You are concise.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_2aq1aouoqhw\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_2aq1aouoqhw\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_2aq1aouoqhw\",\"content_index\":0,\"delta\":\"Hello\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_2aq1aouoqhw\",\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_2aq1aouoqhw\",\"content_index\":0,\"text\":\"Hello!\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_2aq1aouoqhw\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Hello!\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_2aq1aouoqhw\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello!\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":8}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785405-TibUw8IxcUdeh1aIMexG\",\"object\":\"response\",\"created_at\":1790785405,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790785406,\"output\":[{\"id\":\"msg_tmp_2aq1aouoqhw\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Hello!\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":40,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"You are concise.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":21,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":2,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":23,\"cost\":0.00000435,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00000435,\"upstream_inference_input_cost\":0.00000315,\"upstream_inference_output_cost\":0.0000012}}},\"sequence_number\":9}\n\ndata: [DONE]\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-call.json b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-call.json index 4fd4eb9a01b..e67e32a5c94 100644 --- a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-call.json +++ b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-call.json @@ -13,7 +13,7 @@ "golden" ], "name": "openrouter-responses/openrouter-gpt-4o-mini-tool-call", - "recordedAt": "2026-09-30T04:48:49.499Z" + "recordedAt": "2026-09-30T16:23:26.840Z" }, "interactions": [ { @@ -31,7 +31,7 @@ "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743727-bOi6wVr1uZtoku9blJyG\",\"object\":\"response\",\"created_at\":1790743727,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":{\"type\":\"function\",\"name\":\"get_weather\"},\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Call tools exactly as requested.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743727-bOi6wVr1uZtoku9blJyG\",\"object\":\"response\",\"created_at\":1790743727,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":{\"type\":\"function\",\"name\":\"get_weather\"},\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Call tools exactly as requested.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_heuomwdgjvd\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_FbQ1aPeo1cmd2i6savV2SjY6\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_heuomwdgjvd\",\"delta\":\"{\\\"\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_heuomwdgjvd\",\"delta\":\"city\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_heuomwdgjvd\",\"delta\":\"\\\":\\\"\",\"sequence_number\":5}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_heuomwdgjvd\",\"delta\":\"Paris\",\"sequence_number\":6}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_heuomwdgjvd\",\"delta\":\"\\\"}\",\"sequence_number\":7}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_heuomwdgjvd\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_heuomwdgjvd\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_FbQ1aPeo1cmd2i6savV2SjY6\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743727-bOi6wVr1uZtoku9blJyG\",\"object\":\"response\",\"created_at\":1790743727,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790743729,\"output\":[{\"id\":\"fc_tmp_heuomwdgjvd\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_FbQ1aPeo1cmd2i6savV2SjY6\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":{\"type\":\"function\",\"name\":\"get_weather\"},\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Call tools exactly as requested.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":67,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":5,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":72,\"cost\":0.00001305,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00001305,\"upstream_inference_input_cost\":0.00001005,\"upstream_inference_output_cost\":0.000003}}},\"sequence_number\":10}\n\ndata: [DONE]\n\n" + "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785406-YRp9TEkqlahVqXkJJHeX\",\"object\":\"response\",\"created_at\":1790785406,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":{\"type\":\"function\",\"name\":\"get_weather\"},\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Call tools exactly as requested.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785406-YRp9TEkqlahVqXkJJHeX\",\"object\":\"response\",\"created_at\":1790785406,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":{\"type\":\"function\",\"name\":\"get_weather\"},\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Call tools exactly as requested.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_mumt1zk6h6p\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_XK2Bdj78v8s3dW48fhSJAlT6\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_mumt1zk6h6p\",\"delta\":\"{\\\"\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_mumt1zk6h6p\",\"delta\":\"city\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_mumt1zk6h6p\",\"delta\":\"\\\":\\\"\",\"sequence_number\":5}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_mumt1zk6h6p\",\"delta\":\"Paris\",\"sequence_number\":6}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_mumt1zk6h6p\",\"delta\":\"\\\"}\",\"sequence_number\":7}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_mumt1zk6h6p\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_mumt1zk6h6p\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_XK2Bdj78v8s3dW48fhSJAlT6\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785406-YRp9TEkqlahVqXkJJHeX\",\"object\":\"response\",\"created_at\":1790785406,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790785406,\"output\":[{\"id\":\"fc_tmp_mumt1zk6h6p\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_XK2Bdj78v8s3dW48fhSJAlT6\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":{\"type\":\"function\",\"name\":\"get_weather\"},\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Call tools exactly as requested.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":67,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":5,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":72,\"cost\":0.00001305,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00001305,\"upstream_inference_input_cost\":0.00001005,\"upstream_inference_output_cost\":0.000003}}},\"sequence_number\":10}\n\ndata: [DONE]\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-loop.json b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-loop.json index 77b617f14dc..adaee86324d 100644 --- a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-loop.json +++ b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-4o-mini-tool-loop.json @@ -13,7 +13,7 @@ "golden" ], "name": "openrouter-responses/openrouter-gpt-4o-mini-tool-loop", - "recordedAt": "2026-09-30T04:48:50.733Z" + "recordedAt": "2026-09-30T16:23:28.269Z" }, "interactions": [ { @@ -31,7 +31,7 @@ "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743729-bFPsOgVV8INYbpDROpIZ\",\"object\":\"response\",\"created_at\":1790743729,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743729-bFPsOgVV8INYbpDROpIZ\",\"object\":\"response\",\"created_at\":1790743729,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_dj1l0ujp3vq\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_R27c8sJE6vD3hbShIjdVB9C4\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_dj1l0ujp3vq\",\"delta\":\"{\\\"\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_dj1l0ujp3vq\",\"delta\":\"city\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_dj1l0ujp3vq\",\"delta\":\"\\\":\\\"\",\"sequence_number\":5}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_dj1l0ujp3vq\",\"delta\":\"Paris\",\"sequence_number\":6}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_dj1l0ujp3vq\",\"delta\":\"\\\"}\",\"sequence_number\":7}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_dj1l0ujp3vq\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_dj1l0ujp3vq\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_R27c8sJE6vD3hbShIjdVB9C4\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743729-bFPsOgVV8INYbpDROpIZ\",\"object\":\"response\",\"created_at\":1790743729,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790743730,\"output\":[{\"id\":\"fc_tmp_dj1l0ujp3vq\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_R27c8sJE6vD3hbShIjdVB9C4\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":71,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":14,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":85,\"cost\":0.00001905,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00001905,\"upstream_inference_input_cost\":0.00001065,\"upstream_inference_output_cost\":0.0000084}}},\"sequence_number\":10}\n\ndata: [DONE]\n\n" + "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785406-ABGEk8CdTXhfL3hEYDWM\",\"object\":\"response\",\"created_at\":1790785406,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785406-ABGEk8CdTXhfL3hEYDWM\",\"object\":\"response\",\"created_at\":1790785406,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_hgt0s8hlqsa\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_lvGkIhJoXscAOT3UfLkVKowx\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_hgt0s8hlqsa\",\"delta\":\"{\\\"\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_hgt0s8hlqsa\",\"delta\":\"city\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_hgt0s8hlqsa\",\"delta\":\"\\\":\\\"\",\"sequence_number\":5}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_hgt0s8hlqsa\",\"delta\":\"Paris\",\"sequence_number\":6}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_hgt0s8hlqsa\",\"delta\":\"\\\"}\",\"sequence_number\":7}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_hgt0s8hlqsa\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_hgt0s8hlqsa\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_lvGkIhJoXscAOT3UfLkVKowx\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785406-ABGEk8CdTXhfL3hEYDWM\",\"object\":\"response\",\"created_at\":1790785406,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790785407,\"output\":[{\"id\":\"fc_tmp_hgt0s8hlqsa\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_lvGkIhJoXscAOT3UfLkVKowx\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":71,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":14,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":85,\"cost\":0.00001905,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00001905,\"upstream_inference_input_cost\":0.00001065,\"upstream_inference_output_cost\":0.0000084}}},\"sequence_number\":10}\n\ndata: [DONE]\n\n" } }, { @@ -42,14 +42,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"openai/gpt-4o-mini\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_tmp_dj1l0ujp3vq\",\"call_id\":\"call_R27c8sJE6vD3hbShIjdVB9C4\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_R27c8sJE6vD3hbShIjdVB9C4\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":80,\"temperature\":0,\"stream\":true}" + "body": "{\"model\":\"openai/gpt-4o-mini\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_tmp_hgt0s8hlqsa\",\"call_id\":\"call_lvGkIhJoXscAOT3UfLkVKowx\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_lvGkIhJoXscAOT3UfLkVKowx\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":80,\"temperature\":0,\"stream\":true}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743730-6RkMGRipdtlGQTL6QNSG\",\"object\":\"response\",\"created_at\":1790743730,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743730-6RkMGRipdtlGQTL6QNSG\",\"object\":\"response\",\"created_at\":1790743730,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_j7lzfgmkd3\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_j7lzfgmkd3\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_j7lzfgmkd3\",\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_j7lzfgmkd3\",\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_j7lzfgmkd3\",\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_j7lzfgmkd3\",\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_j7lzfgmkd3\",\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[],\"sequence_number\":8}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_j7lzfgmkd3\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_j7lzfgmkd3\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":10}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743730-6RkMGRipdtlGQTL6QNSG\",\"object\":\"response\",\"created_at\":1790743730,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790743730,\"output\":[{\"id\":\"msg_tmp_j7lzfgmkd3\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":103,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":5,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":108,\"cost\":0.00001845,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00001845,\"upstream_inference_input_cost\":0.00001545,\"upstream_inference_output_cost\":0.000003}}},\"sequence_number\":11}\n\ndata: [DONE]\n\n" + "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785407-jHq6bt1PSx3ET9x6hiWK\",\"object\":\"response\",\"created_at\":1790785407,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785407-jHq6bt1PSx3ET9x6hiWK\",\"object\":\"response\",\"created_at\":1790785407,\"model\":\"openai/gpt-4o-mini\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_rrjxmels5k\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_rrjxmels5k\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_rrjxmels5k\",\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_rrjxmels5k\",\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_rrjxmels5k\",\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_rrjxmels5k\",\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_rrjxmels5k\",\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[],\"sequence_number\":8}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_rrjxmels5k\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_rrjxmels5k\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":10}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785407-jHq6bt1PSx3ET9x6hiWK\",\"object\":\"response\",\"created_at\":1790785407,\"model\":\"openai/gpt-4o-mini\",\"status\":\"completed\",\"completed_at\":1790785408,\"output\":[{\"id\":\"msg_tmp_rrjxmels5k\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":103,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":5,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":108,\"cost\":0.00001845,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00001845,\"upstream_inference_input_cost\":0.00001545,\"upstream_inference_output_cost\":0.000003}}},\"sequence_number\":11}\n\ndata: [DONE]\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-5-5-tool-loop.json b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-5-5-tool-loop.json index acb0dcdf623..68f302d0d10 100644 --- a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-5-5-tool-loop.json +++ b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-gpt-5-5-tool-loop.json @@ -14,7 +14,7 @@ "golden" ], "name": "openrouter-responses/openrouter-gpt-5-5-tool-loop", - "recordedAt": "2026-09-30T04:48:52.826Z" + "recordedAt": "2026-09-30T16:23:40.874Z" }, "interactions": [ { @@ -32,7 +32,7 @@ "headers": { "content-type": "text/event-stream" }, - "body": ": \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743730-TBsqgDmmlkyaUVNXg5O5\",\"object\":\"response\",\"created_at\":1790743730,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743730-TBsqgDmmlkyaUVNXg5O5\",\"object\":\"response\",\"created_at\":1790743730,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_6ju3xhq3gge\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_hC5pYJwmASjovJkP6GbuvfYm\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_6ju3xhq3gge\",\"delta\":\"{\\\"\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_6ju3xhq3gge\",\"delta\":\"city\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_6ju3xhq3gge\",\"delta\":\"\\\":\\\"\",\"sequence_number\":5}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_6ju3xhq3gge\",\"delta\":\"Paris\",\"sequence_number\":6}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_6ju3xhq3gge\",\"delta\":\"\\\"}\",\"sequence_number\":7}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_6ju3xhq3gge\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_6ju3xhq3gge\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_hC5pYJwmASjovJkP6GbuvfYm\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743730-TBsqgDmmlkyaUVNXg5O5\",\"object\":\"response\",\"created_at\":1790743730,\"model\":\"openai/gpt-5.5\",\"status\":\"completed\",\"completed_at\":1790743731,\"output\":[{\"id\":\"fc_tmp_6ju3xhq3gge\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_hC5pYJwmASjovJkP6GbuvfYm\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"context\":\"current_turn\",\"effort\":\"medium\",\"mode\":\"standard\",\"summary\":\"detailed\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":74,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":18,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":92,\"cost\":0.00091,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00091,\"upstream_inference_input_cost\":0.00037,\"upstream_inference_output_cost\":0.00054}}},\"sequence_number\":10}\n\ndata: [DONE]\n\n" + "body": ": \n\n: \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785408-P7WTOJJIqq20Fmtefin3\",\"object\":\"response\",\"created_at\":1790785408,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785408-P7WTOJJIqq20Fmtefin3\",\"object\":\"response\",\"created_at\":1790785408,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_kfmcjqs0pta\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_0hH2I7anIhRzJVMaXGgZsSAZ\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_kfmcjqs0pta\",\"delta\":\"{\\\"\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_kfmcjqs0pta\",\"delta\":\"city\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_kfmcjqs0pta\",\"delta\":\"\\\":\\\"\",\"sequence_number\":5}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_kfmcjqs0pta\",\"delta\":\"Paris\",\"sequence_number\":6}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_kfmcjqs0pta\",\"delta\":\"\\\"}\",\"sequence_number\":7}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_kfmcjqs0pta\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_kfmcjqs0pta\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_0hH2I7anIhRzJVMaXGgZsSAZ\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785408-P7WTOJJIqq20Fmtefin3\",\"object\":\"response\",\"created_at\":1790785408,\"model\":\"openai/gpt-5.5\",\"status\":\"completed\",\"completed_at\":1790785419,\"output\":[{\"id\":\"fc_tmp_kfmcjqs0pta\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_0hH2I7anIhRzJVMaXGgZsSAZ\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"context\":\"current_turn\",\"effort\":\"medium\",\"mode\":\"standard\",\"summary\":\"detailed\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":74,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":18,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":92,\"cost\":0.00091,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00091,\"upstream_inference_input_cost\":0.00037,\"upstream_inference_output_cost\":0.00054}}},\"sequence_number\":10}\n\ndata: [DONE]\n\n" } }, { @@ -43,14 +43,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"openai/gpt-5.5\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_tmp_6ju3xhq3gge\",\"call_id\":\"call_hC5pYJwmASjovJkP6GbuvfYm\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_hC5pYJwmASjovJkP6GbuvfYm\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":80,\"temperature\":0,\"stream\":true}" + "body": "{\"model\":\"openai/gpt-5.5\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_tmp_kfmcjqs0pta\",\"call_id\":\"call_0hH2I7anIhRzJVMaXGgZsSAZ\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_0hH2I7anIhRzJVMaXGgZsSAZ\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":80,\"temperature\":0,\"stream\":true}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743731-R9O5oZ5ZNdImLiASD27k\",\"object\":\"response\",\"created_at\":1790743731,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743731-R9O5oZ5ZNdImLiASD27k\",\"object\":\"response\",\"created_at\":1790743731,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_8gl1g6eek2n\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[],\"phase\":\"final_answer\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_8gl1g6eek2n\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_8gl1g6eek2n\",\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_8gl1g6eek2n\",\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_8gl1g6eek2n\",\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_8gl1g6eek2n\",\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_8gl1g6eek2n\",\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[],\"sequence_number\":8}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_8gl1g6eek2n\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_8gl1g6eek2n\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"final_answer\"},\"sequence_number\":10}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743731-R9O5oZ5ZNdImLiASD27k\",\"object\":\"response\",\"created_at\":1790743731,\"model\":\"openai/gpt-5.5\",\"status\":\"completed\",\"completed_at\":1790743732,\"output\":[{\"id\":\"msg_tmp_8gl1g6eek2n\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"final_answer\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"context\":\"current_turn\",\"effort\":\"medium\",\"mode\":\"standard\",\"summary\":\"detailed\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":113,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":8,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":121,\"cost\":0.000805,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.000805,\"upstream_inference_input_cost\":0.000565,\"upstream_inference_output_cost\":0.00024}}},\"sequence_number\":11}\n\ndata: [DONE]\n\n" + "body": ": \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785419-vw658CTigRImCOdrgeoo\",\"object\":\"response\",\"created_at\":1790785419,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785419-vw658CTigRImCOdrgeoo\",\"object\":\"response\",\"created_at\":1790785419,\"model\":\"openai/gpt-5.5\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":null,\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_vz5cc3fsxu\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[],\"phase\":\"final_answer\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_vz5cc3fsxu\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_vz5cc3fsxu\",\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_vz5cc3fsxu\",\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_vz5cc3fsxu\",\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_vz5cc3fsxu\",\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_vz5cc3fsxu\",\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[],\"sequence_number\":8}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_vz5cc3fsxu\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_vz5cc3fsxu\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"final_answer\"},\"sequence_number\":10}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785419-vw658CTigRImCOdrgeoo\",\"object\":\"response\",\"created_at\":1790785419,\"model\":\"openai/gpt-5.5\",\"status\":\"completed\",\"completed_at\":1790785420,\"output\":[{\"id\":\"msg_tmp_vz5cc3fsxu\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"final_answer\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"context\":\"current_turn\",\"effort\":\"medium\",\"mode\":\"standard\",\"summary\":\"detailed\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":113,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":8,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":121,\"cost\":0.000805,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.000805,\"upstream_inference_input_cost\":0.000565,\"upstream_inference_output_cost\":0.00024}}},\"sequence_number\":11}\n\ndata: [DONE]\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-grok-4-3-tool-loop.json b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-grok-4-3-tool-loop.json index 3b1dbabbdbe..1a5901f8e9c 100644 --- a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-grok-4-3-tool-loop.json +++ b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-grok-4-3-tool-loop.json @@ -13,7 +13,7 @@ "golden" ], "name": "openrouter-responses/openrouter-grok-4-3-tool-loop", - "recordedAt": "2026-09-30T04:48:54.082Z" + "recordedAt": "2026-09-30T16:23:43.264Z" }, "interactions": [ { @@ -31,7 +31,7 @@ "headers": { "content-type": "text/event-stream" }, - "body": ": \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743732-IVoOq91Eya07dPabKzsA\",\"object\":\"response\",\"created_at\":1790743732,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743732-IVoOq91Eya07dPabKzsA\",\"object\":\"response\",\"created_at\":1790743732,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_pr5t3h6mjlq\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call-651cf23e-6c63-466e-9909-c1ee3187537b-0\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_pr5t3h6mjlq\",\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_pr5t3h6mjlq\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_pr5t3h6mjlq\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call-651cf23e-6c63-466e-9909-c1ee3187537b-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":5}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743732-IVoOq91Eya07dPabKzsA\",\"object\":\"response\",\"created_at\":1790743732,\"model\":\"x-ai/grok-4.3\",\"status\":\"completed\",\"completed_at\":1790743733,\"output\":[{\"id\":\"fc_tmp_pr5t3h6mjlq\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call-651cf23e-6c63-466e-9909-c1ee3187537b-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\",\"summary\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":319,\"input_tokens_details\":{\"cached_tokens\":128},\"output_tokens\":10,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":329,\"cost\":0.00028935,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00028935,\"upstream_inference_input_cost\":0.00026435,\"upstream_inference_output_cost\":0.000025}}},\"sequence_number\":6}\n\ndata: [DONE]\n\n" + "body": ": \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785420-a3oY2v6sUg0ehNSThKNZ\",\"object\":\"response\",\"created_at\":1790785420,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785420-a3oY2v6sUg0ehNSThKNZ\",\"object\":\"response\",\"created_at\":1790785420,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_rbl2s0gjqna\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call-b8fc2f91-196a-424e-806c-809d8210716c-0\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":2}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":0,\"item_id\":\"fc_tmp_rbl2s0gjqna\",\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":3}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":0,\"item_id\":\"fc_tmp_rbl2s0gjqna\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"fc_tmp_rbl2s0gjqna\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call-b8fc2f91-196a-424e-806c-809d8210716c-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":5}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785420-a3oY2v6sUg0ehNSThKNZ\",\"object\":\"response\",\"created_at\":1790785420,\"model\":\"x-ai/grok-4.3\",\"status\":\"completed\",\"completed_at\":1790785422,\"output\":[{\"id\":\"fc_tmp_rbl2s0gjqna\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call-b8fc2f91-196a-424e-806c-809d8210716c-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\",\"summary\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":319,\"input_tokens_details\":{\"cached_tokens\":128},\"output_tokens\":10,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":329,\"cost\":0.00028935,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.00028935,\"upstream_inference_input_cost\":0.00026435,\"upstream_inference_output_cost\":0.000025}}},\"sequence_number\":6}\n\ndata: [DONE]\n\n" } }, { @@ -42,14 +42,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"x-ai/grok-4.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_tmp_pr5t3h6mjlq\",\"call_id\":\"call-651cf23e-6c63-466e-9909-c1ee3187537b-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call-651cf23e-6c63-466e-9909-c1ee3187537b-0\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"none\"},\"max_output_tokens\":80,\"temperature\":0,\"stream\":true}" + "body": "{\"model\":\"x-ai/grok-4.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_tmp_rbl2s0gjqna\",\"call_id\":\"call-b8fc2f91-196a-424e-806c-809d8210716c-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call-b8fc2f91-196a-424e-806c-809d8210716c-0\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"none\"},\"max_output_tokens\":80,\"temperature\":0,\"stream\":true}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743733-CAH2sthoK7dycbV0bIpG\",\"object\":\"response\",\"created_at\":1790743733,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743733-CAH2sthoK7dycbV0bIpG\",\"object\":\"response\",\"created_at\":1790743733,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_qd0ajwonyi\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_qd0ajwonyi\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_qd0ajwonyi\",\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_qd0ajwonyi\",\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_qd0ajwonyi\",\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_qd0ajwonyi\",\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_qd0ajwonyi\",\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[],\"sequence_number\":8}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_qd0ajwonyi\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_qd0ajwonyi\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":10}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743733-CAH2sthoK7dycbV0bIpG\",\"object\":\"response\",\"created_at\":1790743733,\"model\":\"x-ai/grok-4.3\",\"status\":\"completed\",\"completed_at\":1790743734,\"output\":[{\"id\":\"msg_tmp_qd0ajwonyi\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\",\"summary\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":344,\"input_tokens_details\":{\"cached_tokens\":128},\"output_tokens\":4,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":348,\"cost\":0.0003056,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.0003056,\"upstream_inference_input_cost\":0.0002956,\"upstream_inference_output_cost\":0.00001}}},\"sequence_number\":11}\n\ndata: [DONE]\n\n" + "body": ": \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785422-Zue6MgjVTcuWAjhEmP4R\",\"object\":\"response\",\"created_at\":1790785422,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785422-Zue6MgjVTcuWAjhEmP4R\",\"object\":\"response\",\"created_at\":1790785422,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_lcfnzrpthhm\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":0,\"item_id\":\"msg_tmp_lcfnzrpthhm\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_lcfnzrpthhm\",\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[],\"sequence_number\":4}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_lcfnzrpthhm\",\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_lcfnzrpthhm\",\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":0,\"item_id\":\"msg_tmp_lcfnzrpthhm\",\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":0,\"item_id\":\"msg_tmp_lcfnzrpthhm\",\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[],\"sequence_number\":8}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":0,\"item_id\":\"msg_tmp_lcfnzrpthhm\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"msg_tmp_lcfnzrpthhm\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":10}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785422-Zue6MgjVTcuWAjhEmP4R\",\"object\":\"response\",\"created_at\":1790785422,\"model\":\"x-ai/grok-4.3\",\"status\":\"completed\",\"completed_at\":1790785423,\"output\":[{\"id\":\"msg_tmp_lcfnzrpthhm\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":80,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"none\",\"summary\":\"none\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":344,\"input_tokens_details\":{\"cached_tokens\":128},\"output_tokens\":4,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":348,\"cost\":0.0003056,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.0003056,\"upstream_inference_input_cost\":0.0002956,\"upstream_inference_output_cost\":0.00001}}},\"sequence_number\":11}\n\ndata: [DONE]\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-muse-spark-1-3-tool-loop.json b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-muse-spark-1-3-tool-loop.json index c8f5bc9d78d..3ff1c83c134 100644 --- a/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-muse-spark-1-3-tool-loop.json +++ b/packages/ai/test/fixtures/recordings/openrouter-responses/openrouter-muse-spark-1-3-tool-loop.json @@ -9,7 +9,7 @@ "tool-loop" ], "name": "openrouter-responses/openrouter-muse-spark-1-3-tool-loop", - "recordedAt": "2026-09-30T04:48:45.728Z" + "recordedAt": "2026-09-30T16:23:20.933Z" }, "interactions": [ { @@ -20,14 +20,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"minimal\"},\"max_output_tokens\":512,\"temperature\":0,\"stream\":true}" + "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Call only crm.lookup once with query ping. Do not call inventory.lookup. Wait for the result.\"}]}],\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"minimal\"},\"max_output_tokens\":1536,\"stream\":true}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743723-OKwFcQN2fRHIDoTg54A9\",\"object\":\"response\",\"created_at\":1790743723,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":512,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743723-OKwFcQN2fRHIDoTg54A9\",\"object\":\"response\",\"created_at\":1790743723,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":512,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"rs_6abc94ac811510dbe9cd499e:rs_01a0f0a4c0987619ba7f345b8b8c2533\",\"type\":\"reasoning\",\"status\":\"in_progress\",\"summary\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"rs_6abc94ac811510dbe9cd499e:rs_01a0f0a4c0987619ba7f345b8b8c2533\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgEYAMb2z63CGja44txE6OuW6S9kKYV_-MuZA53bZ9iNm2UyPs_q-dSb-_PvhOnUEvRGYuiKMlhzQF-SMPH37wg9G1SVg3TOFmT6jUJkm0zfA3wLV3Gcv01lGYe39JX4Ze65yeNgvQGW5ClhNSsKFdMn3FTTKHMLFQmlzmWODS4Az-hu4kxBE8MBd3_fTfLul6Eb-wEUSL9xn4BEDMtNauidvHAWXpaT6EKBlTeZ2xZ4EThOhZ9d-kFcyjr4FVsSOSl8I-aPqjToFh58brxa80Bqr0CLekQ9NyR2FA_hSh1IWoMBI6_T5pUUka_PPharMLpWEo35NeYgRHgLpjDaD43DG0bcFWfxyHdrPwZSMycAyXvFXyTfnKHAXdaIGts4_FmW4TZ8XVRCHsmWu8LoCI8PbJDNdNl04uM8s2Zyh6_bJqbcJAzRMC7uGq7VIYzlPF25aT97XMuJFWi8FKUy8GBYynGYE_gPta6fNDDzYWDAii8Yfr91Ju3gOBMYO_xnuVH6_8vgBMcd8l40cxBDyj540feI0V--WLcCk10u1tcTknLljuNEBEujHg6hZKp9ym7OikEmJRml33qY-q5fbW80CsO0wuKR9ScxqR4JfPgIoPJkOgSpeVFVwoiiX3cMjHWBSj7eSVJVVuRyWHc8-2f4HOb4big993TmVKlcAAeYv1HPgWP1C80tRc_CfhkmeMa230LupP7R5tRw2l5jHhJNkIYxeB8C1BQj6xwDw21GXcu8HtAO9u2pZlBIwfLGmFiSjsYf0WwUn4G9iswKc9gmRkczjiXq2psu1wotgucCQ_CbVWA8At78sehpjE-S8rzxvqG71Wb1yRY_IQAMaJXeGrhTN8Sfynlro4YKGdVznq0pRTEAButToZmQmXTLeI0J7-nyFLwzJlnCdDQCbX3ucFpKS7O71mbXoN2TXvlMmQWQrPmwMfNRASY8fWZf88Al5xRzODYn_68pU1eSL7fKkc6XahFGEfEx3-daOQUQbrx4V-JX6tqQDQp8tawHjFk67h-NIs9gNMTs6wEc6eOGmVzEEFg8jTauoJQjbI-sgHcVToDRG3xc3EakCtBKw0wxf6tzVWUjM2IbbrohoiymblizRIRzHX2WmEFlhjadSdO9N-rqodFAdGOi5UcTvmntDJk0JiJtBRQGoWIvq6sBZwdSEkMTWvPD4iXFjkKNcXFGw_6A8nAiI9CXp6j5upxrA-BxaXPBZeB6CPiLQElSv_TI1VsWdwmZut_5CxNjHvtfAF5SQ79LOsRilszSHhtLndJluvxkXSMww3hMThAxwbhjImYYKQQUUIJRy2fxtY3TsUH4xNCxp0JbJ3wWmB7fBh83jFjhrMDBuWCHXK7CuMSEPzAuVzBlOIX_eFkI1v08mfth_soBxDYy_-cn_rP6Ox2-pR6jwg.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_qs9pl1gaflr\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[],\"phase\":\"commentary\"},\"sequence_number\":4}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":1,\"item_id\":\"msg_tmp_qs9pl1gaflr\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":1,\"item_id\":\"msg_tmp_qs9pl1gaflr\",\"content_index\":0,\"delta\":\"I'll check the weather in Paris for you.\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":1,\"item_id\":\"msg_tmp_qs9pl1gaflr\",\"content_index\":0,\"text\":\"I'll check the weather in Paris for you.\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":1,\"item_id\":\"msg_tmp_qs9pl1gaflr\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_qs9pl1gaflr\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":2,\"item\":{\"id\":\"fc_tmp_zvz6k6236km\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_01a0f0a4c1fe755d9f280fb40b317fc4\",\"name\":\"get_weather\",\"arguments\":\"\"},\"sequence_number\":10}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":2,\"item_id\":\"fc_tmp_zvz6k6236km\",\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":11}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":2,\"item_id\":\"fc_tmp_zvz6k6236km\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"sequence_number\":12}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":2,\"item\":{\"id\":\"fc_tmp_zvz6k6236km\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_01a0f0a4c1fe755d9f280fb40b317fc4\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":13}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743723-OKwFcQN2fRHIDoTg54A9\",\"object\":\"response\",\"created_at\":1790743723,\"model\":\"meta/muse-spark-1.3\",\"status\":\"completed\",\"completed_at\":1790743724,\"output\":[{\"id\":\"rs_6abc94ac811510dbe9cd499e:rs_01a0f0a4c0987619ba7f345b8b8c2533\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgEYAMb2z63CGja44txE6OuW6S9kKYV_-MuZA53bZ9iNm2UyPs_q-dSb-_PvhOnUEvRGYuiKMlhzQF-SMPH37wg9G1SVg3TOFmT6jUJkm0zfA3wLV3Gcv01lGYe39JX4Ze65yeNgvQGW5ClhNSsKFdMn3FTTKHMLFQmlzmWODS4Az-hu4kxBE8MBd3_fTfLul6Eb-wEUSL9xn4BEDMtNauidvHAWXpaT6EKBlTeZ2xZ4EThOhZ9d-kFcyjr4FVsSOSl8I-aPqjToFh58brxa80Bqr0CLekQ9NyR2FA_hSh1IWoMBI6_T5pUUka_PPharMLpWEo35NeYgRHgLpjDaD43DG0bcFWfxyHdrPwZSMycAyXvFXyTfnKHAXdaIGts4_FmW4TZ8XVRCHsmWu8LoCI8PbJDNdNl04uM8s2Zyh6_bJqbcJAzRMC7uGq7VIYzlPF25aT97XMuJFWi8FKUy8GBYynGYE_gPta6fNDDzYWDAii8Yfr91Ju3gOBMYO_xnuVH6_8vgBMcd8l40cxBDyj540feI0V--WLcCk10u1tcTknLljuNEBEujHg6hZKp9ym7OikEmJRml33qY-q5fbW80CsO0wuKR9ScxqR4JfPgIoPJkOgSpeVFVwoiiX3cMjHWBSj7eSVJVVuRyWHc8-2f4HOb4big993TmVKlcAAeYv1HPgWP1C80tRc_CfhkmeMa230LupP7R5tRw2l5jHhJNkIYxeB8C1BQj6xwDw21GXcu8HtAO9u2pZlBIwfLGmFiSjsYf0WwUn4G9iswKc9gmRkczjiXq2psu1wotgucCQ_CbVWA8At78sehpjE-S8rzxvqG71Wb1yRY_IQAMaJXeGrhTN8Sfynlro4YKGdVznq0pRTEAButToZmQmXTLeI0J7-nyFLwzJlnCdDQCbX3ucFpKS7O71mbXoN2TXvlMmQWQrPmwMfNRASY8fWZf88Al5xRzODYn_68pU1eSL7fKkc6XahFGEfEx3-daOQUQbrx4V-JX6tqQDQp8tawHjFk67h-NIs9gNMTs6wEc6eOGmVzEEFg8jTauoJQjbI-sgHcVToDRG3xc3EakCtBKw0wxf6tzVWUjM2IbbrohoiymblizRIRzHX2WmEFlhjadSdO9N-rqodFAdGOi5UcTvmntDJk0JiJtBRQGoWIvq6sBZwdSEkMTWvPD4iXFjkKNcXFGw_6A8nAiI9CXp6j5upxrA-BxaXPBZeB6CPiLQElSv_TI1VsWdwmZut_5CxNjHvtfAF5SQ79LOsRilszSHhtLndJluvxkXSMww3hMThAxwbhjImYYKQQUUIJRy2fxtY3TsUH4xNCxp0JbJ3wWmB7fBh83jFjhrMDBuWCHXK7CuMSEPzAuVzBlOIX_eFkI1v08mfth_soBxDYy_-cn_rP6Ox2-pR6jwg.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},{\"id\":\"msg_tmp_qs9pl1gaflr\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},{\"id\":\"fc_tmp_zvz6k6236km\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_01a0f0a4c1fe755d9f280fb40b317fc4\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":512,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":576,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":96,\"output_tokens_details\":{\"reasoning_tokens\":28},\"total_tokens\":672,\"cost\":0.001128,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.001128,\"upstream_inference_input_cost\":0.00072,\"upstream_inference_output_cost\":0.000408}}},\"sequence_number\":14}\n\ndata: [DONE]\n\n" + "body": ": \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\n: \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785364-VktAhM6ZJXQP6x3mVw7T\",\"object\":\"response\",\"created_at\":1790785364,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785364-VktAhM6ZJXQP6x3mVw7T\",\"object\":\"response\",\"created_at\":1790785364,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"rs_6abd3776fff29bd8da44468c:rs_01a0f320a8c9714fa24f527f40c24748\",\"type\":\"reasoning\",\"status\":\"in_progress\",\"summary\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"rs_6abd3776fff29bd8da44468c:rs_01a0f320a8c9714fa24f527f40c24748\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHY_3PI-JeCW7Y8MkHRD9BwIrxUwGzuBlkizQgaR9cB6NITAxPRcBFZxhvP1Acf2GPKrtSVIz4MUZktp1JKC6aGBB8Nsamp6Os43QZAYJ5n8wrSXDEBrKZNK8ldwitW50CF4Hx_GmUt2SHaZOraBaaaAZqa0COdRMJTFV099j3KENOY9TlpOMIEQBBU3If_hwVYQzhHA9kucHpICDohVNl5wdgAT8Z_lvg-cr2jor6NDwEIrdBrQXkNpphfVfP_o4zibO8vmCao5lo5obWxH8pPx8UrZ4qZKSf5sULJWmMpMUEBD7vK_G1b_QeugBCer1S4iBaQo1pUkFVyySNisd-ceytgeEdGT9KsxLYgaOcK9DRCtGJ0fFB2NKIV1LW9nbXlkKQcfDv2agRk__7sWciz-XIGaSMo55kTbASDTIwO9EEKkqFNby0WU5KcZUBAOFncAfDax--ptoqViPW5ReE1xrGPkb0FNmfr7VREcqtzZe5lSAbwx1jK8ojUgk6iJzDVkjRgYLbaFV2avI7pvMF76r4rjgr1jJG71vDtQ8_rKQfiCzaSb5OEJ5IxTobS7HjNAYQkiyrxOm68pbRSZkxn8jUz8unT8UGI3FFAEujpaldteLwta-s2TgI_tCeySlXM9oF1w8GkGSjPzvtrQ6yzYCEiOqWXMrjQxw6TFWtO8oCockU8oz8uFbDcduY8KKEZXgh7iXvohMw4BH58fKEfqmhi6PubDCLgTHu5R-PEvYuVNXduOJfW4XBUJjua-Ux6zIvETdhKgZHmWXg1PjFYfJuEgK800_wkSJYSPkbH01RzPJ4rBRTnS3bJiymA6MjdgMtDk0utCgFr0_Y-vrE1dfDs9nWaFs69cydN06u85VArK6HLdn1uHG69Zt6mVMMEy1m96T1YLl07hq1jePUhe9xOuDnmii6LI1nzaPE-GGenJXGERhX6KnVbTJEgleh5ycLWvQvFXuS9sbK59DdEvdSizGj5taqzQgmPmjWJErJ1GNVTzn8AzX90z6ORTy4MNn0dMu14BDbrbDeBfhoj9pGKUyvsrNeeykpUX2Y6Ms3DWVSj0Z-o59M3_kfzo9GiEq1js0d27pMXC7V-ioTuX3EOTRGeILgPtp97aQumzy_3cg6i0chgUn5xBVPpp-98EO7xjB_eTBgtTn9Rv1lCJOdsHJwtizNTbXkeijaF06fKfc08kAxdG30o55Mh4-sFGEsK5F8bTZmvaul_QUxbqsioMYzOL2BOkp_THWjNSZ6CO1O3LEjpWvzAA_26W16AApzD-XN6GHCuMZbMf5j7Q1Rm0w3MX4r0Vl7q1yvSkoMXVFoirE15CBfWWI16Wt-ku0-ATe1fsXu0zo3v8tOaBJ5MrgcC_ad9odqlwFbYEeH65mQGKdLz7WRG7BpdV0sW9X8c8RWtDA.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_el0yxdghgbv\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[],\"phase\":\"commentary\"},\"sequence_number\":4}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":1,\"item_id\":\"msg_tmp_el0yxdghgbv\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":1,\"item_id\":\"msg_tmp_el0yxdghgbv\",\"content_index\":0,\"delta\":\"I'll run that single lookup now.\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":1,\"item_id\":\"msg_tmp_el0yxdghgbv\",\"content_index\":0,\"text\":\"I'll run that single lookup now.\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":1,\"item_id\":\"msg_tmp_el0yxdghgbv\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"I'll run that single lookup now.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_el0yxdghgbv\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll run that single lookup now.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":2,\"item\":{\"id\":\"fc_tmp_lhl1yjbxd7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"call_id\":\"call_01a0f320ab507055864d9277288849b3\",\"name\":\"lookup\",\"arguments\":\"\",\"namespace\":\"crm\"},\"sequence_number\":10}\n\ndata: {\"type\":\"response.function_call_arguments.delta\",\"output_index\":2,\"item_id\":\"fc_tmp_lhl1yjbxd7\",\"delta\":\"{\\\"query\\\":\\\"ping\\\"}\",\"sequence_number\":11}\n\ndata: {\"type\":\"response.function_call_arguments.done\",\"output_index\":2,\"item_id\":\"fc_tmp_lhl1yjbxd7\",\"name\":\"lookup\",\"arguments\":\"{\\\"query\\\":\\\"ping\\\"}\",\"sequence_number\":12}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":2,\"item\":{\"id\":\"fc_tmp_lhl1yjbxd7\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_01a0f320ab507055864d9277288849b3\",\"name\":\"lookup\",\"arguments\":\"{\\\"query\\\":\\\"ping\\\"}\",\"namespace\":\"crm\"},\"sequence_number\":13}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785364-VktAhM6ZJXQP6x3mVw7T\",\"object\":\"response\",\"created_at\":1790785364,\"model\":\"meta/muse-spark-1.3\",\"status\":\"completed\",\"completed_at\":1790785399,\"output\":[{\"id\":\"rs_6abd3776fff29bd8da44468c:rs_01a0f320a8c9714fa24f527f40c24748\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHY_3PI-JeCW7Y8MkHRD9BwIrxUwGzuBlkizQgaR9cB6NITAxPRcBFZxhvP1Acf2GPKrtSVIz4MUZktp1JKC6aGBB8Nsamp6Os43QZAYJ5n8wrSXDEBrKZNK8ldwitW50CF4Hx_GmUt2SHaZOraBaaaAZqa0COdRMJTFV099j3KENOY9TlpOMIEQBBU3If_hwVYQzhHA9kucHpICDohVNl5wdgAT8Z_lvg-cr2jor6NDwEIrdBrQXkNpphfVfP_o4zibO8vmCao5lo5obWxH8pPx8UrZ4qZKSf5sULJWmMpMUEBD7vK_G1b_QeugBCer1S4iBaQo1pUkFVyySNisd-ceytgeEdGT9KsxLYgaOcK9DRCtGJ0fFB2NKIV1LW9nbXlkKQcfDv2agRk__7sWciz-XIGaSMo55kTbASDTIwO9EEKkqFNby0WU5KcZUBAOFncAfDax--ptoqViPW5ReE1xrGPkb0FNmfr7VREcqtzZe5lSAbwx1jK8ojUgk6iJzDVkjRgYLbaFV2avI7pvMF76r4rjgr1jJG71vDtQ8_rKQfiCzaSb5OEJ5IxTobS7HjNAYQkiyrxOm68pbRSZkxn8jUz8unT8UGI3FFAEujpaldteLwta-s2TgI_tCeySlXM9oF1w8GkGSjPzvtrQ6yzYCEiOqWXMrjQxw6TFWtO8oCockU8oz8uFbDcduY8KKEZXgh7iXvohMw4BH58fKEfqmhi6PubDCLgTHu5R-PEvYuVNXduOJfW4XBUJjua-Ux6zIvETdhKgZHmWXg1PjFYfJuEgK800_wkSJYSPkbH01RzPJ4rBRTnS3bJiymA6MjdgMtDk0utCgFr0_Y-vrE1dfDs9nWaFs69cydN06u85VArK6HLdn1uHG69Zt6mVMMEy1m96T1YLl07hq1jePUhe9xOuDnmii6LI1nzaPE-GGenJXGERhX6KnVbTJEgleh5ycLWvQvFXuS9sbK59DdEvdSizGj5taqzQgmPmjWJErJ1GNVTzn8AzX90z6ORTy4MNn0dMu14BDbrbDeBfhoj9pGKUyvsrNeeykpUX2Y6Ms3DWVSj0Z-o59M3_kfzo9GiEq1js0d27pMXC7V-ioTuX3EOTRGeILgPtp97aQumzy_3cg6i0chgUn5xBVPpp-98EO7xjB_eTBgtTn9Rv1lCJOdsHJwtizNTbXkeijaF06fKfc08kAxdG30o55Mh4-sFGEsK5F8bTZmvaul_QUxbqsioMYzOL2BOkp_THWjNSZ6CO1O3LEjpWvzAA_26W16AApzD-XN6GHCuMZbMf5j7Q1Rm0w3MX4r0Vl7q1yvSkoMXVFoirE15CBfWWI16Wt-ku0-ATe1fsXu0zo3v8tOaBJ5MrgcC_ad9odqlwFbYEeH65mQGKdLz7WRG7BpdV0sW9X8c8RWtDA.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},{\"id\":\"msg_tmp_el0yxdghgbv\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll run that single lookup now.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},{\"id\":\"fc_tmp_lhl1yjbxd7\",\"type\":\"function_call\",\"status\":\"completed\",\"call_id\":\"call_01a0f320ab507055864d9277288849b3\",\"name\":\"lookup\",\"arguments\":\"{\\\"query\\\":\\\"ping\\\"}\",\"namespace\":\"crm\"}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":611,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens\":97,\"output_tokens_details\":{\"reasoning_tokens\":27},\"total_tokens\":708,\"cost\":0.0010517,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.0010517,\"upstream_inference_input_cost\":0.00063945,\"upstream_inference_output_cost\":0.00041225}}},\"sequence_number\":14}\n\ndata: [DONE]\n\n" } }, { @@ -38,14 +38,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abc94ac811510dbe9cd499e:rs_01a0f0a4c0987619ba7f345b8b8c2533\",\"summary\":[],\"encrypted_content\":\"Q-PaDgEYAMb2z63CGja44txE6OuW6S9kKYV_-MuZA53bZ9iNm2UyPs_q-dSb-_PvhOnUEvRGYuiKMlhzQF-SMPH37wg9G1SVg3TOFmT6jUJkm0zfA3wLV3Gcv01lGYe39JX4Ze65yeNgvQGW5ClhNSsKFdMn3FTTKHMLFQmlzmWODS4Az-hu4kxBE8MBd3_fTfLul6Eb-wEUSL9xn4BEDMtNauidvHAWXpaT6EKBlTeZ2xZ4EThOhZ9d-kFcyjr4FVsSOSl8I-aPqjToFh58brxa80Bqr0CLekQ9NyR2FA_hSh1IWoMBI6_T5pUUka_PPharMLpWEo35NeYgRHgLpjDaD43DG0bcFWfxyHdrPwZSMycAyXvFXyTfnKHAXdaIGts4_FmW4TZ8XVRCHsmWu8LoCI8PbJDNdNl04uM8s2Zyh6_bJqbcJAzRMC7uGq7VIYzlPF25aT97XMuJFWi8FKUy8GBYynGYE_gPta6fNDDzYWDAii8Yfr91Ju3gOBMYO_xnuVH6_8vgBMcd8l40cxBDyj540feI0V--WLcCk10u1tcTknLljuNEBEujHg6hZKp9ym7OikEmJRml33qY-q5fbW80CsO0wuKR9ScxqR4JfPgIoPJkOgSpeVFVwoiiX3cMjHWBSj7eSVJVVuRyWHc8-2f4HOb4big993TmVKlcAAeYv1HPgWP1C80tRc_CfhkmeMa230LupP7R5tRw2l5jHhJNkIYxeB8C1BQj6xwDw21GXcu8HtAO9u2pZlBIwfLGmFiSjsYf0WwUn4G9iswKc9gmRkczjiXq2psu1wotgucCQ_CbVWA8At78sehpjE-S8rzxvqG71Wb1yRY_IQAMaJXeGrhTN8Sfynlro4YKGdVznq0pRTEAButToZmQmXTLeI0J7-nyFLwzJlnCdDQCbX3ucFpKS7O71mbXoN2TXvlMmQWQrPmwMfNRASY8fWZf88Al5xRzODYn_68pU1eSL7fKkc6XahFGEfEx3-daOQUQbrx4V-JX6tqQDQp8tawHjFk67h-NIs9gNMTs6wEc6eOGmVzEEFg8jTauoJQjbI-sgHcVToDRG3xc3EakCtBKw0wxf6tzVWUjM2IbbrohoiymblizRIRzHX2WmEFlhjadSdO9N-rqodFAdGOi5UcTvmntDJk0JiJtBRQGoWIvq6sBZwdSEkMTWvPD4iXFjkKNcXFGw_6A8nAiI9CXp6j5upxrA-BxaXPBZeB6CPiLQElSv_TI1VsWdwmZut_5CxNjHvtfAF5SQ79LOsRilszSHhtLndJluvxkXSMww3hMThAxwbhjImYYKQQUUIJRy2fxtY3TsUH4xNCxp0JbJ3wWmB7fBh83jFjhrMDBuWCHXK7CuMSEPzAuVzBlOIX_eFkI1v08mfth_soBxDYy_-cn_rP6Ox2-pR6jwg.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\"},{\"type\":\"message\",\"id\":\"msg_tmp_qs9pl1gaflr\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\"}],\"phase\":\"commentary\",\"status\":\"completed\"},{\"type\":\"function_call\",\"id\":\"fc_tmp_zvz6k6236km\",\"call_id\":\"call_01a0f0a4c1fe755d9f280fb40b317fc4\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0f0a4c1fe755d9f280fb40b317fc4\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"minimal\"},\"max_output_tokens\":512,\"temperature\":0,\"stream\":true}" + "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Call only crm.lookup once with query ping. Do not call inventory.lookup. Wait for the result.\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abd3776fff29bd8da44468c:rs_01a0f320a8c9714fa24f527f40c24748\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHY_3PI-JeCW7Y8MkHRD9BwIrxUwGzuBlkizQgaR9cB6NITAxPRcBFZxhvP1Acf2GPKrtSVIz4MUZktp1JKC6aGBB8Nsamp6Os43QZAYJ5n8wrSXDEBrKZNK8ldwitW50CF4Hx_GmUt2SHaZOraBaaaAZqa0COdRMJTFV099j3KENOY9TlpOMIEQBBU3If_hwVYQzhHA9kucHpICDohVNl5wdgAT8Z_lvg-cr2jor6NDwEIrdBrQXkNpphfVfP_o4zibO8vmCao5lo5obWxH8pPx8UrZ4qZKSf5sULJWmMpMUEBD7vK_G1b_QeugBCer1S4iBaQo1pUkFVyySNisd-ceytgeEdGT9KsxLYgaOcK9DRCtGJ0fFB2NKIV1LW9nbXlkKQcfDv2agRk__7sWciz-XIGaSMo55kTbASDTIwO9EEKkqFNby0WU5KcZUBAOFncAfDax--ptoqViPW5ReE1xrGPkb0FNmfr7VREcqtzZe5lSAbwx1jK8ojUgk6iJzDVkjRgYLbaFV2avI7pvMF76r4rjgr1jJG71vDtQ8_rKQfiCzaSb5OEJ5IxTobS7HjNAYQkiyrxOm68pbRSZkxn8jUz8unT8UGI3FFAEujpaldteLwta-s2TgI_tCeySlXM9oF1w8GkGSjPzvtrQ6yzYCEiOqWXMrjQxw6TFWtO8oCockU8oz8uFbDcduY8KKEZXgh7iXvohMw4BH58fKEfqmhi6PubDCLgTHu5R-PEvYuVNXduOJfW4XBUJjua-Ux6zIvETdhKgZHmWXg1PjFYfJuEgK800_wkSJYSPkbH01RzPJ4rBRTnS3bJiymA6MjdgMtDk0utCgFr0_Y-vrE1dfDs9nWaFs69cydN06u85VArK6HLdn1uHG69Zt6mVMMEy1m96T1YLl07hq1jePUhe9xOuDnmii6LI1nzaPE-GGenJXGERhX6KnVbTJEgleh5ycLWvQvFXuS9sbK59DdEvdSizGj5taqzQgmPmjWJErJ1GNVTzn8AzX90z6ORTy4MNn0dMu14BDbrbDeBfhoj9pGKUyvsrNeeykpUX2Y6Ms3DWVSj0Z-o59M3_kfzo9GiEq1js0d27pMXC7V-ioTuX3EOTRGeILgPtp97aQumzy_3cg6i0chgUn5xBVPpp-98EO7xjB_eTBgtTn9Rv1lCJOdsHJwtizNTbXkeijaF06fKfc08kAxdG30o55Mh4-sFGEsK5F8bTZmvaul_QUxbqsioMYzOL2BOkp_THWjNSZ6CO1O3LEjpWvzAA_26W16AApzD-XN6GHCuMZbMf5j7Q1Rm0w3MX4r0Vl7q1yvSkoMXVFoirE15CBfWWI16Wt-ku0-ATe1fsXu0zo3v8tOaBJ5MrgcC_ad9odqlwFbYEeH65mQGKdLz7WRG7BpdV0sW9X8c8RWtDA.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\"},{\"type\":\"message\",\"id\":\"msg_tmp_el0yxdghgbv\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll run that single lookup now.\"}],\"phase\":\"commentary\",\"status\":\"completed\"},{\"type\":\"function_call\",\"id\":\"fc_tmp_lhl1yjbxd7\",\"call_id\":\"call_01a0f320ab507055864d9277288849b3\",\"name\":\"lookup\",\"namespace\":\"crm\",\"arguments\":\"{\\\"query\\\":\\\"ping\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0f320ab507055864d9277288849b3\",\"output\":\"\\\"pong\\\"\"},{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Do not call tools again. Reply exactly pong.\"}]}],\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"minimal\"},\"max_output_tokens\":1536,\"stream\":true}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790743724-L7dx7E48PJMwLi5b7Itv\",\"object\":\"response\",\"created_at\":1790743724,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":512,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790743724-L7dx7E48PJMwLi5b7Itv\",\"object\":\"response\",\"created_at\":1790743724,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":512,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"rs_6abc94ada24a2d24b1094e83:rs_01a0f0a4c5a8771985213097a0b77e85\",\"type\":\"reasoning\",\"status\":\"in_progress\",\"summary\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"rs_6abc94ada24a2d24b1094e83:rs_01a0f0a4c5a8771985213097a0b77e85\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHdo7VHKqTApb35TVIHY0chttGUraTfO9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OOwKlOz2xkKl_Gv5_vI28SJoirJmXRKDhOcUxZ8cjyUj20Ayjh5DCl53Vo7Ak2qGbXVFQUsU7Jzt0A7knhz9dnDH2cK9QynNPDtiaaKOfgWKanDRHv2ddL8I5kJl9vJoiWQGtgT4vn1sAtPQRaXArvCgImRb1fQ5dGp4sBRh2Q0yQS2XYoQzotp5Lv3T4xxRX3LuhwyLiXP0hIjb3mMsKfsbfY5494t_RG3_lIYTNw59tGlX7VStaiPmoF7F7haKI5aTl9TisuIL1w1yF6zX95I4zsy3HI9Av_pdLMEYNnREA.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_xon0hygprf8\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":4}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":1,\"item_id\":\"msg_tmp_xon0hygprf8\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":1,\"item_id\":\"msg_tmp_xon0hygprf8\",\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":1,\"item_id\":\"msg_tmp_xon0hygprf8\",\"content_index\":0,\"delta\":\" is sunny.\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":1,\"item_id\":\"msg_tmp_xon0hygprf8\",\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[],\"sequence_number\":8}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":1,\"item_id\":\"msg_tmp_xon0hygprf8\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_xon0hygprf8\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":10}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790743724-L7dx7E48PJMwLi5b7Itv\",\"object\":\"response\",\"created_at\":1790743724,\"model\":\"meta/muse-spark-1.3\",\"status\":\"completed\",\"completed_at\":1790743725,\"output\":[{\"id\":\"rs_6abc94ada24a2d24b1094e83:rs_01a0f0a4c5a8771985213097a0b77e85\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHdo7VHKqTApb35TVIHY0chttGUraTfO9GF3-mLdEqjcXD7675lq_Rtp0MeLVCnSAGK2rTzyCO3cJC_DYXtaEs6-zTPxo0ceySh1oZhXLgPcMDEtK5K3e1hBOXymfWu0uOUEMsLQq6wL3qelA_lIdMJpDiTmTgZe593C3tTge1KokSJF6mTzkSnW2VQb9xGDfXhzTB4MUtUhkL5wSovcnh5Fjmvb64GVu3rPWJhPHGUl_0jpcl0gv7TIYQu9BNzlpbAZ4wXniHI-E2prgCS4KdkZGuRBVXAZpggemZoUVGbzItYG2_XC-Zu8a6_B1M4GBe0jLZ8BO2DjCZYC2VJ66ZMLhx9oiwM2upiJ0x04FS0Ts3AAqSib_CP26ZgWz7c5T0YP-ScB_e6cVtffCq6NT5A87EdzR27hmWbwOja6DLW0TSjt3kaAIRKhoacNt-vMEXrefqNP9Fe1wFS22oTUpMitAr1L1NeDWWAhWZuNM9AMA4iuL6ZwTCL5VMtClyZaQHv5bVCuBe2qGkp2RFnNkRoqqJst4VjRb6ZS55q7SRIfSsVNEgxxvbXJspMY9SW7rBlS891cIOIgcLSVYANGauXAfCpX-SLwAQmcPQh0BfzFLETcs3GipItQtCarjEUgUyhBZC3actSAtR1mfpNEOhL8Axftz1QmqdgDXLJMRZkM56-OxX-jG2zu70EWmdjCBjPURFNhKZ6ZOpVdLZXcef64tYMFCi5x8gNMf5w2qq0afZc-3zPK-JvFZVdEray7dD9k_tUWixTsgz_n1g_rGN8MWkn9JPeTZDV5Hf-Paa8qxqpOYvj7LUPeMkpIJRpw62jLMVf-kjQwngciU1fDcLefyL5X0sbN3TtB-frwM5H_U22rF4HXfekqxYwNW6In860iWnF0rNtxi-YR5FN76ulYqhyhm2ym_1QkeEPncS_Km3eCXs5t2nHGO-6uMXWnKaAhxArT5RQkrRoa-QlGn3YspZXUTGpcZxvMvbaaUOiwNzqDqLujSkhPR32IgttDUQ643MtdFb8gMCpj0MJ87rF4vvE6kiiQy9G56FqEGrSRh3B2hckMTEvQxkDus329tv34AOhLaxc4nfipJp8soN-ic2JlSvg_OOwKlOz2xkKl_Gv5_vI28SJoirJmXRKDhOcUxZ8cjyUj20Ayjh5DCl53Vo7Ak2qGbXVFQUsU7Jzt0A7knhz9dnDH2cK9QynNPDtiaaKOfgWKanDRHv2ddL8I5kJl9vJoiWQGtgT4vn1sAtPQRaXArvCgImRb1fQ5dGp4sBRh2Q0yQS2XYoQzotp5Lv3T4xxRX3LuhwyLiXP0hIjb3mMsKfsbfY5494t_RG3_lIYTNw59tGlX7VStaiPmoF7F7haKI5aTl9TisuIL1w1yF6zX95I4zsy3HI9Av_pdLMEYNnREA.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},{\"id\":\"msg_tmp_xon0hygprf8\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"strict\":false,\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":512,\"temperature\":0,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":704,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":22,\"output_tokens_details\":{\"reasoning_tokens\":8},\"total_tokens\":726,\"cost\":0.0009735,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.0009735,\"upstream_inference_input_cost\":0.00088,\"upstream_inference_output_cost\":0.0000935}}},\"sequence_number\":11}\n\ndata: [DONE]\n\n" + "body": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785400-WslI9z4mjOwRslPnpsbE\",\"object\":\"response\",\"created_at\":1790785400,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785400-WslI9z4mjOwRslPnpsbE\",\"object\":\"response\",\"created_at\":1790785400,\"model\":\"meta/muse-spark-1.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"rs_6abd37783b11e27402574811:rs_01a0f320af0f77f3ac543044f0ee8973\",\"type\":\"reasoning\",\"status\":\"in_progress\",\"summary\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"rs_6abd37783b11e27402574811:rs_01a0f320af0f77f3ac543044f0ee8973\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHxXN6Xr-m7QIGh92Ruts8MDG5vvrRhPk3-vT8rBvlyo-BV6kYDL0K59-goz0VqH-g4BJgnduTp4BnpRwcDwbNM2HkrcHeDguUx1GmBSNzlO3KPMmfXWBdL3E4Os0f2rLNwfrzsHgozq-nK_yUDVLg1Fzu-uG9M63aL-zU7QenjztdCTc8QkfEiRebRwZqMLqHvc00DYViboCzckusLPWoEiTAUtWEX-5ye80TZ1MJmwUTzokeU24bYa-d9FGgJIs-CFKUvxubYzHJ-re4bDwqDd40i8zgvHtV3J6q1JhmDrcoJyEG2_qUfRNO2u7GLPnjC45cEwfd-lvMOEQ61Iv_bpWpQ72vD12EeWgIQf_DAPBKBLg64Hha6A0CJewsK0eyDRi1VX3DSfpl3Hi2CBBmOptBZhhnzOIrWkSdXcXOywfFdOEDtVD4znM5c3B6UEu5q97wv9rIGo1pEZhJHlH7hs2fe79jFKHHQD4dWariEhiYZV8Fh8lRMBjohN7Up_cPSOLuCky0txrCVxWR0JCCAfsRjlFKCw1uQryck2bBguCViHuj94LqO7ZHAY_eaAeYKFrLCgDY-EM0u7CY9YwabsegY5kHZujlwSg7Vjo8LFcUiLMjx5Vi_UTM-zONMrA0qKAcGfwroTkDyRYln2IYDbgYLeI8KX2KKMndMLg9OEUh5jReTJbuYAOSpTqPWcWKasRN53Y3x5NKtLMe4bHL3fhUaoVU2ccSiSdH4srZ7yFaS959hqdpPdV0o1s1xp5vsQmw8ECyUAeQfQZzliGT_96irxoBIHoPdY4yIky5SggcyJRi5G0RFh2pGRgB74jB0Wr5lPdBwzygZKQbSuVqFAc5bG6MqHzNZMjoD92SDOt5j2jOgb1wDZtsbopzSAhzH9X7QaHae3295J0WeX5I23PEeQJ6m3S7zmhlUaj-wUequMpvICvyvv7SngrUrVCh4fe7fHzFNmXO0t6qOu4jBNJQC_2ibtDJ0L9LcwtZzjnCOXF8M6MLydkL2pdJ9JZ3FSug_HtIc9Ylze8tCCdXp7BbjeCX1wHoNYrjCM6WtWbkchwVT12NITZ6eG2etBqnDcNaPdzEkPs3c3r0iMK-S0BvFNADFFmVqU9dBLqcwNs27SX-WaeXya-2DBMc3P_NWXPRXBaO0QEwcKSBIF05zLtxw9nycnfsFx0OJk67W91VeDBFcj-93pkkQGDut_vivpqV6IRImxtDl6sH_75h2-lhxJPj5DLwhr5nmKbO9npGGYP04FPT_IftnmrBwUUM4YLJqG4YYCttCOc97BxNuiPS-SDwAaNkm2Dh30EVIL-D4okZmhJ6ZxHC5guYODGDvKbgpZIxFFbZTOI1WxIzz348QD_VC2NLOVvyZpnsnsAamH2Jk7twFnO48uA6ary8itqjbfoO_Fw.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},\"sequence_number\":3}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_z35rof48ore\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":4}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":1,\"item_id\":\"msg_tmp_z35rof48ore\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":5}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":1,\"item_id\":\"msg_tmp_z35rof48ore\",\"content_index\":0,\"delta\":\"pong\",\"logprobs\":[],\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":1,\"item_id\":\"msg_tmp_z35rof48ore\",\"content_index\":0,\"text\":\"pong\",\"logprobs\":[],\"sequence_number\":7}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":1,\"item_id\":\"msg_tmp_z35rof48ore\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"pong\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":8}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":1,\"item\":{\"id\":\"msg_tmp_z35rof48ore\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"pong\",\"annotations\":[],\"logprobs\":[]}]},\"sequence_number\":9}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785400-WslI9z4mjOwRslPnpsbE\",\"object\":\"response\",\"created_at\":1790785400,\"model\":\"meta/muse-spark-1.3\",\"status\":\"completed\",\"completed_at\":1790785400,\"output\":[{\"id\":\"rs_6abd37783b11e27402574811:rs_01a0f320af0f77f3ac543044f0ee8973\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHxXN6Xr-m7QIGh92Ruts8MDG5vvrRhPk3-vT8rBvlyo-BV6kYDL0K59-goz0VqH-g4BJgnduTp4BnpRwcDwbNM2HkrcHeDguUx1GmBSNzlO3KPMmfXWBdL3E4Os0f2rLNwfrzsHgozq-nK_yUDVLg1Fzu-uG9M63aL-zU7QenjztdCTc8QkfEiRebRwZqMLqHvc00DYViboCzckusLPWoEiTAUtWEX-5ye80TZ1MJmwUTzokeU24bYa-d9FGgJIs-CFKUvxubYzHJ-re4bDwqDd40i8zgvHtV3J6q1JhmDr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snsAamH2Jk7twFnO48uA6ary8itqjbfoO_Fw.eyJlbmRwb2ludF9zbHVnIjoibWV0YS9tdXNlLXNwYXJrLTEuMy0yMDI2MDkwMnxtZXRhIn0\",\"format\":\"meta-responses-v1\"},{\"id\":\"msg_tmp_z35rof48ore\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"pong\",\"annotations\":[],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"namespace\",\"name\":\"crm\",\"description\":\"Tools in the crm namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]},{\"type\":\"namespace\",\"name\":\"inventory\",\"description\":\"Tools in the inventory namespace.\",\"tools\":[{\"type\":\"function\",\"name\":\"lookup\",\"description\":\"Look up a reference value\",\"parameters\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"string\"}},\"required\":[\"query\"]},\"strict\":false}]}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":null,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"minimal\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":751,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":17,\"output_tokens_details\":{\"reasoning_tokens\":6},\"total_tokens\":768,\"cost\":0.001011,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.001011,\"upstream_inference_input_cost\":0.00093875,\"upstream_inference_output_cost\":0.00007225}}},\"sequence_number\":10}\n\ndata: [DONE]\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/openrouter-responses/preserves-native-hosted-search-events.json b/packages/ai/test/fixtures/recordings/openrouter-responses/preserves-native-hosted-search-events.json new file mode 100644 index 00000000000..f4cd01e5962 --- /dev/null +++ b/packages/ai/test/fixtures/recordings/openrouter-responses/preserves-native-hosted-search-events.json @@ -0,0 +1,32 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:openrouter-responses", + "provider:openrouter", + "protocol:openrouter-responses" + ], + "name": "openrouter-responses/preserves-native-hosted-search-events", + "recordedAt": "2026-09-30T16:23:24.820Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://openrouter.ai/api/v1/responses", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"x-ai/grok-4.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Use web search once to find the official OpenRouter Responses API documentation. Reply with its URL.\"}]}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":1536,\"stream\":true,\"tools\":[{\"type\":\"web_search_preview\",\"engine\":\"native\",\"max_uses\":1}],\"max_tool_calls\":1}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": ": \n\n: \n\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"gen-1790785401-4rHQLRdt9DarcnvBnIFk\",\"object\":\"response\",\"created_at\":1790785401,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"web_search_preview\",\"engine\":\"native\",\"max_uses\":1}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":1,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"low\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":0}\n\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"gen-1790785401-4rHQLRdt9DarcnvBnIFk\",\"object\":\"response\",\"created_at\":1790785401,\"model\":\"x-ai/grok-4.3\",\"status\":\"in_progress\",\"completed_at\":null,\"output\":[],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"web_search_preview\",\"engine\":\"native\",\"max_uses\":1}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":1,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"auto\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"low\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":null},\"sequence_number\":1}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":0,\"item\":{\"id\":\"rs_7bc4fd07-6624-997e-b8de-0b3aaa3e5931\",\"type\":\"reasoning\",\"status\":\"in_progress\",\"summary\":[]},\"sequence_number\":2}\n\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"output_index\":0,\"item_id\":\"rs_7bc4fd07-6624-997e-b8de-0b3aaa3e5931\",\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"},\"sequence_number\":3}\n\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"output_index\":0,\"item_id\":\"rs_7bc4fd07-6624-997e-b8de-0b3aaa3e5931\",\"summary_index\":0,\"delta\":\"I will search for the official OpenRouter Responses API documentation.\",\"sequence_number\":4}\n\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"output_index\":0,\"item_id\":\"rs_7bc4fd07-6624-997e-b8de-0b3aaa3e5931\",\"summary_index\":0,\"text\":\"I will search for the official OpenRouter Responses API documentation.\",\"sequence_number\":5}\n\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"output_index\":0,\"item_id\":\"rs_7bc4fd07-6624-997e-b8de-0b3aaa3e5931\",\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"I will search for the official OpenRouter Responses API documentation.\"},\"sequence_number\":6}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":0,\"item\":{\"id\":\"rs_7bc4fd07-6624-997e-b8de-0b3aaa3e5931\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"I will search for the official OpenRouter Responses API documentation.\"}],\"encrypted_content\":\"tNPIeYfeRXKbTG9pT7+LPJGI4uZb0hqxDQJ68MySq6Un6zHCEQS5RxmS4rY5CusaE5QiFqfGp8YaDoNpXUlljzMpFNMAuknqGXNSsdW3TiO0qHq/+0Z7ZZEa7ePmb7LeDVirxysjWWsFKN6iI+M/wQCGD5jW9ZlZnfmt17/p/VIUNSf3V4xevGDA055pTneBkiGOsl2YM/Pskkrj2dyWDHfzpidNGDYMnaxdiAwWn+IwyIxvPqwKfitdrbfhZjxT3QLPjHDRzY8ATOAj5M+KCicnKFjmUtXGk2G/38U2pXAlL9m0KEM5wxOP0+86n0Nnab6PNyvdZc+UBz+SnRO6Z4PPQvSO62oL/oVqUJ4FwK8fCA+8H+ECXY0yvXHyPaUiMYJBxh1ciaPouaK4l4K85wGXcCB36RXw3bv4De8EN+zrP/J/KwSdVh4W0z7HZwPsPWikuHGUEkl5vG+ontofnBmE+2rA64pXL5JJ8jvnjEffeGUBbovkNpavNkTHW3BCA0xnxAJMNtlWvQ4hVZwE5iEoIf6W8qVV.eyJlbmRwb2ludF9zbHVnIjoieC1haS9ncm9rLTQuMy0yMDI2MDQzMHx4YWkifQ\",\"format\":\"xai-responses-v1\"},\"sequence_number\":9}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":1,\"item\":{\"id\":\"ws_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"type\":\"web_search_call\",\"status\":\"in_progress\",\"action\":{\"type\":\"search\",\"query\":\"\"}},\"sequence_number\":7}\n\ndata: {\"type\":\"response.web_search_call.in_progress\",\"output_index\":1,\"item_id\":\"ws_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"sequence_number\":8}\n\ndata: {\"type\":\"response.web_search_call.searching\",\"output_index\":1,\"item_id\":\"ws_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"sequence_number\":10}\n\ndata: {\"type\":\"response.web_search_call.completed\",\"output_index\":1,\"item_id\":\"ws_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"sequence_number\":11}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":1,\"item\":{\"id\":\"ws_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"type\":\"web_search_call\",\"status\":\"completed\",\"action\":{\"type\":\"search\",\"query\":\"OpenRouter Responses API official documentation\"}},\"sequence_number\":12}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":2,\"item\":{\"id\":\"tco_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"type\":\"reasoning\",\"status\":\"in_progress\",\"summary\":[]},\"sequence_number\":13}\n\n: \n\n: \n\n: \n\n: \n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":2,\"item\":{\"id\":\"tco_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"tco_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0_Z+t9USWYZIbgDT8xdtFjrtuT/eRucYQ1UlQgv2BEaYB2dUS2Yj2lsNMsgtAza32dNva2QyCnE8svD0cWK51eTN0mS/FRS+0X7Ut5PHsYj3HVTqAht4vrGpjNz/iunD2+yZfb+E/ByWHAcUYTfij8ficLqPi+vgyryJssZONCV2S7TBSBTmeO/AFMX4YdWi5i1rVOr9IctVSJ6Prass6u5dX4g4mhNgp4NiSj9nbGppEVb9WseESffc+RfK5H4zpmK5pxsNs7wuXszbwHUEKG+nAmPnFB+ZYfYGoksa3z5DMYS7xxWgVay42M0MxdNq66pHJsotNRUTqOrocMYE25LE1K+pl5NYv5TOgahvSnpZzYsUTgLsdq3LdXi4wzdjZ1T7H2iwo+je4gRSHOEsZhY4nUNhvD7VxJJa93INK/74ZrGwDYkb6M6RxzUMJASNfPqqQAYJzXiZwBWWjF6FgZ1oP44WMG6w/bLczjSyJAiIE25rNZVR67fUAQODK3QvetnAuzvLG3EeBlCQRDHQ+kHMuHMbh1zOC4wruhpBhrqCs583yv2lnYMIyi/YZlk+Yif2fVlhtgM0uxhZTJynIP9tkM9gfOP8gQg14Qd0kLgc3gVCL3Wgd0uBGnEEr2cWWIA6TRK5+oOLiFejPsCZFcToAdMzNdNYPsR/fF3U/q4a4K7CjAZWZXtl25cA39cy/s7pk+hSuNOryB1GPJ9gtnKCA+FiCtTh7WusbxlIRF6hc4aXEmhwNc5qNCUBTrfGzkwc8N9BWMET6Q+oUinI0NfPUaNKK1PSNmcqHbL9Kk/cRpVIV/Y3uFnGu0A0StpBhBtMuQyyfdssm/sSr16k9CzDps+p4nicD3hO7XHACsdB44X8EvfCyYphZsBEGYZBnZ9A2Gjcsc1MrR0NjnWQkEKp9/BK9YQUFEYd37iOrTVD3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+BB345STnLTq0lQV+88Ux+VIIJj6Wak9C8KJIrR748DpuBLmLxkG5WNIGDI4eBlXncArb0uOaVFSo6GDSjE+KKUDjLixQxD+SsH+EvOnnA3gh6MuwaNylmuHfq/YvFktqvz5b652rJrSNryiilmpv016tk46PosT69YpVM3ovTYepRSBlx0LXYi2wEiMNDo2pJrigXSSU3aC3kWypSYL1ZPP0y2dcI4wsQnoE0BfvDQ7cf9DFRLggo+K1/O0U3PprZCj1zgmxyQg2Gk1LiafEnMk+yfngcjRGS1jUojvGX11VRkfgaFPuE2EON5g8YqIBERaem0w4o995Zhax9El+6ZhkzoflRHYvcmCrBMEowA8u/jG7eaqst4jJvif9XxyZPWLU380nm0U2CZKW/VqehPVA07JouKo11OoWPpfsgT1U3QP2OR1dMhwNHmdh44FhpvUdBDjdZe45pSmpeUZ7DIXuh/bDxY4P1DjTLtom3nQelr7y4p6Kp0nTcgzB4zPqMFmE76+G4og1KenhZlb+M5Wjuq7bNNa+QENYehjRlaa3ONUT8A8VTNY0u1XVtbpf5j9QwflFzTwrnuvj0o8yyT0/pxg6QdAM1aFDGvWVT2/nDV9fT1Nrx100fKa1qIv9AzGbLcYevM/zyuJzOWYeF2GwjQ9s+zMBao73NLVJEuXFeIlZN709FMabl651kJLa0GGBZgmY0PyAOFPdm1JG7/4Qbnh+rK8TUpOgBvUmr8bUsC0/T09xALg5FjvXQSxgnNCMoQF7Rwjtcr3fBhmyw189kfCWBay/x0wFPyxcVPRN7sRxP/WM2zaZzrzlvDTOMxEcEUuUl7lI+GUU6Fz4ToDE0LdOwyUvA2O4cvDc.eyJlbmRwb2ludF9zbHVnIjoieC1haS9ncm9rLTQuMy0yMDI2MDQzMHx4YWkifQ\",\"format\":\"xai-responses-v1\"},\"sequence_number\":14}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":3,\"item\":{\"id\":\"rs_tmp_gxfnqaxcthp\",\"type\":\"reasoning\",\"status\":\"in_progress\",\"summary\":[]},\"sequence_number\":15}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":3,\"item\":{\"id\":\"rs_tmp_gxfnqaxcthp\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"YQPNdQ0k2YUcCMpbhleH8Jyo9RHL6fhsiCfOuvigN9JwC8aBcv+xL+se37k93Bsbmxl+DAFDpLZloJJ+Jpo7NQHkJ/LbVkibLBnrYzTtj80aGV8nk/fQeNt7aYmY6Y9SWlgkcaLAGdXeulBuf+Wu/wChsNgSbzRdZiDSGY9n4aQnj/3WL2zC0I+0CVGmquGf6c64De8PDEQEkBdQSVHRwp/NcyLTal0b4oMlnaDqqUgT8T0s344ede3TtlLX+N5/XP55LIMnGPujc+mD9QsTzHhrYfQCplDQa1Iya83IsYyTUdQjvEaMSRzq+FlqOnzHarhVSGGrhzjrHwHOgL6bHI0hwBrExaLvU7tCZsuB8Sd/dv5nqCdAnPutdl28HZOsmr1cAbtXvB3PnN92p9LbMwNhaRqJ7RCSYXOyTDyPkZ+A7jk5zyPVO7cCZPfkMNosgZJyHL3K66aMQNX9J/SQHgWtetahtmZB1LTQZSc2Dllmtu7wu72BGC85uDz5AoWB31ow2x3EHpmeP1Gp7ghCneOpX+XaKpTaqvRfQ2tFh5jtf3fbBOGnvxXoyIFlU6Ir2BfmGDk3HSg840MrDOFoyC0ZojuDj11CxwGJ0wT/9YhaMNY20BXk+n3KUjUZK6puXvhO6PCWEv23PGorhTG4H2kRs0MNSFvGNHH8Ifhb6MYYXxpyo0gSCd1RGRm9UNA1NvdUl28/pmp+uydwKYe1IsJD/LwgxkzrTrfRyw7JD19tOLGHZRAt1FsAbbJrYSgUdqWd04PzQc3KOuLX8HW8jrw9gsns9lCxbxo6QLn086OwmyUxcw.eyJlbmRwb2ludF9zbHVnIjoieC1haS9ncm9rLTQuMy0yMDI2MDQzMHx4YWkifQ\",\"format\":\"xai-responses-v1\"},\"sequence_number\":16}\n\ndata: {\"type\":\"response.output_item.added\",\"output_index\":4,\"item\":{\"id\":\"msg_tmp_iv8lx4agkll\",\"type\":\"message\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[]},\"sequence_number\":17}\n\ndata: {\"type\":\"response.content_part.added\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]},\"sequence_number\":18}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"https\",\"logprobs\":[],\"sequence_number\":19}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"://\",\"logprobs\":[],\"sequence_number\":20}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"open\",\"logprobs\":[],\"sequence_number\":21}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"router\",\"logprobs\":[],\"sequence_number\":22}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\".ai\",\"logprobs\":[],\"sequence_number\":23}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"/docs\",\"logprobs\":[],\"sequence_number\":24}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"/api\",\"logprobs\":[],\"sequence_number\":25}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"_reference\",\"logprobs\":[],\"sequence_number\":26}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"/res\",\"logprobs\":[],\"sequence_number\":27}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"ponses\",\"logprobs\":[],\"sequence_number\":28}\n\ndata: {\"type\":\"response.output_text.delta\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"delta\":\"/overview\",\"logprobs\":[],\"sequence_number\":29}\n\ndata: {\"type\":\"response.output_text.annotation.added\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"annotation_index\":0,\"annotation\":{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"start_index\":0,\"end_index\":0},\"sequence_number\":30}\n\ndata: {\"type\":\"response.output_text.annotation.added\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"annotation_index\":1,\"annotation\":{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"start_index\":0,\"end_index\":0},\"sequence_number\":31}\n\ndata: {\"type\":\"response.output_text.annotation.added\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"annotation_index\":2,\"annotation\":{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"start_index\":0,\"end_index\":0},\"sequence_number\":32}\n\ndata: {\"type\":\"response.output_text.annotation.added\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"annotation_index\":3,\"annotation\":{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"title\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"start_index\":0,\"end_index\":0},\"sequence_number\":33}\n\ndata: {\"type\":\"response.output_text.annotation.added\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"annotation_index\":4,\"annotation\":{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"start_index\":0,\"end_index\":0},\"sequence_number\":34}\n\ndata: {\"type\":\"response.output_text.done\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"text\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"logprobs\":[],\"sequence_number\":35}\n\ndata: {\"type\":\"response.content_part.done\",\"output_index\":4,\"item_id\":\"msg_tmp_iv8lx4agkll\",\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"annotations\":[{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"title\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"start_index\":0,\"end_index\":0}],\"logprobs\":[]},\"sequence_number\":36}\n\ndata: {\"type\":\"response.output_item.done\",\"output_index\":4,\"item\":{\"id\":\"msg_tmp_iv8lx4agkll\",\"type\":\"message\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"annotations\":[{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"title\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"start_index\":0,\"end_index\":0}],\"logprobs\":[]}]},\"sequence_number\":37}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"gen-1790785401-4rHQLRdt9DarcnvBnIFk\",\"object\":\"response\",\"created_at\":1790785401,\"model\":\"x-ai/grok-4.3\",\"status\":\"completed\",\"completed_at\":1790785404,\"output\":[{\"id\":\"rs_7bc4fd07-6624-997e-b8de-0b3aaa3e5931\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"I will search for the official OpenRouter Responses API documentation.\"}],\"encrypted_content\":\"tNPIeYfeRXKbTG9pT7+LPJGI4uZb0hqxDQJ68MySq6Un6zHCEQS5RxmS4rY5CusaE5QiFqfGp8YaDoNpXUlljzMpFNMAuknqGXNSsdW3TiO0qHq/+0Z7ZZEa7ePmb7LeDVirxysjWWsFKN6iI+M/wQCGD5jW9ZlZnfmt17/p/VIUNSf3V4xevGDA055pTneBkiGOsl2YM/Pskkrj2dyWDHfzpidNGDYMnaxdiAwWn+IwyIxvPqwKfitdrbfhZjxT3QLPjHDRzY8ATOAj5M+KCicnKFjmUtXGk2G/38U2pXAlL9m0KEM5wxOP0+86n0Nnab6PNyvdZc+UBz+SnRO6Z4PPQvSO62oL/oVqUJ4FwK8fCA+8H+ECXY0yvXHyPaUiMYJBxh1ciaPouaK4l4K85wGXcCB36RXw3bv4De8EN+zrP/J/KwSdVh4W0z7HZwPsPWikuHGUEkl5vG+ontofnBmE+2rA64pXL5JJ8jvnjEffeGUBbovkNpavNkTHW3BCA0xnxAJMNtlWvQ4hVZwE5iEoIf6W8qVV.eyJlbmRwb2ludF9zbHVnIjoieC1haS9ncm9rLTQuMy0yMDI2MDQzMHx4YWkifQ\",\"format\":\"xai-responses-v1\"},{\"type\":\"web_search_call\",\"id\":\"ws_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"status\":\"completed\",\"action\":{\"type\":\"search\",\"query\":\"OpenRouter Responses API official documentation\"}},{\"id\":\"tco_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"tco_7bc4fd07-6624-997e-b8de-0b3aaa3e5931_call-7cfcb560-a663-4788-a631-7274e773df1d-0_Z+t9USWYZIbgDT8xdtFjrtuT/eRucYQ1UlQgv2BEaYB2dUS2Yj2lsNMsgtAza32dNva2QyCnE8svD0cWK51eTN0mS/FRS+0X7Ut5PHsYj3HVTqAht4vr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xyQg2Gk1LiafEnMk+yfngcjRGS1jUojvGX11VRkfgaFPuE2EON5g8YqIBERaem0w4o995Zhax9El+6ZhkzoflRHYvcmCrBMEowA8u/jG7eaqst4jJvif9XxyZPWLU380nm0U2CZKW/VqehPVA07JouKo11OoWPpfsgT1U3QP2OR1dMhwNHmdh44FhpvUdBDjdZe45pSmpeUZ7DIXuh/bDxY4P1DjTLtom3nQelr7y4p6Kp0nTcgzB4zPqMFmE76+G4og1KenhZlb+M5Wjuq7bNNa+QENYehjRlaa3ONUT8A8VTNY0u1XVtbpf5j9QwflFzTwrnuvj0o8yyT0/pxg6QdAM1aFDGvWVT2/nDV9fT1Nrx100fKa1qIv9AzGbLcYevM/zyuJzOWYeF2GwjQ9s+zMBao73NLVJEuXFeIlZN709FMabl651kJLa0GGBZgmY0PyAOFPdm1JG7/4Qbnh+rK8TUpOgBvUmr8bUsC0/T09xALg5FjvXQSxgnNCMoQF7Rwjtcr3fBhmyw189kfCWBay/x0wFPyxcVPRN7sRxP/WM2zaZzrzlvDTOMxEcEUuUl7lI+GUU6Fz4ToDE0LdOwyUvA2O4cvDc.eyJlbmRwb2ludF9zbHVnIjoieC1haS9ncm9rLTQuMy0yMDI2MDQzMHx4YWkifQ\",\"format\":\"xai-responses-v1\"},{\"id\":\"rs_tmp_gxfnqaxcthp\",\"type\":\"reasoning\",\"status\":\"completed\",\"summary\":[],\"encrypted_content\":\"YQPNdQ0k2YUcCMpbhleH8Jyo9RHL6fhsiCfOuvigN9JwC8aBcv+xL+se37k93Bsbmxl+DAFDpLZloJJ+Jpo7NQHkJ/LbVkibLBnrYzTtj80aGV8nk/fQeNt7aYmY6Y9SWlgkcaLAGdXeulBuf+Wu/wChsNgSbzRdZiDSGY9n4aQnj/3WL2zC0I+0CVGmquGf6c64De8PDEQEkBdQSVHRwp/NcyLTal0b4oMlnaDqqUgT8T0s344ede3TtlLX+N5/XP55LIMnGPujc+mD9QsTzHhrYfQCplDQa1Iya83IsYyTUdQjvEaMSRzq+FlqOnzHarhVSGGrhzjrHwHOgL6bHI0hwBrExaLvU7tCZsuB8Sd/dv5nqCdAnPutdl28HZOsmr1cAbtXvB3PnN92p9LbMwNhaRqJ7RCSYXOyTDyPkZ+A7jk5zyPVO7cCZPfkMNosgZJyHL3K66aMQNX9J/SQHgWtetahtmZB1LTQZSc2Dllmtu7wu72BGC85uDz5AoWB31ow2x3EHpmeP1Gp7ghCneOpX+XaKpTaqvRfQ2tFh5jtf3fbBOGnvxXoyIFlU6Ir2BfmGDk3HSg840MrDOFoyC0ZojuDj11CxwGJ0wT/9YhaMNY20BXk+n3KUjUZK6puXvhO6PCWEv23PGorhTG4H2kRs0MNSFvGNHH8Ifhb6MYYXxpyo0gSCd1RGRm9UNA1NvdUl28/pmp+uydwKYe1IsJD/LwgxkzrTrfRyw7JD19tOLGHZRAt1FsAbbJrYSgUdqWd04PzQc3KOuLX8HW8jrw9gsns9lCxbxo6QLn086OwmyUxcw.eyJlbmRwb2ludF9zbHVnIjoieC1haS9ncm9rLTQuMy0yMDI2MDQzMHx4YWkifQ\",\"format\":\"xai-responses-v1\"},{\"id\":\"msg_tmp_iv8lx4agkll\",\"type\":\"message\",\"role\":\"assistant\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"text\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"annotations\":[{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/go/sdks/responses/README\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/overview\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"title\":\"https://openrouter.ai/docs/api_reference/responses/basic-usage\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"title\":\"https://openrouter.ai/docs/api_reference/overview.md\",\"start_index\":0,\"end_index\":0},{\"type\":\"url_citation\",\"url\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"title\":\"https://openrouter.ai/docs/client-sdks/typescript/sdks/responses/README\",\"start_index\":0,\"end_index\":0}],\"logprobs\":[]}]}],\"error\":null,\"incomplete_details\":null,\"tools\":[{\"type\":\"web_search_preview\",\"engine\":\"native\",\"max_uses\":1}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_output_tokens\":1536,\"temperature\":1,\"top_p\":1,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"max_tool_calls\":1,\"metadata\":{},\"background\":false,\"previous_response_id\":null,\"service_tier\":\"default\",\"truncation\":\"disabled\",\"store\":false,\"instructions\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"reasoning\":{\"effort\":\"low\",\"summary\":\"detailed\"},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_options\":null,\"usage\":{\"input_tokens\":4900,\"input_tokens_details\":{\"cached_tokens\":2048},\"output_tokens\":232,\"output_tokens_details\":{\"reasoning_tokens\":201},\"total_tokens\":5132,\"cost\":0.0095546,\"is_byok\":false,\"cost_details\":{\"upstream_inference_cost\":0.0095546,\"upstream_inference_input_cost\":0.0039746,\"upstream_inference_output_cost\":0.00058},\"server_tool_use_details\":{\"web_search_requests\":1}}},\"sequence_number\":38}\n\ndata: [DONE]\n\n" + } + } + ] +} diff --git a/packages/ai/test/provider/openrouter-native.recorded.test.ts b/packages/ai/test/provider/openrouter-native.recorded.test.ts index 21ef1ad4b03..58622bcc755 100644 --- a/packages/ai/test/provider/openrouter-native.recorded.test.ts +++ b/packages/ai/test/provider/openrouter-native.recorded.test.ts @@ -1,9 +1,9 @@ import { expect } from "bun:test" import { Effect } from "effect" -import { LLMEvent, LLMResponse } from "../../src/index.js" +import { LLM, LLMRequest, Message } from "../../src/index.js" import { OpenRouter } from "../../src/providers/openrouter.js" +import { LLMClient } from "../../src/route.js" import { recordedTests } from "../recorded-test.js" -import { expectWeatherToolLoop, goldenWeatherToolLoopRequest, runWeatherToolLoop } from "../recorded-scenarios.js" const recorded = recordedTests({ prefix: "openrouter-responses", @@ -13,24 +13,71 @@ const recorded = recordedTests({ }) recorded.effect.with( - "continues Meta reasoning through a tool loop", + "continues Meta reasoning through a namespaced tool loop", { cassette: "openrouter-responses/openrouter-muse-spark-1-3-tool-loop", tags: ["reasoning", "tool-loop"] }, () => Effect.gen(function* () { - const events = yield* runWeatherToolLoop( - goldenWeatherToolLoopRequest({ - model: OpenRouter.configure({ - apiKey: process.env.OPENROUTER_API_KEY ?? "fixture", - providerOptions: { reasoning: { effort: "minimal" } }, - }).model("meta/muse-spark-1.3"), - maxTokens: 512, + const tool = { + name: "lookup", + description: "Look up a reference value", + inputSchema: { + type: "object", + properties: { query: { type: "string" } }, + required: ["query"], + }, + } + const request = LLM.request({ + model: OpenRouter.configure({ + apiKey: process.env.OPENROUTER_API_KEY ?? "fixture", + providerOptions: { reasoning: { effort: "minimal" } }, + }).model("meta/muse-spark-1.3"), + prompt: "Call only crm.lookup once with query ping. Do not call inventory.lookup. Wait for the result.", + tools: ["crm", "inventory"].map((name) => ({ type: "namespace", name, tools: [tool] })), + generation: { maxTokens: 1536 }, + }) + const first = yield* LLMClient.generate(request) + expect(first.toolCalls).toMatchObject([{ name: "lookup", namespace: "crm", input: { query: "ping" } }]) + const call = first.toolCalls[0] + if (!call) throw new Error("Expected a namespaced tool call") + const second = yield* LLMClient.generate( + LLMRequest.update(request, { + messages: [ + ...request.messages, + first.message, + Message.tool({ id: call.id, name: call.name, namespace: call.namespace, result: "pong" }), + Message.user("Do not call tools again. Reply exactly pong."), + ], }), ) - expectWeatherToolLoop(events) - expect(LLMResponse.text({ events: events.slice(events.findIndex(LLMEvent.is.stepFinish) + 1) }).trim()).toMatch( - /^Paris is sunny\.?$/, - ) + expect(second.toolCalls).toHaveLength(0) + expect(second.text.trim()).toBe("pong") + }), + 60_000, +) + +recorded.effect( + "preserves native hosted-search events", + () => + Effect.gen(function* () { + const response = yield* LLMClient.generate( + LLM.request({ + model: OpenRouter.configure({ + apiKey: process.env.OPENROUTER_API_KEY ?? "fixture", + providerOptions: { reasoning: { effort: "low" } }, + }).model("x-ai/grok-4.3"), + prompt: + "Use web search once to find the official OpenRouter Responses API documentation. Reply with its URL.", + generation: { maxTokens: 1536 }, + http: { body: { tools: [{ type: "web_search_preview", engine: "native", max_uses: 1 }], max_tool_calls: 1 } }, + }), + ) + + expect(response.toolCalls).toContainEqual(expect.objectContaining({ name: "web_search", providerExecuted: true })) + expect(response.message.content).toContainEqual( + expect.objectContaining({ type: "tool-result", name: "web_search", providerExecuted: true }), + ) + expect(response.text.trim().length).toBeGreaterThan(0) }), 60_000, ) diff --git a/packages/ai/test/provider/openrouter.test.ts b/packages/ai/test/provider/openrouter.test.ts index 38fd3065592..0e25a76b7bc 100644 --- a/packages/ai/test/provider/openrouter.test.ts +++ b/packages/ai/test/provider/openrouter.test.ts @@ -3,24 +3,48 @@ import { Effect } from "effect" import { CacheHint, LLM, Message } from "../../src/index.js" import { LLMClient } from "../../src/route.js" import { compileRequest } from "../../src/route/client.js" -import * as OpenRouter from "../../src/providers/openrouter.js" +import { OpenRouter } from "../../src/providers/openrouter.js" import { it } from "../lib/effect.js" import { fixedResponse } from "../lib/http.js" import { sseEvents } from "../lib/sse.js" describe("OpenRouter", () => { - it.effect("routes OpenAI, xAI, and Meta models through the same generic Responses protocol", () => + it.effect("routes OpenAI, xAI, and Meta models through the same namespace-aware Responses protocol", () => Effect.forEach(["openai/gpt-4o-mini", "x-ai/grok-4.3", "meta/muse-spark-1.3", "~x-ai/grok-latest"], (id) => Effect.gen(function* () { const model = OpenRouter.configure({ apiKey: "test-key", providerOptions: { - reasoning: { effort: "low", exclude: true }, - text: { verbosity: "low" }, + reasoning: { effort: "low", exclude: true, summary: "detailed" }, + text: { verbosity: "low", format: { type: "json_schema", name: "result", schema: { type: "object" } } }, provider: { allow_fallbacks: false }, }, }).model(id) - const prepared = yield* compileRequest(LLM.request({ model, prompt: "Say hello." })) + const prepared = yield* compileRequest( + LLM.request({ + model, + prompt: "Say hello.", + tools: [ + { + type: "namespace", + name: "crm", + tools: [ + { + type: "namespace", + name: "contacts", + tools: [ + { + name: "lookup", + description: "Look up a contact", + inputSchema: { type: "object", properties: {} }, + }, + ], + }, + ], + }, + ], + }), + ) expect(model.route.endpoint.baseURL).toBe("https://openrouter.ai/api/v1") expect(prepared.route).toBe("openrouter-responses") @@ -31,8 +55,9 @@ describe("OpenRouter", () => { stream: true, store: false, include: ["reasoning.encrypted_content"], - reasoning: { effort: "low", exclude: true }, - text: { verbosity: "low" }, + reasoning: { effort: "low", exclude: true, summary: "detailed" }, + text: { verbosity: "low", format: { type: "json_schema", name: "result", schema: { type: "object" } } }, + tools: [{ type: "namespace", name: "crm", tools: [{ type: "function", name: "contacts_lookup" }] }], provider: { allow_fallbacks: false }, }) }), @@ -92,17 +117,17 @@ describe("OpenRouter", () => { Effect.gen(function* () { const openrouter = OpenRouter.configure({ apiKey: "test-key", - providerOptions: { provider: { allow_fallbacks: false }, reasoning: { effort: "low" } }, + providerOptions: { provider: { allow_fallbacks: false }, reasoning: { effort: "low", summary: "detailed" } }, }) const messages = [Message.effort({ previous: "high", effort: "low" }), Message.user("Hello")] - const response = yield* compileRequest(LLM.request({ model: openrouter.model("openai/gpt-6-luna"), messages })) + const response = yield* compileRequest(LLM.request({ model: openrouter.model("openai/gpt-6.1-sol"), messages })) const message = yield* compileRequest( LLM.request({ model: openrouter.model("anthropic/claude-fable-5.1"), messages }), ) expect(response.body).toMatchObject({ provider: { allow_fallbacks: false }, - reasoning: { effort: "high" }, + reasoning: { effort: "high", summary: "detailed" }, input: [{ type: "configuration_update", reasoning: { effort: "low" } }, { role: "user" }], }) expect(message.body).toMatchObject({