diff --git a/.env.example b/.env.example index a7c0fa0..134fc8c 100644 --- a/.env.example +++ b/.env.example @@ -4,3 +4,9 @@ MOLTO_LOG_LEVEL_STDERR=INFO # External API keys ANTHROPIC_API_KEY= OPENAI_API_KEY= +AWS_BEARER_TOKEN_BEDROCK= +# Alternatively, replace the preceding line with BEDROCK_API_KEY=. +FIREWORKS_API_KEY= +GEMINI_API_KEY= +OPENROUTER_API_KEY= +TOGETHER_AI_API_KEY= diff --git a/.prettierignore b/.prettierignore index 2ca0a38..755d8f7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,6 +4,8 @@ thumbs.db # Cassettes tests/cassettes/**/*.yaml +# Preserve generated provenance alongside unchanged original capture bytes. +tests/cassettes/provider_recordings/**/manifest.json # Internal references, dependencies, temporary folders & files .env diff --git a/AGENTS.md b/AGENTS.md index 6c1606b..b2dc2f8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,6 +36,8 @@ The user's job as a senior software engineer is dependent on you implementing cl - **Get Buy-In for Speculative Robustness**: Before adding complexity solely for a speculative or vanishingly unlikely race or security edge case, explain the concrete failure mode and impact, evidence for its likelihood (or that likelihood is unknown), and the implementation and maintenance cost. Present the simpler alternative and its trade-offs, then get the user's explicit agreement before expanding scope. Reuse existing approval when it already covers that trade-off, and continue independent authorized work while waiting. Do not silently expand scope for theoretical robustness. Unknown likelihood is not evidence that a risk is negligible; this rule does not justify weakening required controls or delaying an already-authorized fix for a demonstrated defect. +- **Require Observed Compatibility Failures**: Never add protection for a scenario that has not been observed. For compatibility guards, require an observed failure or provider capture; a hypothetical synthetic test alone is not evidence. Preserve required security controls and protocol invariants. This rule does not remove explicitly agreed functionality, including the client-declared reasoning-representation selection contract. + - **Check Shared Models Before Editing**: A fix at the failing call site may belong in an existing shared layer. 1. Before adding or moving a configuration field, inspect its base classes, sibling models, presets, validators, and consumers. Trace how the value reaches runtime through construction and serialization. 2. Choose the existing owner by responsibility and intended consumers, not merely where the failing test accepts the field. Use a shared base when the setting belongs to all its consumers; keep variant-specific settings on the relevant model. diff --git a/docs/README.md b/docs/README.md index a37b78b..c979b05 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,7 +19,7 @@ Three rules make this principle concrete: - Normalized outputs are open to provider extensions. - Retaining unknown output data does not authorize projecting it into another protocol. -“Closed” applies recursively to nested request models. “Lossless-or-rejected” means each populated input field must affect the normalized request or target request, or Molto must reject it. Documented omission exceptions are optional Responses output-item IDs on Chat Completions and Messages, caller-defined prompt-cache keys on Messages, and the behavior-neutral Responses settings `include=["reasoning.encrypted_content"]`, `include=["web_search_call.action.sources"]`, and `store=false` on translated routes. Native passthrough forwards these fields unchanged, while `store=true` remains unsupported for translation. Portable call identities such as `tool_call_id` are not part of these exceptions. +“Closed” applies recursively to nested request models. “Lossless-or-rejected” means each populated input field must affect the normalized request or target request, or Molto must reject it. Documented omission exceptions are optional Responses output-item IDs on Chat Completions and Messages, caller-defined prompt-cache keys on Messages, the `format="unknown"` label on raw-only Responses reasoning history, and the behavior-neutral Responses settings `include=["reasoning.encrypted_content"]`, `include=["web_search_call.action.sources"]`, and `store=false` on translated routes. Native passthrough forwards these fields unchanged, while `store=true` remains unsupported for translation. Named reasoning formats and formatted summary/signature state remain rejected. Portable call identities such as `tool_call_id` are not part of these exceptions. Shared Chat history groups text and tool calls into separate fields, preserving order within each kind while losing their interleaving; it retains explicit assistant-message boundaries. Cross-protocol semantic input rejections raise `molto.types.exceptions.UnsupportedInput`, a `ValueError` subclass. Schema validation on translated routes uses the validation errors provided by the protocol's Pydantic request model. Molto's local public request models reject unknown top-level fields; nested fields follow their declared schemas. @@ -85,9 +85,15 @@ Four independent choices define a route: | `provider` | Selects the serving implementation and its immutable capability profile. | | `base_url` | Selects only the HTTP destination. | -Molto never infers provider behavior from a hostname. When `provider` is omitted, the endpoint supplies a convenience default: OpenAI for Responses and Chat Completions, and Anthropic for Messages. An explicit provider overrides that default without changing the endpoint or base URL. +See [hosted provider compatibility](provider-compatibility.md) for provider keys, exact destinations, history constraints, and the recorded/matched/synthetic evidence matrix. -Provider capabilities matter even when two implementations expose the same schema. For example, Chat Completions `reasoning_content` and Messages `thinking_delta` do not label their text as raw reasoning or a summary. The provider profile supplies that interpretation: OpenAI and Anthropic profiles classify it as a summary, while vLLM classifies it as raw reasoning. +Molto never infers provider behavior from a hostname. When `provider` is omitted, the endpoint supplies a convenience default: OpenAI for Responses and Chat Completions, and Anthropic for Messages. An explicit provider overrides that default without changing the endpoint or base URL. Both native and translated routes require an explicit registration in `CLIENTS` for the selected pair; an explicit `base_url` does not bypass this requirement. + +The provider profile classifies unlabeled Chat and Messages reasoning. Responses labels raw text and summaries explicitly. + +## Reasoning + +See [Reasoning and signatures](reasoning.md) for field selection, signature attachments, continuation, and SDK stream collection. ## How translation works @@ -209,9 +215,9 @@ The translated path currently supports: - string input and ordered text messages; - ordered mixed text and image user input using remote URLs or base64 data URLs; - system prompts and supported assistant history; -- raw reasoning across all three protocols, reasoning summaries between Responses and Messages, and unsigned summary output and history through Chat; +- raw reasoning, summaries, and provider-specific continuation state across the three protocols; - client-defined function tools, selection, parallel-call control, calls, successful results, history, and streamed argument deltas; -- basic [hosted web search](web-search.md), URL attribution between Responses and Messages, and mandatory search with text output for downstream Chat when reasoning is absent or unsigned; signed or encrypted reasoning is rejected; +- basic [hosted web search](web-search.md), URL attribution between Responses and Messages, and mandatory search with text output for downstream Chat; signed Chat projections require a signature namespace; - model, output-token limit, reasoning effort, temperature, and `top_p`; - prompt-cache settings and supported text/image breakpoints under the [shared mapping policy](#prompt-caching), including silent omission of caller-defined keys on Messages; - response identity, model, lifecycle metadata, termination, and semantic token usage; and @@ -225,16 +231,7 @@ Protocol guides distinguish these current implementation gaps from information t ### Reasoning -The normalized representation distinguishes raw reasoning from reasoning summaries: - -- `Thinking.content` and `ThinkingDelta.content_delta` contain raw reasoning. -- `Thinking.summary` and `ThinkingDelta.summary_delta` contain a summary. - -Responses events label those representations explicitly and must agree with the configured provider capability. Chat Completions `reasoning_content` and Messages `thinking_delta` are ambiguous, so the capability profile classifies them before normalization. - -A Responses reasoning output lifecycle contains raw reasoning without a summary or signature, a summary with an optional signature and no raw reasoning, or a signature without reasoning text. A Messages thinking output lifecycle follows the same rule. A completely empty start may be deferred until its representation is known, and a lifecycle must not switch representations. - -Output processing preserves unsigned summaries rather than rejecting a response because its signature is missing. Chat can carry unsigned raw reasoning or summaries according to the provider profile, but rejects present signatures because it has no signature field. Request normalization preserves unsigned summary history. Upstream Chat request construction accepts that summary text; upstream Responses and Messages request construction still requires its original signature. Receiving unsigned reasoning output does not establish opaque continuation state. Native passthrough is unchanged. +Responses preserves raw content, summaries, and opaque state independently. Chat and Messages each project one text representation. Their inbound provider profile classifies returned text again when it enters continuation history. See [Reasoning and signatures](reasoning.md). ### Opaque continuation state @@ -353,7 +350,7 @@ For open-weight models, the selected renderer or chat template is the most autho ## Compatibility and maintenance -OpenAI request wrappers track the exact SDK version pinned in `pyproject.toml`. OpenAI result and event types are SDK aliases rather than duplicated Molto models, except two narrow Responses event replacements: `OpenAIResponseCompletedEvent` (sets a `null` `cache_write_tokens` to `0`) and `OpenAIResponseFunctionCallArgumentsDoneEvent` (relaxes the required `name`). Compatible-provider extensions are modeled narrowly; accepting an extension must not weaken every message or event to an untyped dictionary. +OpenAI request wrappers track the exact SDK version pinned in `pyproject.toml`. Narrow Responses schema extensions accept an omitted cache-write count as `None` and an omitted function name on argument completion. Native Responses transport preserves the SDK result. Responses is the canonical behavioral reference for matched cross-protocol cassettes. Same-protocol tests compare native request bodies and parsed SDK events. Translated tests compare reconstructable semantics and separately validate lifecycle ordering, generated identifiers, target defaults, and exact upstream request construction. Normal test runs replay committed cassettes and never record or rewrite them. diff --git a/docs/protocols/anthropic-messages.md b/docs/protocols/anthropic-messages.md index c6617db..75cc427 100644 --- a/docs/protocols/anthropic-messages.md +++ b/docs/protocols/anthropic-messages.md @@ -96,6 +96,8 @@ stream = await molto.responses( Here the provider receives a Messages request and the application receives OpenAI Responses events. The downstream method, not the upstream endpoint, determines the returned SDK types. +For Claude on Bedrock, use `provider="bedrock"`, `endpoint="messages"`, and an explicit runtime or Mantle `base_url` ending in `/anthropic`. Molto uses the selected Bedrock API key with the regular Anthropic SDK; the SDK appends `/v1/messages`. See [Bedrock configuration and examples](../provider-compatibility.md#selected-protocols-and-configuration). Native Messages and translated Responses/Chat requests support streaming and non-streaming results. + ## Native wire contract ### Requests and conversation turns @@ -231,7 +233,7 @@ The instructions retain their order relative to each other, but `B` loses its po The client preserves the response ID, model, and supported block order. Each emitted block keeps a stable index across its lifecycle. Text delta boundaries, thinking delta boundaries, tool call identity, and every partial-JSON delta are also preserved. Anthropic does not provide a creation timestamp, so Molto captures local wall-clock time when it observes `message_start` for downstream protocols that require one. -`thinking_delta` does not say whether its text is raw reasoning or a summary. Molto classifies it using the explicit provider capability profile: Anthropic and OpenAI profiles use summaries, while vLLM uses raw reasoning. The endpoint or base URL does not select this behavior. +Messages `thinking` text uses the provider profile during normalization. A signature remains independent of the resulting raw or summary classification. An OpenRouter Responses summary therefore projects into a Messages thinking block even when its continuation uses the raw profile. See [Reasoning and signatures](../reasoning.md). A thinking block that starts with text or a signature begins immediately so the observed snapshot cannot be lost. A completely empty thinking start is deferred until a non-empty thinking or signature delta establishes content. If the block stays empty, Molto omits it and assigns dense normalized indexes to the remaining blocks. Native `ping` events are ignored on this semantic path. @@ -267,7 +269,9 @@ User text and tool-result text are always projected in explicit content-block li Reasoning effort is the portable control. For known Claude model IDs, Molto uses the installed Anthropic model profile to select adaptive thinking or manual extended thinking. Non-Claude model IDs on Messages-compatible endpoints default to adaptive thinking, as covered by the cross-protocol fixtures. In addition, current and future adaptive Claude families are force-treated as adaptive and `xhigh`-capable even when the pinned model table has no entry yet: `claude-mythos-preview` and any `claude-{fable,haiku,mythos,opus,sonnet}-=5+` model ID. -When the application speaks Messages, an inbound thinking block is normalized as summarized reasoning: Molto sets `reasoning.summary="detailed"` on the normalized request for both adaptive and `enabled` manual modes. +Any prefix before `claude-` is ignored only for this capability lookup, including vendor names, route names, and Bedrock inference profiles. The original model ID is preserved in the request. + +When a Messages request enables adaptive or manual thinking, Molto requests `reasoning.summary="detailed"`. The provider profile separately classifies text in assistant history. | Normalized effort | Adaptive `output_config.effort` | Manual `budget_tokens` | | ----------------- | --------------------------------------- | ---------------------- | @@ -282,16 +286,12 @@ When the application speaks Messages, an inbound thinking block is normalized as Adaptive requests always use summarized display and an explicit effort. A manual `budget_tokens` value must be less than `max_tokens`; Molto rejects the request before transport when the budget is invalid. Reasoning history enables thinking when the current request omits reasoning configuration, using high effort for adaptive models or the default 10,000-token manual budget. -Inbound `thinking_delta` classification is a separate concern from the outbound adaptive-versus-manual model policy. A Messages thinking output lifecycle contains one of: - -- raw reasoning without a signature; -- a reasoning summary with an optional signature; or -- a signature without reasoning text. - -It must not mix or switch representations within one block. Output processing accepts a missing summary signature and projects it as an empty Messages signature without inventing continuation state. Request normalization preserves unsigned summary history for upstream validation. Chat upstreams accept the summary text, while Responses and Messages upstream builders reject it before transport. Official Anthropic continuation requires the original Anthropic-issued signature. Molto's local request model also permits an absent signature for compatible providers such as vLLM; this does not make unsigned thinking history valid against Anthropic's official API. +The shared request builder uses raw content when available and otherwise uses the summary. It includes a supplied signature and accepts unsigned history. Official Anthropic continuation may require the original Anthropic-issued signature. ### Opaque thinking state +See [Reasoning and signatures](../reasoning.md) for current provider profiles, signature replacement semantics, and the distinction between accepting output and replaying signed or unsigned history. + A Messages thinking block has an initial `signature` and may later receive a `signature_delta`. The delta is a complete replacement snapshot, not text to append to the initial value: the Anthropic SDK replaces the block's initial signature when it processes a `signature_delta`. Molto stores and reuses the replacement value for block completion and subsequent history. OpenAI Responses exposes three encrypted snapshots where Messages has only two slots: @@ -372,7 +372,7 @@ When Messages is the translated upstream and the provider is Anthropic, missing, Cross-protocol Messages support includes streaming and non-streaming requests for the explicitly mapped text, portable image input, thinking, custom function tools, direct tool calls, successful tool results, limited failed-result paths, conversation history, lifecycle metadata, termination, and usage semantics described above. -A route targeting Messages must supply a downstream output-token limit because Messages requires `max_tokens`. Unsigned reasoning summary output can pass through Chat Completions, but present signatures cannot because Chat has no signature slot. Unsigned summary history can be translated to a Chat upstream; Responses and Messages upstream builders still require signatures. Molto also does not enforce the same-provider requirement for opaque continuation state; callers must keep signatures with their issuing provider. +A route targeting Messages must supply a downstream output-token limit because Messages requires `max_tokens`. Applications must keep opaque state with its issuing provider. The [reasoning guide](../reasoning.md) covers signed Chat extensions, attachment order, and unsigned continuation. The normalized path does not currently implement image output, non-web citations, refusals as content blocks, redacted thinking, hosted tools other than basic web search, structured output, or multiple candidates. Request fields accepted by the local Messages wrapper are not cross-protocol features unless the adapter and client map them explicitly. diff --git a/docs/protocols/comparison.md b/docs/protocols/comparison.md index b213fdc..0bebdfe 100644 --- a/docs/protocols/comparison.md +++ b/docs/protocols/comparison.md @@ -17,7 +17,7 @@ Every row below holds for a translated route (one protocol to another through th | Multipart instruction boundaries | Lost | One `SystemPrompt` per instruction part | Text-part content and markers survive; the enclosing instruction-message boundary does not | | Assistant-history message container | Preserved where the target can represent it | One `AssistantInput` per source message | Responses separates reasoning and calls from text messages; Chat rejects incompatible part ordering | | Ordered assistant-history parts | Preserved, including multipart text and markers | Ordered `AssistantInput.content` | Responses emits each contiguous text run as one message interleaved with standalone reasoning and calls; generated-output containers remain a separate limitation | -| Raw versus summary reasoning | Classified by provider capability profile | Capability profile | OpenAI/Anthropic profiles = summary; vLLM = raw; explicit Responses events are authoritative | +| Raw versus summary reasoning | Responses preserves both explicit labels. Chat and Messages use one text field. | Independent raw and summary fields | The provider profile classifies unlabeled text at ingestion. | | Function `call_id`, name, args, results, ordering | Preserved | Portable call identity | Responses output-item `id` is a separate structure with no Chat equivalent | | Termination reason | Projected per the shared table | Provider-neutral termination | Pauses retain unfinished generation; other unrepresentable reasons use the documented coercions | | Semantic token usage | Preserved | Mapped by meaning, not field spelling | Source-only audio, prediction, cache TTL, geographic, server-tool details are not synthesized; known Responses [search counts](../web-search.md#failures-pauses-and-usage) become Messages `server_tool_use.web_search_requests` | @@ -40,7 +40,7 @@ Full boundary fidelity would require more than the current normalized representa | Streaming events | `ResponseStreamEvent` lifecycles | `ChatCompletionChunk` deltas | `RawMessageStreamEvent` blocks | | `created_at` | Source-backed or, from Messages, local `message_start` time | Source-backed; local time from Messages upstream | Captured locally when required by a downstream protocol | | Termination | `completed` / `incomplete` with reason | `finish_reason` | `message_delta.stop_reason` | -| Reasoning representation | Explicit `reasoning_text.*` vs `reasoning_summary_*` | Ambiguous `reasoning_content`, capability-classified | Ambiguous `thinking_delta`, capability-classified | +| Reasoning representation | Explicit `reasoning_text.*` vs `reasoning_summary_*` | Unlabeled `reasoning` or `reasoning_content`, capability-classified | Ambiguous `thinking_delta`, capability-classified | | Service tier (translated) | Target default `default` | Target default `default` | `standard` in `message_start.usage` | | Keepalive | None specific on translated output | None specific on translated output | `ping` is transport-only, filtered by the SDK, never synthesized | | Multiple candidates | Not supported | Only `choices[0]` normalized; translated requests reject `n` | Not supported | @@ -51,7 +51,7 @@ Responses is the richer lifecycle protocol. Translating into Responses requires ## Hosted-search fidelity -Responses and Messages translate basic search calls, results, and URL attribution. The Anthropic Messages-to-Responses route preserves excerpts and opaque references in `extra_content.anthropic` for callers that echo the extension in history; standard Responses fields alone cannot reconstruct them. Translated Chat rejects signed or encrypted reasoning, including signature-only parts. This prevents translating the OpenAI encrypted-reasoning search stream and Anthropic search turns with signed thinking to Chat; use Responses or Messages downstream instead. Search turns without reasoning or with unsigned reasoning remain representable, retaining answer text and inline links while omitting hosted activity and structured citations. The returned reasoning data determines rejection, not the search declaration. Native Chat passthrough preserves its provider output. See [Hosted web search](../web-search.md) for directional mappings and limitations. +Responses and Messages translate basic search calls, results, and URL attribution. Messages-to-Responses preserves excerpts and opaque citation references in `extra_content.anthropic` for continuation. Chat output retains answer text and inline links while omitting hosted activity and structured citations. A signed Chat projection requires a signature namespace. See [Hosted web search](../web-search.md). ## Role and placement diff --git a/docs/protocols/openai-chat-completions.md b/docs/protocols/openai-chat-completions.md index 8a518fb..0cccd6d 100644 --- a/docs/protocols/openai-chat-completions.md +++ b/docs/protocols/openai-chat-completions.md @@ -130,7 +130,7 @@ One user message becomes one normalized user input. Ordered text and image parts System and developer messages accept scalar text or ordered text-part lists and become role-less instructions. Their sequence position and part markers are retained while targeting Responses or Chat, but their original role identity is lost. A later Chat projection emits every normalized instruction as `developer`. Messages projects instructions into top-level `system`, retaining separate blocks when any system block is marked. With any cache markers present, mid-conversation instructions are rejected because hoisting would change the cached prefix. -Each assistant-history message becomes one `AssistantInput` containing ordered reasoning, text, and tool-call parts. Its enclosing message boundary is retained. The adapter accepts assistant scalar text or ordered text-part lists, optional string `reasoning_content`, and function tool calls. Text-part markers remain attached to their normalized assistant text items. When a Chat request carries `reasoning_effort`, Molto requests a detailed summary (`reasoning.summary="detailed"` unless the effort is `none`, which disables reasoning) so a Responses or Messages target receives a completed summarized reasoning value. +Each assistant-history message becomes one `AssistantInput` containing ordered reasoning, text, and tool-call parts. Its enclosing message boundary is retained. The adapter accepts assistant scalar text or ordered text-part lists, optional string `reasoning` or `reasoning_content`, and function tool calls. Text-part markers remain attached to their normalized assistant text items. When a Chat request carries `reasoning_effort`, Molto requests a detailed summary (`reasoning.summary="detailed"` unless the effort is `none`, which disables reasoning) so a Responses or Messages target receives a completed summarized reasoning value. Tool messages normalize scalar text or ordered text parts as successful tool results. Chat tool messages containing image parts are rejected on translated routes. The downstream adapter does not reinterpret such input as an image tool result. User text/images and tool-result text retain supported `prompt_cache_breakpoint` values as positional normalized markers. @@ -156,36 +156,37 @@ An upstream Chat client converts another downstream protocol's normalized reques ### Upstream request construction -| Normalized input | Chat request | -| --------------------------- | ---------------------------------------------------------------------------------- | -| Instruction | `developer` message at the same sequence position | -| User input | One `user` message with an explicit ordered content-part array | -| Portable image | `image_url` part, preserving URL or data URL and optional detail | -| Assistant history message | One assistant message with supported reasoning, ordered text parts, and tool calls | -| Adjacent assistant messages | Separate assistant messages | -| Function call | Assistant `tool_calls[]` entry | -| Successful text tool result | `tool` message with the original `tool_call_id` | -| Output-token limit | `max_completion_tokens` | -| Streaming usage | `stream_options.include_usage=true` | -| Prompt cache | `prompt_cache_key`, `prompt_cache_options`, `prompt_cache_retention` | -| Content cache breakpoint | `prompt_cache_breakpoint` on supported text/image parts | +| Normalized input | Chat request | +| --------------------------- | --------------------------------------------------------------------------------------------- | +| Instruction | `developer` message at the same sequence position | +| User input | One `user` message with an explicit ordered content-part array | +| Portable image | `image_url` part, preserving URL or data URL and optional detail | +| Assistant history message | One or more assistant messages retaining separate reasoning parts, ordered text, and call IDs | +| Adjacent assistant messages | Separate assistant messages | +| Function call | Assistant `tool_calls[]` entry | +| Successful text tool result | `tool` message with the original `tool_call_id` | +| Output-token limit | `max_completion_tokens` | +| Streaming usage | `stream_options.include_usage=true` | +| Prompt cache | `prompt_cache_key`, `prompt_cache_options`, `prompt_cache_retention` | +| Content cache breakpoint | `prompt_cache_breakpoint` on supported text/image parts | The client rejects normalized settings that Chat cannot represent: hosted search declarations, selections, and search history; `max_tool_calls`; a `concise` reasoning summary; and tool-result names, such as the optional `name` on a Responses `function_call_output`. -The client preserves every explicit assistant-history message boundary. Within one message, Chat accepts runs of reasoning, text, and tool-call parts in that order; each run is optional. Adjacent reasoning parts concatenate into `reasoning_content` in order with a newline separator. Multiple text parts remain an ordered content array with their individual markers; one unmarked text part uses scalar content. Multiple tool calls remain separate entries in one `tool_calls` array, retaining their call IDs. +The client keeps explicit assistant messages separate. Consecutive reasoning parts can use separate assistant entries so independent reasoning and signatures survive. Text and tool-call parts may interleave. The shared builder groups them into `content` and `tool_calls`, preserving order within each field. Multiple text parts retain their individual markers. A single unmarked text part uses scalar content. These examples apply within one explicit assistant message: | Ordered parts | Chat projection | | ----------------------------------------- | ----------------------------------------------------------------------------------------- | -| `Thinking("First") -> Thinking("second")` | Accepted as `reasoning_content="First\nsecond"`; a newline separates the parts. | +| `Thinking("First") -> Thinking("second")` | Preserved as separate assistant entries. | | `Text("First") -> Text("Second")` | Accepted as two ordered parts in one `content` array; each part retains its cache marker. | | `ToolCall(id="a") -> ToolCall(id="b")` | Accepted as two entries in one `tool_calls` array; IDs `a` and `b` remain distinct. | | `Text -> Thinking` | Rejected: Chat has no slot for reasoning after text. | | `ToolCall -> Thinking` | Rejected: Chat has no slot for reasoning after tool calls. | -| `ToolCall -> Text` | Rejected: Chat has no slot for text after tool calls. | +| `ToolCall -> Text` | Accepted as `tool_calls` plus `content`; their relative order is lost. | +| `Text A -> Call 1 -> Text B -> Call 2` | Accepted as text `[A, B]` and calls `[1, 2]`; their interleaving is lost. | -Molto rejects those incompatible orders rather than splitting or reordering the source message. Grouping parts never merges separate explicit assistant messages. Standalone Responses reasoning may accompany the following text message, and following standalone function calls may join that message. These Responses items have no explicit shared message boundary to preserve. A reasoning-only message is forwarded with `reasoning_content`; the upstream decides whether to accept it. +A signature-only part can carry message state or prefix a tool call. Text and tool interleaving is lost because Chat stores them in separate fields. A reasoning-only message uses the configured reasoning field. OpenAI Chat tool messages cannot carry images. For a normalized image tool result, Molto leaves a text notice in the `tool` message and emits the image in a later `user` message labeled with the call ID. This relocation follows the approach in [github/copilot-sdk#1922](https://github.com/github/copilot-sdk/issues/1922). It first emits every tool response belonging to the preceding assistant call block, then emits all relocated image prompts. For two parallel calls, the valid order is: @@ -199,16 +200,9 @@ This relocation matches how vLLM itself handles a `tool_result` image through it ### Upstream stream normalization -The client reads only `choices[0]`. Non-empty `reasoning_content` and text deltas are preserved for that choice, while an empty role-establishment content chunk does not become a text delta. A transition between reasoning and text closes one normalized part and opens another; later reasoning can open a new thinking part. Tool-call deltas must be contiguous by tool index, and their first chunk must provide the call ID and function name. +Translated streams read the choice with index zero, even when the server sends other choices in separate chunks. Native streams retain all choices. A transition between reasoning and visible text closes the active part. Tool-call deltas use their call index. The first chunk for a call supplies its ID and function name. See [Chat fields and signatures](../reasoning.md#chat-fields-and-signatures) for reasoning aliases, Google thought markers, and signature attachments. -`reasoning_content` does not say whether it contains raw reasoning or a reasoning summary. Molto classifies it with the explicit provider capability: - -| Provider profile | Interpretation | -| ---------------- | ----------------- | -| `openai` | Reasoning summary | -| `vllm` | Raw reasoning | - -`endpoint` and `base_url` do not select this interpretation. A custom OpenAI-compatible service must use the provider profile matching its actual behavior. +Use a provider profile matching the selected server. The base URL only sets its destination. The first native chunk supplies response ID, creation time, model, and source service-tier metadata. A supported `finish_reason` closes active parts, while a late usage chunk can update semantic usage before the normalized response ends. The stream must contain at least one chunk and a supported finish reason. @@ -231,7 +225,7 @@ The provider or model renderer can still merge, move, or reinterpret accepted wi ### Reasoning and continuation state -Chat's single `reasoning_content` extension can be classified as either the normalized raw reasoning field or summary field according to the provider profile. Chat has no reasoning signature or encrypted continuation slot. Translated output supports unsigned raw reasoning and summaries. Responses and Messages output projection accepts a Chat summary without inventing a signature; in the reverse direction, Chat projection rejects any present signature rather than silently discarding it. Request normalization preserves unsigned summary history, and the Chat upstream builder accepts it as `reasoning_content`. Responses and Messages upstream builders still reject unsigned summaries before transport. Accepting summary text does not restore opaque continuation state; native passthrough is unchanged. +Chat has one reasoning text field per message. Apps can configure the field name and signature extension independently of classification. The [reasoning guide](../reasoning.md) describes streaming selection, continuation, and SDK accumulation across signature runs. ### Tools and tool results @@ -267,7 +261,7 @@ Usage maps semantically rather than by dumping provider objects: | Reasoning output | `completion_tokens_details.reasoning_tokens` | | Total tokens | `total_tokens` | -Missing cached, cache-write, and reasoning detail counts default to zero in the current normalized path. Audio usage and accepted or rejected prediction-token details have no current normalized mapping. When Messages is the source, Molto's normalized input total includes uncached input, cache creation, and cache reads before it is projected into `prompt_tokens`. +An omitted cache-write count remains unknown. When Messages is the source, normalized input includes uncached input, cache creation, and cache reads. Audio usage and prediction-token details have no normalized mapping. Translated Chat Completions always includes terminal usage, matching the other translated protocols. A cross-protocol request may omit `stream_options.include_usage` or set it to `true`; setting it to `false` is rejected. @@ -294,7 +288,7 @@ Recognized errors use the OpenAI SDK namespace and the [shared error contract](. - Projected Chat uses choice index `0`, target-default `service_tier="default"`, and `logprobs=None`. Streaming chunks use `object="chat.completion.chunk"`; the collected response uses `object="chat.completion"`. - A Messages upstream has no creation timestamp, so its normalized client captures local wall-clock time and that generated value becomes Chat `created`. - Responses has no Chat `system_fingerprint`; translated Chat output omits it. -- Chat has no output-item IDs, content indexes, item statuses, assistant `phase`, exact response-completion timestamp, or encrypted reasoning state. A richer downstream protocol must generate, omit, or reject those values according to its own guide. +- Chat has no output-item IDs, content indices, item statuses, assistant `phase`, or exact response-completion timestamp. Opaque reasoning state requires a Chat extension namespace. A richer downstream protocol must generate, omit, or reject those values according to its own guide. - Parsing and serialization can change key order, omitted versus explicit null, whitespace, SSE framing, and provider chunk placement. Cross-protocol parity is semantic, not byte-for-byte wire equality. ## Hosted web search @@ -303,7 +297,7 @@ Native Chat routes forward `web_search_options` from the request or `extra_body` Use `web_search_options: {}` with a Responses or Messages upstream to require hosted search. Translated routes targeting a Chat upstream reject hosted search before transport. -Translated Chat raises `ValueError("Chat Completions cannot preserve reasoning signatures.")` when upstream output contains signed thinking or encrypted reasoning, including signature-only parts. The OpenAI hosted-search streaming recording contains encrypted reasoning; Anthropic hosted-search turns with signed thinking have the same limitation. Use Responses or Messages downstream for these turns. Search without reasoning or with unsigned reasoning remains representable; enabling search alone does not cause rejection. Native Chat passthrough is unaffected. +Chat projects signed search reasoning through the configured signature namespace. Without one, signed output raises a translation error. For representable output, translated Chat retains answer text and inline links while omitting hosted activity and structured citations. See [Hosted web search](../web-search.md) for tool selection, option mappings, and continuation limits. @@ -312,7 +306,7 @@ For representable output, translated Chat retains answer text and inline links w These are implementation gaps rather than inherent claims about the Chat protocol: - Translated Chat requests reject `n`, so Molto never requests multiple choices. An upstream Chat stream that still returns them, for example through `extra_body`, is read only from `choices[0]`; additional choices are not rejected and are lost. -- Chat cannot carry signed reasoning output or history. Unsigned summary output and history are supported, but Responses and Messages upstream builders still require signatures when replaying summary history. +- Signed reasoning uses the configured Chat signature namespace. Each choice has one message-level signature field when the SDK collects a response. - Refusals, hosted tools other than basic web search, redacted thinking, structured output, moderation, non-web annotations, image output, audio, prediction output, and log probabilities are not carried through the normalized path. Hosted-search structured annotations are deliberately omitted from translated Chat output. - Chat text chunks therefore use `logprobs=None`, even when another protocol could theoretically represent compatible token log probabilities. - Chat has no normalized per-part status. Target lifecycle and status fields are synthesized where required, and pauses map to `finish_reason="length"`; other terminal reasons without an exact Chat mapping become `finish_reason="stop"`. @@ -343,3 +337,7 @@ External protocol references: - [OpenAI Chat Completions create reference](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create) - [vLLM OpenAI-compatible server](https://docs.vllm.ai/en/latest/serving/online_serving/openai_compatible_server/) + +## Hosted extensions + +See [provider compatibility](../provider-compatibility.md) for Google `extra_content` at message/part/call attachments, Gemini missing index repair, and native history preservation. Native acceptance does not establish translated portability. On translated input, populated opaque state rejects where there is no lossless mapping; on output, only a client that models an extension validates it. diff --git a/docs/protocols/openai-responses.md b/docs/protocols/openai-responses.md index 8f64cc0..eaca618 100644 --- a/docs/protocols/openai-responses.md +++ b/docs/protocols/openai-responses.md @@ -123,7 +123,7 @@ Native passthrough forwards `include` and `store` unchanged. Their behavior-neut Unknown top-level body properties reach the SDK through `extra_body`; explicit caller `extra_body` overrides take precedence. Molto's own `extra_content.anthropic` search extension still requires its Anthropic Messages destination and is rejected on native Responses routes. See the [shared input policy](../README.md#cross-protocol-contract) for model serialization and null handling. -There is one narrow compatible-provider normalization: if a completed Responses event includes usage but omits `input_tokens_details.cache_write_tokens` as `null`, Molto sets it to `0` to satisfy the pinned SDK contract. Otherwise it does not revalidate or rewrite each event. +Native Responses transport yields the parsed SDK event. Missing or null `input_tokens_details.cache_write_tokens` remains unknown. An explicit zero remains zero. ## When the application speaks Responses @@ -150,7 +150,7 @@ The implemented normalized path accepts: - string input and text messages with `system`, `developer`, `user`, and `assistant` roles. - ordered mixed text and image user input, using remote URLs or base64 data URLs. -- raw reasoning and reasoning-summary history. +- raw reasoning and reasoning-summary history. The `format="unknown"` label is accepted and omitted only for raw-only history; named formats and formatted summary/signature state are rejected. Native passthrough preserves the field. - client-defined function tools, tool choice, parallel-call control, calls, successful results, and streamed JSON argument deltas. - `prompt_cache_key`, `prompt_cache_options`, `prompt_cache_retention`, and supported content-part `prompt_cache_breakpoint` markers. - model, streaming mode, output-token limit, reasoning effort, temperature, `top_p`, and `include_obfuscation` when the upstream protocol has an equivalent stream option. @@ -160,7 +160,7 @@ One user message remains one user message, and its ordered text and image parts System and developer messages both become role-less normalized instructions. A multipart instruction message becomes multiple instruction values, losing its role and enclosing boundary. Each assistant message becomes one `AssistantInput` retaining its optional message ID and ordered text parts, including part markers. Standalone reasoning and function-call items remain separate normalized items; multiple reasoning parts of the same representation are joined within their normalized reasoning value. -Unsupported item types, content parts, non-successful tool outcomes, and populated request-wrapper fields outside the implemented normalization surface are rejected on translated routes. Nested request settings are validated independently; accepting their top-level container does not authorize unsupported members. Documented omissions are optional Responses output-item IDs on Chat Completions or Messages, and caller-defined prompt-cache keys on Messages. Output-item IDs remain valid normalized history and are preserved by Responses, including marked assistant history; Messages drops cache keys without enabling caching and processes cache options independently. Encrypted-reasoning inclusion is ignored because Molto already preserves any encrypted reasoning returned by the provider, search-source inclusion because Molto requests and projects sources whenever hosted search is declared, while disabled storage is ignored because it requests no provider-side state; `store=true` is rejected. Messages has no obfuscation field, so a Responses obfuscation request is not portable to that endpoint. Supported content-part `prompt_cache_breakpoint` values become normalized positional markers. Assistant markers use `output_text` parts and preserve optional output-item IDs. +Unsupported item types, content parts, non-successful tool outcomes, and populated request-wrapper fields outside the implemented normalization surface are rejected on translated routes. Nested request settings are validated independently; accepting their top-level container does not authorize unsupported members. Documented omissions are optional Responses output-item IDs on Chat Completions or Messages, caller-defined prompt-cache keys on Messages, and `format="unknown"` on raw-only reasoning history. Output-item IDs remain valid normalized history and are preserved by Responses, including marked assistant history; Messages drops cache keys without enabling caching and processes cache options independently. Encrypted-reasoning inclusion is ignored because Molto already preserves any encrypted reasoning returned by the provider, search-source inclusion because Molto requests and projects sources whenever hosted search is declared, while disabled storage is ignored because it requests no provider-side state; `store=true` is rejected. Messages has no obfuscation field, so a Responses obfuscation request is not portable to that endpoint. Supported content-part `prompt_cache_breakpoint` values become normalized positional markers. Assistant markers use `output_text` parts and preserve optional output-item IDs. ### Downstream event projection @@ -210,20 +210,20 @@ When another Molto method selects `endpoint="responses"`, the Responses client p The Responses client maps normalized input as follows: -| Normalized value | Responses request | -| ------------------------ | -------------------------------------------------------------------- | -| Instruction | `developer` message at the same normalized sequence position | -| User input | One `user` message with ordered `input_text` and `input_image` parts | -| Raw reasoning | Completed `reasoning` item with `reasoning_text` content | -| Reasoning summary | Completed `reasoning` item with summary and encrypted state | -| Assistant text run | Completed assistant `message` with ordered `output_text` parts | -| Function call | Completed `function_call` item | -| Function result | `function_call_output` with ordered text and image parts | -| Output-token limit | `max_output_tokens` | -| Function definition | Responses function tool | -| Tool selection | Responses `auto`, `none`, `required`, or named function choice | -| Prompt cache | `prompt_cache_key`, `prompt_cache_options`, `prompt_cache_retention` | -| Content cache breakpoint | `prompt_cache_breakpoint` on supported text/image parts | +| Normalized value | Responses request | +| ------------------------ | ------------------------------------------------------------------------ | +| Instruction | `developer` message at the same normalized sequence position | +| User input | One `user` message with ordered `input_text` and `input_image` parts | +| Raw reasoning | Completed `reasoning` item with `reasoning_text` content | +| Reasoning summary | Completed `reasoning` item with summary and any supplied encrypted state | +| Assistant text run | Completed assistant `message` with ordered `output_text` parts | +| Function call | Completed `function_call` item | +| Function result | `function_call_output` with ordered text and image parts | +| Output-token limit | `max_output_tokens` | +| Function definition | Responses function tool | +| Tool selection | Responses `auto`, `none`, `required`, or named function choice | +| Prompt cache | `prompt_cache_key`, `prompt_cache_options`, `prompt_cache_retention` | +| Content cache breakpoint | `prompt_cache_breakpoint` on supported text/image parts | Every normalized instruction is emitted as a `developer` message with one `input_text` part; an original `system` role cannot be reconstructed. Contiguous text parts of one assistant input become one assistant message with ordered `output_text` parts. Reasoning or function calls between text parts become standalone items, so they split the surrounding text into separate Responses messages. Assistant `phase` remains omitted. @@ -235,13 +235,13 @@ If a normalized request came from Messages, Molto sets `stream_options.include_o Reasoning effort is a portable control. A normalized reasoning effort is carried into the Responses `reasoning` object as-is. When a normalized request originated from Messages, `output_config.effort` is preserved directly; adaptive thinking defaults to high effort, while an `enabled` manual `budget_tokens` is normalized by rounding up to the smallest effort preset that is at least the budget (`max` above 32,768) rather than the nearest one. Responses-only features such as conversation references, previous-response state, hosted tools other than basic web search, and background execution require an explicit mapping or rejection before they can be translated from another protocol. -Reconstructed reasoning history omits the output lifecycle `status` field. The live OpenAI API rejects that field on reasoning input, even though the SDK schema permits it. Summary text, item IDs, and encrypted state are preserved. Native passthrough still forwards the caller's request for provider validation. +Reconstructed reasoning history omits the output lifecycle `status` field. The live OpenAI API rejects that field on reasoning input, even though the SDK schema permits it. Raw content, summary text, item IDs, and encrypted state are preserved. The translated history builder uses an empty `content` array when no raw text was supplied. Native passthrough still forwards the caller's request for provider validation. ### Upstream event normalization The Responses client emits one normalized response start, one part lifecycle per supported output item, each source delta as a matching normalized delta, and one response end. Empty role or lifecycle echoes do not become content deltas. -Supported output items are assistant text, reasoning, and client function calls. A completely empty reasoning `output_item.added` snapshot is deferred until text or encrypted state establishes a real part. If it also completes empty, Molto omits that empty part and reindexes surviving normalized parts densely. An item that starts with content or encrypted state is emitted immediately. +Supported output items include assistant text, reasoning, and client function calls. A reasoning item starts immediately, including when it has an ID and no text or encrypted state. The client recognizes completed and incomplete response terminals. A completed response containing a function call normalizes as `tool_call`; otherwise it normalizes as `stop`. An incomplete response without a reason normalizes as `unknown`. Other terminal events, including `response.failed`, are rejected with `ValueError`. Unsupported stream event variants are rejected unless they are explicitly classified as transport or redundant lifecycle events. @@ -249,6 +249,8 @@ The client recognizes completed and incomplete response terminals. A completed r ### Reasoning representation +Responses uses the same mapping for every provider, including OpenRouter and Fireworks. + Responses is explicit where Chat Completions and Messages are ambiguous: | Responses events or item content | Normalized representation | @@ -257,17 +259,7 @@ Responses is explicit where Chat Completions and Messages are ambiguous: | `response.reasoning_summary_*` | Summary in `Thinking.summary` | | `encrypted_content` | Opaque snapshot in `Thinking.signature` | -Every explicit Responses event must agree with the selected provider capability profile. OpenAI is classified as summarized reasoning and vLLM as raw reasoning. A base URL never chooses this behavior. - -A Responses reasoning output lifecycle must use exactly one representation: - -- raw reasoning content with no summary or encrypted state; -- a reasoning summary with optional encrypted state and no raw content; or -- encrypted state with neither summary nor raw content. - -The item must not combine or switch representations between its added, delta, and done states. A completely empty start may remain deferred until its representation becomes known. Output processing accepts completed summaries without encrypted state and normalizes empty `encrypted_content` to no signature. Request normalization preserves unsigned summary history; upstream Chat accepts the summary text, while upstream Responses and Messages builders still reject it before transport. - -Chat Completions has one `reasoning_content` extension and no signature. Messages has one `thinking_delta` field plus signature lifecycle. Their configured provider capability decides whether their text is classified as Responses raw reasoning or summary. Unsigned Chat reasoning output can project into Responses as raw reasoning or a summary according to that capability. Responses-to-Chat output rejects any present signature instead of dropping it; unsigned summary output is representable. Supported delta boundaries remain observable and are preserved by matched parity coverage. +A single item can carry raw text, a summary, both, or neither, along with optional opaque state. Each text field with data has its own part lifecycle. Unsigned history omits encrypted state. When translated through Chat or Messages, reasoning uses the [single-field projection and continuation rules](../reasoning.md#protocol-mapping). ### Opaque continuation state @@ -293,6 +285,8 @@ Assistant-history text parts remain in their original message, and adjacent assi Responses client-defined functions map to the provider-neutral function name, description, JSON schema, and strictness. Named choices and `auto`, `none`, and `required` are preserved where the target has an equivalent. Messages maps `required` to `any` and represents `parallel_tool_calls` by inverting `disable_parallel_tool_use`. +On translated Responses requests, omitted or `null` function-tool `strict` defaults to `true`; explicit `false` is preserved. For existing callers, `strict: null` previously became upstream `false` and now becomes `true`. Chat Completions input retains its non-strict default. Molto sends the supplied parameter schema unchanged and does not reproduce native Responses' automatic schema normalization or non-strict fallback. For OpenAI strict mode, each object needs `additionalProperties: false` and every property must be required; optional values can use a nullable type. Incompatible schemas or unsupported strict mode may be rejected upstream. Set `strict: false` to request best-effort arguments. Native Responses passthrough leaves omission and explicit values to the provider. See the [provider compatibility policy](../provider-compatibility.md#provider-differences). + Function-call history preserves call IDs, function names, JSON arguments, successful results, and ordering. Keep these two identifiers distinct: - `call_id` is the portable identity that pairs a function call with its result. @@ -319,6 +313,8 @@ Molto constructs Responses usage explicitly from normalized semantic fields: | `output_tokens_details.reasoning_tokens` | Reasoning or thinking output tokens | | `total_tokens` | Total input plus output tokens | +For strict validation of a complete response body, `molto.types.openai_responses.OpenAICompatibleResponsesResponse.model_validate(body)` accepts omitted or null cache-write counts. The Responses event adapter applies the same schema to every response snapshot. Native transport returns the SDK's own parsed objects. + Chat maps prompt, completion, cache, and reasoning counts directly to these meanings. Messages input totals combine uncached input, cache creation, and cache reads before projection. Source-only audio, prediction, cache TTL, inference geography, and server-tool usage are not synthesized. All translated Responses results report `service_tier="default"`. The source tier can remain normalized metadata, but tier vocabularies are not treated as portable. Native Responses passthrough preserves the provider value. Request service tier is not forwarded across protocols. @@ -392,7 +388,7 @@ A Responses stream can fail after HTTP `200`: the SDK raises `APIError` on the c The following are implementation gaps, not general claims that the source data cannot exist: - multiple Chat Completions choices; the current translated client reads only `choices[0]`; -- signed reasoning output or history through Chat Completions and unsigned summary history targeting Responses or Messages upstreams; Chat has no signature slot, while Responses and Messages request builders require summary signatures; +- signed reasoning projection into Chat without a configured signature namespace; - refusals as content, hosted tools other than basic search, failed client-function result semantics, redacted thinking, structured output, non-web annotations, moderation, and image or other multimodal output; - log probability transport across the normalized representation; - Chat audio and accepted or rejected prediction-token details; diff --git a/docs/provider-compatibility.md b/docs/provider-compatibility.md new file mode 100644 index 0000000..a3ade66 --- /dev/null +++ b/docs/provider-compatibility.md @@ -0,0 +1,134 @@ +# Provider compatibility + +Each supported provider/protocol pair has its own explicit upstream client. Each class implements one protocol, and thin subclasses share the protocol implementation. The shared Responses and Chat Completions clients ignore output extensions they do not model; a provider client validates only its own extensions. Prefer Responses when it supports the desired model and capabilities, then Messages, then Chat Completions. `molto.upstream.registry.CLIENTS` selects the client for both native and translated routes. Both require a registered provider/endpoint pair, including when an explicit `base_url` is supplied. Unsupported pairs fail before HTTP. Neither path switches protocols. + +Choose a registered pair explicitly: OpenRouter uses `endpoint="responses"`, Gemini uses `endpoint="chat/completions"`, and Anthropic uses `endpoint="messages"`. A custom URL changes the destination of that registered client; it does not register another protocol. SDK resource paths are appended to the base URL, and Bedrock requires an explicit regional destination. + +## Selected protocols and configuration + +| Provider | Client | Default SDK base URL | Credential | +| --- | --- | --- | --- | +| Together AI | `TogetherAIResponsesClient`, `TogetherAIChatCompletionsClient` | `https://api.together.ai/v1` | `TOGETHER_AI_API_KEY` | +| Fireworks | `FireworksResponsesClient`, `FireworksChatCompletionsClient` | `https://api.fireworks.ai/inference/v1` | `FIREWORKS_API_KEY` | +| OpenRouter | `OpenRouterResponsesClient` | `https://openrouter.ai/api/v1` | `OPENROUTER_API_KEY` | +| Bedrock | `BedrockResponsesClient`, `BedrockMessagesClient`, `BedrockChatCompletionsClient` | Explicit regional URL required | `AWS_BEARER_TOKEN_BEDROCK` or `BEDROCK_API_KEY` | +| Gemini | `GeminiChatCompletionsClient` | `https://generativelanguage.googleapis.com/v1beta/openai` | `GEMINI_API_KEY` | + +An explicit `api_key` overrides the configured provider key; hosted clients reject an empty key locally. Missing provider keys cannot fall back to OpenAI credentials. An explicit `base_url` overrides the default without changing the provider or protocol. Authentication and account headers supplied through `extra_headers` cannot override the selected upstream identity. + +Bedrock accepts either credential name from the environment or `.env`. `AWS_BEARER_TOKEN_BEDROCK` takes precedence when both names are configured, including across those sources. For the same name, the environment overrides `.env`. + +For Claude on Bedrock, select `endpoint="messages"`. The [Anthropic-native Messages API](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-messages-api.html) accepts the regular Anthropic SDK wire format on runtime and Mantle. Supply a base URL ending in `/anthropic`, such as `https://bedrock-runtime.us-east-1.amazonaws.com/anthropic` or `https://bedrock-mantle.us-east-1.api.aws/anthropic`; the SDK appends `/v1/messages`. This client uses the selected Bedrock key in `x-api-key`, suppresses ambient Anthropic bearer credentials, and reuses Messages streaming and translation. It does not use the InvokeModel/Converse transports or sign requests with AWS SigV4. Keep the model or inference-profile ID expected by the selected destination; Molto does not switch protocols based on model names. Native calls still require a registered provider/endpoint pair. + +```python +response = await molto.responses( + {"model": "global.anthropic.claude-sonnet-5", "input": "Hello!", "max_output_tokens": 1024}, + provider="bedrock", + endpoint="messages", + base_url="https://bedrock-runtime.us-east-1.amazonaws.com/anthropic", +) +``` + +`Molto.messages(..., provider="bedrock", base_url=...)` passes Messages through natively. Responses and Chat callers select `endpoint="messages"` for translation; both streaming and non-streaming results are supported. Model access and region availability are owned by Bedrock. + +Select the upstream protocol explicitly when it differs from the public method. For example, `Molto.chat_completions(..., provider="openrouter", endpoint="responses")` translates Chat input through the Responses client. The existing method defaults remain unchanged. + +Protocol availability is documented by [Together](https://docs.together.ai/docs/inference/responses-api), [Fireworks](https://docs.fireworks.ai/api-reference/post-responses), [OpenRouter](https://openrouter.ai/docs/api_reference/responses/overview), [Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-responses-api.html), and [Gemini](https://ai.google.dev/gemini-api/docs/openai). Availability does not establish support for every model or feature. Together's Responses documentation lists GLM-5.2 and GLM-5.3 families; its Chat Completions recordings do not validate Responses for those Chat models. Together, Fireworks, and Bedrock expose separate Chat Completions clients to reach models and capabilities available through that protocol. Bedrock's [Chat Completions guide](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-chat-completions.html) documents the regional runtime and Mantle destinations; callers must choose a destination supported by their model. + +## Provider differences + +The [reasoning guide](reasoning.md) describes profile selection, wire labels, signature routing, and the limits of collected Chat output. + +Messages thinking-capability lookup recognizes the `claude-...` portion regardless of provider, route, or inference-profile prefixes. For example, `us.anthropic.claude-haiku-4-5-20251001-v1:0` uses the manual thinking budget, while `global.anthropic.claude-sonnet-5` uses adaptive thinking. The exact supplied model ID stays unchanged on the wire. + +OpenRouter accepts `format="unknown"` on raw-only Responses reasoning. Translated history omits this encoding label. Named formats and formatted summary or signature state reject. Fireworks and OpenRouter both follow the explicit Responses labels. Their raw profiles classify reasoning only when it arrives through Chat or Messages. + +Bedrock Chat uses raw classification and the `reasoning` field for GPT-OSS 20B on Oregon Mantle. A runtime probe returned literal `` tags in ordinary content, which remains visible text. Signed Bedrock Messages thinking uses its summary profile. The selected model and endpoint determine which features are available. + +Gemini uses the summary profile and the `google` Chat signature namespace. Its `extra_content.google.thought` marker identifies summary text. A streamed tool signature can accompany the first arguments. A message signature can arrive after the final text chunk. Continuation restores those attachments. Google describes the exposed text as a thought summary. [Google OpenAI compatibility](https://ai.google.dev/gemini-api/docs/openai) + +Gemini repairs missing streamed tool indices from first-seen call IDs or the sole known call. Repaired fragments omit repeated IDs so SDK accumulation retains the original call ID. Native chunks with indices pass through directly. + +A [bounded live probe on 2026-11-16](https://github.com/EmbeddedLLM/molto/actions/runs/43849083274) tested signature placement with `gemini-3.1-flash-lite`, minimal reasoning, and non-streaming native OpenAI SDK requests. Native tool generation and unchanged continuation succeeded. The probe then combined the earlier tool call with a genuine message-level signature from its successful continuation, removing the call's original signature. These comparison histories were synthetic; they were not emitted by Gemini in that form. + +| Synthetic history | Signature on message only | Same signature moved onto tool call | +| ---------------------- | ------------------------------------------------------ | -------------------------------------- | +| Text and one tool call | HTTP 400; error identified a missing thought signature | HTTP 200; returned the expected result | +| One tool call, no text | HTTP 200; returned the expected result | HTTP 200; returned the expected result | + +The no-text result establishes request acceptance for the tested configuration. Equivalent model use and other configurations remain unverified. + +Gemini and Fireworks Chat clients omit `stream_options.include_obfuscation`, which their tested endpoints reject, on native and translated requests. Other streaming options remain intact. Gemini tool-bearing successful `finish_reason="stop"` becomes normalized tool termination on translated routes, producing Messages `stop_reason="tool_use"`; native output retains the provider's original finish reason. + +Translated Responses function tools default omitted or `null` `strict` to `true`; explicit `false` remains non-strict. Translated Chat Completions tools retain their non-strict default. Molto forwards the supplied parameter schema without adding strict-mode constraints and does not retry with non-strict tools. This is a deliberate approximation of [native Responses](https://developers.openai.com/api/docs/guides/function-calling#strict-mode), which attempts schema normalization and can fall back to non-strict mode. Supply a strict-compatible schema or set `strict: false` explicitly; an upstream may reject an incompatible schema or unsupported strict mode. Native passthrough preserves omission and explicit values for the provider to interpret. + +## Migration notes + +- Native and translated calls now require a registered provider/endpoint pair. An explicit `base_url` no longer enables unregistered native fallback. +- Compatible-server callers using `provider="openai"` must select `provider="openrouter"` or `provider="gemini"` for those providers' translated extensions, and select their registered endpoint. +- Translated Responses function-tool `strict: null` previously became upstream `false` and now becomes `true`. Omitted `strict` also defaults to `true`; explicit `false` and supplied schemas remain unchanged. Molto neither normalizes strict schemas nor retries with non-strict tools. +- Responses now preserves Fireworks summary labels. Chat and Messages continuation through Fireworks or OpenRouter can return that unlabeled text as raw reasoning. +- Shared Chat history now groups interleaved text and calls into separate fields. It preserves text order and call order but cannot preserve their interleaving. Explicit assistant-message boundaries remain separate. +- Gemini streams text before a trailing message signature and restores the token on the assistant message. Tool signatures stay with their calls. vLLM and Bedrock Chat use `reasoning` by default. For older vLLM deployments, set `chat_reasoning_field="reasoning_content"`. + +## Replay evidence + +Bedrock Messages has independent native text/tool and signed-thinking recordings for the model below, plus offline transport and translation coverage using the existing matched Messages/OpenAI fixtures. Matched tests compare native Anthropic SDK output and translated OpenAI SDK output, and check the runtime/Mantle URLs, credential isolation, and request bodies. Live provider evidence comes from the Bedrock-owned recordings; matched fixtures alone do not establish server acceptance. + +Provider conversations share `tests/upstream/test_multi_turn.py`. Cassettes use the existing scenario-first layout, for example `tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-00.yaml`. Each provider uses its own recordings. Canonical OpenAI/Anthropic fixtures are not reused as evidence of hosted-provider behavior. + +The suite checks native SDK parity, actual-output history, normalized lifecycle and semantics, exact expected subsequent requests, and focused public translation or rejection cases. Independent SDK responses supply the comparison values. Expected normalized request copies account for documented wire representations, downstream strictness defaults, parsed tool-argument JSON, and omitted optional metadata; recorded fixtures are not rewritten to match Molto output. + +The reasoning conversation tests carry actual Molto output through two tool results to a final answer. OpenRouter, Fireworks, and Together Responses recordings cover Chat and Messages callers in both downstream response modes. Fireworks and Together Chat recordings cover Responses and Messages callers in both modes. Bedrock Messages signed-thinking recordings cover Responses callers in both modes, preserving reasoning text and signatures. Translated calls consume the streaming upstream recordings even when the downstream response is non-streaming. Non-streaming upstream recordings are independently replayed for native SDK parity and native continuation. + +The recordings below were imported unchanged. The later [cassette storage cleanup](../tests/cassettes/README.md) removed duplicate response byte copies while preserving every parsed response value and SSE line. Non-streaming JSON replay now serializes the retained `body` rather than preserving its original whitespace. + +| Provider/model | Protocol | Retained conversation evidence | Remaining limits | +| --- | --- | --- | --- | +| Together `zai-org/GLM-5.2` | Responses | Two-turn text and three-turn sequential tools in both native modes; additional three-turn reasoning/tool continuation with `reasoning.effort="low"`, including public Chat/Messages continuation in both downstream modes | Other models, images, and parallel calls are unverified | +| Together `zai-org/GLM-5.2` | Chat Completions | Three-turn native reasoning/tool continuation in both modes with `reasoning_effort="low"`; public Responses/Messages continuation in both downstream modes | Other models, images, and parallel calls are unverified | +| Fireworks `accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b` | Responses | Text, sequential and parallel tools, and low-effort reasoning/tool continuation. Missing cache-write counts remain unknown. | Chat or Messages continuation can return a recorded summary as raw reasoning. Other models and images are unverified. | +| Together `Qwen/Qwen3.5-9B` | Chat Completions | Two-turn text and three-turn sequential tools, streaming and non-streaming, with `reasoning.enabled=false` | Other models, images, parallel calls, and reasoning-enabled continuation are unverified | +| Fireworks `accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b` | Chat Completions | Two-turn text and three-turn sequential tools in both modes; additional three-turn native reasoning/tool continuation with `reasoning_effort="low"`, including public Responses/Messages continuation in both downstream modes | Other models, images, and parallel calls are unverified | +| OpenRouter `nvidia/nemotron-3.5-lightning:free` | Responses | Text in both native modes; non-streaming sequential tools; streamed raw-reasoning sequential tools with public Chat/Messages continuation in both downstream modes | Non-streaming native reasoning and parallel Responses calls are unverified | +| Gemini `gemini-3.1-flash-lite` | Chat Completions | Text and sequential tool history, including message and tool signatures. Medium-effort captures with `include_thoughts=true` exercise the Google thought marker. | Other models, images, and live parallel calls are unverified. | +| Bedrock `global.openai.gpt-5.6-luna` | Responses and Chat Completions | Two-turn text and three-turn sequential tools, streaming and non-streaming, with reasoning disabled | Verified only through the runtime endpoint in `ap-southeast-1`; other models, regions, images, parallel calls, and reasoning-enabled continuation are unverified | +| Bedrock `openai.gpt-oss-20b` | Chat Completions | Three-turn raw reasoning and tool continuation on Oregon Mantle in both native modes | Runtime and other model or region combinations require separate evidence. | +| Bedrock `global.anthropic.claude-haiku-4-5-20251001-v1:0` | Messages | Text/tool conversations in both modes; additional three-turn signed-thinking/tool continuation in both native modes with a 1,024-token thinking budget; normalized and public Responses continuation preserve signatures in both downstream modes | Verified through runtime in `ap-southeast-1`; Mantle, other models/regions, images, and parallel tools are unverified | + +The first 24 recordings in `upstream_ir/tool_use_reasoning_low/` were captured on November 17, 2026: 12 Together GLM-5.2 exchanges across Responses/Chat and both modes, six Fireworks Nemotron Chat exchanges, and six Bedrock Haiku 4.5 Messages exchanges across both modes. Each three-turn native SDK conversation carries actual reasoning and tool output through two tool results to a final answer. Together and Fireworks used low reasoning; Bedrock Messages used enabled thinking with a 1,024-token budget. All used a 2,048-token output cap, zero SDK retries, and the recorder proxy outside pytest. These captures establish the tested models/settings, not other models or equivalent reasoning use across independent generations. Six additional Bedrock Mantle Chat captures use `openai.gpt-oss-20b` in `us-west-2`, low effort, a 2,048-token output cap, and zero retries. Two three-turn tool conversations include raw `reasoning`; summary-bearing Bedrock Chat output remains unverified. Six Fireworks Responses captures omit the SDK-required cache-write count. The scoped compatibility model preserves that count as unknown in both native modes. + +The Bedrock GPT-5.6 Luna captures use `https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1`, manual actual-output history, and zero retries. Responses requests use `store=false`; Chat Completions requests use `reasoning_effort="none"`. The model is an explicit system-defined inference profile. An earlier Mantle `openai.gpt-oss-20b` attempt returned HTTP 200 but stalled after `response.created` and `response.in_progress`; it was stopped after more than five minutes and remains in staging, outside the successful replay corpus. A Chat Completions attempt with `mistral.ministral-3-3b-instruct` returned an invalid-model HTTP 400 on runtime and timed out after 75 seconds on Mantle; neither attempt is successful replay evidence. The Singapore endpoint and global inference profile do not establish that inference occurred in Singapore. + +Bedrock Messages captures were recorded on November 16, 2026 with native Anthropic SDK 0.121.0 through the recorder proxy, outside pytest, at `https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages`. All 10 requests returned HTTP 200, with a 512-token output cap and zero retries; all five streams completed. Caller history contains the actual SDK content blocks, and the two sequential calls calculate 2 + 3 and then 5 + 7 before returning 12. The recorded request and response values are unchanged. Six additional native Messages requests recorded on November 17 enabled thinking with a 1,024-token budget and a 2,048-token output cap; both three-turn conversations carried actual signed thinking and tool results through 2 + 3 and then 5 + 7 to a final answer of 12. Native SDK continuation replay passed for all six exchanges. Normalized replay and public Responses continuation also passed, comparing actual returned thinking and signatures with the Anthropic SDK and checking exact subsequent upstream requests in both downstream modes. The global inference profile does not establish the execution region. + +Chat Completions continuation retains the actual SDK output. Together and Gemini repeat `delta.role`; the SDK accumulator concatenates these values, so the recording caller and replay helper restore the single `assistant` role before reuse. Fireworks rejects null output-only fields in assistant history, so its recording caller and replay helper omit those nulls. Gemini also rejects null optional message fields; its caller omits top-level nulls while retaining nested Google state unchanged. These are history-construction choices in the evidence workflow; native production output remains unchanged. The Fireworks and Gemini clients also omit null top-level message fields from every request they send, so history echoed from SDK output is accepted; nested values, including Google state, are unchanged. Every other client forwards message nulls as sent, which the Bedrock and Together recorded requests show those providers accept. Native parity sends input copies without empty output-only annotations, null `reasoning_content`/`tool_calls`, or stream-only tool indices, which are absent from the Chat request schema. The recorded source history is still checked against actual SDK output, and recorded response values remain unchanged. + +Gemini captures came from the [successful GitHub-hosted recording run](https://github.com/EmbeddedLLM/molto/actions/runs/42160882628), using the existing Actions secret, native OpenAI SDK calls through the recorder proxy, zero retries, and 90-second request deadlines. The temporary driver and workflow remain on a separate recording branch. Artifact YAML was imported unchanged before the storage cleanup described above. Streamed tool calls omit `index`; independent SDK references assign index zero only for these recorded single-call responses before comparison with the Gemini client. Native parity otherwise retains full provider output, including streamed `finish_reason="stop"` on tool calls and Google thought signatures on text and tool output. + +A [GitHub-hosted Gemini probe](https://github.com/EmbeddedLLM/molto/actions/runs/44128342414) captured text and tool generation in both native modes with medium effort and `include_thoughts=true`. Its complete replies used the Google thought marker. Its streams returned unmarked text or calls. The probe stopped after the first turns because it expected a `reasoning_content` field. + +A [second Gemini recording run](https://github.com/EmbeddedLLM/molto/actions/runs/44276479795) retained ten original exchanges with medium thinking, `include_thoughts=true`, and a 2,048-token output cap. The four native conversations used actual assistant output for text and tool continuation in both modes. A [mixed-mode follow-up](https://github.com/EmbeddedLLM/molto/actions/runs/44277431390) completed another five requests. Complete responses marked the entire content field as thought, including prose resembling an answer. There was no separate visible answer in those messages. The streams in both runs carried unmarked text or calls and genuine signatures. Molto follows the marker received in each mode. + +A four-call [combined-history comparison](https://github.com/EmbeddedLLM/molto/actions/runs/44280209744) kept the streamed answer and its genuine message signature together. The comparison added `reasoning_content` from an independent marked reply to that same prompt. The control and combined messages both returned the expected answer, 36, in streaming and non-streaming mode. This validates acceptance of the combined shape for this model and setting. + +The retained OpenRouter captures use an explicit free model, disabled provider fallbacks, zero price caps, and no plugins. Reported costs were zero. Responses history is manual with `store=false`. Captures establish only the recorded model, settings, and date; replay does not prove that translated request bodies were executed live. + +The duplicate PR #76 corpus, per-run manifests, source snapshots, and unsupported-protocol captures are omitted. Full issue #78 coverage still requires the remaining provider/model cells. + +## Opt-in live smoke checks + +Replay verifies saved responses and request construction; it cannot establish that a hosted endpoint accepts today's translated requests. Run the standalone smoke command explicitly with one provider, model, and upstream protocol: + +```bash +uv run --extra test python -m scripts.smoke_provider \ + --provider gemini --model gemini-3.1-flash-lite \ + --upstream chat/completions \ + --extra-body '{"reasoning_effort":"minimal"}' +``` + +The command uses configured provider credentials and makes live, potentially billable requests. It first checks Molto's native route, then the selected downstream protocols (all three by default), with text and a forced function call followed by its actual tool-result history in streaming and non-streaming modes. It checks tool identity, arguments, termination, and final output. The native route is a diagnostic control, not an independent SDK comparison; offline replay supplies SDK parity coverage. + +Defaults bound the run to 18 HTTP attempts, 512 output tokens per request, a 45-second HTTP timeout, and a 180-second total deadline. SDK retries count against the HTTP budget. Use `--downstream`, `--mode`, `--max-requests`, and `--deadline` to narrow a run, and `--base-url` for an explicit protocol destination. Provider-specific `--extra-body` options cannot replace the smoke inputs, tools, modes, or token limits. Results report pass/fail and error class/status without printing provider response bodies or credentials. A failing check exits nonzero. + +These checks create no cassettes and never run as part of pytest or default CI. A pass establishes only the selected model, settings, and scenarios at that time. Known unsupported reasoning/signature translations may fail; choose explicit reasoning controls where appropriate rather than treating all provider/model combinations as supported. diff --git a/docs/reasoning.md b/docs/reasoning.md new file mode 100644 index 0000000..2dc241e --- /dev/null +++ b/docs/reasoning.md @@ -0,0 +1,37 @@ +# Reasoning and signatures + +On translated routes, Molto stores raw reasoning in `Thinking.content`, a summary in `Thinking.summary`, and opaque continuation state in `Thinking.signature`. All three fields are independent. Text deltas append to their corresponding field. A signature delta replaces the previous value for its attachment. Return opaque state to the provider that issued it. + +## Protocol mapping + +| Protocol | Protocol to IR | IR to protocol | +| --- | --- | --- | +| Responses | `reasoning_text` supplies raw content, `summary_text` supplies a summary, and `encrypted_content` supplies the signature. | Preserve both text fields and any signature independently, including an item whose only populated field is its ID. | +| Chat Completions | Classify unlabeled reasoning text using the provider profile. Read signatures from the configured extension namespace. | Emit one text representation in the selected Chat field. Carry signatures at their message or tool-call attachment when a namespace is configured. | +| Messages | Classify `thinking` text using the provider profile. Preserve the block signature independently. | Emit one text representation in a thinking block and preserve any signature. | + +A complete history part sent to Chat or Messages uses nonempty raw content first, then the summary. When projecting a stream, the first nonempty representation wins for that part. If one snapshot supplies both, raw content wins. For example, summary A, raw B, summary C produces A and C. A signature or an empty start leaves the choice open. Each new part selects independently. Translated non-streaming responses collect the same projected stream. + +Responses and Messages request builders accept unsigned summaries and omit absent signature state. Endpoint and model requirements still apply. A provider that requires its original signature may reject unsigned history. + +## Provider profiles + +The `thinking` profile only classifies text that Chat or Messages leaves unlabeled. It applies to provider output and to application-supplied continuation. OpenAI, Anthropic, Gemini, and Bedrock Responses and Messages use `summary`. vLLM, Together, OpenRouter, Fireworks, and Bedrock Chat use `raw`. The provider and selected client determine this profile. A base URL does not select it. + +A Responses summary projected into Chat or Messages loses its wire label. If returned as history through a raw profile, the next Responses request carries that text as `reasoning_text`. This applies to OpenRouter and Fireworks. Molto preserves the text without inferring how the provider will use it. + +The coordinator option `reasoning_representation` selects `raw` or `summary` only for translated routes whose client declares `REQUIRES_REASONING_REPRESENTATION`. The registered clients use fixed profiles. Native same-protocol requests bypass reasoning translation. + +## Chat fields and signatures + +Chat accepts both `reasoning_content` and `reasoning`. The configured nonempty field takes precedence when both occur. vLLM and Bedrock Chat default to `reasoning`. Other Chat clients default to `reasoning_content`. Set `chat_reasoning_field="reasoning_content"` on the Molto call for an older vLLM server. The selected spelling controls translated output and outgoing Chat history. + +When `extra_content.google.thought` is `true`, its associated content is reasoning. False or absent markers leave the text visible. Literal `` tags in normal content remain visible text. + +Use `chat_signature_namespace` to select the issuer's Chat extension. For example, `chat_signature_namespace="google"` maps `extra_content.google.thought_signature`. Gemini selects `google` by default. The namespace identifies the wire field. It does not establish that another provider accepts the token. Signed history or output projected into Chat requires a namespace. + +Within a contiguous reasoning run, Molto holds the latest message signature and keeps streaming reasoning text. It emits the signature at the next text or tool boundary, or at normal completion. Empty metadata does not close a run. A signature-only IR part directly before a tool call supplies that call’s signature. If two signature-only parts precede the call, the first carries message state. A message-only prefix immediately before an unsigned call uses the same position as a call signature and cannot distinguish those two attachments. Recorded Gemini tool calls supply their signature with the arguments. Gemini also sends a message signature after the last visible text chunk. Molto emits this trailing state at completion and restores it on the assistant message when it builds continuation. Text and tool output stream without waiting for a late message signature. + +Chat history can carry independent reasoning parts in separate assistant messages. Chat output has one message per choice. Streaming delivers the final signature for each run separately. OpenAI SDK 2.53.0 concatenates strings at the same extension path when it collects a choice, even across intervening text. Two runs that emit message signatures `B` and `D` therefore appear as `BD` in an SDK-collected message, including translated non-streaming Chat. Raw chunk iteration retains each value. Separate tool indices retain separate attachment paths. + +See [provider compatibility](provider-compatibility.md#replay-evidence) for the models, settings, and continuation evidence. diff --git a/docs/web-search.md b/docs/web-search.md index bf8315a..c6e4231 100644 --- a/docs/web-search.md +++ b/docs/web-search.md @@ -2,13 +2,13 @@ Molto preserves provider-hosted web search on native routes and translates basic search through Responses and Messages upstreams. Searches run at the provider, separately from client functions. -| Caller protocol | Responses upstream | Messages upstream | Chat upstream | -| ---------------- | ------------------------------------------- | ------------------------------------------- | ------------------------- | -| Responses | Native passthrough | Search, answer, and URL attribution | Rejected before transport | -| Messages | Search, answer, and reduced URL attribution | Native passthrough | Rejected before transport | -| Chat Completions | Mandatory search; signed reasoning rejected | Mandatory search; signed reasoning rejected | Native passthrough | +| Caller protocol | Responses upstream | Messages upstream | Chat upstream | +| ---------------- | ------------------------------------------- | ----------------------------------- | ------------------------- | +| Responses | Native passthrough | Search, answer, and URL attribution | Rejected before transport | +| Messages | Search, answer, and reduced URL attribution | Native passthrough | Rejected before transport | +| Chat Completions | Mandatory search | Mandatory search | Native passthrough | -Translated Chat cannot preserve reasoning signatures or encrypted reasoning. The OpenAI Responses streaming search recording contains encrypted reasoning, and Anthropic Messages search turns can contain signed thinking; these turns raise `ValueError("Chat Completions cannot preserve reasoning signatures.")`. Use Responses or Messages downstream to retain that output. Search without reasoning or with unsigned reasoning remains representable; the provider profile classifies Chat reasoning as raw text (`vllm`) or a summary (`openai`, `anthropic`). Provider support for hosted search is separate. Rejection depends on the returned reasoning data, not whether search was requested. Native Chat passthrough is unaffected. +The OpenAI Responses search recording contains encrypted reasoning, and Anthropic Messages search turns can contain signed thinking. To receive this state through translated Chat, supply `chat_signature_namespace` for the continuation issuer. Without that option, signed output raises a translation error. See [Reasoning and signatures](reasoning.md). Messages callers receive translated URL citations with `Molto.messages(..., citation_policy="buffer")`, or with `citation_policy="auto"` when the normalized request declares hosted search or carries search or citation history. The default `"drop"` streams text without citations; native Messages passthrough preserves citations under every policy. @@ -33,7 +33,7 @@ Omitted options remain omitted; native options pass through unchanged. Without a `extra_body` and `extra_headers` are opaque upstream request extensions, merged by the provider SDK after Molto constructs its request. They never guide routing, normalization, request translation, or output projection. Headers are filtered once at the credential boundary before forwarding. Translation guarantees cover the normalized request; callers supplying `tools`, `input`, `include`, or `web_search_options` through `extra_body` opt out of those guarantees for the extensions. Normalized search declarations, selections, and history (search calls, results, and cited text) remain rejected on translated Chat upstreams. A caller can enable search through `extra_body.web_search_options` on a Chat upstream: Molto forwards it verbatim, transport proceeds, and the translated Chat projection drops any returned annotations. -Replacing tools does not change reasoning projection: Chat rejects signed or encrypted reasoning whether search was declared, injected, disabled, or absent. +Tool overrides do not change the signature namespace used for Chat output. Responses and Messages preserve automatic, disabled, required, and supported named selection. Translated Chat requests require hosted search specifically, using Responses required `allowed_tools` restricted to search or Messages named `web_search` selection. Conflicting explicit Chat tool choices are rejected on translated routes. A client function named `web_search` remains distinct from hosted search, but Messages cannot select between them by name; rename the function when using named selection. @@ -100,7 +100,7 @@ Buffering increases text latency and changes chunk boundaries. All policies reta Each buffered Messages text block starts with empty text and its citations, then emits the full block text in one `text_delta` before stopping. This preserves compatibility with the Anthropic SDK's `text_stream` iterator. -Translated Chat omits structured annotations in both modes. It preserves actual answer text and existing inline links, without inserting replacement citations or narration. Signed or encrypted reasoning raises the error described above, including signature-only parts without visible reasoning text. Unsigned reasoning follows the existing protocol restrictions. +Translated Chat omits structured annotations in both modes. It preserves the answer text and existing inline links. ## Search activity and results diff --git a/python/ARCHITECTURE.md b/python/ARCHITECTURE.md index 3699b28..d3ebe03 100644 --- a/python/ARCHITECTURE.md +++ b/python/ARCHITECTURE.md @@ -10,28 +10,30 @@ Three upstream endpoints are implemented: - `chat/completions`: native Chat Completions passthrough or cross-protocol translation through Chat Completions; - `messages`: native Anthropic Messages passthrough or translated through the normalized representation. -Native same-protocol and cross-protocol routes support streaming and non-streaming requests. Cross-protocol routes cover text, portable image input, raw reasoning, reasoning summaries between Responses and Messages, function tools, tool calls and results, conversation history, prompt-cache intent, lifecycle metadata, and token usage. Translated output through Chat supports unsigned raw reasoning and summaries; present signatures remain unsupported because Chat has no signature field. Request normalization preserves unsigned summary history. Chat upstreams accept its text, while Responses and Messages upstream builders still require signatures. +Native and translated routes support streaming and non-streaming requests for text, portable image input, reasoning, tools, conversation history, prompt-cache intent, lifecycle metadata, and usage. See [Reasoning and signatures](../docs/reasoning.md) for the protocol mapping and continuation contract. ## Route configuration `endpoint`, `provider`, and `base_url` are independent: -| Concept | Purpose | -| ---------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `endpoint` | Selects the upstream wire protocol and client: `responses`, `chat/completions`, or `messages`. | -| `provider` | Identifies the implementation serving that protocol and selects its `ProviderCapabilities`: `openai`, `anthropic`, or `vllm`. | -| `base_url` | Selects only the HTTP destination. | +| Concept | Purpose | +| --- | --- | +| `endpoint` | Selects the upstream wire protocol and client: `responses`, `chat/completions`, or `messages`. | +| `provider` | Identifies the implementation serving that protocol and selects its `ProviderCapabilities`: `openai`, `anthropic`, `vllm`, or an explicit hosted-provider profile. | +| `base_url` | Selects only the HTTP destination. | Molto never derives provider behavior from a URL hostname. When `provider` is omitted, the coordinator uses the canonical implementation for the selected endpoint as a convenience default: OpenAI for Responses and Chat Completions, and Anthropic for Messages. An explicit provider overrides that default without changing the endpoint, while an explicit base URL changes neither the protocol nor the capability profile. ### Endpoint selection belongs to the coordinator -Each upstream client implements one upstream wire protocol. A client must not switch or override the selected endpoint to accommodate a provider's supported protocols. Implement provider-specific clients only for protocols that the provider supports, reusing the existing protocol client where possible. For example, if Together AI supports only Chat Completions, implement `TogetherAIChatCompletionsClient`; do not implement a Responses client that silently sends Chat Completions requests. +Each upstream client implements one upstream wire protocol. A client must not switch or override the selected endpoint to accommodate a provider's supported protocols. Implement provider-specific clients only for protocols that the provider supports, reusing the existing protocol client where possible. For example, `GeminiChatCompletionsClient` sends Chat Completions requests; it must not present itself as a Responses client. -Any desired provider-specific endpoint default, forced switch, or override belongs in the `Molto` coordinator. Resolve the effective upstream endpoint before selecting the client and deciding between native passthrough and translation. The coordinator must preserve its downstream protocol contract: a Responses request routed through `TogetherAIChatCompletionsClient` uses the Responses adapter and normalized translation path. +Any desired provider-specific endpoint default, forced switch, or override belongs in the `Molto` coordinator. Resolve the effective upstream endpoint before selecting the client and deciding between native passthrough and translation. The coordinator must preserve its downstream protocol contract: a Responses request routed through `GeminiChatCompletionsClient` uses the Responses adapter and normalized translation path. This defines ownership of any future routing policy; it does not introduce automatic endpoint switching. The current explicit-provider behavior described above remains unchanged. +Each supported `(provider, endpoint)` route has an explicit class in `upstream/registry.py`, including thin subclasses where the shared implementation is sufficient. Prefer Responses for a model and capability it supports, then Messages, then Chat Completions. Together, Fireworks, and Bedrock each have separate Responses and Chat Completions classes; Bedrock also has a Messages class for Claude. OpenRouter uses Responses and Gemini uses Chat Completions. Each class remains single-protocol, and registering a provider does not establish support for its entire model catalog. Existing canonical OpenAI/Anthropic clients and vLLM routes remain available. Native and translated requests require a registered pair, even with an explicit base URL. Unregistered pairs fail before HTTP; registered clients retain their credentials, destination defaults, and explicit overrides. SDK resource paths are appended to the selected base URL unchanged. The coordinator never switches endpoints. Provider classes own their default destination, required credential name, and protocol-specific capability adjustments; the coordinator resolves configured credentials and explicit overrides. Bedrock requires an explicit regional destination. Its Messages client reuses the Anthropic protocol implementation with Bedrock API-key authentication and a runtime or Mantle base URL ending in `/anthropic`; the SDK appends `/v1/messages`. Claude thinking-capability lookup recognizes `claude-...` regardless of preceding provider, route, or inference-profile prefixes, leaving the wire model unchanged. + ## Architectural goal The long-term goal is for Molto to be a drop-in protocol and SDK compatibility layer without implementing a translator for every provider pair. @@ -66,7 +68,7 @@ Downstream X protocol Downstream X events ``` -Each downstream protocol should require one adapter and each upstream protocol should require one client. Composition then grows approximately as N + M implementations instead of N x M pairwise translators. +Each downstream protocol has one adapter, and each upstream protocol has a shared client implementation with provider-specific subclasses. The subclasses inherit transport and normalization unless a provider difference requires an override. The shared Responses and Chat Completions implementations are `ResponsesClient` and `ChatCompletionsClient`; the OpenAI clients are provider subclasses like any other. Shared clients ignore output extensions they do not model, and a provider client validates only the extensions and contract it knows. Translation still composes adapters and clients instead of adding pairwise translators. The native protocol passthrough is an identity optimization to this model. When the two protocols are identical, crossing the IR would only reduce fidelity. Cross-protocol routes still compose adapters and clients through the normalized representation. @@ -76,7 +78,7 @@ Cross-protocol translation follows one governing principle: Molto is strict duri - Normalized outputs are open to provider extensions. - Retaining unknown output data does not authorize projecting it into another protocol. -Documented exceptions allow omission at protocol boundaries. Chat Completions and Messages may omit optional Responses output-item IDs because they have no equivalent and do not affect model behavior. Messages silently drops caller-defined prompt-cache keys because Anthropic computes cache identity implicitly; dropping a key does not enable caching, and remaining cache options are processed independently. Translated Responses routes may ignore `include=["reasoning.encrypted_content"]` because Molto already preserves any encrypted reasoning present in the response, `include=["web_search_call.action.sources"]` because Molto requests and projects search sources whenever hosted search is declared, and `store=false` because it requests no provider-side state; `store=true` remains unsupported. Native passthrough forwards these fields unchanged. Responses preserves output-item IDs, including on marked assistant history. Both OpenAI protocols preserve cache keys. Portable call identities such as `ToolCall.tool_call_id` remain lossless-or-rejected. +Documented exceptions allow omission at protocol boundaries. Chat Completions and Messages may omit optional Responses output-item IDs because they have no equivalent and do not affect model behavior. Messages silently drops caller-defined prompt-cache keys because Anthropic computes cache identity implicitly; dropping a key does not enable caching, and remaining cache options are processed independently. Translated Responses routes may ignore `include=["reasoning.encrypted_content"]` because Molto already preserves any encrypted reasoning present in the response, `include=["web_search_call.action.sources"]` because Molto requests and projects search sources whenever hosted search is declared, and `store=false` because it requests no provider-side state; `store=true` remains unsupported. Responses request normalization also omits the `format="unknown"` label on raw-only reasoning history, which names no encoding; other formats are rejected. Native passthrough forwards these fields unchanged. Responses preserves output-item IDs, including on marked assistant history. Both OpenAI protocols preserve cache keys. Portable call identities such as `ToolCall.tool_call_id` remain lossless-or-rejected. Every semantic rejection while normalizing or projecting a cross-protocol request raises `UnsupportedInput`, a `ValueError` subclass. Protocol schema validation on translated routes remains owned by the corresponding Pydantic request model and retains its native validation errors. Molto's local public request models inherit from `ExcludeNoneModel` and reject unknown fields by default. Native routes bypass this validation. Output and event validation errors are not `UnsupportedInput`. @@ -107,9 +109,9 @@ The layers have distinct ownership: | Layer | Owns | Must not own | | --- | --- | --- | | `core.py` (`Molto`) | Public orchestration facade, protocol coordinators, route selection, composition, credentials | Provider-specific field transformations | -| `providers.py` | Provider names, endpoint defaults, and immutable capability profiles | Wire-protocol schemas or HTTP destinations | +| `providers.py` | Provider names, default protocol-to-provider selection, and immutable capability profiles | Wire-protocol schemas or HTTP destinations | | `adapters/` | Downstream native request to normalized request; normalized events to downstream-native events; projected native events to a complete downstream-native response | HTTP transport | -| `upstream/` | Upstream request construction, provider SDK stream integration, compatibility validation where required, upstream response normalization | Downstream response formatting | +| `upstream/` | Explicit provider/protocol client registry, destination/authentication defaults, upstream request construction, provider SDK stream integration, compatibility validation, and upstream response normalization | Downstream response formatting | | `types/normalized.py` | Provider-neutral schemas and validation for request content, response parts, deltas, lifecycle metadata, and usage | Protocol conversions, transport, or SDK lifecycle objects | | `types/openai_*.py` | OpenAI request schemas, SDK-native result aliases, and narrow compatibility validators | Cross-protocol orchestration | @@ -148,6 +150,8 @@ Each implemented coordinator performs the following work: 5. Select the upstream path from `endpoint`. 6. Return either an async iterator of downstream SDK event models or the downstream SDK response model. +A client can declare `REQUIRES_REASONING_REPRESENTATION` when translation needs a caller-selected raw/summary classification. For a flagged translated route, the keyword-only coordinator option `reasoning_representation` must be `"raw"` or `"summary"` before normalization or HTTP. The coordinator replaces only `thinking` on one immutable resolved profile and passes that same profile to the adapter and client. Native passthrough is exempt; unflagged clients retain their fixed profile, and the option never enters the wire body. Raw classification preserves the original signature. No production client currently enables this flag; Bedrock Chat uses raw classification for the recorded Mantle model. + Every coordinator also accepts request-scoped `extra_body` and `extra_headers` as opaque request extensions sent to the upstream. The selected provider SDK merges them into the final upstream request only after Molto has built it. Molto must never consult these extensions when choosing a route, normalizing input, constructing or translating a request, or projecting output. They must not influence any other Molto logic except the header filtering at the credential boundary described below. Translation guarantees are defined over the normalized request; callers who supply `tools`, `input`, `include`, or `web_search_options` through `extra_body` opt out of those guarantees for those extensions. The sole exception is that the facade filters `extra_headers` once at the credential boundary, removing credential and account-selector headers, hop-by-hop headers, ingress transport headers, and any header named in `Connection` before forwarding. The provider SDK then constructs its own authentication and transport headers. This filtering does not make extra headers inputs to translation or request construction. @@ -255,7 +259,7 @@ OpenAIChatCompletionsAdapter.project_events() ChatCompletionChunk SDK stream ``` -`reasoning_content` is a provider extension to the OpenAI Chat schema, but the field itself does not distinguish raw reasoning from a reasoning summary. Molto models the extension only on assistant messages and uses `ProviderCapabilities.thinking` to classify it. OpenAI classifies it as a summary and vLLM as raw reasoning. Responses events already distinguish `response.reasoning_text.*` from `response.reasoning_summary_*`; their explicit event types remain authoritative. Output normalization and projection tolerate unsigned summaries, including those received through Chat. Request normalization preserves unsigned summary history, and Chat upstream construction accepts its text. Present signatures remain unrepresentable in Chat; Responses and Messages upstream construction still requires signatures for summary history. These destination checks run before transport and do not change native passthrough. +Chat accepts `reasoning` and `reasoning_content`. Its selected field name, signature namespace, and raw/summary classification are independent settings. Responses always uses explicit wire labels. See [Reasoning and signatures](../docs/reasoning.md). ## Normalized request model @@ -273,7 +277,7 @@ ChatCompletionChunk SDK stream Assistant conversation history uses one strict `AssistantInput` per source message, containing ordered `Thinking`, `TextOutput`, `ToolCall`, `SearchCall`, and `SearchResult` parts and an optional Responses message ID. Standalone Responses reasoning and function-call items remain top-level `Thinking` and `ToolCall` values. Hosted search calls and linked results can likewise be top-level history parts. `TextOutput` is an assistant part, not a top-level request item. This retains both the enclosing message boundary and its ordered content. `AssistantInput.id` supplies the history message ID; IDs on nested `TextOutput` parts are retained output metadata and are not used when projecting history. -Native request projection always expresses user text as a protocol content-part list: Responses uses `input_text`, Chat Completions uses `text`, and Anthropic Messages uses a `text` block. In the normalized representation, one `UserInput` corresponds to exactly one user message and each child `TextInput` corresponds to one ordered text part. Adapters and clients must not merge or split either boundary. Provider-specific part discriminators remain at the wire boundary. Assistant text parts follow the same rule: multiple text parts remain in one message, and adjacent assistant messages remain separate. Messages can retain any supported assistant part order. Within one explicit assistant message, Chat accepts runs of reasoning, text, and tool-call parts in that order, with any run optional. Adjacent reasoning parts concatenate in order with a newline separator; text parts retain their array boundaries and markers, and tool calls retain distinct array entries and IDs. Chat rejects reasoning after text or calls and text after calls rather than splitting or reordering the message. This grouping never merges separate explicit assistant messages. Responses has standalone reasoning and call items, so projecting a mixed assistant message emits contiguous text runs as messages interleaved with those items. +Native request projection always expresses user text as a protocol content-part list: Responses uses `input_text`, Chat Completions uses `text`, and Anthropic Messages uses a `text` block. In the normalized representation, one `UserInput` corresponds to exactly one user message and each child `TextInput` corresponds to one ordered text part. Adapters and clients must not merge or split either boundary. Provider-specific part discriminators remain at the wire boundary. Assistant text parts follow the same rule: multiple text parts remain in one message, and adjacent assistant messages remain separate. Messages can retain any supported assistant part order. Within one explicit assistant message, Chat accepts leading reasoning followed by any interleaving of text and tool-call parts. It groups text and calls into separate fields, preserving order within each field while losing their interleaving. Independent reasoning parts use separate Chat assistant entries; text parts retain their array boundaries and markers, and tool calls retain distinct array entries and IDs. Chat still rejects reasoning after text or calls. This grouping never merges separate explicit assistant messages. Responses has standalone reasoning and call items, so projecting a mixed assistant message emits contiguous text runs as messages interleaved with those items. Responses and Chat Completions also project every normalized instruction as a `developer` message with one text part, whether or not it has a cache breakpoint. Markers remain attached only to their marked parts. @@ -327,13 +331,13 @@ For the text, reasoning, and function-tool paths: - `PartEndEvent` carries the complete reasoning, text, or function call accumulated from the deltas; - `ResponseEndEvent` carries terminal metadata, a required provider-neutral `TerminationReason` literal, an optional matched stop sequence, and normalized usage. The literal includes `unknown` for an incomplete response whose cause is unavailable. -A reasoning part with no content, summary, signature, or deltas carries nothing to translate; upstream clients omit its part lifecycle from the stream rather than emitting empty `Thinking` bookends, and surviving parts are reindexed so normalized indices stay dense. Recorded providers never produce such parts. +Responses preserves empty reasoning items and their IDs. An empty Messages thinking block is deferred until it carries text or state. A Chat chunk without content or a signature does not start a thinking part. Chat's role chunk starts the first part but its empty content is not emitted as a delta. Reasoning and text may interleave, so each transition between them — in either direction — ends the active part and starts a new one. A finish reason ends the active part. Usage can arrive in a later chunk, so the response ends only after the upstream SDK stream has been consumed. Chat does not expose an end marker for each indexed tool call. Molto treats calls as contiguous: a new call index closes the preceding call, and a later delta cannot resume a closed index. This keeps normalized, Responses and Messages content-block lifecycles balanced without buffering calls. -The normalized representation preserves the distinction that ambiguous wire protocols omit: `Thinking.content` and `ThinkingDelta.content_delta` contain raw reasoning, while `Thinking.summary` and `ThinkingDelta.summary_delta` contain a summary. Chat Completions `reasoning_content` and Messages `thinking_delta` are classified by the resolved provider capability profile. Every downstream adapter accepts the normalized representation selected by that profile; Chat Completions and Messages then emit it through their protocol's single reasoning field, while Responses retains the distinction with separate reasoning-text and reasoning-summary lifecycles. +`Thinking.content` and `Thinking.summary` are independent. Responses retains both and their separate text lifecycles. A Chat or Messages history builder selects raw content first. Its streaming projector selects the first nonempty representation for each part, including when building a non-streaming response. Opaque reasoning state is represented as snapshots, not text. `Thinking.signature` carries the state observed at part start or part end, and `ThinkingDelta.signature_delta` replaces the prior snapshot instead of appending to it. Empty Responses `encrypted_content` normalizes to no signature and does not produce a signature delta. Responses exposes three encrypted snapshots for a reasoning item (`output_item.added`, `output_item.done`, and terminal response output), while Messages exposes only a thinking-block start signature and a later signature delta. Molto preserves the first two by mapping `added` to part start and `done` to the replacement delta; a translated terminal Responses item reuses the `done` snapshot rather than buffering the stream to reproduce a third ciphertext. @@ -347,7 +351,7 @@ The normalized termination reason maps shared semantics explicitly: normal compl `SearchCall` and `SearchResult` use the existing part lifecycle and link by call identity. They are assistant history/output parts. An unfinished call may have no result, and a search error does not determine overall termination. Responses folds a call and result into one item; Messages emits separate server-tool blocks. -Chat projection rejects reasoning signatures and encrypted reasoning based on output data, including signature-only parts. Search declarations and transport overrides do not change that rule; turns without reasoning or with unsigned reasoning remain representable. +A Chat projection with signed reasoning requires a signature namespace, including during hosted search. Search declarations and transport overrides do not select this namespace. `TextOutput.citations` holds `WebCitation` ranges local to each text part. `CitationDelta` adds attribution, and the final snapshot is authoritative. Citation buffering belongs to the Messages adapter, exposed by the `Molto.messages()` argument `citation_policy`, which accepts `"buffer"`, `"auto"`, or `"drop"`. With Responses upstream, the default `"drop"` streams text and discards attribution; `"buffer"` waits for every text part's completed snapshot, including uncited text, before splitting it at citation boundaries. `"auto"` buffers when the normalized request declares hosted search or carries search calls, search results, or text with citations in its history; otherwise text streams and unexpected citations are dropped. The coordinator selects `"drop"` for Chat upstream regardless of the requested policy, preserving immediate text streaming and chunk boundaries because Chat normalization discards annotations. The policy never changes request construction or native passthrough. The Responses normalizer and Messages projector buffer unresolved search parts in start order, allowing ordinary parts to stream when they reach the front. No upstream client predicts citation buffering, and opaque extensions cannot influence it. The `"auto"` policy inspects only the normalized request; callers supplying search context only through `extra_body` must explicitly select `"buffer"` for attribution. Projection assigns output indices because parts can expand or disappear. @@ -435,9 +439,7 @@ Response and stream result types are intentional SDK aliases: - `OpenAIChatCompletionsResponse` aliases the SDK `ChatCompletion`; - `OpenAIChatCompletionsStreamChunk` aliases the SDK `ChatCompletionChunk`. -Molto does not subclass or duplicate these result models. The SDK already owns the wire schema, and aliases avoid schema drift while giving callers familiar types. - -Two members of the Responses event union are intentionally replaced rather than aliased: `OpenAIResponseCompletedEvent` normalizes a `null` `cache_write_tokens` to `0`, and `OpenAIResponseFunctionCallArgumentsDoneEvent` relaxes the SDK's required `name` on the function-call-arguments-done event. Assert these unions by comparing wrapped members with the SDK union rather than asserting identity. +SDK result aliases keep native passthrough aligned with the installed SDK. For strict validation of recorded response bodies, `OpenAICompatibleResponsesResponse` accepts an omitted or null cache-write count as `None`. Each Responses event that contains a response uses the same model. The function-call-arguments-done model also accepts an omitted `name`. Molto does not recreate or expose the OpenAI SDK's transport-bearing `AsyncStream` runtime object. It context-manages the SDK stream internally and exposes a Molto-owned async iterator that yields SDK-native Responses events and Chat Completions chunks directly. @@ -453,9 +455,9 @@ Each OpenAI upstream client constructs a short-lived `AsyncOpenAI` wrapper with: An absent vLLM key resolves to the fixed non-secret `EMPTY` credential. OpenAI organization and project environment settings are suppressed so compatible-provider requests cannot leak OpenAI account metadata. -The SDK owns request serialization, authentication, HTTP, SSE decoding, terminal markers, retries, error types, and native model construction for both protocols. Recognized errors on every route follow the [error translation](../docs/errors.md) contract; unknown SDK errors pass through unchanged. Before directly yielding a Responses completion event, Molto narrowly normalizes the compatible-provider omission where `cache_write_tokens` is `None` to `0`. +The SDK owns request serialization, authentication, HTTP, SSE decoding, terminal markers, retries, error types, and native model construction for both protocols. Recognized errors on every route follow the [error translation](../docs/errors.md) contract; unknown SDK errors pass through unchanged. Native Responses preserves missing cache-write counts. -Translated clients build one validated upstream-native request model and pass it directly to native transport. Serialization at the SDK boundary retains the translated request models' unset/`None` exclusions. Native passthrough retains the supplied request dictionary, including explicit nulls. +Translated clients build one validated upstream-native request model and pass it directly to native transport. Serialization at the SDK boundary retains the translated request models' unset/`None` exclusions. Native passthrough retains the supplied request dictionary, including explicit nulls. The Fireworks and Gemini Chat clients, whose input endpoints reject null top-level message fields, omit those fields on native and translated routes and leave nested values unchanged. Native transport separates SDK body parameters from unknown top-level properties. It sends unknown properties through the SDK's `extra_body`, with explicit coordinator `extra_body` values taking precedence. Names such as `extra_headers`, `extra_body`, `extra_query`, and `timeout` inside the request body remain body properties; they cannot become SDK transport options. Nested request properties pass through the SDK's native serialization without Molto schema filtering. @@ -505,7 +507,7 @@ Matched public-route conversations carry actual returned SDK output cumulatively ## Current limitations and extension path -The current public paths support native and translated streaming and non-streaming responses for text, portable image input, raw reasoning, reasoning summaries between Responses and Messages, and client-defined function tools. Output through Chat Completions supports unsigned raw reasoning and summaries, but rejects present signatures. Request normalization preserves unsigned summary history. Chat upstreams accept its text, while Responses and Messages upstream builders still require signatures. Function-tool support includes definitions, selection, parallel-call control, successful results, conversation history, and streamed JSON arguments. Native routes preserve hosted web search. Basic hosted search translation is supported through Responses and Messages upstreams, with text-only projection for downstream Chat when reasoning is absent or unsigned; signed or encrypted reasoning raises an error; translated Chat upstreams reject normalized search declarations and history, while opaque `extra_body.web_search_options` is forwarded and returned annotations are dropped. Other hosted tools, failed client-function result semantics outside Messages, other multimodal content, and additional provider capabilities are not complete yet. The matched Responses/Messages fixtures also map the reconstructible opaque reasoning snapshots under the assumption that OpenAI serves both endpoints; opaque state is not portable across providers, the implementation does not enforce its issuer, and the separately recorded terminal Responses ciphertext is not byte-reconstructible through Messages. +The public paths support text, portable image input, reasoning, client-defined functions, streamed arguments, and successful tool results. Native routes preserve hosted web search. Basic search translation supports Responses and Messages upstreams. Chat output omits hosted activity and structured citations, and requires a signature namespace for signed reasoning. Chat upstreams reject normalized search declarations and history. The implementation does not validate the issuer of opaque state. See [Reasoning and signatures](../docs/reasoning.md) and [Hosted web search](../docs/web-search.md). Function and hosted-search definitions and tool selection use provider-neutral normalized types. Protocol-specific function schemas and tool-choice shapes remain at their adapters and clients. @@ -519,3 +521,11 @@ To add another upstream protocol: 4. add cassette-backed parity tests against the downstream SDK contract. To add another downstream protocol, add an adapter that normalizes its request and projects normalized events without performing transport. + +## Hosted compatibility boundaries + +Hosted clients inherit the shared protocol implementation and override observed provider differences. Gemini repairs missing tool indices by call ID or the sole known call. Already-indexed native calls pass through. The shared Chat implementation carries signatures through the configured namespace, including the observed Gemini message signature that follows its text. See [provider compatibility](../docs/provider-compatibility.md). + +Provider conversations share `tests/upstream/test_multi_turn.py` and scenario-first `upstream_ir/` cassette names. Tests reuse actual output as history and compare independent SDK semantics. Configuration tests do not establish live provider compatibility. + +OpenRouter accepts `format="unknown"` on raw-only Responses items. Other formats and formatted signed or summarized reasoning require an encoding contract. Fireworks uses the shared Responses parser and builder. All Responses clients preserve the explicit raw and summary labels. diff --git a/python/CONVENTIONS.md b/python/CONVENTIONS.md index 9a9e159..2e8826e 100644 --- a/python/CONVENTIONS.md +++ b/python/CONVENTIONS.md @@ -32,7 +32,11 @@ Keep these three concepts separate: - `provider` identifies the serving implementation and selects its capability profile; and - `base_url` selects only the HTTP destination. -Do not treat an endpoint or URL hostname as evidence about provider behavior. A coordinator may supply a documented canonical provider when the caller omits one, but an explicit provider must override that convenience default independently of the endpoint and base URL. Keep provider capabilities in the single `PROVIDER_CAPABILITIES` registry and pass the resolved profile explicitly to adapters and clients. +Do not treat an endpoint or URL hostname as evidence about provider behavior. A coordinator may supply a documented canonical provider when the caller omits one, but an explicit provider must override that convenience default independently of the endpoint and base URL. Keep shared provider profiles in `PROVIDER_CAPABILITIES`; resolve protocol-specific adjustments through the selected client's `resolve_capabilities()` and pass that resolved profile explicitly to adapters and clients. + +Add one explicit client per supported provider/protocol pair. Each client implements exactly one protocol. Prefer Responses when it supports the desired model and capabilities, then Messages, then Chat Completions; add separate clients when another protocol is needed for model coverage. Thin subclasses are appropriate when the shared protocol implementation is sufficient. Keep destination and credential defaults on the provider client, while `Molto` resolves configured credentials and request overrides. Inherit common protocol behavior and override only demonstrated provider differences. Extend `tests/upstream/test_multi_turn.py` with actual provider recordings instead of creating a parallel conversation suite or replaying another provider's fixtures as provider evidence. + +All Responses and Chat providers inherit their shared protocol clients. Translate known extensions there when the wire contract is shared. Keep provider-specific format checks and native transport adjustments in their provider subclasses. Keep upstream clients specific to one supported wire protocol; never switch or override endpoints inside a client. Any desired endpoint override belongs in `Molto`, before client selection and the native-versus-translated route decision. See [endpoint selection ownership](ARCHITECTURE.md#endpoint-selection-belongs-to-the-coordinator). @@ -107,7 +111,7 @@ kind: Annotated[ Keep all field default assignments outside `Annotated`; do not pass defaults such as `default=None` to `Field`. -Local protocol request models inherit from `ExcludeNoneModel`, which rejects unknown fields. Native Molto model inputs and translated upstream requests use their `model_dump()` so unset and `None` values do not become unintended provider parameters. Do not recover extras discarded by model serialization. Native request dictionaries bypass these models and retain unknown fields and explicit nulls. +Local protocol request models inherit from `ExcludeNoneModel`, which rejects unknown fields. Native Molto model inputs and translated upstream requests use their `model_dump()` so unset and `None` values do not become unintended provider parameters. Do not recover extras discarded by model serialization. Native request dictionaries bypass these models and retain unknown fields and explicit nulls. Chat message history also retains explicit nulls when serialized from a Molto model. A provider client whose input endpoint rejects them sets `OMIT_NULL_MESSAGE_FIELDS`, which omits null top-level message fields on native and translated routes and leaves nested values unchanged; only Fireworks and Gemini do. The cross-protocol contract is: Molto is strict during input validation but lenient during output handling. Every accepted input field must be effected, and any output stemming from an accepted input set must be tolerated. Apply it through these rules: @@ -123,7 +127,7 @@ Never raise `UnsupportedInput` from `native_events()` or `native_response()`: th ## Normalized content and events -Use explicit semantic content types and discriminated unions. In particular, one user message is a `UserInput` containing ordered `TextInput` and `ImageUrlInput` parts. One assistant-history message is an `AssistantInput` containing ordered `Thinking`, `TextOutput`, `ToolCall`, `SearchCall`, and `SearchResult` parts; do not encode roles as content-part metadata. Preserve explicit assistant boundaries and per-part markers. Keep standalone Responses reasoning and function calls as top-level items. A Responses projection emits contiguous text runs from mixed assistant content as messages interleaved with standalone reasoning and calls. Within one explicit assistant message, Chat accepts reasoning, text, and tool-call runs in that order. Adjacent reasoning parts concatenate with a newline separator; text parts retain their boundaries and markers, and tool calls retain distinct IDs. Never merge separate explicit assistant messages. Reject reasoning after text or calls and text after calls rather than splitting or reordering the message. These request containers do not change the normalized output-event grammar. +Use explicit semantic content types and discriminated unions. In particular, one user message is a `UserInput` containing ordered `TextInput` and `ImageUrlInput` parts. One assistant-history message is an `AssistantInput` containing ordered `Thinking`, `TextOutput`, `ToolCall`, `SearchCall`, and `SearchResult` parts; do not encode roles as content-part metadata. Preserve explicit assistant boundaries and per-part markers. Keep standalone Responses reasoning and function calls as top-level items. A Responses projection emits contiguous text runs from mixed assistant content as messages interleaved with standalone reasoning and calls. Within one explicit assistant message, Chat accepts leading reasoning followed by any interleaving of text and tool calls. It groups text into `content` and calls into `tool_calls`, preserving order within each field but losing their relative order. Keep independent reasoning parts in separate Chat assistant entries; text parts retain their boundaries and markers, and tool calls retain distinct IDs. Never merge separate explicit assistant messages. Reject reasoning text after text or calls within an explicit message; shared text/tool grouping does not relax reasoning-order validation. These request containers do not change the normalized output-event grammar. Streaming is the primitive. Upstream clients emit normalized lifecycle, part, and delta events; downstream adapters project those events. A single normalized event may produce multiple native lifecycle events. @@ -131,13 +135,9 @@ Complete cross-protocol responses must reuse the complete streaming projection p Preserve chunk boundaries when they are observable and covered by parity tests. Do not turn an empty role-establishment chunk into a text delta. -Store raw reasoning in `Thinking.content` and `ThinkingDelta.content_delta`. Store reasoning summaries in `Thinking.summary` and `ThinkingDelta.summary_delta`. Responses wire events label these representations explicitly; preserve that label and require it to match `ProviderCapabilities.thinking`. Chat Completions `reasoning_content` and Messages `thinking_delta` are ambiguous, so classify them with the same capability. Project only the matching normalized representation into each protocol's reasoning field. - -A Responses reasoning output lifecycle must use exactly one representation: raw reasoning content with no summary or signature, a reasoning summary with optional signature and no raw content, or a signature with no reasoning summary or raw content. Preserve that representation across its start, delta, and end state; do not combine or switch representations during the part lifecycle. A completely empty start may remain deferred until its representation is known. +Keep raw content, summary text, and opaque reasoning state independent. Use `thinking` only to classify unlabeled Chat or Messages input. Follow explicit Responses labels on input and retain both representations on output. Shared Responses and Messages request builders accept unsigned summaries. -Chat Completions reasoning has no signature and may represent either raw reasoning or a summary according to the provider capability profile. Responses and Messages output processing tolerates missing summary signatures and preserves observed opaque state. Chat output may carry unsigned raw reasoning or summaries but rejects present signatures rather than discarding them. Request normalization preserves unsigned summary history and any supplied signature. Upstream request builders own destination constraints: Chat accepts unsigned summary text but rejects signatures, while Responses and Messages require signatures for summary history. Accepting summary text does not restore opaque continuation state. Keep these checks in the upstream builders rather than the downstream adapters or provider-neutral normalized models; native passthrough remains unchanged. - -Treat `ThinkingDelta.signature_delta` as a complete replacement snapshot of provider-specific opaque state. Never concatenate it with `Thinking.signature`. +For complete Chat and Messages history parts, use raw content when present and otherwise use the summary. Stream only the first nonempty representation per part. Preserve signature replacement and attachment boundaries independently. See [Reasoning and signatures](../docs/reasoning.md). Map prompt-cache intent according to the [shared cache policy](../docs/README.md#prompt-caching). Keep positional markers in `CacheBreakpoint` on supported content parts, and use `NormalizedRequest.iter_cache_breakpoints()` for shared traversal. OpenAI marker presence resolves omitted mode and lifetime to implicit and `30m`; Messages maps that lifetime to `1h` for blocks and automatic caching. Explicit mode preserves markers while omitting automatic caching. Anthropic block-only input selects explicit mode. OpenAI projects every explicit request or block lifetime as one request-wide `30m` TTL, preserving mode and marker positions. This rounds `5m` up but weakens the requested `1h` minimum and collapses mixed lifetimes. Leave an omitted lifetime unspecified unless another explicit lifetime supplies the shared TTL; do not synthesize retention to approximate a minimum lifetime. Document retention and pricing differences. @@ -147,6 +147,8 @@ Map usage semantically and construct the public usage payload explicitly. This p ## Same-protocol passthrough +Require an explicitly registered `(provider, endpoint)` pair for native and translated routes, including requests with an explicit base URL. Reject unregistered pairs before HTTP. Preserve the registered client's credentials, destination defaults, and explicit overrides. Do not infer a different endpoint or rewrite an explicit base URL. Gemini repairs only missing native tool indices using call identity; already-indexed chunks bypass Molto index/identity validation, with no guarantee against mixed-stream collisions. + When downstream and upstream use the same protocol, preserve the native protocol instead of round-tripping through the normalized IR. - Preserve the request dictionary, including unknown properties, nested extensions, and explicit nulls, without validating it against Molto's protocol model. @@ -172,7 +174,7 @@ Propagate closure through every intermediate iterator as well. An `async for` lo Let the SDK own request serialization, authentication, HTTP, SSE decoding, terminal markers, retries, non-success responses, and OpenAI exception construction. Preserve the original SDK exception for unknown errors. Map only the known semantic errors covered by the documented error translation contract, on native and translated routes alike; do not add compatibility wrappers for the previous `httpx` errors. -Yield SDK Responses events and `ChatCompletionChunk` models directly to avoid duplicate serialization and validation on every event or delta. Before yielding a Responses completion event, normalize the documented compatible-provider omission where `cache_write_tokens` is `None` to `0`. Do not rewrite an accurate cassette merely to satisfy a newer SDK schema. +Yield native SDK Responses events and Chat chunks directly. Preserve unknown cache-write counts as `None` throughout translation. Keep an explicit zero distinct. ## Unsupported semantics @@ -180,7 +182,7 @@ Avoid rejecting inputs based on provider restrictions that may change, such as c Reject unsupported roles, content parts, request modes, and event types explicitly. Never silently drop a field that changes request meaning. This rule is aspirational for the Messages client's stream loop: it inspects only the six handled `RawMessageStreamEvent` types and silently ignores any other variant (documented in the [Messages guide](../docs/protocols/anthropic-messages.md)), diverging from the Responses client, which raises for unknown stream events. Tightening the Messages path is tracked future work. Retaining a value in `extra_fields` is not evidence that an upstream protocol supports it. -For cross-protocol requests, a downstream adapter must map each populated native field into `NormalizedRequest`, apply it while projecting the downstream response, or reject it. An upstream client must map each populated normalized field into its native request or reject it when the target protocol cannot preserve the semantics, except under the documented [cache-lifetime approximation policy](../docs/README.md#prompt-caching). The documented omission exceptions are optional Responses output-item `id` values on Chat Completions and Messages, caller-defined prompt-cache keys on Messages, and the behavior-neutral Responses settings `include=["reasoning.encrypted_content"]`, `include=["web_search_call.action.sources"]`, and `store=false` on translated routes. Native passthrough forwards these fields unchanged, and `store=true` remains unsupported for translation. Messages computes cache identity implicitly and must not enable caching from a key alone. These exceptions do not apply to portable identifiers such as `ToolCall.tool_call_id`. Keep target-specific compatibility checks with the relevant wire conversion: adapters validate native hosted-search declarations, and upstream clients reject normalized options that their protocol cannot represent. +For cross-protocol requests, a downstream adapter must map each populated native field into `NormalizedRequest`, apply it while projecting the downstream response, or reject it. An upstream client must map each populated normalized field into its native request or reject it when the target protocol cannot preserve the semantics, except under the documented [cache-lifetime approximation policy](../docs/README.md#prompt-caching). The documented omission exceptions are optional Responses output-item `id` values on Chat Completions and Messages, caller-defined prompt-cache keys on Messages, the `format="unknown"` label on raw-only Responses reasoning history, and the behavior-neutral Responses settings `include=["reasoning.encrypted_content"]`, `include=["web_search_call.action.sources"]`, and `store=false` on translated routes. Native passthrough forwards these fields unchanged, and `store=true` remains unsupported for translation. Messages computes cache identity implicitly and must not enable caching from a key alone. These exceptions do not apply to portable identifiers such as `ToolCall.tool_call_id`. Keep target-specific compatibility checks with the relevant wire conversion: adapters validate native hosted-search declarations, and upstream clients reject normalized options that their protocol cannot represent. Prefer semantic normalized types over SDK parameter types. Any SDK type retained inside the normalized IR is transitional coupling and should not spread to new adapters or clients. @@ -222,7 +224,7 @@ Never record cassettes during a normal test run. New cassettes must come from an Use the following workflow when adding a feature shared by Responses and one or more other protocols: -1. Record semantically equivalent Responses and counterpart protocol cassettes directly under `tests/cassettes/matched/` from approved official sources. Inspect their requests and events, verify that they contain no secrets, validate them against their native SDK types, and commit the unchanged recordings before modifying them. +1. Record semantically equivalent Responses and counterpart protocol conversations into a staging directory such as `/tmp/molto-recordings`, outside pytest, using native SDKs independently of Molto. Use the established scenario-first filenames, such as `upstream_ir/tool_use/togetherai-responses-stream-00.yaml`; no manifest or separate recording corpus is needed. Review all fields for secrets and private content, validate against native SDK types, then promote unchanged originals into the scenario directory and commit them. Create separate matched copies only after this baseline exists; raw captures must never go directly into `matched/`. 2. Add or extend deterministic matching tooling when the current tooling cannot align the new scenario. Use Responses as the canonical input and modify only the non-Responses fixture fields needed to express equivalent native requests, align source-backed response values, and align observable chunk boundaries. Never copy a Responses request body into another protocol or rewrite transport metadata, and keep every transformed fixture valid native wire data. 3. Run the matching tooling on each non-Responses cassette paired with the canonical Responses cassette. 4. Review every resulting cassette diff before implementation. The diff must contain only intentional, representable alignment changes and must not remove meaningful native fields. If it does not, correct the matching logic and repeat the matching and review steps. Commit the reviewed matching-tool and cassette changes before implementation. diff --git a/python/molto/adapters/anthropic.py b/python/molto/adapters/anthropic.py index 4b9ebb0..097dd1b 100644 --- a/python/molto/adapters/anthropic.py +++ b/python/molto/adapters/anthropic.py @@ -18,7 +18,7 @@ from httpx import Response from pydantic_core import from_json -from molto.adapters.base import BaseAdapter +from molto.adapters.base import BaseAdapter, ReasoningTextStream from molto.providers import ProviderCapabilities from molto.types.anthropic_messages import ( AnthropicMessagesCreateRequest, @@ -653,7 +653,7 @@ def event(data: dict[str, Any]) -> AnthropicMessagesStreamEvent: indices: dict[int, int] = {} next_index = 0 omitted_calls: set[str] = set() - thinking_parts: set[int] = set() + thinking_parts: dict[int, ReasoningTextStream] = {} thinking_signatures: dict[int, str] = {} buffer_text = self._citation_policy == "buffer" or ( @@ -675,7 +675,6 @@ def event(data: dict[str, Any]) -> AnthropicMessagesStreamEvent: "stop_sequence": None, "usage": { "input_tokens": 0, - "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 0, "service_tier": "standard", @@ -690,22 +689,10 @@ def event(data: dict[str, Any]) -> AnthropicMessagesStreamEvent: # in the block instead of waiting for deltas that may not exist. if isinstance(normalized_event.part, Thinking): part = normalized_event.part - if self._capabilities.thinking == "raw": - if part.summary or part.signature: - raise ValueError( - "A raw Anthropic thinking block cannot contain a summary " - "or signature." - ) - thinking = part.content - else: - if part.content: - raise ValueError( - "An Anthropic summary block cannot contain raw reasoning." - ) - thinking = part.summary - if part.signature: - thinking_signatures[index] = part.signature - thinking_parts.add(index) + selection = thinking_parts[index] = ReasoningTextStream() + thinking = selection.text(part.content, part.summary) + if part.signature: + thinking_signatures[index] = part.signature content_block = { "type": "thinking", "thinking": thinking, @@ -749,19 +736,9 @@ def event(data: dict[str, Any]) -> AnthropicMessagesStreamEvent: delta = normalized_event.delta if index not in thinking_parts: raise ValueError("Received a thinking delta before its block started.") - if self._capabilities.thinking == "raw": - if delta.summary_delta or delta.signature_delta: - raise ValueError( - "A raw Anthropic thinking block cannot contain a summary " - "or signature." - ) - reasoning_delta = delta.content_delta - else: - if delta.content_delta: - raise ValueError( - "An Anthropic summary block cannot contain raw reasoning." - ) - reasoning_delta = delta.summary_delta + reasoning_delta = thinking_parts[index].text( + delta.content_delta, delta.summary_delta + ) if reasoning_delta: yield event( { @@ -868,22 +845,28 @@ def event(data: dict[str, Any]) -> AnthropicMessagesStreamEvent: part = normalized_event.part if index not in thinking_parts: raise ValueError("Received a thinking end before its block started.") - if self._capabilities.thinking == "raw": - if part.summary or part.signature: - raise ValueError( - "A raw Anthropic thinking block cannot contain a summary " - "or signature." - ) - else: - if part.content: - raise ValueError( - "An Anthropic summary block cannot contain raw reasoning." - ) - if thinking_signatures.get(index) != (part.signature or None): - raise ValueError( - "An Anthropic reasoning signature must be streamed before " - "the block ends." - ) + tail = thinking_parts.pop(index).text( + part.content, part.summary, snapshot=True + ) + if tail: + yield event( + { + "type": "content_block_delta", + "index": index, + "delta": {"type": "thinking_delta", "thinking": tail}, + } + ) + if part.signature and thinking_signatures.get(index) != part.signature: + yield event( + { + "type": "content_block_delta", + "index": index, + "delta": { + "type": "signature_delta", + "signature": part.signature, + }, + } + ) yield event({"type": "content_block_stop", "index": index}) elif isinstance(normalized_event, ResponseEndEvent): stop_reason = _STOP_REASONS.get( @@ -895,7 +878,9 @@ def event(data: dict[str, Any]) -> AnthropicMessagesStreamEvent: cache_creation = usage.input_tokens_details.cache_write_tokens cache_read = usage.input_tokens_details.cached_tokens raw_usage = { - "input_tokens": usage.input_tokens - cache_creation - cache_read, + "input_tokens": usage.input_tokens + - (cache_creation or 0) + - cache_read, "cache_creation_input_tokens": cache_creation, "cache_read_input_tokens": cache_read, "output_tokens": usage.output_tokens, diff --git a/python/molto/adapters/base.py b/python/molto/adapters/base.py index 297fe49..63a8e3e 100644 --- a/python/molto/adapters/base.py +++ b/python/molto/adapters/base.py @@ -1,11 +1,12 @@ from abc import ABC, abstractmethod from collections.abc import AsyncIterator, Awaitable from contextlib import AsyncExitStack +from dataclasses import dataclass from typing import NoReturn from pydantic import BaseModel, ValidationError -from molto.providers import ProviderCapabilities +from molto.providers import ProviderCapabilities, ReasoningRepresentation from molto.types.exceptions import UnsupportedInput from molto.types.normalized import ( ModelResponseStreamEvent, @@ -14,6 +15,26 @@ ) +@dataclass +class ReasoningTextStream: + """Select the first nonempty representation for one unlabeled output part.""" + + representation: ReasoningRepresentation | None = None + emitted: int = 0 + + def text(self, content: str | None, summary: str | None, *, snapshot: bool = False) -> str: + if self.representation is None: + if content: + self.representation = "raw" + elif summary: + self.representation = "summary" + text = (content if self.representation == "raw" else summary) or "" + if snapshot: + text = text[self.emitted :] + self.emitted += len(text) + return text + + class BaseAdapter[ NativeRequestT: BaseModel, NativeEventT, @@ -167,5 +188,5 @@ def _classify_thinking(self, text: str, *, signature: str | None = None) -> Thin return Thinking( content=text if self._capabilities.thinking == "raw" else "", summary=text if self._capabilities.thinking == "summary" else "", - signature=(signature or None) if self._capabilities.thinking == "summary" else None, + signature=signature or None, ) diff --git a/python/molto/adapters/openai.py b/python/molto/adapters/openai.py index 1808c2f..30ebc50 100644 --- a/python/molto/adapters/openai.py +++ b/python/molto/adapters/openai.py @@ -20,7 +20,7 @@ from openai.lib.streaming.chat import ChatCompletionStreamState from pydantic import BaseModel -from molto.adapters.base import BaseAdapter +from molto.adapters.base import BaseAdapter, ReasoningTextStream from molto.providers import ProviderCapabilities, ReasoningRepresentation from molto.types.exceptions import ( APIException, @@ -67,6 +67,8 @@ OpenAIChatCompletionsCreateRequest, OpenAIChatCompletionsResponse, OpenAIChatCompletionsStreamChunk, + chat_reasoning_text, + chat_thought_state, ) from molto.types.openai_responses import ( OpenAIResponsesCreateRequest, @@ -174,13 +176,14 @@ def _raise_openai_error(error: Exception) -> NoReturn: ) -def _function_tool(function: dict[str, Any]) -> FunctionTool: +def _function_tool(function: dict[str, Any], *, default_strict: bool = False) -> FunctionTool: """Normalize one protocol's function definition shape.""" + strict = function.get("strict") return FunctionTool( name=function["name"], description=function.get("description"), parameters=function.get("parameters") or {}, - strict=function.get("strict") or False, + strict=default_strict if strict is None else strict, ) @@ -379,7 +382,8 @@ def _translate_tool(tool: dict[str, Any]) -> FunctionTool | WebSearchTool: raise UnsupportedInput("Deferred Responses function tools are not supported.") if tool.get("output_schema") is not None: raise UnsupportedInput("Responses function output schemas are not supported.") - return _function_tool(tool) + # Use a strict default without rewriting schemas or overriding explicit false. + return _function_tool(tool, default_strict=True) async def _project_response( self, @@ -408,6 +412,13 @@ def _normalize_message( if message_type == "reasoning": content = message.get("content") or [] summary = message.get("summary") or [] + format = message.get("format") + # OpenRouter labels raw text "unknown", which names no encoding and + # is omitted. Any other format describes opaque state that would be lost. + if format is not None and ( + format != "unknown" or summary or message.get("encrypted_content") + ): + raise UnsupportedInput("Responses reasoning format cannot be translated.") if not all(part.get("type") == "reasoning_text" for part in content): raise UnsupportedInput("Reasoning content should only contain `reasoning_text`.") if not all(part.get("type") == "summary_text" for part in summary): @@ -619,7 +630,7 @@ async def _project_events( sequence_number = 0 response_start: ResponseStartEvent | None = None item_ids: dict[int, str] = {} - reasoning_text_started: set[int] = set() + reasoning_text_started: set[tuple[int, ReasoningRepresentation]] = set() output_items: dict[int, dict[str, Any]] = {} output_indices: dict[int, int] = {} search_calls: dict[str, tuple[int, dict[str, Any]]] = {} @@ -728,13 +739,6 @@ def response_data( ) continue if isinstance(part, Thinking): - if self._capabilities.thinking == "raw": - if part.summary or part.signature: - raise ValueError( - "Raw Responses reasoning cannot contain a summary or signature." - ) - elif part.content: - raise ValueError("Summarized Responses reasoning cannot contain raw text.") item_id = part.id or uuid4().hex item: dict[str, Any] = { "id": item_id, @@ -776,17 +780,18 @@ def response_data( ) # Seed the part lifecycle from a non-empty start snapshot so the # streamed text stays consistent with the completed item. - if isinstance(part, Thinking) and (part.content or part.summary): - representation = self._capabilities.thinking - reasoning_text_started.add(output_index) - yield event( - _reasoning_part_added( - representation, - item_id=item_id, - output_index=output_index, - text=part.content if representation == "raw" else part.summary, - ) - ) + if isinstance(part, Thinking): + for representation, text in (("raw", part.content), ("summary", part.summary)): + if text: + reasoning_text_started.add((output_index, representation)) + yield event( + _reasoning_part_added( + representation, + item_id=item_id, + output_index=output_index, + text=text, + ) + ) elif isinstance(part, TextOutput): yield event( { @@ -833,47 +838,37 @@ def response_data( raise ValueError("Received a delta before its output item started.") if isinstance(normalized_event.delta, ThinkingDelta): delta = normalized_event.delta - if self._capabilities.thinking == "raw": - if delta.summary_delta or delta.signature_delta: - raise ValueError( - "Raw Responses reasoning cannot contain a summary or signature." - ) - representation = "raw" - text_delta = delta.content_delta - else: - if delta.content_delta: - raise ValueError( - "Summarized Responses reasoning cannot contain raw text." + # Responses exposes opaque state on item snapshots. Its text + # events can independently update both representations. + for representation, text in ( + ("raw", delta.content_delta), + ("summary", delta.summary_delta), + ): + if not text: + continue + key = (output_index, representation) + if key not in reasoning_text_started: + reasoning_text_started.add(key) + yield event( + _reasoning_part_added( + representation, + item_id=item_id, + output_index=output_index, + ) ) - representation = "summary" - text_delta = delta.summary_delta - if not text_delta: - # Responses has no mid-stream signature event; a signature-only - # delta is preserved through the completed item's - # encrypted_content instead. - continue - if output_index not in reasoning_text_started: - reasoning_text_started.add(output_index) yield event( - _reasoning_part_added( - representation, - item_id=item_id, - output_index=output_index, - ) + { + "type": ( + "response.reasoning_text.delta" + if representation == "raw" + else "response.reasoning_summary_text.delta" + ), + "delta": text, + "item_id": item_id, + "output_index": output_index, + "content_index" if representation == "raw" else "summary_index": 0, + } ) - yield event( - { - "type": ( - "response.reasoning_text.delta" - if representation == "raw" - else "response.reasoning_summary_text.delta" - ), - "delta": text_delta, - "item_id": item_id, - "output_index": output_index, - "content_index" if representation == "raw" else "summary_index": 0, - } - ) elif isinstance(normalized_event.delta, TextDelta): yield event( { @@ -967,14 +962,6 @@ def response_data( completed_item: dict[str, Any] if isinstance(part, Thinking): - if self._capabilities.thinking == "raw": - if part.summary or part.signature: - raise ValueError( - "Raw Responses reasoning cannot contain a summary or signature." - ) - elif part.content: - raise ValueError("Summarized Responses reasoning cannot contain raw text.") - representation = self._capabilities.thinking completed_item = { "id": item_id, "type": "reasoning", @@ -984,17 +971,17 @@ def response_data( } if part.signature: completed_item["encrypted_content"] = part.signature - # An opaque or completely empty reasoning part has no text - # lifecycle to project; its completed item carries only the - # encrypted snapshot, when present. - if output_index in reasoning_text_started or part.content or part.summary: + for representation, text in (("raw", part.content), ("summary", part.summary)): + started = (output_index, representation) in reasoning_text_started + if not started and not text: + continue completed_part = { "type": ( "reasoning_text" if representation == "raw" else "summary_text" ), - "text": part.content if representation == "raw" else part.summary, + "text": text, } - if output_index not in reasoning_text_started: + if not started: # The part text arrived without deltas; open the text # lifecycle at completion so it stays balanced. part_events.append( @@ -1202,6 +1189,10 @@ def _normalize_message( ) -> Input: role = message.get("role") content = message.get("content") + if role != "assistant": + attachments = [message, *(content if isinstance(content, list) else [])] + if any(dict(part).get("extra_content") for part in attachments): + raise UnsupportedInput("Chat Completions extra_content cannot be translated.") if role == "user" and isinstance(content, list): parts: list[TextInput | ImageUrlInput] = [] @@ -1281,21 +1272,59 @@ def _normalize_message( return [UserInput(content=[TextInput(content=content)])] if role == "assistant": items: list[Thinking | TextOutput | ToolCall] = [] - reasoning_content = message.get("reasoning_content") - if reasoning_content is not None: - if not isinstance(reasoning_content, str): - raise UnsupportedInput("Chat Completions reasoning_content must be a string.") - items.append(self._classify_thinking(reasoning_content)) - items.extend( - TextOutput(content=part.content, cache_breakpoint=part.cache_breakpoint) - for part in text_parts + namespace = self._capabilities.chat_signature_namespace + marked, signature = chat_thought_state( + message.get("extra_content"), namespace, history=True + ) + reasoning = chat_reasoning_text( + self._capabilities.chat_reasoning_field, + message.get("reasoning"), + message.get("reasoning_content"), + ) + if marked and isinstance(content, str): + reasoning = content or reasoning + text_parts = [] + elif marked and text_parts: + # Marked content takes priority over aliases. Each list part can + # carry its own signature in addition to the message signature. + reasoning = None + trailing_signature = ( + signature + if not reasoning and not text_parts and message.get("tool_calls") + else None ) + if reasoning or (signature and not trailing_signature): + items.append(self._classify_thinking(reasoning or "", signature=signature)) + for index, part in enumerate(text_parts): + extra = content[index].get("extra_content") if isinstance(content, list) else None + part_marked, part_signature = chat_thought_state( + extra, namespace or ("google" if marked else None), history=True + ) + if marked or part_marked: + if part.cache_breakpoint is not None: + raise UnsupportedInput( + "Chat reasoning cannot preserve a text cache breakpoint." + ) + items.append(self._classify_thinking(part.content, signature=part_signature)) + continue + if part_signature: + raise UnsupportedInput( + "Chat Completions extra_content on visible text parts cannot be translated." + ) + items.append( + TextOutput(content=part.content, cache_breakpoint=part.cache_breakpoint) + ) for tool_call in message.get("tool_calls") or []: tool_call = dict(tool_call) if tool_call.get("type") != "function": raise UnsupportedInput( f"Unsupported Chat Completions tool call type: {tool_call.get('type')}" ) + _, tool_signature = chat_thought_state( + tool_call.get("extra_content"), namespace, history=True + ) + if tool_signature: + items.append(self._classify_thinking("", signature=tool_signature)) function = dict(tool_call["function"]) items.append( ToolCall( @@ -1304,6 +1333,8 @@ def _normalize_message( tool_call_id=tool_call["id"], ) ) + if trailing_signature: + items.append(self._classify_thinking("", signature=trailing_signature)) return [AssistantInput(content=items)] raise UnsupportedInput(f"Unsupported Chat Completions message role: {role}") @@ -1391,6 +1422,36 @@ async def _project_events( response_start: ResponseStartEvent | None = None initial_chunk_sent = False tool_indices: dict[int, int] = {} + reasoning_field = self._capabilities.chat_reasoning_field or "reasoning_content" + namespace = self._capabilities.chat_signature_namespace + thinking_parts: dict[int, ReasoningTextStream] = {} + message_signature: str | None = None + prefix_signature: str | None = None + prefix_index: int | None = None + + def remember_signature( + index: int, selection: ReasoningTextStream, signature: str | None + ) -> None: + nonlocal message_signature, prefix_signature, prefix_index + if signature and not namespace: + raise ValueError( + "Chat Completions cannot preserve reasoning signatures " + "without chat_signature_namespace." + ) + if selection.representation: + message_signature = signature or prefix_signature or message_signature + prefix_signature = None + elif signature: + # With two signed parts before one call, only the immediately + # preceding part belongs to the call. Revisions within one + # part replace its token. + if prefix_signature and prefix_index != index: + message_signature = prefix_signature + prefix_signature = signature + prefix_index = index + + def signature_extension(signature: str) -> dict[str, Any]: + return {"extra_content": {namespace: {"thought_signature": signature}}} def chunk( metadata: ResponseStartEvent | ResponseEndEvent, @@ -1441,31 +1502,31 @@ def delta_chunk( # in the stream instead of waiting for deltas that may not exist. if isinstance(normalized_event.part, Thinking): part = normalized_event.part - if part.signature: - raise ValueError("Chat Completions cannot preserve reasoning signatures.") - if self._capabilities.thinking == "raw": - if part.summary: - raise ValueError( - "Raw Chat Completions reasoning cannot contain a summary." - ) - start_text = part.content - else: - if part.content: - raise ValueError( - "Summarized Chat Completions reasoning cannot contain raw text." - ) - start_text = part.summary + selection = thinking_parts[normalized_event.index] = ReasoningTextStream() + start_text = selection.text(part.content, part.summary) + remember_signature(normalized_event.index, selection, part.signature) elif isinstance(normalized_event.part, TextOutput): start_text = normalized_event.part.content else: start_text = "" + tool_signature = None + if not isinstance(normalized_event.part, Thinking): + # A signature-only prefix immediately before a call belongs to + # that call. A signed reasoning part carries message state. + if isinstance(normalized_event.part, ToolCall): + tool_signature = prefix_signature + elif prefix_signature: + message_signature = prefix_signature + if message_signature: + yield delta_chunk(response_start, signature_extension(message_signature)) + message_signature = prefix_signature = None if not initial_chunk_sent: initial_chunk_sent = True if isinstance(normalized_event.part, Thinking): delta = { "role": "assistant", "content": None, - "reasoning_content": start_text, + reasoning_field: start_text, } elif isinstance(normalized_event.part, TextOutput): delta = {"role": "assistant", "content": start_text, "refusal": None} @@ -1474,7 +1535,7 @@ def delta_chunk( yield delta_chunk(response_start, delta) elif start_text: key = ( - "reasoning_content" + reasoning_field if isinstance(normalized_event.part, Thinking) else "content" ) @@ -1491,6 +1552,11 @@ def delta_chunk( "index": tool_index, "id": normalized_event.part.tool_call_id, "type": "function", + **( + signature_extension(tool_signature) + if tool_signature + else {} + ), "function": { "name": normalized_event.part.tool_name, "arguments": normalized_event.part.args or "", @@ -1507,29 +1573,24 @@ def delta_chunk( raise ValueError("Received a delta before its response started.") if isinstance(normalized_event.delta, ThinkingDelta): thinking_delta = normalized_event.delta - if thinking_delta.signature_delta: - raise ValueError("Chat Completions cannot preserve reasoning signatures.") - if self._capabilities.thinking == "raw": - if thinking_delta.summary_delta: - raise ValueError( - "Raw Chat Completions reasoning cannot contain a summary." - ) - reasoning_delta = thinking_delta.content_delta - else: - if thinking_delta.content_delta: - raise ValueError( - "Summarized Chat Completions reasoning cannot contain raw text." - ) - reasoning_delta = thinking_delta.summary_delta - if reasoning_delta is None: + selection = thinking_parts.setdefault( + normalized_event.index, ReasoningTextStream() + ) + reasoning_delta = selection.text( + thinking_delta.content_delta, thinking_delta.summary_delta + ) + remember_signature( + normalized_event.index, selection, thinking_delta.signature_delta + ) + if not reasoning_delta: continue if not initial_chunk_sent: yield delta_chunk( response_start, - {"role": "assistant", "content": None, "reasoning_content": ""}, + {"role": "assistant", "content": None, reasoning_field: ""}, ) initial_chunk_sent = True - delta = {"reasoning_content": reasoning_delta} + delta = {reasoning_field: reasoning_delta} elif isinstance(normalized_event.delta, TextDelta): delta = {"content": normalized_event.delta.content_delta} elif isinstance(normalized_event.delta, ToolCallDelta): @@ -1563,18 +1624,15 @@ def delta_chunk( raise ValueError(f"Unsupported output part: {type(normalized_event.part)}") if isinstance(normalized_event.part, Thinking): part = normalized_event.part - if part.signature: - raise ValueError("Chat Completions cannot preserve reasoning signatures.") - if self._capabilities.thinking == "raw" and part.summary: - raise ValueError( - "Raw Chat Completions reasoning cannot contain a summary." - ) - if self._capabilities.thinking == "summary" and part.content: - raise ValueError( - "Summarized Chat Completions reasoning cannot contain raw text." - ) + selection = thinking_parts.pop(normalized_event.index, ReasoningTextStream()) + tail = selection.text(part.content, part.summary, snapshot=True) + if tail: + yield delta_chunk(response_start, {reasoning_field: tail}) + remember_signature(normalized_event.index, selection, part.signature) elif isinstance(normalized_event, ResponseEndEvent): + if signature := prefix_signature or message_signature: + yield delta_chunk(normalized_event, signature_extension(signature)) finish_reason = _CHAT_FINISH_REASONS.get( normalized_event.termination_reason, "stop" ) diff --git a/python/molto/configs.py b/python/molto/configs.py index a03d1ff..12470f9 100644 --- a/python/molto/configs.py +++ b/python/molto/configs.py @@ -1,7 +1,8 @@ import sys +from typing import Annotated from loguru import logger -from pydantic import SecretStr +from pydantic import AliasChoices, Field, SecretStr from pydantic_settings import BaseSettings, SettingsConfigDict MIN_HS256_SECRET_BYTES = 32 @@ -24,7 +25,12 @@ class EnvConfig(BaseSettings): molto_log_level_stderr: str = "INFO" # External services anthropic_api_key: SecretStr = "" + aws_bearer_token_bedrock: Annotated[ + SecretStr, + Field(validation_alias=AliasChoices("aws_bearer_token_bedrock", "BEDROCK_API_KEY")), + ] = "" deepseek_api_key: SecretStr = "" + fireworks_api_key: SecretStr = "" gemini_api_key: SecretStr = "" openai_api_key: SecretStr = "" openrouter_api_key: SecretStr = "" diff --git a/python/molto/core.py b/python/molto/core.py index 05efc9d..2b32079 100644 --- a/python/molto/core.py +++ b/python/molto/core.py @@ -1,4 +1,5 @@ from collections.abc import AsyncIterator, Mapping +from dataclasses import replace from typing import Any, Self from httpx import AsyncClient, Headers @@ -9,8 +10,11 @@ from molto.providers import ( DEFAULT_PROVIDER_BY_ENDPOINT, PROVIDER_CAPABILITIES, + ChatReasoningField, Endpoint, Provider, + ProviderCapabilities, + ReasoningRepresentation, ) from molto.types.anthropic_messages import ( AnthropicMessagesCreateRequest, @@ -29,8 +33,8 @@ OpenAIResponsesStreamEvent, has_anthropic_search_metadata, ) -from molto.upstream.anthropic import AnthropicMessagesClient -from molto.upstream.openai import OpenAIChatCompletionsClient, OpenAIResponsesClient +from molto.upstream.base import BaseClient +from molto.upstream.registry import CLIENTS from molto.utils.io import request_to_dict VLLM_DUMMY_API_KEY = "EMPTY" @@ -166,14 +170,20 @@ async def aclose(self) -> None: await self._http_client.aclose() @staticmethod - def _resolve_api_key(provider: Provider, api_key: str | None) -> str | None: - if api_key is None and provider == "openai": + def _resolve_api_key( + client_type: type[BaseClient], provider: Provider, api_key: str | None + ) -> str | None: + if api_key is not None: + return api_key + if client_type.REQUIRED_API_KEY: + return getattr(ENV_CONFIG, client_type.REQUIRED_API_KEY.lower()).get_secret_value() + if provider == "openai": return ENV_CONFIG.openai_api_key_plain - if api_key is None and provider == "anthropic": + if provider == "anthropic": return ENV_CONFIG.anthropic_api_key_plain - if api_key is None and provider == "vllm": + if provider == "vllm": return VLLM_DUMMY_API_KEY - return api_key + return None @staticmethod def _resolve_provider(endpoint: Endpoint, provider: Provider | None) -> Provider: @@ -181,7 +191,59 @@ def _resolve_provider(endpoint: Endpoint, provider: Provider | None) -> Provider # endpoint cannot surface as an unrelated translation error. if endpoint not in DEFAULT_PROVIDER_BY_ENDPOINT: raise ValueError(f"Unsupported endpoint: {endpoint!r}.") - return provider or DEFAULT_PROVIDER_BY_ENDPOINT[endpoint] + if provider is not None and provider not in PROVIDER_CAPABILITIES: + raise ValueError(f"Unsupported provider: {provider!r}.") + resolved_provider = provider or DEFAULT_PROVIDER_BY_ENDPOINT[endpoint] + return resolved_provider + + def _upstream_client( + self, + endpoint: Endpoint, + provider: Provider, + *, + downstream: Endpoint, + reasoning_representation: ReasoningRepresentation | None, + chat_reasoning_field: ChatReasoningField | None = None, + chat_signature_namespace: str | None = None, + api_key: str | None, + base_url: str | None, + extra_body: Mapping[str, Any] | None, + extra_headers: Mapping[str, str] | None, + ) -> tuple[BaseClient, ProviderCapabilities]: + """Select a registered client and resolve its translation capabilities.""" + client_type = CLIENTS.get((provider, endpoint)) + if client_type is None: + raise ValueError( + f"Unsupported upstream endpoint {endpoint!r} for provider {provider!r}." + ) + profile = PROVIDER_CAPABILITIES[provider] + if chat_reasoning_field is not None: + if chat_reasoning_field not in {"reasoning", "reasoning_content"}: + raise ValueError( + "chat_reasoning_field must be 'reasoning' or 'reasoning_content'." + ) + profile = replace(profile, chat_reasoning_field=chat_reasoning_field) + if chat_signature_namespace is not None: + if not chat_signature_namespace.strip(): + raise ValueError("chat_signature_namespace must be a nonempty namespace.") + profile = replace(profile, chat_signature_namespace=chat_signature_namespace) + capabilities = client_type.resolve_capabilities(profile) + if downstream != endpoint and client_type.REQUIRES_REASONING_REPRESENTATION: + if reasoning_representation not in {"raw", "summary"}: + raise ValueError( + f"{client_type.__name__} translation requires " + "reasoning_representation='raw' or 'summary'." + ) + capabilities = replace(capabilities, thinking=reasoning_representation) + upstream = client_type( + self._http_client, + api_key=self._resolve_api_key(client_type, provider, api_key), + base_url=base_url, + capabilities=capabilities, + extra_body=extra_body, + extra_headers=_upstream_headers(extra_headers), + ) + return upstream, capabilities async def responses( self, @@ -192,6 +254,10 @@ async def responses( base_url: str | None = None, extra_body: Mapping[str, Any] | None = None, extra_headers: Mapping[str, str] | None = None, + *, + reasoning_representation: ReasoningRepresentation | None = None, + chat_reasoning_field: ChatReasoningField | None = None, + chat_signature_namespace: str | None = None, ) -> MoltoStream[OpenAIResponsesStreamEvent] | OpenAIResponsesResponse: """ Consume OpenAI Responses request and return Responses output. @@ -208,13 +274,29 @@ async def responses( extra_body: Additional fields merged into the upstream request body. extra_headers: Additional upstream headers. Client credentials and transport headers are removed before the provider request. + reasoning_representation: Required raw/summary classification when the + translated upstream client declares ambiguous reasoning. Other + clients retain their fixed profile. Native passthrough ignores it. + chat_reasoning_field: Preferred Chat reasoning alias during translation. + Set to "reasoning_content" for older vLLM servers. + chat_signature_namespace: Chat extension namespace for opaque signatures, + such as "google" for Gemini. """ resolved_provider = self._resolve_provider(endpoint, provider) if not isinstance(body, (dict, OpenAIResponsesCreateRequest)): raise TypeError("body must be a dictionary or OpenAIResponsesCreateRequest.") - resolved_api_key = self._resolve_api_key(resolved_provider, api_key) - capabilities = PROVIDER_CAPABILITIES[resolved_provider] - upstream_headers = _upstream_headers(extra_headers) + upstream, capabilities = self._upstream_client( + endpoint, + resolved_provider, + downstream="responses", + reasoning_representation=reasoning_representation, + chat_reasoning_field=chat_reasoning_field, + chat_signature_namespace=chat_signature_namespace, + api_key=api_key, + base_url=base_url, + extra_body=extra_body, + extra_headers=extra_headers, + ) if endpoint == "responses": body = request_to_dict(body) @@ -223,14 +305,6 @@ async def responses( "Anthropic search extra_content requires endpoint='messages' " "and provider='anthropic'." ) - upstream = OpenAIResponsesClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) adapter = OpenAIResponsesAdapter(capabilities) if body.get("stream") is True: return await _prefetch_stream( @@ -250,26 +324,6 @@ async def responses( capabilities, preserve_anthropic_search_metadata=preserve_search_metadata ) normalized_request = adapter.normalize_request(request) - if endpoint == "chat/completions": - upstream = OpenAIChatCompletionsClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) - elif endpoint == "messages": - upstream = AnthropicMessagesClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) - else: - raise ValueError(f"Unsupported endpoint: {endpoint!r}.") projected_events = adapter.project_events( upstream.events(normalized_request.model_copy(update={"stream": True})), normalized_request, @@ -287,6 +341,10 @@ async def chat_completions( base_url: str | None = None, extra_body: Mapping[str, Any] | None = None, extra_headers: Mapping[str, str] | None = None, + *, + reasoning_representation: ReasoningRepresentation | None = None, + chat_reasoning_field: ChatReasoningField | None = None, + chat_signature_namespace: str | None = None, ) -> MoltoStream[OpenAIChatCompletionsStreamChunk] | OpenAIChatCompletionsResponse: """Consume a Chat Completions request using any supported upstream protocol. @@ -297,19 +355,20 @@ async def chat_completions( resolved_provider = self._resolve_provider(endpoint, provider) if not isinstance(body, (dict, OpenAIChatCompletionsCreateRequest)): raise TypeError("body must be a dictionary or OpenAIChatCompletionsCreateRequest.") - resolved_api_key = self._resolve_api_key(resolved_provider, api_key) - capabilities = PROVIDER_CAPABILITIES[resolved_provider] - upstream_headers = _upstream_headers(extra_headers) + upstream, capabilities = self._upstream_client( + endpoint, + resolved_provider, + downstream="chat/completions", + reasoning_representation=reasoning_representation, + chat_reasoning_field=chat_reasoning_field, + chat_signature_namespace=chat_signature_namespace, + api_key=api_key, + base_url=base_url, + extra_body=extra_body, + extra_headers=extra_headers, + ) if endpoint == "chat/completions": body = request_to_dict(body) - upstream = OpenAIChatCompletionsClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) adapter = OpenAIChatCompletionsAdapter(capabilities) if body.get("stream") is True: return await _prefetch_stream( @@ -321,26 +380,6 @@ async def chat_completions( request = OpenAIChatCompletionsCreateRequest.model_validate(body) adapter = OpenAIChatCompletionsAdapter(capabilities) normalized_request = adapter.normalize_request(request) - if endpoint == "responses": - upstream = OpenAIResponsesClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) - elif endpoint == "messages": - upstream = AnthropicMessagesClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) - else: - raise ValueError(f"Unsupported endpoint: {endpoint!r}.") projected_events = adapter.project_events( upstream.events(normalized_request.model_copy(update={"stream": True})), normalized_request, @@ -359,6 +398,10 @@ async def messages( extra_body: Mapping[str, Any] | None = None, extra_headers: Mapping[str, str] | None = None, citation_policy: CitationPolicy = "drop", + *, + reasoning_representation: ReasoningRepresentation | None = None, + chat_reasoning_field: ChatReasoningField | None = None, + chat_signature_namespace: str | None = None, ) -> MoltoStream[AnthropicMessagesStreamEvent] | AnthropicMessagesResponse: """Consume an Anthropic Messages request using any supported upstream protocol. @@ -374,19 +417,20 @@ async def messages( resolved_provider = self._resolve_provider(endpoint, provider) if not isinstance(body, (dict, AnthropicMessagesCreateRequest)): raise TypeError("body must be a dictionary or AnthropicMessagesCreateRequest.") - resolved_api_key = self._resolve_api_key(resolved_provider, api_key) - capabilities = PROVIDER_CAPABILITIES[resolved_provider] - upstream_headers = _upstream_headers(extra_headers) + upstream, capabilities = self._upstream_client( + endpoint, + resolved_provider, + downstream="messages", + reasoning_representation=reasoning_representation, + chat_reasoning_field=chat_reasoning_field, + chat_signature_namespace=chat_signature_namespace, + api_key=api_key, + base_url=base_url, + extra_body=extra_body, + extra_headers=extra_headers, + ) if endpoint == "messages": body = request_to_dict(body) - upstream = AnthropicMessagesClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) adapter = AnthropicMessagesAdapter(capabilities, citation_policy=citation_policy) if body.get("stream") is True: return await _prefetch_stream( @@ -402,26 +446,6 @@ async def messages( citation_policy="drop" if endpoint == "chat/completions" else citation_policy, ) normalized_request = adapter.normalize_request(request) - if endpoint == "responses": - upstream = OpenAIResponsesClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) - elif endpoint == "chat/completions": - upstream = OpenAIChatCompletionsClient( - self._http_client, - api_key=resolved_api_key, - base_url=base_url, - capabilities=capabilities, - extra_body=extra_body, - extra_headers=upstream_headers, - ) - else: - raise ValueError(f"Unsupported endpoint: {endpoint!r}.") projected_events = adapter.project_events( upstream.events(normalized_request.model_copy(update={"stream": True})), normalized_request, diff --git a/python/molto/providers.py b/python/molto/providers.py index e9bfa22..d99bc7b 100644 --- a/python/molto/providers.py +++ b/python/molto/providers.py @@ -2,7 +2,10 @@ from typing import Literal, TypeAlias Endpoint: TypeAlias = Literal["responses", "chat/completions", "messages"] -Provider: TypeAlias = Literal["anthropic", "openai", "vllm"] +Provider: TypeAlias = Literal[ + "anthropic", "bedrock", "fireworks", "gemini", "openai", "openrouter", "togetherai", "vllm" +] +ChatReasoningField: TypeAlias = Literal["reasoning_content", "reasoning"] ReasoningRepresentation: TypeAlias = Literal["raw", "summary"] @@ -10,11 +13,18 @@ class ProviderCapabilities: thinking: ReasoningRepresentation requires_search_history_state: bool = False + chat_reasoning_field: ChatReasoningField | None = None + chat_signature_namespace: str | None = None PROVIDER_CAPABILITIES: dict[Provider, ProviderCapabilities] = { "anthropic": ProviderCapabilities(thinking="summary", requires_search_history_state=True), + "bedrock": ProviderCapabilities(thinking="summary"), + "fireworks": ProviderCapabilities(thinking="raw"), "openai": ProviderCapabilities(thinking="summary"), + "gemini": ProviderCapabilities(thinking="summary"), + "openrouter": ProviderCapabilities(thinking="raw"), + "togetherai": ProviderCapabilities(thinking="raw"), "vllm": ProviderCapabilities(thinking="raw"), } diff --git a/python/molto/types/normalized.py b/python/molto/types/normalized.py index 9802460..86b9be2 100644 --- a/python/molto/types/normalized.py +++ b/python/molto/types/normalized.py @@ -4,7 +4,7 @@ from time import time from typing import Annotated, Any, Literal, Self, TypeAlias -from pydantic import BeforeValidator, Discriminator, Field, model_validator +from pydantic import BeforeValidator, Discriminator, Field from molto.types.base import ExtraModel, StrictModel, ZeroIfNoneInt @@ -272,14 +272,6 @@ class Thinking(ExtraModel): Field(description="Content type identifier as a discriminator."), ] = "thinking" - @model_validator(mode="after") - def _validate_representation(self) -> Self: - if self.content and self.summary: - raise ValueError("Thinking cannot contain both raw reasoning and a summary.") - if self.content and self.signature: - raise ValueError("A thinking signature cannot accompany raw reasoning.") - return self - OutputItem = Annotated[ Thinking | TextOutput | ToolCall | SearchCall | SearchResult, @@ -639,14 +631,6 @@ class ThinkingDelta(ExtraModel): Field(description="Part delta type identifier, used as a discriminator."), ] = "thinking-delta" - @model_validator(mode="after") - def _validate_representation(self) -> Self: - if self.content_delta and self.summary_delta: - raise ValueError("A thinking delta cannot contain both raw reasoning and a summary.") - if self.content_delta and self.signature_delta: - raise ValueError("A signature delta cannot accompany raw reasoning.") - return self - class ToolCallDelta(ExtraModel): """A partial update (delta) for a `ToolCall` to modify tool name, arguments, or tool call ID.""" @@ -681,9 +665,9 @@ class InputTokenDetails(ExtraModel): Field(description="The number of cached input tokens."), ] = 0 cache_write_tokens: Annotated[ - ZeroIfNoneInt, - Field(description="The number of input tokens written to a prompt cache."), - ] = 0 + int | None, + Field(description="The reported number of input tokens written to a prompt cache."), + ] = None class OutputTokenDetails(ExtraModel): diff --git a/python/molto/types/openai_chat_completions.py b/python/molto/types/openai_chat_completions.py index d28078f..03a32ad 100644 --- a/python/molto/types/openai_chat_completions.py +++ b/python/molto/types/openai_chat_completions.py @@ -8,7 +8,7 @@ from __future__ import annotations -from typing import Annotated, Literal, TypeAlias, Union, get_args +from typing import Annotated, Any, Literal, TypeAlias, Union, get_args from openai import AsyncStream from openai._types import SequenceNotStr @@ -17,7 +17,15 @@ ChatCompletionAssistantMessageParam, ) from openai.types.chat.chat_completion_audio_param import ChatCompletionAudioParam -from openai.types.chat.chat_completion_content_part_param import ChatCompletionContentPartParam +from openai.types.chat.chat_completion_content_part_image_param import ( + ChatCompletionContentPartImageParam, +) +from openai.types.chat.chat_completion_content_part_input_audio_param import ( + ChatCompletionContentPartInputAudioParam, +) +from openai.types.chat.chat_completion_content_part_param import ( + File as ChatCompletionContentPartFileParam, +) from openai.types.chat.chat_completion_content_part_refusal_param import ( ChatCompletionContentPartRefusalParam, ) @@ -27,10 +35,13 @@ from openai.types.chat.chat_completion_developer_message_param import ( ChatCompletionDeveloperMessageParam, ) -from openai.types.chat.chat_completion_message_param import ChatCompletionMessageParam -from openai.types.chat.chat_completion_message_tool_call_union_param import ( - ChatCompletionMessageToolCallUnionParam, +from openai.types.chat.chat_completion_message_custom_tool_call_param import ( + ChatCompletionMessageCustomToolCallParam, +) +from openai.types.chat.chat_completion_message_function_tool_call_param import ( + ChatCompletionMessageFunctionToolCallParam, ) +from openai.types.chat.chat_completion_message_param import ChatCompletionMessageParam from openai.types.chat.chat_completion_prediction_content_param import ( ChatCompletionPredictionContentParam, ) @@ -55,54 +66,154 @@ from openai.types.shared.chat_model import ChatModel from openai.types.shared.metadata import Metadata from openai.types.shared.reasoning_effort import ReasoningEffort -from pydantic import Field +from pydantic import Field, JsonValue, SerializationInfo, TypeAdapter, field_serializer from typing_extensions import NotRequired, Required, TypedDict from molto.types.base import ExcludeNoneModel +from molto.types.exceptions import UnsupportedInput + + +def chat_reasoning_text( + preferred: str | None, reasoning: str | None, reasoning_content: str | None +) -> str | None: + """Read one alias, preferring the configured spelling when both carry text.""" + if preferred == "reasoning": + return reasoning or reasoning_content + return reasoning_content or reasoning + + +def chat_thought_state( + extra: Any, namespace: str | None, *, history: bool = False +) -> tuple[bool, str | None]: + """Read the Google thought marker and the configured signature attachment.""" + if not extra: + return False, None + if not isinstance(extra, dict): + if not namespace and not history: + return False, None + raise UnsupportedInput("Chat Completions extra_content must be an object.") + google = extra.get("google", {}) + marked = isinstance(google, dict) and google.get("thought") is True + if marked and namespace is None: + namespace = "google" + extension = extra.get(namespace, {}) if namespace else {} + if not isinstance(extension, dict): + raise UnsupportedInput(f"Chat Completions extra_content.{namespace} must be an object.") + signature = extension.get("thought_signature") + if "thought_signature" in extension and (not isinstance(signature, str) or not signature): + raise UnsupportedInput( + f"Chat Completions extra_content.{namespace}.thought_signature must be a nonempty string." + ) + if history: + # Output may introduce unknown extensions. Caller-supplied history must + # retain every extension it accepts through the translated request. + for name, values in extra.items(): + allowed = {"thought"} if name == "google" else set() + if name == namespace: + allowed.add("thought_signature") + if not allowed or not isinstance(values, dict) or values.keys() - allowed: + raise UnsupportedInput("Chat Completions extra_content cannot be translated.") + return marked, signature + + +class GoogleExtraContent(TypedDict): + """Opaque Google continuation state, retained at its original attachment.""" + + google: Required[dict[str, JsonValue]] + + +class ChatCompletionTextPartParam(ChatCompletionContentPartTextParam): + """Text content with Google's per-part continuation extension.""" + + extra_content: NotRequired[GoogleExtraContent] + + +class ChatCompletionImagePartParam(ChatCompletionContentPartImageParam): + """Image content with Google's per-part continuation extension.""" + + extra_content: NotRequired[GoogleExtraContent] + + +class ChatCompletionAudioPartParam(ChatCompletionContentPartInputAudioParam): + """Audio content with Google's per-part continuation extension.""" + + extra_content: NotRequired[GoogleExtraContent] + + +class ChatCompletionFilePartParam(ChatCompletionContentPartFileParam): + """File content with Google's per-part continuation extension.""" + + extra_content: NotRequired[GoogleExtraContent] + + +class ChatCompletionRefusalPartParam(ChatCompletionContentPartRefusalParam): + """Refusal content with Google's per-part continuation extension.""" + + extra_content: NotRequired[GoogleExtraContent] + + +class ChatCompletionFunctionToolCallParam(ChatCompletionMessageFunctionToolCallParam): + """A function call retaining provider continuation fields.""" + + extra_content: NotRequired[dict[str, dict[str, JsonValue]]] + + +OpenAIChatCompletionContentPartParam: TypeAlias = Union[ + ChatCompletionTextPartParam, + ChatCompletionImagePartParam, + ChatCompletionAudioPartParam, + ChatCompletionFilePartParam, +] class ChatCompletionAssistantMessageWithReasoningParam(ChatCompletionAssistantMessageParam): """Provider-compatible assistant message containing either raw reasoning or summary.""" reasoning_content: NotRequired[str] + reasoning: NotRequired[str] + extra_content: NotRequired[dict[str, dict[str, JsonValue]]] + tool_calls: NotRequired[ + list[ChatCompletionFunctionToolCallParam | ChatCompletionMessageCustomToolCallParam] + ] content: NotRequired[ - str - | list[ChatCompletionContentPartTextParam | ChatCompletionContentPartRefusalParam] - | None + str | list[ChatCompletionTextPartParam | ChatCompletionRefusalPartParam] | None ] - tool_calls: NotRequired[list[ChatCompletionMessageToolCallUnionParam]] class ChatCompletionUserMessageListParam(TypedDict): """User message with eagerly validated, repeatable content parts.""" - content: Required[str | list[ChatCompletionContentPartParam]] + content: Required[str | list[OpenAIChatCompletionContentPartParam]] role: Required[Literal["user"]] name: NotRequired[str] + extra_content: NotRequired[GoogleExtraContent] class ChatCompletionSystemMessageListParam(TypedDict): """System message with eagerly validated, repeatable content parts.""" - content: Required[str | list[ChatCompletionContentPartTextParam]] + content: Required[str | list[ChatCompletionTextPartParam]] role: Required[Literal["system"]] name: NotRequired[str] + extra_content: NotRequired[GoogleExtraContent] class ChatCompletionDeveloperMessageListParam(TypedDict): """Developer message with eagerly validated, repeatable content parts.""" - content: Required[str | list[ChatCompletionContentPartTextParam]] + content: Required[str | list[ChatCompletionTextPartParam]] role: Required[Literal["developer"]] name: NotRequired[str] + extra_content: NotRequired[GoogleExtraContent] class ChatCompletionToolMessageListParam(TypedDict): """Tool message with eagerly validated, repeatable text content parts.""" - content: Required[str | list[ChatCompletionContentPartTextParam]] + content: Required[str | list[ChatCompletionTextPartParam]] role: Required[Literal["tool"]] tool_call_id: Required[str] + extra_content: NotRequired[GoogleExtraContent] _RETAINED_CHAT_MESSAGE_PARAMS = tuple( @@ -125,6 +236,7 @@ class ChatCompletionToolMessageListParam(TypedDict): ChatCompletionAssistantMessageWithReasoningParam, *_RETAINED_CHAT_MESSAGE_PARAMS, # pyright: ignore[reportInvalidTypeForm] ] +_CHAT_MESSAGES_ADAPTER = TypeAdapter(list[OpenAIChatCompletionMessageParam]) class OpenAIChatCompletionsCreateRequest(ExcludeNoneModel): @@ -279,6 +391,21 @@ class OpenAIChatCompletionsCreateRequest(ExcludeNoneModel): Field(description="Configuration for the web search tool."), ] = None + @field_serializer("messages") + def serialize_messages(self, messages, info: SerializationInfo): + # Explicit native history nulls are wire values, unlike unset optional + # request parameters. In particular, tool-only assistant content is null. + return _CHAT_MESSAGES_ADAPTER.dump_python( + messages, + mode=info.mode, + include=info.include, + exclude=info.exclude, + by_alias=info.by_alias, + exclude_unset=info.exclude_unset, + exclude_defaults=info.exclude_defaults, + exclude_none=False, + ) + # The SDK's response classes are already Pydantic models generated from the # endpoint schema, so aliases preserve the full nested response structures. diff --git a/python/molto/types/openai_responses.py b/python/molto/types/openai_responses.py index 56652c5..89a03d1 100644 --- a/python/molto/types/openai_responses.py +++ b/python/molto/types/openai_responses.py @@ -11,8 +11,18 @@ from typing import Annotated, Any, Literal, TypeAlias, Union, get_args from openai import AsyncStream -from openai.types.responses import Response, ResponseCompletedEvent, ResponseStreamEvent +from openai.types.responses import ( + Response, + ResponseCompletedEvent, + ResponseCreatedEvent, + ResponseFailedEvent, + ResponseIncompleteEvent, + ResponseInProgressEvent, + ResponseQueuedEvent, + ResponseStreamEvent, +) from openai.types.responses.easy_input_message_param import EasyInputMessageParam +from openai.types.responses.function_tool_param import FunctionToolParam from openai.types.responses.response_create_params import ( ContextManagement, Conversation, @@ -56,11 +66,12 @@ Summary as ResponseReasoningSummaryParam, ) from openai.types.responses.response_text_config_param import ResponseTextConfigParam +from openai.types.responses.response_usage import InputTokensDetails, ResponseUsage from openai.types.responses.tool_param import ToolParam from openai.types.shared.metadata import Metadata from openai.types.shared.reasoning import Reasoning from openai.types.shared.responses_model import ResponsesModel -from pydantic import BaseModel, Discriminator, Field, TypeAdapter, field_validator, model_validator +from pydantic import BaseModel, Discriminator, Field, TypeAdapter, field_validator from typing_extensions import Required, TypedDict from molto.types.base import ExcludeNoneModel @@ -90,6 +101,10 @@ class ResponseReasoningItemOptionalIDParam(ExcludeNoneModel): Literal["in_progress", "completed", "incomplete"] | None, Field(description="The reasoning item status."), ] = None + format: Annotated[ + str | None, + Field(description="Provider-specific reasoning format required for native continuation."), + ] = None class AnthropicSearchSourceMetadataParam(TypedDict, total=False): @@ -231,6 +246,18 @@ class ResponseInputMessageParam(SDKResponseInputMessageParam): OpenAIResponsesInputParam: TypeAlias = list[OpenAIResponsesInputItemParam] +class ResponseFunctionToolOptionalStrictParam(FunctionToolParam, total=False): + """Preserve omitted strictness accepted by recorded compatible Responses APIs.""" + + strict: bool | None + + +OpenAIResponsesToolParam: TypeAlias = Union[ + ResponseFunctionToolOptionalStrictParam, + *(item for item in get_args(ToolParam) if item is not FunctionToolParam), # pyright: ignore[reportInvalidTypeForm] +] + + class OpenAIResponsesCreateRequest(ExcludeNoneModel): """The JSON parameters accepted by `AsyncOpenAI.responses.create`. @@ -346,7 +373,7 @@ class OpenAIResponsesCreateRequest(ExcludeNoneModel): Field(description="How the model should select tools."), ] = None tools: Annotated[ - list[ToolParam] | None, + list[OpenAIResponsesToolParam] | None, Field(description="Tools available to the model."), ] = None top_logprobs: Annotated[ @@ -418,19 +445,42 @@ def _has_anthropic_metadata(value: Any) -> bool: return isinstance(extra, dict) and "anthropic" in extra +class _InputTokensDetails(InputTokensDetails): + cache_write_tokens: int | None = None + + +class _ResponseUsage(ResponseUsage): + input_tokens_details: _InputTokensDetails + + +class OpenAICompatibleResponsesResponse(Response): + """Responses providers can omit the cache-write count even when reporting usage.""" + + usage: _ResponseUsage | None = None + + class OpenAIResponseCompletedEvent(ResponseCompletedEvent): - """ResponseCompletedEvent but with usage that is set to zero when null.""" + response: OpenAICompatibleResponsesResponse - @model_validator(mode="before") - @classmethod - def set_usage_to_zero(cls, data: dict[str, Any]) -> dict[str, Any]: - usage = data.get("response", {}).get("usage") - if ( - usage is not None - and usage.get("input_tokens_details", {}).get("cache_write_tokens") is None - ): - usage["input_tokens_details"]["cache_write_tokens"] = 0 - return data + +class OpenAIResponseCreatedEvent(ResponseCreatedEvent): + response: OpenAICompatibleResponsesResponse + + +class OpenAIResponseFailedEvent(ResponseFailedEvent): + response: OpenAICompatibleResponsesResponse + + +class OpenAIResponseInProgressEvent(ResponseInProgressEvent): + response: OpenAICompatibleResponsesResponse + + +class OpenAIResponseIncompleteEvent(ResponseIncompleteEvent): + response: OpenAICompatibleResponsesResponse + + +class OpenAIResponseQueuedEvent(ResponseQueuedEvent): + response: OpenAICompatibleResponsesResponse class OpenAIResponseFunctionCallArgumentsDoneEvent(ResponseFunctionCallArgumentsDoneEvent): @@ -439,9 +489,13 @@ class OpenAIResponseFunctionCallArgumentsDoneEvent(ResponseFunctionCallArguments name: str | None = None -# Some compatible providers omit `cache_write_tokens` _REPLACED_SDK_STREAM_ITEMS = { ResponseCompletedEvent, + ResponseCreatedEvent, + ResponseFailedEvent, + ResponseInProgressEvent, + ResponseIncompleteEvent, + ResponseQueuedEvent, ResponseFunctionCallArgumentsDoneEvent, } _RETAINED_SDK_STREAM_ITEMS = tuple( @@ -452,6 +506,11 @@ class OpenAIResponseFunctionCallArgumentsDoneEvent(ResponseFunctionCallArguments OpenAIResponsesStreamEvent: TypeAlias = Annotated[ Union[ OpenAIResponseCompletedEvent, + OpenAIResponseCreatedEvent, + OpenAIResponseFailedEvent, + OpenAIResponseInProgressEvent, + OpenAIResponseIncompleteEvent, + OpenAIResponseQueuedEvent, OpenAIResponseFunctionCallArgumentsDoneEvent, *_RETAINED_SDK_STREAM_ITEMS, # pyright: ignore[reportInvalidTypeForm] ], @@ -461,13 +520,13 @@ class OpenAIResponseFunctionCallArgumentsDoneEvent(ResponseFunctionCallArguments # These are aliases rather than duplicate classes intentionally: the SDK's response # models are already Pydantic models generated from the same schema as the endpoint. OpenAIResponsesResponse = Response -# OpenAIResponsesStreamEvent = ResponseStreamEvent OpenAIResponsesStreamEventAdapter = TypeAdapter(OpenAIResponsesStreamEvent) OpenAIResponsesStream = AsyncStream[OpenAIResponsesStreamEvent] OpenAIResponsesCreateResult = OpenAIResponsesResponse | OpenAIResponsesStream __all__ = [ + "OpenAICompatibleResponsesResponse", "OpenAIResponsesCreateRequest", "OpenAIResponsesCreateResult", "OpenAIResponsesInputContentParam", diff --git a/python/molto/upstream/anthropic.py b/python/molto/upstream/anthropic.py index 8f1cf03..cc0576c 100644 --- a/python/molto/upstream/anthropic.py +++ b/python/molto/upstream/anthropic.py @@ -105,6 +105,11 @@ def _is_current_or_future_adaptive_claude(model: str) -> bool: def _model_thinking_capabilities(model: str) -> tuple[bool, bool]: + # Providers may prefix Claude IDs with a vendor, route, or inference profile. + # Resolve capabilities from the Claude name without rewriting the wire model. + _, claude_prefix, claude_name = model.partition("claude-") + if claude_prefix: + model = claude_prefix + claude_name # Anthropic-compatible endpoints in the matched fixtures use non-Claude model # IDs and expose adaptive thinking. Known Claude IDs use the installed model # profile, supplemented for newer families not yet present in the pinned table. @@ -405,29 +410,8 @@ def _assistant_blocks( ) for item in parts: if isinstance(item, Thinking): - representation = ( - "raw" - if item.content - else "summary" - if item.summary or item.signature - else None - ) - if representation == "summary" and not item.signature: - raise UnsupportedInput("An Anthropic reasoning summary requires a signature.") - if ( - representation is not None - and capabilities is not None - and representation != capabilities.thinking - ): - raise UnsupportedInput( - "Anthropic thinking history does not match the provider's reasoning " - "representation." - ) - block = { - "type": "thinking", - "thinking": item.content if representation == "raw" else item.summary, - } - if representation == "summary": + block = {"type": "thinking", "thinking": item.content or item.summary} + if item.signature: block["signature"] = item.signature blocks.append(block) elif isinstance(item, TextOutput): @@ -672,7 +656,7 @@ def _validate_request(request: NormalizedRequest) -> None: async def _events(self, request: NormalizedRequest) -> AsyncIterator[ModelResponseStreamEvent]: metadata: ResponseStartEvent | None = None input_tokens = 0 - cache_creation = 0 + cache_creation: int | None = None cache_read = 0 usage: Usage | None = None termination_reason: TerminationReason | None = None @@ -717,7 +701,7 @@ def start_part( service_tier=message.usage.service_tier, ) input_tokens = message.usage.input_tokens - cache_creation = message.usage.cache_creation_input_tokens or 0 + cache_creation = message.usage.cache_creation_input_tokens cache_read = message.usage.cache_read_input_tokens or 0 if message.usage.server_tool_use is not None: search_usage = message.usage.server_tool_use.web_search_requests @@ -800,8 +784,6 @@ def start_part( delta=self._classify_thinking_delta(delta.thinking), ) elif delta.type == "signature_delta" and isinstance(part, Thinking): - if self._capabilities.thinking == "raw": - continue # An empty signature carries no state and must not # materialize a deferred block. if not delta.signature and event.index in pending_thinking: @@ -911,9 +893,10 @@ def start_part( reasoning_tokens = ( output_details.thinking_tokens if output_details is not None else 0 ) + total_input = input_tokens + (cache_creation or 0) + cache_read usage = Usage( web_search_requests=search_usage, - input_tokens=input_tokens + cache_creation + cache_read, + input_tokens=total_input, input_tokens_details=InputTokenDetails( cached_tokens=cache_read, cache_write_tokens=cache_creation, @@ -922,10 +905,7 @@ def start_part( output_tokens_details=OutputTokenDetails( reasoning_tokens=reasoning_tokens ), - total_tokens=input_tokens - + cache_creation - + cache_read - + raw_usage.output_tokens, + total_tokens=total_input + raw_usage.output_tokens, ) elif isinstance(event, RawMessageStopEvent): if metadata is None: diff --git a/python/molto/upstream/base.py b/python/molto/upstream/base.py index dc1ffea..6c9a6a9 100644 --- a/python/molto/upstream/base.py +++ b/python/molto/upstream/base.py @@ -1,10 +1,11 @@ from abc import ABC, abstractmethod from collections.abc import AsyncIterator, Mapping from contextlib import aclosing -from typing import Any, NoReturn +from dataclasses import replace +from typing import Any, ClassVar, NoReturn from httpx import URL, AsyncClient, Headers, Request -from openai import AsyncOpenAI, omit +from openai import AsyncOpenAI, OpenAIError, omit from pydantic import BaseModel from molto.providers import ProviderCapabilities @@ -23,6 +24,14 @@ class BaseClient[ ](ABC): DEFAULT_BASE_URL: str REQUEST_MODEL: type[NativeRequestT] + REQUIRED_API_KEY: str | None = None + REQUIRES_BASE_URL = False + REQUIRES_REASONING_REPRESENTATION: ClassVar[bool] = False + + @classmethod + def resolve_capabilities(cls, capabilities: ProviderCapabilities) -> ProviderCapabilities: + """Apply protocol-specific provider policy to the shared provider profile.""" + return capabilities def __init__( self, @@ -34,10 +43,16 @@ def __init__( extra_body: Mapping[str, Any] | None = None, extra_headers: Mapping[str, str] | None = None, ) -> None: + if self.REQUIRES_BASE_URL and not base_url: + raise ValueError(f"{type(self).__name__} requires an explicit base_url.") self._http_client = http_client self._api_key = api_key self._base_url = base_url - self._capabilities = capabilities + self._capabilities = self.resolve_capabilities(capabilities) + if self.REQUIRES_REASONING_REPRESENTATION: + # The coordinator has already selected the interpretation for this + # request; constructor resolution must not restore a fixed default. + self._capabilities = replace(self._capabilities, thinking=capabilities.thinking) self._extra_body = extra_body self._extra_headers = extra_headers self.response_headers = Headers() @@ -61,6 +76,8 @@ def _request_kwargs(self, request: NativeRequestT | dict[str, Any]) -> dict[str, } def _make_sdk_client(self) -> AsyncOpenAI: + if self.REQUIRED_API_KEY and not self._api_key: + raise OpenAIError(f"Missing credentials. Set {self.REQUIRED_API_KEY} or pass api_key.") return AsyncOpenAI( api_key=self._api_key, base_url=self._base_url or self.DEFAULT_BASE_URL, @@ -97,7 +114,7 @@ def _classify_thinking(self, text: str, *, signature: str | None = None) -> Thin return Thinking( content=text if self._capabilities.thinking == "raw" else "", summary=text if self._capabilities.thinking == "summary" else "", - signature=(signature or None) if self._capabilities.thinking == "summary" else None, + signature=signature or None, ) def _classify_thinking_delta(self, text: str) -> ThinkingDelta: diff --git a/python/molto/upstream/bedrock.py b/python/molto/upstream/bedrock.py new file mode 100644 index 0000000..cb065fb --- /dev/null +++ b/python/molto/upstream/bedrock.py @@ -0,0 +1,51 @@ +"""Bedrock API-key clients; callers supply the regional protocol destination.""" + +from dataclasses import replace + +from anthropic import AsyncAnthropic, omit + +from molto.providers import ProviderCapabilities +from molto.types.exceptions import AuthenticationError +from molto.upstream.anthropic import AnthropicMessagesClient +from molto.upstream.openai import ChatCompletionsClient, ResponsesClient + + +class BedrockResponsesClient(ResponsesClient): + REQUIRED_API_KEY = "AWS_BEARER_TOKEN_BEDROCK" + REQUIRES_BASE_URL = True + + +class BedrockChatCompletionsClient(ChatCompletionsClient): + REASONING_FIELD = "reasoning" + + @classmethod + def resolve_capabilities(cls, profile: ProviderCapabilities) -> ProviderCapabilities: + return super().resolve_capabilities(replace(profile, thinking="raw")) + + REQUIRED_API_KEY = "AWS_BEARER_TOKEN_BEDROCK" + REQUIRES_BASE_URL = True + + +class BedrockMessagesClient(AnthropicMessagesClient): + """Anthropic-native Messages on Bedrock runtime or Mantle's /anthropic route.""" + + REQUIRED_API_KEY = "AWS_BEARER_TOKEN_BEDROCK" + REQUIRES_BASE_URL = True + + def _make_anthropic_client(self) -> AsyncAnthropic: + if not self._api_key: + raise AuthenticationError( + f"Missing credentials. Set {self.REQUIRED_API_KEY} or pass api_key.", + response=None, + body=None, + request=self._make_authentication_request("v1/messages"), + ) + return AsyncAnthropic( + api_key=self._api_key, + # Bedrock Messages authenticates via x-api-key. Do not also send an + # unrelated ANTHROPIC_AUTH_TOKEN inherited from the SDK environment. + auth_token="", + default_headers={"Authorization": omit}, + base_url=self._base_url, + http_client=self._http_client, + ) diff --git a/python/molto/upstream/fireworks.py b/python/molto/upstream/fireworks.py new file mode 100644 index 0000000..11b13a8 --- /dev/null +++ b/python/molto/upstream/fireworks.py @@ -0,0 +1,26 @@ +"""Fireworks clients using the shared OpenAI protocol implementations.""" + +from dataclasses import replace + +from molto.providers import ProviderCapabilities +from molto.upstream.openai import ChatCompletionsClient, ResponsesClient + + +class FireworksResponsesClient(ResponsesClient): + DEFAULT_BASE_URL = "https://api.fireworks.ai/inference/v1" + REQUIRED_API_KEY = "FIREWORKS_API_KEY" + + @classmethod + def resolve_capabilities(cls, profile: ProviderCapabilities) -> ProviderCapabilities: + return replace(profile, thinking="raw") + + +class FireworksChatCompletionsClient(ChatCompletionsClient): + DEFAULT_BASE_URL = "https://api.fireworks.ai/inference/v1" + REQUIRED_API_KEY = "FIREWORKS_API_KEY" + OMIT_NULL_MESSAGE_FIELDS = True + OMIT_INCLUDE_OBFUSCATION = True + + @classmethod + def resolve_capabilities(cls, profile: ProviderCapabilities) -> ProviderCapabilities: + return super().resolve_capabilities(replace(profile, thinking="raw")) diff --git a/python/molto/upstream/gemini.py b/python/molto/upstream/gemini.py new file mode 100644 index 0000000..a1d78f5 --- /dev/null +++ b/python/molto/upstream/gemini.py @@ -0,0 +1,65 @@ +"""Gemini's OpenAI-compatible Chat transport.""" + +from collections.abc import AsyncIterator +from contextlib import aclosing + +from molto.types.normalized import TerminationReason +from molto.types.openai_chat_completions import ( + OpenAIChatCompletionsCreateRequest, + OpenAIChatCompletionsStreamChunk, +) +from molto.upstream.openai import ChatCompletionsClient + + +class GeminiChatCompletionsClient(ChatCompletionsClient): + DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/openai" + REQUIRED_API_KEY = "GEMINI_API_KEY" + OMIT_NULL_MESSAGE_FIELDS = True + OMIT_INCLUDE_OBFUSCATION = True + SIGNATURE_NAMESPACE = "google" + + @staticmethod + def _termination_reason(finish_reason: str, *, has_tool_calls: bool) -> TerminationReason: + # Gemini ends completed tool calls with "stop" on its native Chat API. + if finish_reason == "stop" and has_tool_calls: + return "tool_call" + return ChatCompletionsClient._termination_reason( + finish_reason, has_tool_calls=has_tool_calls + ) + + async def native_events( + self, request: OpenAIChatCompletionsCreateRequest + ) -> AsyncIterator[OpenAIChatCompletionsStreamChunk]: + # Repair only missing indices. Association uses call IDs, never a chunk's + # array positions; already indexed provider chunks retain native fidelity. + identities: dict[int, dict[str, int]] = {} + async with aclosing(super().native_events(request)) as source: + async for chunk in source: + # Only an unindexed call is rewritten, so other chunks pass + # through without the per-chunk cost of a copy. + if any( + tool.index is None + for choice in chunk.choices + for tool in choice.delta.tool_calls or [] + ): + chunk = chunk.model_copy(deep=True) + for choice in chunk.choices: + calls = identities.setdefault(choice.index, {}) + for tool in choice.delta.tool_calls or []: + if tool.index is not None: + continue + if tool.id: + if tool.id in calls: + tool.index = calls[tool.id] + # Repeated IDs identify fragments; SDK accumulation + # would otherwise concatenate these snapshots. + tool.id = None + else: + tool.index = calls[tool.id] = len(calls) + elif len(calls) == 1: + tool.index = next(iter(calls.values())) + else: + raise ValueError( + "Gemini tool fragment has no unambiguous index or ID." + ) + yield chunk diff --git a/python/molto/upstream/openai.py b/python/molto/upstream/openai.py index bcf1735..cba0808 100644 --- a/python/molto/upstream/openai.py +++ b/python/molto/upstream/openai.py @@ -5,16 +5,17 @@ from collections import deque from collections.abc import AsyncIterator from contextlib import aclosing -from dataclasses import dataclass +from dataclasses import dataclass, replace from typing import Any, Literal, NoReturn from httpx import Response from openai import APIError, APIStatusError, AsyncStream, OpenAIError from openai import AuthenticationError as OpenAIAuthenticationError from openai import NotFoundError as OpenAINotFoundError -from openai.types.responses import ResponseCompletedEvent, ResponseStreamEvent +from openai.types.responses import ResponseStreamEvent from pydantic import BaseModel, ValidationError +from molto.providers import ChatReasoningField, ProviderCapabilities from molto.types.exceptions import ( AuthenticationError, ContextLengthExceededError, @@ -59,6 +60,8 @@ OpenAIChatCompletionsCreateRequest, OpenAIChatCompletionsResponse, OpenAIChatCompletionsStreamChunk, + chat_reasoning_text, + chat_thought_state, ) from molto.types.openai_responses import OpenAIResponsesCreateRequest, OpenAIResponsesResponse from molto.upstream.base import BaseClient @@ -168,29 +171,8 @@ def _function_call_part(item: Any) -> ToolCall: ) -def _reasoning_part(item: Any) -> Thinking: - """Project a Responses reasoning item snapshot into a normalized part.""" - return Thinking( - content="".join(part.text for part in item.content or [] if part.type == "reasoning_text"), - summary="".join(part.text for part in item.summary if part.type == "summary_text"), - id=item.id, - signature=item.encrypted_content or None, - ) - - -def _validate_responses_reasoning_capability( - part: Thinking, representation: Literal["raw", "summary"] -) -> None: - if representation == "raw" and (part.summary or part.signature): - raise ValueError("Raw Responses reasoning cannot contain a summary or signature.") - if representation == "summary" and part.content: - raise ValueError("Summarized Responses reasoning cannot contain raw text.") - - -def _started_output_item(item: Any) -> Thinking | TextOutput | ToolCall: +def _started_output_item(item: Any) -> TextOutput | ToolCall: """Project a just-added Responses output item into its initial normalized part.""" - if item.type == "reasoning": - return _reasoning_part(item) if item.type == "message": return TextOutput(content="", id=item.id) if item.type == "function_call": @@ -199,10 +181,8 @@ def _started_output_item(item: Any) -> Thinking | TextOutput | ToolCall: raise ValueError(f"Unsupported Responses output item: {item.type}") -def _completed_output_item(item: Any) -> Thinking | TextOutput | ToolCall: +def _completed_output_item(item: Any) -> TextOutput | ToolCall: """Project a completed Responses output item into its normalized part.""" - if item.type == "reasoning": - return _reasoning_part(item) if item.type == "message": text = "" citations = [] @@ -352,7 +332,7 @@ def _chat_usage(raw_usage: Any) -> Usage: input_tokens_details=InputTokenDetails( cached_tokens=prompt_details.cached_tokens if prompt_details is not None else 0, cache_write_tokens=( - prompt_details.cache_write_tokens if prompt_details is not None else 0 + prompt_details.cache_write_tokens if prompt_details is not None else None ), ), output_tokens=raw_usage.completion_tokens, @@ -388,10 +368,15 @@ class _ChatToolCallState: args: str -class OpenAIResponsesClient( +class ResponsesClient( BaseClient[OpenAIResponsesCreateRequest, ResponseStreamEvent, OpenAIResponsesResponse] ): - """OpenAI Responses transport for native and normalized streaming paths.""" + """Shared Responses transport for native and normalized streaming paths. + + Every Responses provider client inherits this implementation. It ignores + output extension fields it does not model; a provider client that knows an + extension owns its extraction and validation. + """ @staticmethod def _translate_tool(tool: FunctionTool | WebSearchTool) -> dict[str, Any]: @@ -414,6 +399,17 @@ def _translate_tool(tool: FunctionTool | WebSearchTool) -> dict[str, Any]: DEFAULT_BASE_URL = "https://api.openai.com/v1" REQUEST_MODEL = OpenAIResponsesCreateRequest + def _reasoning_part(self, item: Any) -> Thinking: + """Project a Responses reasoning item snapshot into a normalized part.""" + return Thinking( + content="".join( + part.text for part in item.content or [] if part.type == "reasoning_text" + ), + summary="".join(part.text for part in item.summary if part.type == "summary_text"), + id=item.id, + signature=item.encrypted_content or None, + ) + async def native_events( self, request: OpenAIResponsesCreateRequest | dict[str, Any] ) -> AsyncIterator[ResponseStreamEvent]: @@ -429,15 +425,6 @@ async def native_events( upstream_response = stream.response async with stream: async for event in stream: - if isinstance(event, ResponseCompletedEvent): - usage = event.response.usage - if ( - usage is not None - and usage.input_tokens_details.cache_write_tokens is None - ): - usage.input_tokens_details.cache_write_tokens = 0 - # The SDK already constructs ResponseStreamEvent instances. Apart from - # the provider omission above, avoid validating every event twice. yield event except Exception as error: self._handle_error(error, response=upstream_response) @@ -499,8 +486,6 @@ def _append_assistant_items( elif isinstance(item, SearchResult): _merge_search_result(items, item) elif isinstance(item, Thinking): - if item.summary and not item.signature: - raise UnsupportedInput("A Responses reasoning summary requires a signature.") # OpenAI rejects output lifecycle status on reasoning history input. reasoning_item = { "type": "reasoning", @@ -580,11 +565,9 @@ def _process_input(request: NormalizedRequest) -> list[dict[str, Any]] | None: content.append(image) items.append({"role": "user", "content": content}) elif isinstance(item, AssistantInput): - OpenAIResponsesClient._append_assistant_items( - items, item.content, message_id=item.id - ) + ResponsesClient._append_assistant_items(items, item.content, message_id=item.id) elif isinstance(item, (Thinking, ToolCall, SearchCall)): - OpenAIResponsesClient._append_assistant_items(items, [item]) + ResponsesClient._append_assistant_items(items, [item]) elif isinstance(item, SearchResult): _merge_search_result(items, item) elif isinstance(item, ToolReturn): @@ -661,14 +644,7 @@ def _native_request(cls, request: NormalizedRequest) -> OpenAIResponsesCreateReq async def _events(self, request: NormalizedRequest) -> AsyncIterator[ModelResponseStreamEvent]: native_request = self._native_request(request) - # Only a reasoning item whose `added` snapshot is completely empty (no - # content, summary, or encrypted state) is deferred: if nothing ever - # arrives, its part lifecycle is omitted from the IR entirely. An item - # that already carries content or encrypted state at `added` starts - # immediately, so a stalled or failed stream cannot lose it. - pending_reasoning: dict[int, Thinking] = {} - # Source output indices map to dense normalized indices so an omitted - # reasoning item cannot leave a gap for downstream projections. + # Splitting message content and search results can shift normalized indices. part_indices: dict[int, int] = {} text_indices: dict[tuple[int, int], int] = {} started_text_items: set[int] = set() @@ -715,57 +691,29 @@ def part_index(source_index: int) -> int: service_tier=metadata.service_tier, ) elif event_type == "response.output_item.added": - part = _started_output_item(event.item) - if isinstance(part, Thinking): - _validate_responses_reasoning_capability(part, self._capabilities.thinking) - if ( - isinstance(part, Thinking) - and not part.content - and not part.summary - and part.signature is None - ): - pending_reasoning[event.output_index] = part - else: - yield start_part(event.output_index, part) - elif event_type == "response.reasoning_text.delta": - if self._capabilities.thinking != "raw" and event.delta: - raise ValueError("Summarized Responses reasoning cannot contain raw text.") - # An empty delta must not materialize a deferred reasoning part. - if not event.delta and event.output_index in pending_reasoning: - continue - if (start := pending_reasoning.pop(event.output_index, None)) is not None: - yield start_part(event.output_index, start) - yield PartDeltaEvent( - index=part_index(event.output_index), - delta=ThinkingDelta(content_delta=event.delta), + part = ( + self._reasoning_part(event.item) + if event.item.type == "reasoning" + else _started_output_item(event.item) ) - elif event_type == "response.reasoning_summary_text.delta": - if self._capabilities.thinking != "summary" and event.delta: - raise ValueError("Raw Responses reasoning cannot contain a summary.") - # An empty delta must not materialize a deferred reasoning part. - if not event.delta and event.output_index in pending_reasoning: - continue - if (start := pending_reasoning.pop(event.output_index, None)) is not None: - yield start_part(event.output_index, start) - yield PartDeltaEvent( - index=part_index(event.output_index), - delta=ThinkingDelta(summary_delta=event.delta), + yield start_part(event.output_index, part) + elif event_type in { + "response.reasoning_text.delta", + "response.reasoning_summary_text.delta", + }: + delta = ( + ThinkingDelta(content_delta=event.delta) + if event_type == "response.reasoning_text.delta" + else ThinkingDelta(summary_delta=event.delta) ) + if event.delta: + yield PartDeltaEvent(index=part_index(event.output_index), delta=delta) elif event_type == "response.content_part.added": - # A part-added snapshot can carry initial text; empty ones are - # lifecycle echoes and must not materialize a deferred part. + # Part-added snapshots can carry initial text before the first delta. added_part = event.part if added_part.type == "reasoning_text" and added_part.text: - if self._capabilities.thinking != "raw": - raise ValueError( - "Summarized Responses reasoning cannot contain raw text." - ) - if (start := pending_reasoning.pop(event.output_index, None)) is not None: - yield start_part(event.output_index, start) - yield PartDeltaEvent( - index=part_index(event.output_index), - delta=ThinkingDelta(content_delta=added_part.text), - ) + delta = ThinkingDelta(content_delta=added_part.text) + yield PartDeltaEvent(index=part_index(event.output_index), delta=delta) elif added_part.type == "output_text": key = (event.output_index, event.content_index) # Non-text snapshots may precede the first text content. @@ -796,14 +744,8 @@ def part_index(source_index: int) -> int: elif event_type == "response.reasoning_summary_part.added": added_part = event.part if added_part.type == "summary_text" and added_part.text: - if self._capabilities.thinking != "summary": - raise ValueError("Raw Responses reasoning cannot contain a summary.") - if (start := pending_reasoning.pop(event.output_index, None)) is not None: - yield start_part(event.output_index, start) - yield PartDeltaEvent( - index=part_index(event.output_index), - delta=ThinkingDelta(summary_delta=added_part.text), - ) + delta = ThinkingDelta(summary_delta=added_part.text) + yield PartDeltaEvent(index=part_index(event.output_index), delta=delta) elif event_type == "response.output_text.delta": yield PartDeltaEvent( index=text_indices.get( @@ -855,26 +797,16 @@ def part_index(source_index: int) -> int: elif event_type == "response.output_item.done": if event.item.type == "message" and event.output_index in ended_text_items: continue - start = pending_reasoning.pop(event.output_index, None) - part = _completed_output_item(event.item) - if isinstance(part, Thinking): - _validate_responses_reasoning_capability(part, self._capabilities.thinking) - # Deferred items always start empty, so the part is omitted - # when it also completes without content or state. - if ( - start is not None - and not part.content - and not part.summary - and part.signature is None - ): - continue - if start is not None: - yield start_part(event.output_index, start) - if part.signature is not None: - yield PartDeltaEvent( - index=part_index(event.output_index), - delta=ThinkingDelta(signature_delta=part.signature), - ) + part = ( + self._reasoning_part(event.item) + if event.item.type == "reasoning" + else _completed_output_item(event.item) + ) + if isinstance(part, Thinking) and part.signature is not None: + yield PartDeltaEvent( + index=part_index(event.output_index), + delta=ThinkingDelta(signature_delta=part.signature), + ) yield PartEndEvent(index=part_index(event.output_index), part=part) elif event_type in {"response.completed", "response.incomplete"}: metadata = event.response @@ -959,14 +891,30 @@ def _handle_error(self, error: Exception, *, response: Response | None = None) - raise error -class OpenAIChatCompletionsClient( +class OpenAIResponsesClient(ResponsesClient): + """OpenAI's own Responses API, which defines no reasoning `format`.""" + + def _reasoning_part(self, item: Any) -> Thinking: + # OpenAI never labels reasoning with a format, so one here is opaque + # state from another implementation that translation would lose. + if getattr(item, "format", None) is not None: + raise ValueError("Responses reasoning format cannot be translated.") + return super()._reasoning_part(item) + + +class ChatCompletionsClient( BaseClient[ OpenAIChatCompletionsCreateRequest, OpenAIChatCompletionsStreamChunk, OpenAIChatCompletionsResponse, ] ): - """OpenAI Chat Completions transport for native and normalized streaming paths.""" + """Shared Chat Completions transport for native and normalized streaming paths. + + Every Chat Completions provider client inherits this implementation. It + ignores output extension fields it does not model; a provider client that + knows an extension owns its extraction and validation. + """ @staticmethod def _translate_tool(tool: FunctionTool) -> dict[str, Any]: @@ -975,6 +923,38 @@ def _translate_tool(tool: FunctionTool) -> dict[str, Any]: DEFAULT_BASE_URL = "https://api.openai.com/v1" REQUEST_MODEL = OpenAIChatCompletionsCreateRequest + # History nulls are wire values and are forwarded as sent. A provider whose + # input endpoint rejects them, although its own SDK output carries them, opts in. + OMIT_NULL_MESSAGE_FIELDS = False + OMIT_INCLUDE_OBFUSCATION = False + REASONING_FIELD: ChatReasoningField = "reasoning_content" + SIGNATURE_NAMESPACE: str | None = None + + @classmethod + def resolve_capabilities(cls, profile: ProviderCapabilities) -> ProviderCapabilities: + return replace( + profile, + chat_reasoning_field=profile.chat_reasoning_field or cls.REASONING_FIELD, + chat_signature_namespace=profile.chat_signature_namespace or cls.SIGNATURE_NAMESPACE, + ) + + def _request_kwargs( + self, request: OpenAIChatCompletionsCreateRequest | dict[str, Any] + ) -> dict[str, Any]: + body = super()._request_kwargs(request) + if self.OMIT_NULL_MESSAGE_FIELDS and isinstance(body.get("messages"), list): + # Nested values, such as opaque provider state, are left unchanged. + body["messages"] = [ + {name: value for name, value in message.items() if value is not None} + for message in body["messages"] + ] + if self.OMIT_INCLUDE_OBFUSCATION and isinstance(body.get("stream_options"), dict): + body["stream_options"] = { + name: value + for name, value in body["stream_options"].items() + if name != "include_obfuscation" + } + return body async def native_events( self, request: OpenAIChatCompletionsCreateRequest | dict[str, Any] @@ -1012,26 +992,61 @@ async def native_response( self._handle_error(error) @staticmethod - def _assistant_message(parts: list[Thinking | TextOutput | ToolCall]) -> dict[str, Any]: + def _assistant_messages( + parts: list[Thinking | TextOutput | ToolCall], + reasoning_field: str, + namespace: str | None, + ) -> list[dict[str, Any]]: + messages = [] message: dict[str, Any] = {"role": "assistant"} - reasoning_parts: list[str] = [] text_parts: list[dict[str, Any]] = [] - for part in parts: + pending_signature = None + has_reasoning = False + + def attach(target: dict[str, Any], signature: str) -> None: + if not namespace: + raise UnsupportedInput( + "Chat Completions cannot represent thinking signatures without a signature namespace." + ) + target["extra_content"] = {namespace: {"thought_signature": signature}} + + def finish_message() -> None: + if len(text_parts) == 1 and "prompt_cache_breakpoint" not in text_parts[0]: + message["content"] = text_parts[0]["text"] + elif text_parts or (reasoning_field not in message and "tool_calls" not in message): + message["content"] = list(text_parts) + messages.append(message) + text_parts.clear() + + for index, part in enumerate(parts): if isinstance(part, Thinking): - if part.signature is not None: - raise UnsupportedInput( - "Chat Completions cannot represent thinking signatures." - ) - if text_parts or "tool_calls" in message: + reasoning = part.content or part.summary + if reasoning and (text_parts or "tool_calls" in message): raise UnsupportedInput( "Chat Completions cannot preserve this assistant reasoning order." ) - reasoning_parts.append(part.content or part.summary) + # Each signed reasoning part needs its own message-level field. + # A signature-only prefix immediately before a tool belongs to that call. + prefixes_call = ( + not reasoning + and part.signature + and index + 1 < len(parts) + and isinstance(parts[index + 1], ToolCall) + ) + if prefixes_call: + pending_signature = part.signature + continue + starts_reasoning = bool(reasoning) or not part.signature + if (starts_reasoning and has_reasoning) or "extra_content" in message: + finish_message() + message = {"role": "assistant"} + has_reasoning = False + has_reasoning = has_reasoning or starts_reasoning + if reasoning: + message[reasoning_field] = reasoning + if part.signature: + attach(message, part.signature) elif isinstance(part, TextOutput): - if "tool_calls" in message: - raise UnsupportedInput( - "Chat Completions cannot preserve assistant text after tool calls." - ) text_parts.append( { "type": "text", @@ -1040,23 +1055,56 @@ def _assistant_message(parts: list[Thinking | TextOutput | ToolCall]) -> dict[st } ) elif isinstance(part, ToolCall): - message.setdefault("tool_calls", []).append( - { - "id": part.tool_call_id, - "type": "function", - "function": {"name": part.tool_name, "arguments": part.args or ""}, - } - ) - if reasoning_parts: - message["reasoning_content"] = "\n".join(reasoning_parts) - if len(text_parts) == 1 and "prompt_cache_breakpoint" not in text_parts[0]: - message["content"] = text_parts[0]["text"] - else: - message["content"] = text_parts if text_parts or not parts else None - return message + call = { + "id": part.tool_call_id, + "type": "function", + "function": {"name": part.tool_name, "arguments": part.args or ""}, + } + if pending_signature is not None: + attach(call, pending_signature) + pending_signature = None + message.setdefault("tool_calls", []).append(call) + finish_message() + return messages - @staticmethod - def _messages(request: NormalizedRequest) -> list[dict[str, Any]]: + @classmethod + def _messages( + cls, request: NormalizedRequest, *, capabilities: ProviderCapabilities | None = None + ) -> list[dict[str, Any]]: + namespace = ( + capabilities.chat_signature_namespace if capabilities else None + ) or cls.SIGNATURE_NAMESPACE + reasoning_field = ( + capabilities.chat_reasoning_field if capabilities else None + ) or cls.REASONING_FIELD + + def is_prefix(part: Any) -> bool: + return bool( + namespace + and isinstance(part, Thinking) + and part.signature + and not (part.content or part.summary) + ) + + items = [] + for item in request.input or []: + if namespace and isinstance(item, AssistantInput): + # A standalone Responses signature prefixes the next explicit + # message. Group unattached calls with its text when available. + signature_start = len(items) + while signature_start and is_prefix(items[signature_start - 1]): + signature_start -= 1 + start = signature_start + while start and ( + isinstance(items[start - 1], ToolCall) or is_prefix(items[start - 1]) + ): + start -= 1 + if start and isinstance(items[start - 1], AssistantInput): + start = signature_start + if start < len(items): + item = item.model_copy(update={"content": [*items[start:], *item.content]}) + del items[start:] + items.append(item) messages: list[dict[str, Any]] = [] assistant_parts: list[Thinking | TextOutput | ToolCall] = [] explicit_assistant = False @@ -1067,7 +1115,9 @@ def _messages(request: NormalizedRequest) -> list[dict[str, Any]]: def flush_assistant() -> None: nonlocal explicit_assistant if explicit_assistant or assistant_parts: - messages.append(OpenAIChatCompletionsClient._assistant_message(assistant_parts)) + messages.extend( + cls._assistant_messages(assistant_parts, reasoning_field, namespace) + ) assistant_parts.clear() explicit_assistant = False @@ -1076,7 +1126,7 @@ def flush_deferred_images() -> None: messages.extend(deferred_image_messages) deferred_image_messages.clear() - for item in request.input or []: + for item in items: if not isinstance(item, ToolReturn): flush_deferred_images() if isinstance(item, SystemPrompt): @@ -1123,13 +1173,16 @@ def flush_deferred_images() -> None: if ( explicit_assistant or any(isinstance(part, ToolCall) for part in assistant_parts) - or any(isinstance(part, Thinking) for part in item.content) + or any( + isinstance(part, Thinking) and not is_prefix(part) for part in item.content + ) ): flush_assistant() assistant_parts.extend(item.content) explicit_assistant = True elif isinstance(item, Thinking): - flush_assistant() + if not is_prefix(item): + flush_assistant() assistant_parts.append(item) elif isinstance(item, ToolCall): assistant_parts.append(item) @@ -1201,7 +1254,9 @@ def flush_deferred_images() -> None: return messages @classmethod - def _native_request(cls, request: NormalizedRequest) -> OpenAIChatCompletionsCreateRequest: + def _native_request( + cls, request: NormalizedRequest, *, capabilities: ProviderCapabilities | None = None + ) -> OpenAIChatCompletionsCreateRequest: cls._validate_request(request) stream_options: dict[str, Any] = {} if request.stream: @@ -1213,7 +1268,7 @@ def _native_request(cls, request: NormalizedRequest) -> OpenAIChatCompletionsCre stream_options["include_obfuscation"] = request.stream_options.include_obfuscation body: dict[str, Any] = { - "messages": cls._messages(request), + "messages": cls._messages(request, capabilities=capabilities), "model": request.model, "stream": request.stream, } @@ -1270,9 +1325,32 @@ def _validate_request(request: NormalizedRequest) -> None: if isinstance(item, ToolReturn) and item.tool_name is not None: raise UnsupportedInput("Chat Completions cannot represent tool return names.") + def _thought_state(self, extra_content: Any) -> tuple[bool, str | None]: + return chat_thought_state(extra_content, self._capabilities.chat_signature_namespace) + + @staticmethod + def _termination_reason(finish_reason: str, *, has_tool_calls: bool) -> TerminationReason: + try: + return _CHAT_TERMINATION_REASONS[finish_reason] + except KeyError as exc: + raise ValueError( + f"Unsupported Chat Completions finish reason: {finish_reason}" + ) from exc + async def _events(self, request: NormalizedRequest) -> AsyncIterator[ModelResponseStreamEvent]: + native_request = self._native_request(request, capabilities=self._capabilities) + async with aclosing(self.native_events(native_request)) as native_events: + async with aclosing(self._normalize_stream(native_events)) as events: + async for event in events: + yield event + + async def _normalize_stream( + self, native_events: AsyncIterator[OpenAIChatCompletionsStreamChunk] + ) -> AsyncIterator[ModelResponseStreamEvent]: + """Normalize native chunks without owning their transport lifecycle.""" response_metadata: ResponseStartEvent | None = None part_text = "" + pending_signature: str | None = None usage: Usage | None = None termination_reason: TerminationReason | None = None active_part: Literal["thinking", "text"] | None = None @@ -1291,171 +1369,208 @@ def start_part(part: Thinking | TextOutput) -> PartStartEvent: part_text = "" return PartStartEvent(index=active_part_index, part=part) - def end_active_part() -> PartEndEvent | None: - nonlocal active_part + def end_active_part() -> list[ModelResponseStreamEvent]: + nonlocal active_part, pending_signature if active_part == "thinking": - part: Thinking | TextOutput = self._classify_thinking(part_text) + part: Thinking | TextOutput = self._classify_thinking( + part_text, signature=pending_signature + ) elif active_part == "text": part = TextOutput(content=part_text) else: - return None + return [] + events: list[ModelResponseStreamEvent] = [] + if active_part == "thinking" and pending_signature: + events.append( + PartDeltaEvent( + index=active_part_index, + delta=ThinkingDelta(signature_delta=pending_signature), + ) + ) + pending_signature = None active_part = None - return PartEndEvent(index=active_part_index, part=part) + events.append(PartEndEvent(index=active_part_index, part=part)) + return events - def end_tool_call(tool_call_index: int) -> PartEndEvent: + def end_tool_call(tool_call_index: int) -> list[ModelResponseStreamEvent]: state = tool_calls[tool_call_index] - return PartEndEvent( - index=state.part_index, - part=ToolCall( - tool_call_id=state.tool_call_id, - tool_name=state.tool_name, - args=state.args, - ), - ) - - native_request = self._native_request(request) - async with aclosing(self.native_events(native_request)) as native_events: - async for chunk in native_events: - if response_metadata is None: - response_metadata = ResponseStartEvent( - id=chunk.id, - created_at=chunk.created, - model=chunk.model, - service_tier=chunk.service_tier, - ) - yield response_metadata - - if chunk.choices: - choice = chunk.choices[0] - reasoning_delta = getattr(choice.delta, "reasoning_content", None) - # Reasoning and text may interleave: a non-empty reasoning chunk - # ends an active text part and starts a new thinking part. Empty - # reasoning chunks carry nothing and never start or switch parts. + return [ + PartEndEvent( + index=state.part_index, + part=ToolCall( + tool_call_id=state.tool_call_id, + tool_name=state.tool_name, + args=state.args, + ), + ) + ] + + async for chunk in native_events: + if response_metadata is None: + response_metadata = ResponseStartEvent( + id=chunk.id, + created_at=chunk.created, + model=chunk.model, + service_tier=chunk.service_tier, + ) + yield response_metadata + + # The normalized response has one completion. Chunks for alternative + # choices can arrive separately or in any array position. + choice = next((choice for choice in chunk.choices if choice.index == 0), None) + if choice is not None: + marked, signature = self._thought_state( + getattr(choice.delta, "extra_content", None) + ) + reasoning_delta = chat_reasoning_text( + self._capabilities.chat_reasoning_field, + getattr(choice.delta, "reasoning", None), + getattr(choice.delta, "reasoning_content", None), + ) + visible_text = choice.delta.content + if marked: + reasoning_delta = visible_text or reasoning_delta + visible_text = None + # Reasoning and text may interleave: a non-empty reasoning chunk + # ends an active text part and starts a new thinking part. Empty + # reasoning chunks carry nothing and never start or switch parts. + if reasoning_delta or signature: + if active_tool_call_index is not None: + for event in end_tool_call(active_tool_call_index): + yield event + active_tool_call_index = None + if active_part == "text": + for event in end_active_part(): + yield event + if active_part is None: + yield start_part(Thinking(content="", summary="")) if reasoning_delta: - if active_part == "text": - ended_part = end_active_part() - if ended_part is not None: - yield ended_part - if active_part is None: - yield start_part(Thinking(content="", summary="")) part_text += reasoning_delta yield PartDeltaEvent( index=active_part_index, delta=self._classify_thinking_delta(reasoning_delta), ) + if signature: + pending_signature = signature - if choice.delta.content is not None: - is_empty_role_chunk = ( - choice.delta.role is not None and choice.delta.content == "" - ) - if not is_empty_role_chunk: - if active_part == "thinking": - ended_part = end_active_part() - if ended_part is not None: - yield ended_part - if active_part is None: - yield start_part(TextOutput(content="")) - if choice.delta.content: - part_text += choice.delta.content - yield PartDeltaEvent( - index=active_part_index, - delta=TextDelta(content_delta=choice.delta.content), - ) - - if choice.delta.tool_calls is not None: - ended_part = end_active_part() - if ended_part is not None: - yield ended_part - for tool_call_delta in choice.delta.tool_calls: - function_delta = tool_call_delta.function - state = tool_calls.get(tool_call_delta.index) - if state is None: - if ( - tool_call_delta.id is None - or function_delta is None - or function_delta.name is None - ): - raise ValueError( - "The first Chat Completions chunk for a tool call must " - "include its ID and function name." - ) - if active_tool_call_index is not None: - yield end_tool_call(active_tool_call_index) - state = _ChatToolCallState( - part_index=next_part_index, - tool_call_id=tool_call_delta.id, - tool_name=function_delta.name, - args=function_delta.arguments or "", - ) - tool_calls[tool_call_delta.index] = state - active_tool_call_index = tool_call_delta.index - yield PartStartEvent( - index=next_part_index, - part=ToolCall( - tool_call_id=state.tool_call_id, - tool_name=state.tool_name, - args=state.args, - ), - ) - next_part_index += 1 - continue + if visible_text: + if active_tool_call_index is not None: + for event in end_tool_call(active_tool_call_index): + yield event + active_tool_call_index = None + if active_part == "thinking": + for event in end_active_part(): + yield event + if active_part is None: + yield start_part(TextOutput(content="")) + part_text += visible_text + yield PartDeltaEvent( + index=active_part_index, + delta=TextDelta(content_delta=visible_text), + ) - if tool_call_delta.index != active_tool_call_index: + if choice.delta.tool_calls: + for event in end_active_part(): + yield event + for tool_call_delta in choice.delta.tool_calls: + if tool_call_delta.index is None: + raise ValueError("Chat Completions tool-call deltas require an index.") + _, tool_signature = self._thought_state( + getattr(tool_call_delta, "extra_content", None) + ) + function_delta = tool_call_delta.function + state = tool_calls.get(tool_call_delta.index) + if state is None: + if ( + tool_call_delta.id is None + or function_delta is None + or function_delta.name is None + ): raise ValueError( - "Chat Completions tool-call deltas must be contiguous by index." + "The first Chat Completions chunk for a tool call must " + "include its ID and function name." ) - - name_delta = ( - function_delta.name if function_delta is not None else None - ) - args_delta = ( - function_delta.arguments if function_delta is not None else None + if active_tool_call_index is not None: + for event in end_tool_call(active_tool_call_index): + yield event + if tool_signature: + part = Thinking(content="", summary="", signature=tool_signature) + yield PartStartEvent(index=next_part_index, part=part) + yield PartEndEvent(index=next_part_index, part=part) + next_part_index += 1 + state = _ChatToolCallState( + part_index=next_part_index, + tool_call_id=tool_call_delta.id, + tool_name=function_delta.name, + args=function_delta.arguments or "", ) - if name_delta == state.tool_name: - name_delta = None - tool_call_id_delta = tool_call_delta.id - if tool_call_id_delta == state.tool_call_id: - tool_call_id_delta = None - if name_delta is not None: - state.tool_name += name_delta - if args_delta is not None: - state.args += args_delta - if tool_call_id_delta is not None: - state.tool_call_id = tool_call_id_delta - yield PartDeltaEvent( - index=state.part_index, - delta=ToolCallDelta( - tool_name_delta=name_delta, - args_delta=args_delta, - tool_call_id=tool_call_id_delta, + tool_calls[tool_call_delta.index] = state + active_tool_call_index = tool_call_delta.index + yield PartStartEvent( + index=next_part_index, + part=ToolCall( + tool_call_id=state.tool_call_id, + tool_name=state.tool_name, + args=state.args, ), ) + next_part_index += 1 + continue - if choice.finish_reason is not None: - try: - termination_reason = _CHAT_TERMINATION_REASONS[choice.finish_reason] - except KeyError as exc: + if tool_signature: raise ValueError( - f"Unsupported Chat Completions finish reason: {choice.finish_reason}" - ) from exc - ended_part = end_active_part() - if ended_part is not None: - yield ended_part - if active_tool_call_index is not None: - yield end_tool_call(active_tool_call_index) - tool_calls.clear() - active_tool_call_index = None + "Chat Completions tool signatures must arrive with the start of the tool call." + ) + if tool_call_delta.index != active_tool_call_index: + raise ValueError( + "Chat Completions tool-call deltas must be contiguous by index." + ) + + name_delta = function_delta.name if function_delta is not None else None + args_delta = ( + function_delta.arguments if function_delta is not None else None + ) + if name_delta == state.tool_name: + name_delta = None + tool_call_id_delta = tool_call_delta.id + if tool_call_id_delta == state.tool_call_id: + tool_call_id_delta = None + if name_delta is not None: + state.tool_name += name_delta + if args_delta is not None: + state.args += args_delta + if tool_call_id_delta is not None: + state.tool_call_id = tool_call_id_delta + yield PartDeltaEvent( + index=state.part_index, + delta=ToolCallDelta( + tool_name_delta=name_delta, + args_delta=args_delta, + tool_call_id=tool_call_id_delta, + ), + ) + + if choice.finish_reason is not None: + termination_reason = self._termination_reason( + choice.finish_reason, has_tool_calls=bool(tool_calls) + ) + for event in end_active_part(): + yield event + if active_tool_call_index is not None: + for event in end_tool_call(active_tool_call_index): + yield event + tool_calls.clear() + active_tool_call_index = None - if chunk.usage is not None: - usage = _chat_usage(chunk.usage) + if chunk.usage is not None: + usage = _chat_usage(chunk.usage) if response_metadata is None: raise ValueError("Chat Completions stream did not contain a response chunk.") if termination_reason is None: raise ValueError("Chat Completions stream ended without a finish reason.") - ended_part = end_active_part() - if ended_part is not None: - yield ended_part + for event in end_active_part(): + yield event yield ResponseEndEvent( id=response_metadata.id, created_at=response_metadata.created_at, @@ -1506,3 +1621,14 @@ def _handle_error(self, error: Exception) -> NoReturn: body=error.body, ) from error raise error + + +class OpenAIChatCompletionsClient(ChatCompletionsClient): + """OpenAI's own Chat Completions API, which defines no `extra_content`.""" + + def _thought_state(self, extra_content: Any) -> tuple[bool, str | None]: + # The OpenAI API has no opaque extensions. Accept explicitly configured + # continuation state and reject fields translation cannot carry. + return chat_thought_state( + extra_content, self._capabilities.chat_signature_namespace, history=True + ) diff --git a/python/molto/upstream/openrouter.py b/python/molto/upstream/openrouter.py new file mode 100644 index 0000000..6790caa --- /dev/null +++ b/python/molto/upstream/openrouter.py @@ -0,0 +1,26 @@ +"""OpenRouter Responses transport and explicit reasoning interpretation.""" + +from dataclasses import replace +from typing import Any + +from molto.providers import ProviderCapabilities +from molto.types.normalized import Thinking +from molto.upstream.openai import ResponsesClient + + +class OpenRouterResponsesClient(ResponsesClient): + DEFAULT_BASE_URL = "https://openrouter.ai/api/v1" + REQUIRED_API_KEY = "OPENROUTER_API_KEY" + + @classmethod + def resolve_capabilities(cls, profile: ProviderCapabilities) -> ProviderCapabilities: + return replace(profile, thinking="raw") + + def _reasoning_part(self, item: Any) -> Thinking: + part = super()._reasoning_part(item) + format = getattr(item, "format", None) + # OpenRouter labels raw text with "unknown" rather than an opaque encoding. + # Signed/summary formats still require an explicit translation contract. + if format is not None and (format != "unknown" or part.summary or part.signature): + raise ValueError("Responses reasoning format cannot be translated.") + return part diff --git a/python/molto/upstream/registry.py b/python/molto/upstream/registry.py new file mode 100644 index 0000000..5d884e6 --- /dev/null +++ b/python/molto/upstream/registry.py @@ -0,0 +1,34 @@ +"""Explicit client selection for every accepted provider/protocol combination.""" + +from molto.providers import Endpoint, Provider +from molto.upstream.anthropic import AnthropicMessagesClient +from molto.upstream.base import BaseClient +from molto.upstream.bedrock import ( + BedrockChatCompletionsClient, + BedrockMessagesClient, + BedrockResponsesClient, +) +from molto.upstream.fireworks import FireworksChatCompletionsClient, FireworksResponsesClient +from molto.upstream.gemini import GeminiChatCompletionsClient +from molto.upstream.openai import OpenAIChatCompletionsClient, OpenAIResponsesClient +from molto.upstream.openrouter import OpenRouterResponsesClient +from molto.upstream.together import TogetherAIChatCompletionsClient, TogetherAIResponsesClient +from molto.upstream.vllm import VLLMChatCompletionsClient, VLLMMessagesClient, VLLMResponsesClient + +CLIENTS: dict[tuple[Provider, Endpoint], type[BaseClient]] = { + ("openai", "responses"): OpenAIResponsesClient, + ("openai", "chat/completions"): OpenAIChatCompletionsClient, + ("anthropic", "messages"): AnthropicMessagesClient, + ("vllm", "responses"): VLLMResponsesClient, + ("vllm", "chat/completions"): VLLMChatCompletionsClient, + ("vllm", "messages"): VLLMMessagesClient, + ("bedrock", "responses"): BedrockResponsesClient, + ("bedrock", "chat/completions"): BedrockChatCompletionsClient, + ("bedrock", "messages"): BedrockMessagesClient, + ("fireworks", "responses"): FireworksResponsesClient, + ("fireworks", "chat/completions"): FireworksChatCompletionsClient, + ("openrouter", "responses"): OpenRouterResponsesClient, + ("togetherai", "responses"): TogetherAIResponsesClient, + ("togetherai", "chat/completions"): TogetherAIChatCompletionsClient, + ("gemini", "chat/completions"): GeminiChatCompletionsClient, +} diff --git a/python/molto/upstream/together.py b/python/molto/upstream/together.py new file mode 100644 index 0000000..88d5928 --- /dev/null +++ b/python/molto/upstream/together.py @@ -0,0 +1,13 @@ +"""Together clients using the shared OpenAI protocol implementations.""" + +from molto.upstream.openai import ChatCompletionsClient, ResponsesClient + + +class TogetherAIResponsesClient(ResponsesClient): + DEFAULT_BASE_URL = "https://api.together.ai/v1" + REQUIRED_API_KEY = "TOGETHER_AI_API_KEY" + + +class TogetherAIChatCompletionsClient(ChatCompletionsClient): + DEFAULT_BASE_URL = "https://api.together.ai/v1" + REQUIRED_API_KEY = "TOGETHER_AI_API_KEY" diff --git a/python/molto/upstream/vllm.py b/python/molto/upstream/vllm.py new file mode 100644 index 0000000..fe7a645 --- /dev/null +++ b/python/molto/upstream/vllm.py @@ -0,0 +1,18 @@ +"""vLLM protocol clients sharing the canonical wire implementations.""" + +from molto.upstream.anthropic import AnthropicMessagesClient +from molto.upstream.openai import ChatCompletionsClient, ResponsesClient + + +class VLLMResponsesClient(ResponsesClient): + """vLLM Responses transport and normalization.""" + + +class VLLMChatCompletionsClient(ChatCompletionsClient): + """vLLM Chat Completions transport and normalization.""" + + REASONING_FIELD = "reasoning" + + +class VLLMMessagesClient(AnthropicMessagesClient): + """vLLM Messages transport and normalization.""" diff --git a/python/molto/utils/test.py b/python/molto/utils/test.py index 0fb1b8c..69fe219 100644 --- a/python/molto/utils/test.py +++ b/python/molto/utils/test.py @@ -234,7 +234,7 @@ def reconstructable_chat_completions_chunks( "total_tokens": usage["total_tokens"], "prompt_tokens_details": { "cached_tokens": prompt_details.get("cached_tokens") or 0, - "cache_write_tokens": prompt_details.get("cache_write_tokens") or 0, + "cache_write_tokens": prompt_details.get("cache_write_tokens"), }, "completion_tokens_details": { "reasoning_tokens": completion_details.get("reasoning_tokens") or 0, diff --git a/scripts/match_anthropic_cassette_events.py b/scripts/match_anthropic_cassette_events.py index 7e21e5c..06d3ddc 100644 --- a/scripts/match_anthropic_cassette_events.py +++ b/scripts/match_anthropic_cassette_events.py @@ -979,21 +979,25 @@ def _map_input_usage( raise ValueError("Responses input token details must be an object.") input_tokens = response_usage["input_tokens"] - cache_creation_tokens = input_details.get("cache_write_tokens", 0) + cache_creation_tokens = input_details.get("cache_write_tokens") cache_read_tokens = input_details.get("cached_tokens", 0) - if not all( - isinstance(value, int) - for value in (input_tokens, cache_creation_tokens, cache_read_tokens) + if ( + not isinstance(input_tokens, int) + or not isinstance(cache_read_tokens, int) + or (cache_creation_tokens is not None and not isinstance(cache_creation_tokens, int)) ): raise ValueError("Responses input token counts must be integers.") - message_input_tokens = input_tokens - cache_creation_tokens - cache_read_tokens + message_input_tokens = input_tokens - (cache_creation_tokens or 0) - cache_read_tokens if message_input_tokens < 0: raise ValueError("Responses cache tokens exceed total input tokens.") message_usage["input_tokens"] = message_input_tokens message_usage["cache_creation_input_tokens"] = cache_creation_tokens message_usage["cache_read_input_tokens"] = cache_read_tokens + if cache_creation_tokens is None: + message_usage.pop("cache_creation", None) + return if isinstance(message_usage.get("cache_creation"), dict): # OpenAI has one shared lifetime, so every projected write has the same TTL. message_usage["cache_creation"] = { diff --git a/scripts/match_anthropic_cassette_responses.py b/scripts/match_anthropic_cassette_responses.py index a7fa1ad..b71bee3 100644 --- a/scripts/match_anthropic_cassette_responses.py +++ b/scripts/match_anthropic_cassette_responses.py @@ -541,20 +541,24 @@ def _map_input_usage( raise ValueError("Responses input token details must be an object.") input_tokens = response_usage["input_tokens"] - cache_creation_tokens = input_details.get("cache_write_tokens", 0) + cache_creation_tokens = input_details.get("cache_write_tokens") cache_read_tokens = input_details.get("cached_tokens", 0) - if not all( - isinstance(value, int) - for value in (input_tokens, cache_creation_tokens, cache_read_tokens) + if ( + not isinstance(input_tokens, int) + or not isinstance(cache_read_tokens, int) + or (cache_creation_tokens is not None and not isinstance(cache_creation_tokens, int)) ): raise ValueError("Responses input token counts must be integers.") - message_input_tokens = input_tokens - cache_creation_tokens - cache_read_tokens + message_input_tokens = input_tokens - (cache_creation_tokens or 0) - cache_read_tokens if message_input_tokens < 0: raise ValueError("Responses cache tokens exceed total input tokens.") message_usage["input_tokens"] = message_input_tokens message_usage["cache_creation_input_tokens"] = cache_creation_tokens message_usage["cache_read_input_tokens"] = cache_read_tokens + if cache_creation_tokens is None: + message_usage.pop("cache_creation", None) + return cache_creation = message_usage.get("cache_creation") if isinstance(cache_creation, dict): if len(cache_lifetimes) > 1 and cache_creation_tokens: diff --git a/scripts/match_openai_cassette_events.py b/scripts/match_openai_cassette_events.py index 52f95ec..d907257 100644 --- a/scripts/match_openai_cassette_events.py +++ b/scripts/match_openai_cassette_events.py @@ -653,6 +653,8 @@ def _map_usage(response_usage: dict[str, Any], chat_usage: dict[str, Any]) -> No chat_usage["total_tokens"] = response_usage["total_tokens"] input_details = response_usage.get("input_tokens_details") or {} + if "cache_write_tokens" not in input_details and chat_usage.get("prompt_tokens_details"): + chat_usage["prompt_tokens_details"].pop("cache_write_tokens", None) if input_details: prompt_details = chat_usage.get("prompt_tokens_details") or {} for field in ("cache_write_tokens", "cached_tokens"): diff --git a/scripts/match_openai_cassette_responses.py b/scripts/match_openai_cassette_responses.py index 6d2461b..3b9ceff 100644 --- a/scripts/match_openai_cassette_responses.py +++ b/scripts/match_openai_cassette_responses.py @@ -195,6 +195,8 @@ def _map_usage(response_usage: dict[str, Any], chat_usage: dict[str, Any]) -> No chat_usage["total_tokens"] = response_usage["total_tokens"] input_details = response_usage.get("input_tokens_details") or {} + if "cache_write_tokens" not in input_details and chat_usage.get("prompt_tokens_details"): + chat_usage["prompt_tokens_details"].pop("cache_write_tokens", None) prompt_details = { field: input_details[field] for field in ("cache_write_tokens", "cached_tokens") diff --git a/scripts/recorder_proxy.py b/scripts/recorder_proxy.py index 0ab8897..cba3c50 100644 --- a/scripts/recorder_proxy.py +++ b/scripts/recorder_proxy.py @@ -10,6 +10,7 @@ import argparse import json +from collections.abc import Awaitable, Callable from contextlib import asynccontextmanager from datetime import datetime, timezone from pathlib import Path @@ -18,46 +19,21 @@ import uvicorn from anyio import CancelScope from fastapi import FastAPI, Request, Response -from fastapi.responses import JSONResponse, StreamingResponse -from httpx import AsyncClient, HTTPStatusError +from fastapi.responses import StreamingResponse +from httpx import URL, AsyncClient from loguru import logger -from pydantic_ai.retries import AsyncTenacityTransport, RetryConfig, wait_retry_after from starlette.types import Send -from tenacity import retry_if_exception_type, stop_after_attempt, wait_exponential from uuid_utils import uuid7 from yaml import dump as yaml_dump -# Defaults -OUTPUT_DIR = Path("tests") / "cassettes/matched/tool_call" +# Unreviewed captures must never enter the matched fixture corpus. +OUTPUT_DIR = Path("/tmp/molto-recordings") TARGET_HOST = "https://api.openai.com" TIMEOUT = 60 * 5 # 5 minutes - -def should_retry_status(response) -> None: - """Raise exceptions for retryable HTTP status codes.""" - if response.status_code in (429, 502, 503, 504): - response.raise_for_status() # This will raise HTTPStatusError - - -HTTP_CLIENT = AsyncClient( - timeout=TIMEOUT, - transport=AsyncTenacityTransport( - config=RetryConfig( - # Retry on HTTP errors and connection issues - retry=retry_if_exception_type((HTTPStatusError, ConnectionError)), - # Smart waiting: respects Retry-After headers, falls back to exponential backoff - wait=wait_retry_after( - fallback_strategy=wait_exponential(multiplier=1, max=60), - max_wait=300, - ), - # Stop after 5 attempts - stop=stop_after_attempt(5), - # Re-raise the last exception if all retries fail - reraise=True, - ), - validate_response=should_retry_status, - ), -) +# Each exchange is evidence: retries would conceal the original provider failure. +# Native SDK callers must likewise set max_retries=0. +HTTP_CLIENT = AsyncClient(timeout=TIMEOUT) # Headers to record (whitelist) RECORDED_HEADERS = { @@ -71,6 +47,9 @@ def should_retry_status(response) -> None: "connection", # Helpful for grouping multi-request tool loops into a single "run" "x-run-id", + "x-request-id", + "request-id", + "retry-after", } # Headers to exclude when forwarding response (they're handled by httpx/client) @@ -115,8 +94,6 @@ def save_recording(recording: dict[str, Any], filename: str): """Save recording to file.""" OUTPUT_DIR.mkdir(parents=True, exist_ok=True) filepath = OUTPUT_DIR / filename - # with open(filepath, "w", encoding="utf-8") as f: - # json.dump(recording, f, indent=2, ensure_ascii=False) with open(filepath.with_suffix(".yaml"), "w", encoding="utf-8") as f: yaml_dump(recording, f, allow_unicode=True, encoding="utf-8") @@ -131,6 +108,10 @@ async def lifespan(app: FastAPI): class RecordingStreamingResponse(StreamingResponse): + def __init__(self, *args, on_close: Callable[[], Awaitable[None]], **kwargs): + super().__init__(*args, **kwargs) + self.on_close = on_close + async def stream_response(self, send: Send) -> None: try: await super().stream_response(send) @@ -138,7 +119,46 @@ async def stream_response(self, send: Send) -> None: # A disconnect during send leaves the generator suspended at yield. # Close it explicitly so its recording is saved before returning. with CancelScope(shield=True): - await self.body_iterator.aclose() + try: + await self.body_iterator.aclose() + finally: + await self.on_close() + + +def decode_body(body: bytes, content_type: str) -> Any: + """Retain malformed or non-JSON bodies without inventing a JSON representation.""" + media_type = content_type.partition(";")[0].strip().lower() + if media_type == "application/json" or media_type.endswith("+json"): + try: + return json.loads(body) + except (ValueError, UnicodeDecodeError): + pass + try: + return body.decode("utf-8") + except UnicodeDecodeError: + return body + + +CREDENTIAL_QUERY_PARAMS = {"key", "api_key", "api-key", "access_token"} + + +def mask_secrets(value: Any, secrets: list[str]) -> Any: + """Mask known request credentials, including credentials echoed by an upstream error.""" + if isinstance(value, dict): + return {key: mask_secrets(item, secrets) for key, item in value.items()} + if isinstance(value, list): + return [mask_secrets(item, secrets) for item in value] + if isinstance(value, (str, bytes)): + for secret in secrets: + # Molto's fixed vLLM placeholder is not secret. Replacing it would + # corrupt unrelated text; real credentials remain masked at any length. + if secret in {"", "EMPTY", "Bearer EMPTY"}: + continue + if isinstance(value, bytes): + value = value.replace(secret.encode(), b"***") + else: + value = value.replace(secret, "***") + return value @app.api_route( @@ -146,119 +166,138 @@ async def stream_response(self, send: Send) -> None: methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"], ) async def proxy_request(request: Request, path: str) -> Response: - """Proxy all requests and record them.""" - # Generate request ID + """Forward one exchange without retries and retain its observed completion state.""" request_id = str(uuid7()) - now = datetime.now() + now = datetime.now(timezone.utc) filename = f"{now.strftime('%Y-%m-%d')}-{request_id}" - logger.info(f"Recording `{path}` to `{OUTPUT_DIR / filename}`...") - - # Build target URL - query_string = str(request.query_params) - target_url = f"{TARGET_HOST}/{path}" - if query_string: - target_url += f"?{query_string}" - - # Parse request body + logger.info("Recording exchange to {}", OUTPUT_DIR / filename) + target = URL(TARGET_HOST) + if target.username or target.password or target.query: + raise ValueError("Configure credentials on the SDK, not in the proxy target URL") + target_url = f"{TARGET_HOST.rstrip('/')}/{path}" + secrets = [ + value + for name, value in request.headers.items() + if name.lower() in {"authorization", "x-api-key", "api-key"} and value + ] + authorization = request.headers.get("authorization", "") + if authorization.lower().startswith("bearer "): + secrets.append(authorization[7:]) + secrets.extend( + value + for name, value in request.query_params.multi_items() + if name.lower() in CREDENTIAL_QUERY_PARAMS and value + ) body = await request.body() - if not body: - body = None - parsed_body = json.loads(body.decode("utf-8")) - - # Prepare recording structure + parsed_body = decode_body(body, request.headers.get("content-type", "")) recording: dict[str, Any] = { - "timestamp": now.astimezone(timezone.utc).isoformat(), + "timestamp": now.isoformat(), "request_id": request_id, "filename": filename, + "upstream_url": target_url, "request": { "method": request.method, "path": f"/{path}", - "query_params": dict(request.query_params), + # A credential's own field is masked whatever its length. + "query_params": { + name: "***" if name.lower() in CREDENTIAL_QUERY_PARAMS and value else value + for name, value in request.query_params.items() + }, "headers": filter_headers(request.headers), "body": parsed_body, }, - "response": { - "status_code": None, - "headers": {}, - }, + "response": {"status_code": None, "headers": {}}, } - - # Make the request new_headers = {k: v for k, v in request.headers.items() if k.lower() != "host"} - media_type = "application/json" - if parsed_body.get("stream", False): - - async def _stream() -> AsyncGenerator[Response | str, None]: - async with HTTP_CLIENT.stream( - method=request.method, - url=target_url, - headers=new_headers, - content=body, - timeout=TIMEOUT, - ) as response: - recording["response"]["status_code"] = response.status_code - recording["response"]["headers"] = filter_headers(response.headers) - try: - yield response - - if response.status_code != 200: - chunk_str = (await response.aread()).decode() - if media_type == "application/json": - recording["response"]["body"] = json.loads(chunk_str) + upstream_request = HTTP_CLIENT.build_request( + request.method, + target_url, + params=request.query_params.multi_items(), + headers=new_headers, + content=body, + timeout=TIMEOUT, + ) + try: + response = await HTTP_CLIENT.send(upstream_request, stream=True) + except Exception as exc: + # Exception text can contain credential-bearing URLs. Retain the class only. + recording["response"]["transport_error"] = type(exc).__name__ + save_recording(mask_secrets(recording, secrets), filename) + raise + result = recording["response"] + result["status_code"] = response.status_code + result["headers"] = filter_headers(response.headers) + media_type = response.headers.get("content-type", "") + if media_type.partition(";")[0].strip().lower() == "text/event-stream": + result.update(sse=[], stream_status="disconnected", terminal_event=None, error_event=False) + + async def close_stream() -> None: + await response.aclose() + save_recording(mask_secrets(recording, secrets), filename) + + async def stream() -> AsyncGenerator[str, None]: + try: + async for line in response.aiter_lines(): + # This is ordered SSE-line evidence, not original TCP/newline bytes. + result["sse"].append(f"{line}\n") + if line.startswith("event:"): + event_type = line.removeprefix("event:").strip() + if event_type in { + "response.completed", + "response.incomplete", + "response.failed", + "message_stop", + }: + result["terminal_event"] = event_type + if event_type == "error": + result["error_event"] = True + if line.startswith("data:"): + data = line.removeprefix("data:").strip() + if data == "[DONE]": + result["terminal_event"] = "[DONE]" else: - recording["response"]["body"] = chunk_str - yield chunk_str - else: - sse_events = recording["response"]["sse"] = [] - try: - async for chunk_str in response.aiter_lines(): - chunk_str = f"{chunk_str}\n" - # Retain the line before yielding: the SDK may close - # the stream as soon as it receives an error event. - sse_events.append(chunk_str) - yield chunk_str - except Exception as e: - recording["response"]["stream_error"] = f"{e.__class__.__name__}: {e}" - finally: - save_recording(recording, recording["filename"]) - logger.info("Streaming recording saved.") + try: + event = json.loads(data) + except ValueError: + event = None + if isinstance(event, dict) and ( + event.get("type") == "error" or "error" in event + ): + result["error_event"] = True + yield f"{line}\n" + result["stream_status"] = "complete" + except Exception as exc: + result["stream_status"] = "transport_error" + result["transport_error"] = type(exc).__name__ + raise - agen = _stream() - response: Response = await anext(agen) - media_type = response.headers.get("content-type", "text/event-stream") return RecordingStreamingResponse( - agen, + stream(), + on_close=close_stream, status_code=response.status_code, headers=filter_response_headers(response.headers), - media_type=media_type, - ) - # Regular request - else: - response = await HTTP_CLIENT.request( - method=request.method, - url=target_url, - headers=new_headers, - content=body, - timeout=TIMEOUT, - ) - media_type = response.headers.get("content-type", "application/json") - if response.status_code != 200: - body = response.text - if media_type == "application/json": - body = json.loads(body) - else: - body = response.json() - recording["response"]["body"] = body - recording["response"]["status_code"] = response.status_code - recording["response"]["headers"] = filter_headers(response.headers) - save_recording(recording, recording["filename"]) - return JSONResponse( - content=body, - status_code=response.status_code, - headers=filter_response_headers(response.headers), - media_type=media_type, ) + chunks = [] + try: + async for chunk in response.aiter_bytes(): + chunks.append(chunk) + except Exception as exc: + result["transport_error"] = type(exc).__name__ + raise + finally: + # Retain bytes received before a read failure as incomplete evidence too. + response_body = b"".join(chunks) + result["body"] = decode_body(response_body, media_type) + with CancelScope(shield=True): + await response.aclose() + save_recording(mask_secrets(recording, secrets), filename) + return Response( + content=response_body, + status_code=response.status_code, + headers=filter_response_headers(response.headers), + ) + def main(): """Run the recording proxy server.""" @@ -286,15 +325,18 @@ def main(): ) parser.add_argument( "--host", - default="0.0.0.0", + default="127.0.0.1", ) args = parser.parse_args() OUTPUT_DIR = Path(args.output_dir) TARGET_HOST = args.target.rstrip("/") + target = URL(TARGET_HOST) + if target.username or target.password or target.query: + parser.error("Configure credentials on the SDK, not in the proxy target URL") - print("🎬 Recording Proxy Starting...") + print("Recording Proxy Starting (no retries)...") print(f" Proxy: http://{args.host}:{args.port}") print(f" Target: {TARGET_HOST}") print(f" Output: {OUTPUT_DIR.absolute()}") @@ -305,6 +347,8 @@ def main(): host=args.host, port=args.port, log_level="info", + # Access logs include the raw query string, which can contain credentials. + access_log=False, ) diff --git a/scripts/smoke_provider.py b/scripts/smoke_provider.py new file mode 100644 index 0000000..918cfb5 --- /dev/null +++ b/scripts/smoke_provider.py @@ -0,0 +1,256 @@ +"""Opt-in live checks for one explicit provider/model, without recording fixtures. + +Run with ``python -m scripts.smoke_provider --help`` from the repository root. +Passing the required arguments authorizes live requests, which may incur provider charges. +""" + +import argparse +import asyncio +import json +from contextlib import aclosing +from copy import deepcopy +from typing import get_args + +import httpx + +from molto import Molto +from molto.providers import Endpoint, Provider +from molto.utils.test import collect_sdk_response + +PROTOCOLS = get_args(Endpoint) +FUNCTION = { + "name": "add", + "description": "Add two integers.", + "parameters": { + "type": "object", + "properties": {"a": {"type": "integer"}, "b": {"type": "integer"}}, + "required": ["a", "b"], + "additionalProperties": False, + }, + "strict": False, +} + + +def request_body(protocol, model, stream, max_tokens, *, tools=False): + prompt = "Call add with a=2 and b=3, then report the result." if tools else "Reply with OK." + body = {"model": model, "stream": stream} + if protocol == "responses": + body.update(input=[{"role": "user", "content": prompt}], max_output_tokens=max_tokens) + if tools: + body.update( + tools=[{"type": "function", **deepcopy(FUNCTION)}], + tool_choice={"type": "function", "name": "add"}, + ) + else: + body["messages"] = [{"role": "user", "content": prompt}] + body["max_tokens" if protocol == "messages" else "max_completion_tokens"] = max_tokens + if tools: + if protocol == "messages": + body.update( + tools=[ + { + "name": "add", + "description": FUNCTION["description"], + "input_schema": deepcopy(FUNCTION["parameters"]), + } + ], + tool_choice={"type": "tool", "name": "add"}, + ) + else: + body.update( + tools=[{"type": "function", "function": deepcopy(FUNCTION)}], + tool_choice={"type": "function", "function": {"name": "add"}}, + ) + return body + + +def response_parts(protocol, response): + """Read observable content and portable calls from each SDK response.""" + if protocol == "responses": + assert response.status == "completed", "Response did not complete" + return response.output_text, [ + (item.call_id, item.name, json.loads(item.arguments)) + for item in response.output + if item.type == "function_call" + ] + if protocol == "messages": + calls = [ + (item.id, item.name, item.input) + for item in response.content + if item.type == "tool_use" + ] + assert response.stop_reason == ("tool_use" if calls else "end_turn"), ( + "Unexpected Messages stop reason" + ) + return "".join(item.text for item in response.content if item.type == "text"), calls + choice = response.choices[0] + assert choice.finish_reason in {"stop", "tool_calls"}, "Unexpected Chat finish reason" + return choice.message.content or "", [ + (item.id, item.function.name, json.loads(item.function.arguments)) + for item in choice.message.tool_calls or [] + ] + + +def append_tool_result(protocol, body, response, call_id): + """Carry actual output forward, removing only SDK output bookkeeping.""" + if protocol == "responses": + body["input"].extend( + item.model_dump(exclude_unset=True, exclude={"status"}) for item in response.output + ) + body["input"].append({"type": "function_call_output", "call_id": call_id, "output": "5"}) + elif protocol == "messages": + blocks = [block.model_dump(exclude_unset=True) for block in response.content] + for block in blocks: + if block.get("caller") == {"type": "direct"}: + block.pop("caller") + if block.get("type") == "thinking" and not block.get("signature"): + block.pop("signature", None) + body["messages"].extend( + [ + {"role": "assistant", "content": blocks}, + { + "role": "user", + "content": [{"type": "tool_result", "tool_use_id": call_id, "content": "5"}], + }, + ] + ) + else: + history = response.choices[0].message.model_dump(exclude_unset=True) + assert history.pop("annotations", None) in (None, []), "Annotated history needs a policy" + history.pop("parsed", None) + for field in ("reasoning_content", "tool_calls"): + if history.get(field) is None: + history.pop(field, None) + # Some compatible providers repeat role in each chunk; the SDK concatenates it. + assert history["role"] and not history["role"].replace("assistant", "") + history["role"] = "assistant" + for call in history.get("tool_calls", []): + call.pop("index", None) + call["function"].pop("parsed_arguments", None) + body["messages"].extend( + [history, {"role": "tool", "tool_call_id": call_id, "content": "5"}] + ) + body["tool_choice"] = "none" if protocol != "messages" else {"type": "none"} + + +async def complete(client, protocol, body, options): + coordinator = getattr(client, protocol.replace("/", "_")) + response = await coordinator(body=body, **options) + if body["stream"]: + async with aclosing(response): + return collect_sdk_response(protocol, [event async for event in response]) + return response + + +async def run(args): + """Run native and selected translated checks with finite HTTP and wall-clock budgets.""" + request_count = 0 + failures = 0 + + async def count_request(request): + nonlocal request_count + if request_count >= args.max_requests: + raise RuntimeError("Smoke HTTP request budget exhausted") + request_count += 1 + + options = {"provider": args.provider, "endpoint": args.upstream, "base_url": args.base_url} + if args.extra_body: + options["extra_body"] = args.extra_body + protocols = list(dict.fromkeys([args.upstream, *(args.downstream or PROTOCOLS)])) + modes = [False, True] if args.mode == "both" else [args.mode == "stream"] + try: + async with ( + asyncio.timeout(args.deadline), + Molto( + http_client=httpx.AsyncClient( + timeout=args.timeout, event_hooks={"request": [count_request]} + ) + ) as client, + ): + for protocol in protocols: + for stream in modes: + for tools in (False, True): + label = f"{protocol} {'stream' if stream else 'non-stream'} {'tool' if tools else 'text'}" + try: + body = request_body( + protocol, args.model, stream, args.max_tokens, tools=tools + ) + response = await complete(client, protocol, body, options) + text, calls = response_parts(protocol, response) + if tools: + assert len(calls) == 1 and calls[0][1:] == ( + "add", + {"a": 2, "b": 3}, + ), "Unexpected tool call" + append_tool_result(protocol, body, response, calls[0][0]) + text, calls = response_parts( + protocol, await complete(client, protocol, body, options) + ) + assert "5" in text, "Tool result absent from final answer" + assert text.strip() and not calls, ( + "Final answer is missing or calls a tool" + ) + print(f"PASS {label}", flush=True) + except Exception as error: + failures += 1 + status = getattr(error, "status_code", None) + print( + f"FAIL {label}: {type(error).__name__} status={status}", flush=True + ) + if request_count >= args.max_requests: + return 1 + except TimeoutError: + failures += 1 + print("FAIL run deadline exceeded", flush=True) + finally: + print( + f"HTTP attempts: {request_count}/{args.max_requests}; failed cases: {failures}", + flush=True, + ) + return int(bool(failures)) + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--provider", required=True, choices=get_args(Provider)) + parser.add_argument("--model", required=True) + parser.add_argument("--upstream", required=True, choices=PROTOCOLS) + parser.add_argument("--downstream", action="append", choices=PROTOCOLS) + parser.add_argument("--base-url") + parser.add_argument( + "--extra-body", help="Provider options as JSON; never include credentials." + ) + parser.add_argument("--mode", choices=("both", "stream", "non-stream"), default="both") + parser.add_argument("--max-tokens", type=int, default=512) + parser.add_argument("--max-requests", type=int, default=18) + parser.add_argument("--timeout", type=float, default=45) + parser.add_argument("--deadline", type=float, default=180) + args = parser.parse_args(argv) + if min(args.max_tokens, args.max_requests, args.timeout, args.deadline) <= 0: + parser.error("Token, request, and time limits must be positive") + if args.extra_body: + try: + args.extra_body = json.loads(args.extra_body) + except json.JSONDecodeError: + parser.error("--extra-body must be a valid JSON object") + if not isinstance(args.extra_body, dict): + parser.error("--extra-body must be a JSON object") + if args.extra_body.keys() & { + "model", + "input", + "messages", + "tools", + "tool_choice", + "stream", + "max_tokens", + "max_completion_tokens", + "max_output_tokens", + }: + parser.error( + "--extra-body cannot override smoke inputs, tools, modes, or token limits" + ) + return asyncio.run(run(args)) + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/adapters/test_anthropic.py b/tests/adapters/test_anthropic.py index a974758..1c24793 100644 --- a/tests/adapters/test_anthropic.py +++ b/tests/adapters/test_anthropic.py @@ -60,6 +60,23 @@ def _normalize(request: AnthropicMessagesCreateRequest, capabilities: ProviderCa return AnthropicMessagesAdapter(capabilities).normalize_request(request) +@pytest.mark.parametrize("signature_fields", [{}, {"signature": ""}]) +def test_normalization_preserves_unsigned_raw_history(signature_fields): + """Ensures raw continuation accepts omitted or empty signatures without changing reasoning.""" + request = _request( + messages=[ + { + "role": "assistant", + "content": [{"type": "thinking", "thinking": "Raw thought", **signature_fields}], + } + ] + ) + normalized = _normalize(request, ProviderCapabilities(thinking="raw")) + assert normalized.input == [ + AssistantInput(content=[Thinking(content="Raw thought", summary="", signature=None)]) + ] + + @pytest.mark.parametrize("signature_fields", [{}, {"signature": ""}, {"signature": "state"}]) def test_normalization_preserves_summary_history(signature_fields: dict[str, str]) -> None: """Ensures normalization preserves summary history for destination-owned validation.""" @@ -72,7 +89,7 @@ def test_normalization_preserves_summary_history(signature_fields: dict[str, str ] ) - normalized = _normalize(request, _CAPABILITIES) + normalized = _normalize(request, ProviderCapabilities(thinking="summary")) assert normalized.input == [ AssistantInput( content=[ @@ -537,7 +554,8 @@ async def test_projection_skips_empty_thinking_delta() -> None: async def test_projection_supports_official_empty_summary_start() -> None: - adapter, request = _adapter() + """Ensures signed summaries preserve their text and signature under both output policies.""" + adapter, request = _adapter(ProviderCapabilities(thinking="summary")) events = [ event @@ -562,27 +580,53 @@ async def test_projection_supports_official_empty_summary_start() -> None: assert [delta.type for delta in deltas] == ["thinking_delta", "signature_delta"] -async def test_projection_rejects_reasoning_outside_capability() -> None: +@pytest.mark.parametrize("first", ["raw", "summary"]) +async def test_projection_streams_first_representation_per_block(first) -> None: + """Ensures each block selects text on first arrival and keeps its final signature.""" adapter, request = _adapter() - with pytest.raises(ValueError, match="cannot contain raw reasoning"): - [ - event - async for event in adapter.project_events( - _stream( - _MESSAGE_START, - PartStartEvent(index=0, part=Thinking(content="", summary="")), - PartDeltaEvent(index=0, delta=ThinkingDelta(content_delta="raw")), - ), - request, - ) - ] + def delta(text, raw): + return ThinkingDelta(content_delta=text) if raw else ThinkingDelta(summary_delta=text) + + raw_first = first == "raw" + final = Thinking( + content="AC!" if raw_first else "B", + summary="B" if raw_first else "AC!", + signature="signed", + ) + events = [ + event + async for event in adapter.project_events( + _stream( + _MESSAGE_START, + PartStartEvent(index=0, part=Thinking(content="", summary="", signature="early")), + PartDeltaEvent(index=0, delta=delta("A", raw_first)), + PartDeltaEvent(index=0, delta=delta("B", not raw_first)), + PartDeltaEvent(index=0, delta=delta("C", raw_first)), + PartEndEvent(index=0, part=final), + PartStartEvent(index=1, part=Thinking(content="raw", summary="other")), + PartEndEvent(index=1, part=Thinking(content="raw", summary="other")), + _MESSAGE_END, + ), + request, + ) + ] + result = await adapter.project_response(_native_stream(*events), request) + assert [(block.thinking, block.signature) for block in result.content] == [ + ("AC!", "signed"), + ("raw", ""), + ] + assert [ + e.delta.thinking + for e in events + if e.type == "content_block_delta" and e.delta.type == "thinking_delta" + ] == ["A", "C", "!"] @pytest.mark.parametrize("signature", [None, ""]) async def test_projection_preserves_unsigned_summary_completion(signature: str | None) -> None: """Ensures missing output signatures do not discard streamed reasoning summaries.""" - adapter, request = _adapter() + adapter, request = _adapter(ProviderCapabilities(thinking="summary")) events = [ event diff --git a/tests/adapters/test_openai.py b/tests/adapters/test_openai.py index 439cc1a..a221ad2 100644 --- a/tests/adapters/test_openai.py +++ b/tests/adapters/test_openai.py @@ -41,6 +41,27 @@ _CAPABILITIES = PROVIDER_CAPABILITIES["openai"] +@pytest.mark.parametrize( + "schema", + [ + {"type": "object", "properties": {"query": {"type": "string"}}}, + {"type": "object", "properties": {}, "additionalProperties": False}, + ], +) +def test_responses_default_strictness_preserves_schema(schema): + """Ensures the strict default neither repairs schemas nor mutates the caller's tool.""" + request = OpenAIResponsesCreateRequest( + model="m", + input="Hello", + tools=[{"type": "function", "name": "lookup", "parameters": schema}], + ) + original = request.model_dump() + normalized = OpenAIResponsesAdapter(_CAPABILITIES).normalize_request(request) + assert normalized.tools[0].strict is True + assert normalized.tools[0].parameters == schema + assert request.model_dump() == original + + @pytest.mark.parametrize( "content", [ @@ -649,7 +670,7 @@ async def test_responses_response_projection_returns_terminal_response() -> None request, ) - assert type(response) is OpenAIResponsesResponse + assert isinstance(response, OpenAIResponsesResponse) assert response.id == "resp_123" assert response.status == "completed" assert response.output[0].content[0].text == "Answer" @@ -814,6 +835,46 @@ async def test_chat_response_projection_handles_completion_without_content() -> assert choice.message.content is None +@pytest.mark.parametrize("provider", ["openai", "vllm", "openrouter"]) +@pytest.mark.parametrize( + ("part", "deltas", "expected"), + [ + (Thinking(content="", summary=""), [ThinkingDelta(content_delta="raw")], "raw"), + (Thinking(content="", summary=""), [ThinkingDelta(summary_delta="summary")], "summary"), + (Thinking(content="raw", summary=""), [], "raw"), + (Thinking(content="", summary="summary"), [], "summary"), + ], + ids=["raw-delta", "summary-delta", "raw-start", "summary-start"], +) +async def test_chat_projection_carries_either_reasoning_representation( + provider, part, deltas, expected +) -> None: + """Ensures Chat reasoning carries raw text or a summary whatever the provider profile.""" + adapter, request = _chat_adapter(PROVIDER_CAPABILITIES[provider]) + completed = Thinking( + content=part.content + "".join(delta.content_delta or "" for delta in deltas), + summary=part.summary + "".join(delta.summary_delta or "" for delta in deltas), + ) + + response = await adapter.project_response( + adapter.project_events( + _stream( + _CHAT_START, + PartStartEvent(index=0, part=part), + *(PartDeltaEvent(index=0, delta=delta) for delta in deltas), + PartEndEvent(index=0, part=completed), + ResponseEndEvent( + id="chatcmpl_123", created_at=1, model="m", termination_reason="stop" + ), + ), + request, + ), + request, + ) + + assert response.choices[0].message.reasoning_content == expected + + async def test_chat_response_projection_rejects_missing_finish_reason() -> None: adapter, request = _chat_adapter(_CAPABILITIES) @@ -1014,31 +1075,58 @@ async def test_responses_projection_preserves_signature_only_reasoning_snapshots @pytest.mark.parametrize( - "deltas", - [ - ( - ThinkingDelta(content_delta="raw"), - ThinkingDelta(summary_delta="summary"), - ), - ], + "capabilities", [PROVIDER_CAPABILITIES["openai"], PROVIDER_CAPABILITIES["vllm"]] ) -async def test_responses_projection_rejects_reasoning_outside_capability( - deltas: tuple[ThinkingDelta, ...], +@pytest.mark.parametrize("populated_start", [True, False]) +async def test_responses_projection_preserves_both_text_lifecycles( + capabilities, populated_start ) -> None: - adapter, request = _responses_adapter(_CAPABILITIES) - - with pytest.raises(ValueError, match="cannot contain raw text"): + """Ensures each explicit representation has a balanced lifecycle and shares the final signature.""" + adapter, request = _responses_adapter(capabilities) + start = Thinking( + content="R" if populated_start else "", + summary="S" if populated_start else "", + signature="initial", + ) + delta = ThinkingDelta(content_delta="aw", summary_delta="ummary", signature_delta="final") + completed = Thinking(content="Raw", summary="Summary", signature="final") + events = [ + event + async for event in adapter.project_events( + _stream( + _RESPONSE_START, + PartStartEvent(index=0, part=start), + *([PartDeltaEvent(index=0, delta=delta)] if populated_start else []), + PartEndEvent(index=0, part=completed), + _RESPONSE_END, + ), + request, + ) + ] + assert [ + (event.type, event.part.text) for event in events if event.type.endswith("part.added") + ] == [ + ("response.content_part.added", start.content), + ("response.reasoning_summary_part.added", start.summary), + ] + assert [(event.type, event.delta) for event in events if event.type.endswith(".delta")] == ( [ - event - async for event in adapter.project_events( - _stream( - _RESPONSE_START, - PartStartEvent(index=0, part=Thinking(content="", summary="")), - *(PartDeltaEvent(index=0, delta=delta) for delta in deltas), - ), - request, - ) + ("response.reasoning_text.delta", "aw"), + ("response.reasoning_summary_text.delta", "ummary"), ] + if populated_start + else [] + ) + assert [ + (event.type, event.part.text) for event in events if event.type.endswith("part.done") + ] == [ + ("response.content_part.done", "Raw"), + ("response.reasoning_summary_part.done", "Summary"), + ] + item = events[-1].response.output[0] + assert item.content[0].text == "Raw" + assert item.summary[0].text == "Summary" + assert item.encrypted_content == "final" @pytest.mark.parametrize( @@ -1105,23 +1193,6 @@ async def test_responses_projection_preserves_unsigned_summary_completion( assert events[-1].response.output[0] == completed -async def test_responses_projection_rejects_thinking_part_with_content_and_summary() -> None: - adapter, request = _responses_adapter(_CAPABILITIES) - - with pytest.raises(ValueError, match="cannot contain both raw reasoning"): - [ - event - async for event in adapter.project_events( - _stream( - _RESPONSE_START, - PartStartEvent(index=0, part=Thinking(content="", summary="")), - PartEndEvent(index=0, part=Thinking(content="raw", summary="summary")), - ), - request, - ) - ] - - async def test_responses_projection_signature_only_delta_defers_to_completed_item() -> None: # Responses has no mid-stream signature event, so a signature-only delta emits # nothing and does not register a text representation; the completed item @@ -1569,3 +1640,112 @@ def test_chat_normalizes_marked_text_arrays_without_merging_parts(role): ] assert normalized.input == ([AssistantInput(content=parts)] if role == "assistant" else parts) assert normalized.prompt_cache == PromptCache(mode="implicit", ttl="30m") + + +@pytest.mark.parametrize("raw_first", [True, False], ids=["raw-first", "summary-first"]) +async def test_chat_reasoning_run_signatures_and_collection(raw_first): + """Ensures reasoning streams immediately and signatures flush at their attachment boundaries.""" + adapter, request = _chat_adapter( + ProviderCapabilities( + thinking="raw", chat_reasoning_field="reasoning", chat_signature_namespace="issuer" + ) + ) + empty = Thinking(content="", summary="") + call = ToolCall(tool_call_id="call1", tool_name="lookup", args="{}") + + def reasoning_delta(text, raw): + return ThinkingDelta(content_delta=text) if raw else ThinkingDelta(summary_delta=text) + + events = [ + _CHAT_START, + PartStartEvent(index=0, part=empty), + PartDeltaEvent(index=0, delta=ThinkingDelta(signature_delta="A")), + PartDeltaEvent(index=0, delta=reasoning_delta("1", raw_first)), + PartDeltaEvent(index=0, delta=reasoning_delta("other", not raw_first)), + PartDeltaEvent(index=0, delta=ThinkingDelta(signature_delta="B")), + PartDeltaEvent(index=0, delta=reasoning_delta("2", raw_first)), + PartEndEvent( + index=0, + part=Thinking( + content="12" if raw_first else "other", + summary="other" if raw_first else "12", + signature="B", + ), + ), + PartStartEvent(index=1, part=TextOutput(content="answer")), + PartEndEvent(index=1, part=TextOutput(content="answer")), + PartStartEvent(index=2, part=Thinking(content="raw", summary="summary", signature="C")), + PartEndEvent(index=2, part=Thinking(content="raw!", summary="summary", signature="D")), + PartStartEvent(index=3, part=Thinking(content="", summary="", signature="tool-old")), + PartDeltaEvent(index=3, delta=ThinkingDelta(signature_delta="tool-final")), + PartEndEvent(index=3, part=Thinking(content="", summary="", signature="tool-final")), + PartStartEvent(index=4, part=call), + PartEndEvent(index=4, part=call), + PartStartEvent(index=5, part=Thinking(content="", summary="", signature="E")), + PartDeltaEvent(index=5, delta=ThinkingDelta(signature_delta="F")), + PartEndEvent(index=5, part=Thinking(content="", summary="", signature="F")), + _RESPONSE_END, + ] + chunks = [chunk async for chunk in adapter.project_events(_stream(*events), request)] + deltas = [chunk.choices[0].delta.model_dump(exclude_none=True) for chunk in chunks] + + def extra(token): + return {"issuer": {"thought_signature": token}} + + assert deltas == [ + {"role": "assistant", "reasoning": ""}, + {"reasoning": "1"}, + {"reasoning": "2"}, + {"extra_content": extra("B")}, + {"content": "answer"}, + {"reasoning": "raw"}, + {"reasoning": "!"}, + {"extra_content": extra("D")}, + { + "tool_calls": [ + { + "index": 0, + "id": "call1", + "type": "function", + "function": {"name": "lookup", "arguments": "{}"}, + "extra_content": extra("tool-final"), + } + ] + }, + {"extra_content": extra("F")}, + {}, + ] + # The stock SDK concatenates values from distinct runs at the same field path. + result = await adapter.project_response(_stream(*chunks), request) + message = result.choices[0].message + assert message.reasoning == "12raw!" + assert message.extra_content["issuer"]["thought_signature"] == "BDF" + assert message.tool_calls[0].extra_content == extra("tool-final") + + +@pytest.mark.parametrize( + "part_fields", + [ + {"extra_content": {"google": {"unrecognized": "state"}}}, + {"prompt_cache_breakpoint": {"mode": "explicit"}}, + ], +) +@pytest.mark.parametrize("parent_marked", [False, True]) +def test_marked_chat_reasoning_validates_nested_state(part_fields, parent_marked): + """Ensures a message or part thought marker never hides unsupported per-part state.""" + part = {"type": "text", "text": "thought", **part_fields} + if not parent_marked: + google = part.get("extra_content", {}).get("google", {}) + part["extra_content"] = {"google": {**google, "thought": True}} + request = OpenAIChatCompletionsCreateRequest( + model="m", + messages=[ + { + "role": "assistant", + "content": [part], + "extra_content": {"google": {"thought": parent_marked}}, + } + ], + ) + with pytest.raises(UnsupportedInput, match="extra_content|cache breakpoint"): + OpenAIChatCompletionsAdapter(_CAPABILITIES).normalize_request(request) diff --git a/tests/cassettes/README.md b/tests/cassettes/README.md index d8df354..b66e448 100644 --- a/tests/cassettes/README.md +++ b/tests/cassettes/README.md @@ -2,6 +2,10 @@ These YAML files capture sanitized HTTP requests and provider responses for deterministic test playback. Most cassettes are faithful recordings apart from secret masking and the filtering of unstable transport metadata. +Non-SSE responses have one `response.body`: parsed JSON, UTF-8 text for non-JSON or malformed JSON, or YAML binary data when the body is not UTF-8. Replay serializes JSON bodies and forwards text or binary bodies directly. JSON whitespace and original serialization are not retained. Streaming responses use ordered `response.sse` lines instead. + +On November 18, 2026, the duplicate `response.body_bytes` field was removed from 59 committed non-streaming recordings at the developer's request. Each removed byte copy was verified to parse to the existing JSON body; all remaining cassette data and formatting were preserved. The provenance descriptions below refer to the original imports, with this storage-only removal applied afterward. + Normal test runs are playback-only. Do not record or rewrite cassettes during a test run. Pytest has no recording option or cassette manager; its default async HTTP transport is blocked unconditionally. Approved recordings use standalone tooling such as `scripts/recorder_proxy.py`, which retains its authorization masking and retry policy. ## Conversation discovery @@ -22,11 +26,11 @@ Malformed filenames, duplicate numeric identities, missing turns or required cou ## Recorded cassettes -Faithful originals live under `native/`, `upstream_ir/`, `errors/`, or `anthropic/web_search/`, according to their test purpose. Preserve each original separately from any deliberately edited matched companion. Authorization values are masked, and only selected headers are retained so the fixtures remain safe and deterministic. Review request bodies for secrets before retaining recordings. +Faithful originals live under `native/`, `upstream_ir/`, `errors/`, or `anthropic/web_search/`, according to their test purpose. Preserve each original separately from any deliberately edited matched companion. Authorization is masked and API-key headers are excluded. The recorder masks known header/query credentials, including exact echoed values, but arbitrary body or query content is not automatically safe. The known non-secret vLLM placeholder `EMPTY` is excluded from echo replacement so ordinary body text remains intact; its credential header/query fields are still masked. Real credentials are masked even when short. Use controlled prompts and review every persisted field before promotion; retain required opaque continuation state or withhold the capture. Only selected headers are retained. For each provider deviation, a nearby README must identify the source provider, endpoint, model and server version when available, response mode, purpose, and recording provenance. Retain the complete sanitized conversation. Native tests compare requests and SDK-parsed results with that original, asserting the observed deviation separately from any documented Molto adjustment. If translation is affected, retain the difference in the upstream replay and compare against Responses-referenced expectations; matching must not erase the deviation under test. -The matched `reasoning_raw` omission regression separately checks that the OpenAI SDK observes `cache_write_tokens` as `None` and Molto adjusts it to zero. It has no verified faithful original establishing the omission's provider provenance. Its filename selects the raw-reasoning profile; this regression does not establish live deployment behavior. Replay verifies the saved wire contract, while live provider acceptance requires approved source evidence. +The matched `reasoning_raw` omission regression separately checks that the OpenAI SDK observes `cache_write_tokens` as `None` and Molto preserves this unknown value. It has no verified faithful original establishing the omission's provider provenance. Its filename selects the raw-reasoning profile; this regression does not establish live deployment behavior. Replay verifies the saved wire contract, while live provider acceptance requires approved source evidence. Recorded headers are informational. In particular, `content-length` is not guaranteed to match the serialized body after sanitization or other approved cassette edits and must not be used as a fixture integrity check. @@ -34,13 +38,23 @@ Treat these files as provider evidence. Do not edit a recorded value merely to m ### SDK schema mismatches -When a cassette fails validation against the pinned SDK because a recorded field is missing or incompatible, identify the cassette path, SDK version, and validation error, and ask the developer to record a fresh cassette from an approved source. Do not synthesize missing values, add compatibility defaults or coercions, weaken runtime or test-helper validation, or fabricate fields in the fixture solely to make that recording pass. For example, a missing SDK-required `cache_write_tokens` count requires a new recording rather than an assumed zero. +When a cassette fails validation against the pinned SDK because a recorded field is missing or incompatible, identify the cassette path, SDK version, and validation error, and ask the developer to record a fresh cassette from an approved source. Do not synthesize missing values, add compatibility defaults or coercions, weaken runtime or test-helper validation, or fabricate fields in the fixture solely to make that recording pass. The supported exception for Responses cache writes accepts an omitted or null count as unknown. Other SDK fields retain their validation rules. Preserve the original evidence, continue unaffected work, and report dependent verification as awaiting the new recording. New recordings must be sanitized, reviewed, and committed before matching edits; normal test runs remain replay-only. If a fresh recording reproduces the mismatch, establish the supported provider contract with the developer before implementing compatibility behavior. ### Multi-turn upstream IR recordings -`upstream_ir/{scenario}/{provider}-{endpoint}-stream-{turn}.yaml` contains independent, unchanged provider recordings for `tests/upstream/test_multi_turn.py`. The scenarios are two-turn `text_chat`, `text_image_chat`, and `consecutive_user_text`, plus three-turn `tool_use` and `tool_use_reasoning`. Text, multimodal input, consecutive user messages, and tool use cover all three upstream clients; reasoning tool use covers Responses and Messages. +The 10 Bedrock Messages recordings in `text_chat` and `tool_use` were captured on November 16, 2026 with the native Anthropic SDK 0.121.0 through `scripts/recorder_proxy.py`, outside pytest. They use `global.anthropic.claude-haiku-4-5-20251001-v1:0` at `https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages`, a 512-token output cap, no thinking configuration, and zero retries. All responses returned HTTP 200 and all five streams reached `message_stop`. Each subsequent request retains actual SDK content blocks; sequential tools compute 2 + 3, then 5 + 7, and finish with 12. Captures retain recorded response bodies/SSE and were imported unchanged after credential scanning and SDK validation. These establish native text/tool continuation for this model and endpoint, not Mantle, other models, reasoning, images, or parallel tools. The global inference profile does not establish execution in Singapore. + +Bedrock Messages transport tests in `tests/test_hosted_providers.py` also reuse existing matched Messages and OpenAI fixtures for offline cross-protocol SDK parity. Those matched fixtures verify request projection and returned protocol semantics; only the provider-owned recordings establish live Bedrock acceptance. + +`upstream_ir/{scenario}/{provider}-{endpoint}-{mode}-{turn}.yaml` contains independent, unchanged provider recordings for `tests/upstream/test_multi_turn.py`. The scenarios are two-turn `text_chat`, `text_image_chat`, and `consecutive_user_text`, plus three-turn `tool_use` and `tool_use_reasoning`. Text, multimodal input, consecutive user messages, and tool use cover the three canonical upstream clients; reasoning tool use covers Responses and Messages. + +Provider cases use their own recordings under the same scenario directories and naming convention, such as `tool_use/fireworks-responses-stream-00.yaml`. Bedrock, Together, Fireworks, and Gemini also have independent Chat Completions text/tool captures such as `tool_use/togetherai-chat_completions-stream-00.yaml`, covering both native modes. Bedrock Responses and Chat Completions captures retain the explicit regional runtime URL; replay takes the destination from the recorded exchange. `tests/upstream/test_multi_turn.py` covers independent SDK parity, native actual-output continuation, normalized continuation, and representable downstream output. Expected request copies account only for normalized wire representations and omitted optional metadata; the recorded request and response values remain unchanged. Unsupported reasoning is covered by explicit rejection cases. + +The Chat Completions captures use Bedrock `global.openai.gpt-5.6-luna` through Singapore runtime, Together `Qwen/Qwen3.5-9B`, and Fireworks `accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b`, with reasoning disabled. They establish these model/settings combinations, not provider-wide model coverage. Native continuation uses SDK-parsed assistant output. Together repeats the streamed role, which the SDK accumulator concatenates; the caller restores `assistant` before reuse. Fireworks history omits null output-only fields that its input endpoint rejects. Replay follows those same caller choices without modifying recorded responses or production passthrough behavior. + +Gemini `gemini-3.1-flash-lite` text/tool captures use `reasoning_effort="minimal"` and preserve Google thought signatures on assistant messages and function calls. They were recorded on a [GitHub-hosted runner](https://github.com/EmbeddedLLM/molto/actions/runs/42160882628) and imported byte for byte. Caller history restores the single assistant role after SDK accumulation of repeated role deltas and removes only top-level null fields and SDK output-only metadata; nested opaque state remains intact. The independent SDK reference supplies index zero for recorded single-call chunks that omit an index, matching the documented Gemini repair. Native replay verifies complete output and actual-signature continuation. Normalized replay verifies trailing message signatures after text and same-chunk call signatures immediately before the signed call; public Responses and Messages replay checks unchanged `encrypted_content`/`signature` values against independent SDK output and restores the original message/tool attachments on subsequent requests in both downstream modes. These tests reuse the unchanged recordings. `text_image_chat` sends text, an image, and trailing text in one user message on each turn, using the existing `tests/files/github.png` and `tests/files/xlsx.jpg` fixtures as data URLs. `consecutive_user_text` sends two adjacent user messages, each with two text parts, before each assistant response. Both scenarios retain actual assistant output as history and assert that the input IR is not mutated. They also inspect outgoing message roles and content grouping independently of cassette equality, so the expected fixtures cannot silently permit merged user messages or split multimodal parts. These are upstream-client projection checks; incoming request normalization remains covered by the adapter tests. @@ -48,6 +62,8 @@ These requests were recorded outside pytest through `scripts/recorder_proxy.py`, Replay asserts exact outgoing request bodies and provider-neutral invariants: balanced event lifecycles, reconstruction from deltas, valid tool arguments and call identities, consistent usage, terminal reasons, and preserved reasoning signatures. Generated answer wording and chunk counts are not fixed expectations. These recordings are not matched across providers, and opaque reasoning state is only replayed to its original provider. Existing SDK parity tests remain in `tests/core/test_interface.py`. +The 10 Gemini cassettes contain four tool-only responses with signatures attached directly to the tool calls (`tool_use` turns 00 and 01 in both modes), and six text-only responses with message-level signatures (`text_chat` turns 00 and 01 plus `tool_use` turn 02 in both modes). None contains an unsigned tool call followed by a message-level signature. That disputed shape is synthetic test input, not observed provider output in this corpus. + ### Anthropic hosted-search recordings These unmodified Anthropic `claude-sonnet-4-6` recordings provide independent provider evidence: @@ -84,7 +100,7 @@ The context-length streaming requests use the same model and equivalent streamin The streaming and non-streaming recordings under `errors/context_length_exceeded/` have their repeated request text shortened to a single `x` to keep fixtures small and replay fast. The original instruction and recorded responses, including token counts and SSE events, are preserved. These shortened requests test error handling through replay; they no longer reproduce context overflow against a live provider. -An error delivered inside an HTTP `200` stream is recorded under `response.sse`, retaining status `200`; it must not be rewritten as an HTTP `400` error. The OpenAI SDK may raise a plain `APIError` for such an event without attaching an HTTP status to the exception. If the SDK disconnects before the upstream stream finishes, the recorder saves the SSE lines received so far without adding a disconnect marker. That recording may be partial and does not establish which events the provider would have sent afterward. +An error delivered inside an HTTP `200` stream is recorded under `response.sse`, retaining status `200`; it must not be rewritten as an HTTP `400` error. The OpenAI SDK may raise a plain `APIError` for such an event without attaching an HTTP status to the exception. If the SDK disconnects before the upstream stream finishes, the recorder saves the SSE lines received so far without inventing terminal events. New captures include `stream_status` (`complete`, `disconnected`, or `transport_error`), `terminal_event`, and `error_event`. HTTP EOF does not prove model completion; an absent terminal marker remains visible. Legacy captures without these fields may be partial. SSE lines are normalized event evidence, not original TCP chunks or newline bytes. ## Matched cassettes @@ -110,7 +126,7 @@ Request expectations are compared independently of Molto's translator. For encry Responses stream checks validate each output index and item ID before generated IDs are removed from cross-protocol comparisons. Every item update must occur between that item's start and completion. Completed and incomplete terminal responses must contain the completed items in output-index order. Translated terminal reasoning and search sources retain their `done` snapshots; native Responses may expose separate terminal snapshots for these fields and remains covered by exact SDK parity. Search identities, statuses, and queries remain compared across snapshots. -Non-streaming comparisons retain ordered supported output items and part boundaries, all reasoning items and opaque snapshots, terminal state, and semantic token usage. The incomplete-stream helper tests use an SDK-parsed recording to check `incomplete_details`, partial output, and final usage. The fresh streaming recording supplies the SDK-required cache-write count, allowing the incomplete-result comparison and its five negative cases to reach their assertions. A separate regression verifies that the helper rejects a missing count without inventing a value. Negative checks cover altered requests, item identities, output order, incomplete reasons, and usage. These checks do not add incomplete-route coverage beyond the routes described above or establish arbitrary interleaved-item support. +Non-streaming comparisons retain ordered supported output items and part boundaries, all reasoning items and opaque snapshots, terminal state, and semantic token usage. The incomplete-stream helper tests use an SDK-parsed recording to check `incomplete_details`, partial output, and final usage. The fresh streaming recording supplies the SDK-required cache-write count, allowing the incomplete-result comparison and its five negative cases to reach their assertions. A separate regression verifies that an omitted count remains unknown. Negative checks cover altered requests, item identities, output order, incomplete reasons, and usage. These checks do not add incomplete-route coverage beyond the routes described above or establish arbitrary interleaved-item support. ### Actual-output continuation @@ -216,3 +232,30 @@ Relevant test entry points and canonicalization helpers: - `tests/utils/test_test_utils.py` covers the canonicalization helpers themselves. When a matcher changes an SSE payload discriminator, update the corresponding `event:` header as part of the same change. Keep JSON key order and whitespace stable unless the changed value requires reserialization; this keeps fixture diffs focused on intentional semantic alignment. + +## Hosted reasoning continuation evidence + +Each conversation in `upstream_ir/tool_use_reasoning_low/` carries provider-issued reasoning and call IDs through two tool results to a final answer. The original November 17, 2026 recordings used native SDKs, zero retries, a 2,048-token cap, and the standalone recorder. + +| Provider | Endpoint and model | Recorded reasoning | +| --- | --- | --- | +| Together | Responses and Chat, `zai-org/GLM-5.2` | Low effort, three turns in each response mode on both endpoints. | +| Fireworks | Responses and Chat, `accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b` | Low effort, three turns in each mode on both endpoints. Responses reported `summary_text` and omitted the cache-write count in all six exchanges. The normalized replay preserves both facts. Chat and Messages continuation reclassifies the unlabeled text as raw. | +| Bedrock | Oregon Mantle Chat, `openai.gpt-oss-20b` | Low effort, three turns in each mode. The response and continuation use `reasoning`. | +| Bedrock | Singapore runtime Messages, `global.anthropic.claude-haiku-4-5-20251001-v1:0` | Enabled thinking and a 1,024-token budget, three turns in each mode. The first turn supplies signed thinking. | + +Gemini's `reasoning_text` and `tool_use_reasoning` captures used `gemini-3.1-flash-lite`, medium thinking, `include_thoughts=true`, and a 2,048-token cap. Complete replies marked their content with `extra_content.google.thought=true`. The native caller carried that content as `reasoning_content` with the original message or tool signature. The streaming replies delivered unmarked text or tool calls and genuine signatures. All ten original requests completed both conversations. [Hosted recording](https://github.com/EmbeddedLLM/molto/actions/runs/44276479795) + +The five `mixed` captures in those directories begin with a complete, marked reply and carry its actual reasoning into a streaming follow-up. The tool conversation completes both calls and returns 9. The text conversation takes half of 72. Public Responses and Messages replay uses each marked first reply and compares the reconstructed outgoing Gemini history against its recorded follow-up in both public response modes. [Mixed-mode recording](https://github.com/EmbeddedLLM/molto/actions/runs/44277431390) + +The four turn-01 files in `reasoning_combined_control/` and `reasoning_combined/` use the two first replies from `reasoning_text/` as their sources. Both arms retained the visible answer and message signature from the streamed reply. The combined arm added the marked text from the independent complete reply as `reasoning_content`. Both histories returned 36 in streaming and non-streaming calls. Each file is the original response to its recorded request. The combined message was deliberately constructed. [Hosted comparison](https://github.com/EmbeddedLLM/molto/actions/runs/44280209744) + +## Provider recording workflow + +`scripts/recorder_proxy.py` defaults to `/tmp/molto-recordings`, binds localhost, and makes one upstream attempt. Native SDK recording callers must also use `max_retries=0`. Non-SSE responses retain only `response.body`, using the JSON, text, or binary representation described above. Replay reconstructs the response from that value; successful response matching updates it on deliberately modified copies. Request-only error matching preserves the complete response unchanged. + +Record native SDK conversations through `scripts/recorder_proxy.py`, outside pytest, with `max_retries=0`. Carry actual SDK output into subsequent requests and append only caller input or tool results. Validate completion and preserve incomplete captures in staging for investigation. Promote only the exchanges needed by a regression or shared scenario, using the existing `{provider}-{endpoint}-{mode}-{turn:02}.yaml` filenames. No sidecar manifests, source snapshots, or duplicate historical corpus are required. + +For OpenRouter free-model recordings, use an explicit verified `:free` model, disabled provider fallbacks, zero price caps, and no plugins. Check current model availability before recording. Inspect all staged fields for credentials and private content before promotion. Never generate expected fixtures from Molto output or run pytest in recording mode. + +See the [provider support matrix](../../docs/provider-compatibility.md) for the selected protocols, recorded models, and remaining coverage gaps. diff --git a/tests/cassettes/upstream_ir/reasoning_combined/gemini-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/reasoning_combined/gemini-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..fe161d4 --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_combined/gemini-chat_completions-non_stream-01.yaml @@ -0,0 +1,153 @@ +filename: 2026-11-18-01a1ee14-109b-7741-820b-93ef6cd448f9 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + - content: 'The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + **Explanation:** + + To find the smallest number divisible by a set of numbers, you need to find + their **Least Common Multiple (LCM)**. You can do this by looking at the prime + factorization of each number: + + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To calculate the LCM, take the highest power of each prime factor present + in the numbers: + + * The highest power of 2 is **2³ (8)**. + + * The highest power of 3 is **3² (9)**. + + + Multiply these together: **8 × 9 = 72**.' + extra_content: + google: + thought_signature: EtoHCtcHAWkUfRP/lJD4/ar0NXLDacHcmtfTzS0w+RWIb/cAXJPPhZOlPfzfLSlB/rsUfTMie4HMTpLfy7ayDDH9LVyPOnMHrQAVxkAjpEdy0MEDZTG+2rg5x0SsEfxY9cBWRSSw09ZZkRmaP2b2ab4PA0b8qCr8WonzWLg+QG1AYQ2PsMoopuC+i43951NKDFXEyLFs+Q+lr8sFK9VQi073xaF8Bve8yUtTgCcC42vBQ2O1e/1AWmtCCMamgN2qBP7BHjR6irMtSYmqOsZ/jfVQi0eIkxLiLAISJLbmzcSX0Rnp1P2GbS8UNtWfL4CeCR9rIK6PpzUpfuiZlXWmKQWYxD6XWCzt6MLCm5xVFDRk+tXZqjwRWX9sA1NXZIwSAjG7VmNSlIEV5/TxeECZ4yKMDRWN6MDxDA/1ZJwyzHIkN/Nqcn9IAvY2ImOvmenZHKG0VC5o2XfYwbRMz0C4lEMC4FnvSz8twiKksoyAibxCpe4Ox4EO7R47g1ltsG8hmrX662CyIm86iIiBrBbQfp20Jk3MAQT7RIaYZ/05SQJCOKMpaXECOr9GXy++D5MtykcTYzBXiDSMMoaYvYw920EcwUvbsBalilPtB5NLuMoR1lMg9uFyMT6lKCKlBeS7srtQ1/uwb65RCJ+p5DofTxHPEeoUZyjiZF7NJqxgR1rQ47AbJUMrJGF19Uef0O8vD/parv/YQ5fEkLcmljWlqrqMrFVjPLNNPe8rLcZSYnyuI1ABZvY2eqjTgvcWZ2Q1ErESSRvlp6hexQ/HLWNGXlgYkelIlUw5FY8rmIW6+GARYoAr4cK4XtD+eBt4C1iSMnwgcOFhTAYB76leabxkrpzW1+34+2j4D7K2a8IHR4oPdYxhVcKf0d6BaMn39tMNZxrTn8hjnifaAMmjEq0N+JwKIekJcVrriNsVsF63L4AYDX6LihKMaqF6bpSAL6CdLE/VcoNyEzqNDTbSqRvBjIduwz+MAVsCZOJylF/TE4Se1a5vNk6fqPQX+0Ezt5Sm1Tumy1LxbJ6dymdF7EqAWbox6owNV1EIHLPhJm078JPOs81kMyy+STS5q/0HGgPaf7+z827vQrkS0LT1Xg+8yPbqD935m3o8Do1o6pEM++99spgoP7aMceeVSZCTijPheCIXBcMyR+bnvDjUqudHKdlufn6CKMOVKOjzRmDWT9BrwOBUOLoJKQvD1RhTK7b3F7kwiQTDDz2SfWI+Oi1NdzlOJJoU2A7jXcgHmzFF94pL/oPgQoiublewyd9BpnRTaRjuU8wYpmEVfpx46SusQ7Lrxg6ZpL3yTqGegak= + reasoning_content: "**Finding the Least Common Multiple (LCM)**\n\n\ + Okay, my task is clear: I need to determine the smallest positive integer\ + \ that's divisible by 6, 8, and 9. I recognize this as finding the Least\ + \ Common Multiple (LCM) of these three numbers. Right, let's break this down\ + \ systematically.\n\nFirst, I'll prime factorize each number to identify the\ + \ prime building blocks.\n\n* 6 factors into 2 x 3\n* 8 factors into 2³\n\ + * 9 factors into 3²\n\nNow I remember how to calculate the LCM. I need\ + \ to consider each unique prime factor that appears in any of the factorizations\ + \ and raise it to its highest power across all the factorizations.\n\n* \ + \ The prime factors present are 2 and 3.\n* The highest power of 2 is 2³\ + \ (from the factorization of 8).\n* The highest power of 3 is 3² (from the\ + \ factorization of 9).\n\nTherefore, the LCM is the product of these highest\ + \ powers: 2³ * 3².\n\nThis calculates to 8 * 9, which equals 72.\n\nTo ensure\ + \ this is correct, I'll quickly verify that 72 is indeed divisible by all\ + \ three numbers. 72 divided by 6 is 12, divisible. 72 divided by 8 is 9, divisible.\ + \ 72 divided by 9 is 8, also divisible.\n\nTherefore, the final answer is\ + \ 72. I've stated the goal as the LCM, shown the prime factorization, and\ + \ calculated the correct result.\n\n\nTo find the smallest positive\ + \ integer divisible by 6, 8, and 9, you need to find their **Least Common\ + \ Multiple (LCM)**.\n\n### Step-by-Step Calculation:\n\n1. **Find the prime\ + \ factorization of each number:**\n * **6** = $2 \\times 3$\n * \ + \ **8** = $2^3$\n * **9** = $3^2$\n\n2. **Identify the highest power\ + \ of each prime factor present:**\n * The prime factors involved are\ + \ **2** and **3**.\n * The highest power of 2 is **$2^3$** (from 8).\n\ + \ * The highest power of 3 is **$3^2$** (from 9).\n\n3. **Multiply these\ + \ highest powers together:**\n * LCM = $2^3 \\times 3^2$\n * LCM\ + \ = $8 \\times 9$\n * LCM = **72**\n\n**Result:** The smallest positive\ + \ integer divisible by 6, 8, and 9 is **72**." + role: assistant + - content: What is half that number? + role: user + model: gemini-3.1-flash-lite + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '4364' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee14-109b-7741-820b-93ef6cd448f9 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'Okay, here''s my summary, tailored as if I were considering + this myself: + + + **Calculating the Requested Value** + + + Right, the previous response I gave was 72. The user has specifically requested + "half that number". So, a straightforward calculation is needed. Half of + something is simply the value divided by two. Therefore, I need to perform + a division: 72 divided by 2. That calculation is easy enough. 72 / 2 equals + 36. Now, I should state the result clearly. No need for complex explanations + or hedging – just give the answer. + + + + Half of 72 is **36**.' + extra_content: + google: + thought: true + thought_signature: EqsCCqgCAWkUfRNVVzfighUuCxhp2WylA6G92GmRIL/GeoeFBKUdVMCAaheITs2mF4Fcr7zTU2Ht49KcnjHnVt1P3kS99iT6v3yscMvogOokQ4qjwTyQCKPMCOKLPKlDZXIJ/Q9A2DjjenfQCEesj+2NDnLjSEP1x6ANhxDhxKiAojX1KiXEVOGCrAgAPSOCqbkyh/o7WtntB+0WrrAIAD4Y+W+YwclyUf/Y1pp+WgG3hMxCyeIDZ++3LMR81IRTNm/ubYXrELf50h1R9tvdRPia5lRjRk7sNK9C7Nsx2MQ5MaG/Mn/kC8U7gIk9mkNACoaV/9LBznRbHWv+bixLrJPMcDSEcQ1SMu5wR9vtV/VMx+Ys0EPrLV2raqVajs5BR6sLZTGEcAKjTrUm6EM= + role: assistant + created: 1794995657 + id: xnX9apzaNvOymtkP8v3kiAE + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 10 + prompt_tokens: 192 + total_tokens: 249 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoic3RvcCIsImluZGV4IjowLCJtZXNzYWdlIjp7 + ImNvbnRlbnQiOiI8dGhvdWdodD5Pa2F5LCBoZXJlJ3MgbXkgc3VtbWFyeSwgdGFpbG9yZWQgYXMg + aWYgSSB3ZXJlIGNvbnNpZGVyaW5nIHRoaXMgbXlzZWxmOlxuXG4qKkNhbGN1bGF0aW5nIHRoZSBS + ZXF1ZXN0ZWQgVmFsdWUqKlxuXG5SaWdodCwgdGhlIHByZXZpb3VzIHJlc3BvbnNlIEkgZ2F2ZSB3 + YXMgNzIuIFRoZSB1c2VyIGhhcyBzcGVjaWZpY2FsbHkgcmVxdWVzdGVkIFwiaGFsZiB0aGF0IG51 + bWJlclwiLiBTbywgYSBzdHJhaWdodGZvcndhcmQgY2FsY3VsYXRpb24gaXMgbmVlZGVkLiBIYWxm + IG9mIHNvbWV0aGluZyBpcyBzaW1wbHkgdGhlIHZhbHVlIGRpdmlkZWQgYnkgdHdvLiBUaGVyZWZv + cmUsIEkgbmVlZCB0byBwZXJmb3JtIGEgZGl2aXNpb246IDcyIGRpdmlkZWQgYnkgMi4gVGhhdCBj + YWxjdWxhdGlvbiBpcyBlYXN5IGVub3VnaC4gNzIgLyAyIGVxdWFscyAzNi4gTm93LCBJIHNob3Vs + ZCBzdGF0ZSB0aGUgcmVzdWx0IGNsZWFybHkuIE5vIG5lZWQgZm9yIGNvbXBsZXggZXhwbGFuYXRp + b25zIG9yIGhlZGdpbmcg4oCTIGp1c3QgZ2l2ZSB0aGUgYW5zd2VyLlxuXG5cbjwvdGhvdWdodD5I + YWxmIG9mIDcyIGlzICoqMzYqKi4iLCJleHRyYV9jb250ZW50Ijp7Imdvb2dsZSI6eyJ0aG91Z2h0 + Ijp0cnVlLCJ0aG91Z2h0X3NpZ25hdHVyZSI6IkVxc0NDcWdDQVdrVWZSTlZWemZpZ2hVdUN4aHAy + V3lsQTZHOTJHbVJJTC9HZW9lRkJLVWRWTUNBYWhlSVRzMm1GNEZjcjd6VFUySHQ0OUtjbmpIblZ0 + MVAza1M5OWlUNnYzeXNjTXZvZ09va1E0cWp3VHlRQ0tQTUNPS0xQS2xEWlhJSi9ROUEyRGpqZW5m + UUNFZXNqKzJORG5MalNFUDF4NkFOaHhEaHhLaUFvalgxS2lYRVZPR0NyQWdBUFNPQ3Fia3loL283 + V3RudEIrMFdyckFJQUQ0WStXK1l3Y2x5VWYvWTFwcCtXZ0czaE14Q3llSURaKyszTE1SODFJUlRO + bS91YllYckVMZjUwaDFSOXR2ZFJQaWE1bFJqUms3c05LOUM3TnN4Mk1RNU1hRy9Nbi9rQzhVN2dJ + azlta05BQ29hVi85TEJ6blJiSFd2K2JpeExySlBNY0RTRWNRMVNNdTV3Ujl2dFYvVk14K1lzMEVQ + ckxWMnJhcVZhanM1QlI2c0xaVEdFY0FLalRyVW02RU09In19LCJyb2xlIjoiYXNzaXN0YW50In19 + XSwiY3JlYXRlZCI6MTc5NDk5NTY1NywiaWQiOiJ4blg5YXB6YU52T3ltdGtQOHYza2lBRSIsIm1v + ZGVsIjoiZ2VtaW5pLTMuMS1mbGFzaC1saXRlIiwib2JqZWN0IjoiY2hhdC5jb21wbGV0aW9uIiwi + dXNhZ2UiOnsiY29tcGxldGlvbl90b2tlbnMiOjEwLCJwcm9tcHRfdG9rZW5zIjoxOTIsInRvdGFs + X3Rva2VucyI6MjQ5fX0= + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:54:14.811893+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_combined/gemini-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/reasoning_combined/gemini-chat_completions-stream-01.yaml new file mode 100644 index 0000000..2257917 --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_combined/gemini-chat_completions-stream-01.yaml @@ -0,0 +1,121 @@ +filename: 2026-11-18-01a1ee14-1d49-70b1-8a7e-8297dda6bc15 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + - content: 'The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + **Explanation:** + + To find the smallest number divisible by a set of numbers, you need to find + their **Least Common Multiple (LCM)**. You can do this by looking at the prime + factorization of each number: + + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To calculate the LCM, take the highest power of each prime factor present + in the numbers: + + * The highest power of 2 is **2³ (8)**. + + * The highest power of 3 is **3² (9)**. + + + Multiply these together: **8 × 9 = 72**.' + extra_content: + google: + thought_signature: EtoHCtcHAWkUfRP/lJD4/ar0NXLDacHcmtfTzS0w+RWIb/cAXJPPhZOlPfzfLSlB/rsUfTMie4HMTpLfy7ayDDH9LVyPOnMHrQAVxkAjpEdy0MEDZTG+2rg5x0SsEfxY9cBWRSSw09ZZkRmaP2b2ab4PA0b8qCr8WonzWLg+QG1AYQ2PsMoopuC+i43951NKDFXEyLFs+Q+lr8sFK9VQi073xaF8Bve8yUtTgCcC42vBQ2O1e/1AWmtCCMamgN2qBP7BHjR6irMtSYmqOsZ/jfVQi0eIkxLiLAISJLbmzcSX0Rnp1P2GbS8UNtWfL4CeCR9rIK6PpzUpfuiZlXWmKQWYxD6XWCzt6MLCm5xVFDRk+tXZqjwRWX9sA1NXZIwSAjG7VmNSlIEV5/TxeECZ4yKMDRWN6MDxDA/1ZJwyzHIkN/Nqcn9IAvY2ImOvmenZHKG0VC5o2XfYwbRMz0C4lEMC4FnvSz8twiKksoyAibxCpe4Ox4EO7R47g1ltsG8hmrX662CyIm86iIiBrBbQfp20Jk3MAQT7RIaYZ/05SQJCOKMpaXECOr9GXy++D5MtykcTYzBXiDSMMoaYvYw920EcwUvbsBalilPtB5NLuMoR1lMg9uFyMT6lKCKlBeS7srtQ1/uwb65RCJ+p5DofTxHPEeoUZyjiZF7NJqxgR1rQ47AbJUMrJGF19Uef0O8vD/parv/YQ5fEkLcmljWlqrqMrFVjPLNNPe8rLcZSYnyuI1ABZvY2eqjTgvcWZ2Q1ErESSRvlp6hexQ/HLWNGXlgYkelIlUw5FY8rmIW6+GARYoAr4cK4XtD+eBt4C1iSMnwgcOFhTAYB76leabxkrpzW1+34+2j4D7K2a8IHR4oPdYxhVcKf0d6BaMn39tMNZxrTn8hjnifaAMmjEq0N+JwKIekJcVrriNsVsF63L4AYDX6LihKMaqF6bpSAL6CdLE/VcoNyEzqNDTbSqRvBjIduwz+MAVsCZOJylF/TE4Se1a5vNk6fqPQX+0Ezt5Sm1Tumy1LxbJ6dymdF7EqAWbox6owNV1EIHLPhJm078JPOs81kMyy+STS5q/0HGgPaf7+z827vQrkS0LT1Xg+8yPbqD935m3o8Do1o6pEM++99spgoP7aMceeVSZCTijPheCIXBcMyR+bnvDjUqudHKdlufn6CKMOVKOjzRmDWT9BrwOBUOLoJKQvD1RhTK7b3F7kwiQTDDz2SfWI+Oi1NdzlOJJoU2A7jXcgHmzFF94pL/oPgQoiublewyd9BpnRTaRjuU8wYpmEVfpx46SusQ7Lrxg6ZpL3yTqGegak= + reasoning_content: "**Finding the Least Common Multiple (LCM)**\n\n\ + Okay, my task is clear: I need to determine the smallest positive integer\ + \ that's divisible by 6, 8, and 9. I recognize this as finding the Least\ + \ Common Multiple (LCM) of these three numbers. Right, let's break this down\ + \ systematically.\n\nFirst, I'll prime factorize each number to identify the\ + \ prime building blocks.\n\n* 6 factors into 2 x 3\n* 8 factors into 2³\n\ + * 9 factors into 3²\n\nNow I remember how to calculate the LCM. I need\ + \ to consider each unique prime factor that appears in any of the factorizations\ + \ and raise it to its highest power across all the factorizations.\n\n* \ + \ The prime factors present are 2 and 3.\n* The highest power of 2 is 2³\ + \ (from the factorization of 8).\n* The highest power of 3 is 3² (from the\ + \ factorization of 9).\n\nTherefore, the LCM is the product of these highest\ + \ powers: 2³ * 3².\n\nThis calculates to 8 * 9, which equals 72.\n\nTo ensure\ + \ this is correct, I'll quickly verify that 72 is indeed divisible by all\ + \ three numbers. 72 divided by 6 is 12, divisible. 72 divided by 8 is 9, divisible.\ + \ 72 divided by 9 is 8, also divisible.\n\nTherefore, the final answer is\ + \ 72. I've stated the goal as the LCM, shown the prime factorization, and\ + \ calculated the correct result.\n\n\nTo find the smallest positive\ + \ integer divisible by 6, 8, and 9, you need to find their **Least Common\ + \ Multiple (LCM)**.\n\n### Step-by-Step Calculation:\n\n1. **Find the prime\ + \ factorization of each number:**\n * **6** = $2 \\times 3$\n * \ + \ **8** = $2^3$\n * **9** = $3^2$\n\n2. **Identify the highest power\ + \ of each prime factor present:**\n * The prime factors involved are\ + \ **2** and **3**.\n * The highest power of 2 is **$2^3$** (from 8).\n\ + \ * The highest power of 3 is **$3^2$** (from 9).\n\n3. **Multiply these\ + \ highest powers together:**\n * LCM = $2^3 \\times 3^2$\n * LCM\ + \ = $8 \\times 9$\n * LCM = **72**\n\n**Result:** The smallest positive\ + \ integer divisible by 6, 8, and 9 is **72**." + role: assistant + - content: What is half that number? + role: user + model: gemini-3.1-flash-lite + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '4363' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee14-1d49-70b1-8a7e-8297dda6bc15 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"Half of 72 is **3","role":"assistant"},"index":0}],"created":1794995658,"id":"ynX9aqeNCOmxqtsPgbOTkA4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"6**.","role":"assistant"},"index":0}],"created":1794995658,"id":"ynX9aqeNCOmxqtsPgbOTkA4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EvwCCvkCAWkUfRPd1Qm291RbTyLkStFcPcHabqMjbd5sH+ZeNzcTIiBPv/HwZYe0Opsp83f3yfXN6sQC5/q623pu9K0TWxEm0cYssQ5HhwxZx9+8LIQPxdVEFe8s0RlqptXrNXLVDNPZ9/WA3pQmOEQ02hlYxZ0fDDDObRW7hm83ghySOW//NN5atZ2vcVUqo8Z+UPJpyyomhOOvA4zoly/YuI2Ns2dlzAWVyt2C79YtY7m9fj4TCDZPnNuUoBiWGCayEHe2LwV9YSjZVzYN/H6IrybLpgYEjklUEKmxGd3oAGOZcWUOfGHMb9gmjLfS+4ZeA9YxC7iANU9znzpxY5A/RrFUCxf88DvIEFR7HN4NvPjuUXhwICP3Iz9m1TXU0lelEKXnH8lldLcR24lfODotK5NXvFhD1kI8mFAYhyzIDC2XzHWQ/LSrlzr3cCjuOGW/OIrY3SHeFPF0yNpb+BAmTxDuwzGiyB+WTpRyXya1MiGz0O1MvmBRgC9UoEs="}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794995658,"id":"ynX9aqeNCOmxqtsPgbOTkA4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:54:18.057071+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_combined_control/gemini-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/reasoning_combined_control/gemini-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..607132b --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_combined_control/gemini-chat_completions-non_stream-01.yaml @@ -0,0 +1,125 @@ +filename: 2026-11-18-01a1ee14-093f-75e3-9895-a44e48f0aebb +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + - content: 'The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + **Explanation:** + + To find the smallest number divisible by a set of numbers, you need to find + their **Least Common Multiple (LCM)**. You can do this by looking at the prime + factorization of each number: + + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To calculate the LCM, take the highest power of each prime factor present + in the numbers: + + * The highest power of 2 is **2³ (8)**. + + * The highest power of 3 is **3² (9)**. + + + Multiply these together: **8 × 9 = 72**.' + extra_content: + google: + thought_signature: EtoHCtcHAWkUfRP/lJD4/ar0NXLDacHcmtfTzS0w+RWIb/cAXJPPhZOlPfzfLSlB/rsUfTMie4HMTpLfy7ayDDH9LVyPOnMHrQAVxkAjpEdy0MEDZTG+2rg5x0SsEfxY9cBWRSSw09ZZkRmaP2b2ab4PA0b8qCr8WonzWLg+QG1AYQ2PsMoopuC+i43951NKDFXEyLFs+Q+lr8sFK9VQi073xaF8Bve8yUtTgCcC42vBQ2O1e/1AWmtCCMamgN2qBP7BHjR6irMtSYmqOsZ/jfVQi0eIkxLiLAISJLbmzcSX0Rnp1P2GbS8UNtWfL4CeCR9rIK6PpzUpfuiZlXWmKQWYxD6XWCzt6MLCm5xVFDRk+tXZqjwRWX9sA1NXZIwSAjG7VmNSlIEV5/TxeECZ4yKMDRWN6MDxDA/1ZJwyzHIkN/Nqcn9IAvY2ImOvmenZHKG0VC5o2XfYwbRMz0C4lEMC4FnvSz8twiKksoyAibxCpe4Ox4EO7R47g1ltsG8hmrX662CyIm86iIiBrBbQfp20Jk3MAQT7RIaYZ/05SQJCOKMpaXECOr9GXy++D5MtykcTYzBXiDSMMoaYvYw920EcwUvbsBalilPtB5NLuMoR1lMg9uFyMT6lKCKlBeS7srtQ1/uwb65RCJ+p5DofTxHPEeoUZyjiZF7NJqxgR1rQ47AbJUMrJGF19Uef0O8vD/parv/YQ5fEkLcmljWlqrqMrFVjPLNNPe8rLcZSYnyuI1ABZvY2eqjTgvcWZ2Q1ErESSRvlp6hexQ/HLWNGXlgYkelIlUw5FY8rmIW6+GARYoAr4cK4XtD+eBt4C1iSMnwgcOFhTAYB76leabxkrpzW1+34+2j4D7K2a8IHR4oPdYxhVcKf0d6BaMn39tMNZxrTn8hjnifaAMmjEq0N+JwKIekJcVrriNsVsF63L4AYDX6LihKMaqF6bpSAL6CdLE/VcoNyEzqNDTbSqRvBjIduwz+MAVsCZOJylF/TE4Se1a5vNk6fqPQX+0Ezt5Sm1Tumy1LxbJ6dymdF7EqAWbox6owNV1EIHLPhJm078JPOs81kMyy+STS5q/0HGgPaf7+z827vQrkS0LT1Xg+8yPbqD935m3o8Do1o6pEM++99spgoP7aMceeVSZCTijPheCIXBcMyR+bnvDjUqudHKdlufn6CKMOVKOjzRmDWT9BrwOBUOLoJKQvD1RhTK7b3F7kwiQTDDz2SfWI+Oi1NdzlOJJoU2A7jXcgHmzFF94pL/oPgQoiublewyd9BpnRTaRjuU8wYpmEVfpx46SusQ7Lrxg6ZpL3yTqGegak= + role: assistant + - content: What is half that number? + role: user + model: gemini-3.1-flash-lite + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2304' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee14-093f-75e3-9895-a44e48f0aebb +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'Okay, here''s my summary, tailored as if I were considering + this myself: + + + **Calculating the Requested Value** + + + Right, the previous response I gave was 72. The user has specifically requested + "half that number". So, a straightforward calculation is needed. Half of + something is simply the value divided by two. Therefore, I need to perform + a division: 72 divided by 2. That calculation is easy enough. 72 / 2 equals + 36. Now, I should state the result clearly. No need for complex explanations + or hedging – just give the answer. + + + + Half of 72 is **36**.' + extra_content: + google: + thought: true + thought_signature: EqsCCqgCAWkUfRMNCtUKDE2ysGnENqUK/FOZXEBEZtruNn6brw+r4gphYbm6h0VviosKKyic7X6C93djFTYIG5k+mb2yY8/ow35fHw5qiQ6XaEhnPgTLqckKyBZRjTsiHjl8OYTBP3vrr5QKtjHSPwuT8iF1kOAxLcLw46VtAkviBJqgiOGwpH7AzUaBR2K75nE43P3Wz+RqUovzGmNuEYxrjrzgUgkf8hk9aCAzSjLcmqMp2mx/Qwe7qBXah5DPHvDIppKe1+R81a1hjz/Dnx7fGEjM5XK/mkdgA8oOENGvSYIiIQ+h4KF4Em4g8OR/g3NyDmBHvaCVl93UWk3nSiHMODt5tJpilt7BoBeeJWFiNtCEek/CvZVpgbjz35naOLTc3kUWffxqjGfcvgI= + role: assistant + created: 1794995654 + id: xXX9atnCA8aHz7IP3ML1sQs + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 10 + prompt_tokens: 192 + total_tokens: 249 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoic3RvcCIsImluZGV4IjowLCJtZXNzYWdlIjp7 + ImNvbnRlbnQiOiI8dGhvdWdodD5Pa2F5LCBoZXJlJ3MgbXkgc3VtbWFyeSwgdGFpbG9yZWQgYXMg + aWYgSSB3ZXJlIGNvbnNpZGVyaW5nIHRoaXMgbXlzZWxmOlxuXG4qKkNhbGN1bGF0aW5nIHRoZSBS + ZXF1ZXN0ZWQgVmFsdWUqKlxuXG5SaWdodCwgdGhlIHByZXZpb3VzIHJlc3BvbnNlIEkgZ2F2ZSB3 + YXMgNzIuIFRoZSB1c2VyIGhhcyBzcGVjaWZpY2FsbHkgcmVxdWVzdGVkIFwiaGFsZiB0aGF0IG51 + bWJlclwiLiBTbywgYSBzdHJhaWdodGZvcndhcmQgY2FsY3VsYXRpb24gaXMgbmVlZGVkLiBIYWxm + IG9mIHNvbWV0aGluZyBpcyBzaW1wbHkgdGhlIHZhbHVlIGRpdmlkZWQgYnkgdHdvLiBUaGVyZWZv + cmUsIEkgbmVlZCB0byBwZXJmb3JtIGEgZGl2aXNpb246IDcyIGRpdmlkZWQgYnkgMi4gVGhhdCBj + YWxjdWxhdGlvbiBpcyBlYXN5IGVub3VnaC4gNzIgLyAyIGVxdWFscyAzNi4gTm93LCBJIHNob3Vs + ZCBzdGF0ZSB0aGUgcmVzdWx0IGNsZWFybHkuIE5vIG5lZWQgZm9yIGNvbXBsZXggZXhwbGFuYXRp + b25zIG9yIGhlZGdpbmcg4oCTIGp1c3QgZ2l2ZSB0aGUgYW5zd2VyLlxuXG5cbjwvdGhvdWdodD5I + YWxmIG9mIDcyIGlzICoqMzYqKi4iLCJleHRyYV9jb250ZW50Ijp7Imdvb2dsZSI6eyJ0aG91Z2h0 + Ijp0cnVlLCJ0aG91Z2h0X3NpZ25hdHVyZSI6IkVxc0NDcWdDQVdrVWZSTU5DdFVLREUyeXNHbkVO + cVVLL0ZPWlhFQkVadHJ1Tm42YnJ3K3I0Z3BoWWJtNmgwVnZpb3NLS3lpYzdYNkM5M2RqRlRZSUc1 + ayttYjJ5WTgvb3czNWZIdzVxaVE2WGFFaG5QZ1RMcWNrS3lCWlJqVHNpSGpsOE9ZVEJQM3ZycjVR + S3RqSFNQd3VUOGlGMWtPQXhMY0x3NDZWdEFrdmlCSnFnaU9Hd3BIN0F6VWFCUjJLNzVuRTQzUDNX + eitScVVvdnpHbU51RVl4cmpyemdVZ2tmOGhrOWFDQXpTakxjbXFNcDJteC9Rd2U3cUJYYWg1RFBI + dkRJcHBLZTErUjgxYTFoanovRG54N2ZHRWpNNVhLL21rZGdBOG9PRU5HdlNZSWlJUStoNEtGNEVt + NGc4T1IvZzNOeURtQkh2YUNWbDkzVVdrM25TaUhNT0R0NXRKcGlsdDdCb0JlZUpXRmlOdENFZWsv + Q3ZaVnBnYmp6MzVuYU9MVGMza1VXZmZ4cWpHZmN2Z0k9In19LCJyb2xlIjoiYXNzaXN0YW50In19 + XSwiY3JlYXRlZCI6MTc5NDk5NTY1NCwiaWQiOiJ4WFg5YXRuQ0E4YUh6N0lQM01MMXNRcyIsIm1v + ZGVsIjoiZ2VtaW5pLTMuMS1mbGFzaC1saXRlIiwib2JqZWN0IjoiY2hhdC5jb21wbGV0aW9uIiwi + dXNhZ2UiOnsiY29tcGxldGlvbl90b2tlbnMiOjEwLCJwcm9tcHRfdG9rZW5zIjoxOTIsInRvdGFs + X3Rva2VucyI6MjQ5fX0= + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:54:12.927819+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_combined_control/gemini-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/reasoning_combined_control/gemini-chat_completions-stream-01.yaml new file mode 100644 index 0000000..b7d9c75 --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_combined_control/gemini-chat_completions-stream-01.yaml @@ -0,0 +1,93 @@ +filename: 2026-11-18-01a1ee14-1a4c-7651-9c9c-13104c2f2237 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + - content: 'The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + **Explanation:** + + To find the smallest number divisible by a set of numbers, you need to find + their **Least Common Multiple (LCM)**. You can do this by looking at the prime + factorization of each number: + + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To calculate the LCM, take the highest power of each prime factor present + in the numbers: + + * The highest power of 2 is **2³ (8)**. + + * The highest power of 3 is **3² (9)**. + + + Multiply these together: **8 × 9 = 72**.' + extra_content: + google: + thought_signature: EtoHCtcHAWkUfRP/lJD4/ar0NXLDacHcmtfTzS0w+RWIb/cAXJPPhZOlPfzfLSlB/rsUfTMie4HMTpLfy7ayDDH9LVyPOnMHrQAVxkAjpEdy0MEDZTG+2rg5x0SsEfxY9cBWRSSw09ZZkRmaP2b2ab4PA0b8qCr8WonzWLg+QG1AYQ2PsMoopuC+i43951NKDFXEyLFs+Q+lr8sFK9VQi073xaF8Bve8yUtTgCcC42vBQ2O1e/1AWmtCCMamgN2qBP7BHjR6irMtSYmqOsZ/jfVQi0eIkxLiLAISJLbmzcSX0Rnp1P2GbS8UNtWfL4CeCR9rIK6PpzUpfuiZlXWmKQWYxD6XWCzt6MLCm5xVFDRk+tXZqjwRWX9sA1NXZIwSAjG7VmNSlIEV5/TxeECZ4yKMDRWN6MDxDA/1ZJwyzHIkN/Nqcn9IAvY2ImOvmenZHKG0VC5o2XfYwbRMz0C4lEMC4FnvSz8twiKksoyAibxCpe4Ox4EO7R47g1ltsG8hmrX662CyIm86iIiBrBbQfp20Jk3MAQT7RIaYZ/05SQJCOKMpaXECOr9GXy++D5MtykcTYzBXiDSMMoaYvYw920EcwUvbsBalilPtB5NLuMoR1lMg9uFyMT6lKCKlBeS7srtQ1/uwb65RCJ+p5DofTxHPEeoUZyjiZF7NJqxgR1rQ47AbJUMrJGF19Uef0O8vD/parv/YQ5fEkLcmljWlqrqMrFVjPLNNPe8rLcZSYnyuI1ABZvY2eqjTgvcWZ2Q1ErESSRvlp6hexQ/HLWNGXlgYkelIlUw5FY8rmIW6+GARYoAr4cK4XtD+eBt4C1iSMnwgcOFhTAYB76leabxkrpzW1+34+2j4D7K2a8IHR4oPdYxhVcKf0d6BaMn39tMNZxrTn8hjnifaAMmjEq0N+JwKIekJcVrriNsVsF63L4AYDX6LihKMaqF6bpSAL6CdLE/VcoNyEzqNDTbSqRvBjIduwz+MAVsCZOJylF/TE4Se1a5vNk6fqPQX+0Ezt5Sm1Tumy1LxbJ6dymdF7EqAWbox6owNV1EIHLPhJm078JPOs81kMyy+STS5q/0HGgPaf7+z827vQrkS0LT1Xg+8yPbqD935m3o8Do1o6pEM++99spgoP7aMceeVSZCTijPheCIXBcMyR+bnvDjUqudHKdlufn6CKMOVKOjzRmDWT9BrwOBUOLoJKQvD1RhTK7b3F7kwiQTDDz2SfWI+Oi1NdzlOJJoU2A7jXcgHmzFF94pL/oPgQoiublewyd9BpnRTaRjuU8wYpmEVfpx46SusQ7Lrxg6ZpL3yTqGegak= + role: assistant + - content: What is half that number? + role: user + model: gemini-3.1-flash-lite + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2303' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee14-1a4c-7651-9c9c-13104c2f2237 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"Half","role":"assistant"},"index":0}],"created":1794995657,"id":"yXX9aqfNFt2Ez7IPlNj0uQs","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" of 72 is **36**.","role":"assistant"},"index":0}],"created":1794995658,"id":"yXX9aqfNFt2Ez7IPlNj0uQs","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EvoCCvcCAWkUfROMSxVmqRUSbcEJskjak7OEeHxYysMnWqxmlawygM7uLqpzppdOMv+15MJWfgn9UbQdfu70CwqZ7IrG6AhOMW06S1knEl0Quq5ImQMThA0QcNwTBcwLbgkoSC0C9EItTC7XvVpYkCrMR1NdF7Pp4Xw6SyLe6B131vd3yL4U84fptvu572R+r8cr6MsctuvHhAFo6RU2VEkAEtHGts50zrz2Uf691Gyz7QLh7KD+6oE5249PvmapI4ZatYXPLohpkhVoDCs3/8YCGaq3B8aCT1vYLlcQ4RuGYxbUIX9lHutgmY+vGksjRPB0p2ibI690HgVHIXYmATgxHBfQeEDn7IaGlGeHWGOaKDtvdkPWy32iTzIzpN7NYWOT0xiryX1Qn49kKrvVfYdX5HycrFjNi0KgRn3kDQe5N3hGTkqoDd+CcSXLoaGCagwgtsgDDq1YnPIyZFAoQN4C+suytKG2l3YxkG5gshRU1o6jMypLHzJxm8Xa"}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794995658,"id":"yXX9aqfNFt2Ez7IPlNj0uQs","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:54:17.292362+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-mixed-00.yaml b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-mixed-00.yaml new file mode 100644 index 0000000..2680335 --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-mixed-00.yaml @@ -0,0 +1,189 @@ +filename: 2026-11-18-01a1ee03-9b2b-7473-8be7-fd2932b3f0fd +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + model: gemini-3.1-flash-lite + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '291' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee03-9b2b-7473-8be7-fd2932b3f0fd +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: '**Finding the Least Common Multiple (LCM)** + + + Okay, my task is clear: I need to determine the smallest positive integer + that''s perfectly divisible by 6, 8, and 9. In essence, this is a straightforward + LCM problem. I know by definition that the smallest such integer is the + Least Common Multiple of these numbers. + + + Let''s break down each number into its prime factors. I''ve got: + + + * 6 = 2 × 3 + + * 8 = 2 × 2 × 2, which is more concisely written as 2³ + + * 9 = 3 × 3 = 3² + + + Now, to calculate the LCM, I need to consider the highest power of *each* + prime factor present in these factorizations. The prime factors involved + here are 2 and 3. + + + * The highest power of 2 is clearly 2³, which equals 8. + + * The highest power of 3 is 3², which equals 9. + + + Therefore, the LCM is the product of these highest powers: 8 × 9 = 72. + + + Now, to be absolutely sure, I''ll quickly verify that 72 is indeed divisible + by all three original numbers: + + + * 72 / 6 = 12 (Yes) + + * 72 / 8 = 9 (Yes) + + * 72 / 9 = 8 (Yes) + + + Since I''ve used the definition of LCM, this *must* be the smallest such + integer. So, the answer is 72. I''ll state it clearly, along with an explanation + of how I arrived at the solution. + + + + The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + ### Explanation: + + To find the smallest number divisible by a set of numbers, you need to find + their **Least Common Multiple (LCM)**. You can do this by looking at the + prime factorization of each number: + + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To calculate the LCM, take the highest power of each prime factor that appears + in any of the factorizations: + + * The highest power of **2** is 2³ (which is 8). + + * The highest power of **3** is 3² (which is 9). + + + Multiply these together: **8 × 9 = 72**.' + extra_content: + google: + thought: true + thought_signature: EvgHCvUHAWkUfRMEfDqQHQgz20Cf1MlXSgiYIIyaOAfwC6rUD3xG1PwbRJIVmjE1/MQ5OzBQxEuJin2b/7DXtD9zwmTiItD4JTTwJOoZYkPD7lutME7b7cJt7IUlfKA7ccO8Gz6q9HFSlxCNXSv2l0IGnS8HjDsO24UpCTGG30359AC2Lq64QLkLtNXnKpPeJW4o4z7sN8NaGqpa0GxNm1u78LlLsMK/WpeNuh1nnFnvxAozt97yDNYg6IoCoWOFl1CqCSL65QjRGuezPQixo9ihyvWwC1PuxEKtsRW2dZvqjXfw08FcfXanNqV+Cgeh/0zOimvRZTseAUCjrtNgjrk5g0b3EQQ+7T02hlbLNnrHCjv4ozXJmN++EpzKjWufYsyWXn6RbgGhpwDcJebOgZaBBmyQfJchhUNnbnexrz7YgR58H6wHRrN6ipie1ZLicCjthLDM2/b8h/8K0+2gixc5DAZeZM3PyDXTPIdXlF2pt6lSytC+3vChtnnjxfAcA/+3NDp3ROPwXakb8mFj+b+VwlsMiYjYaCHJsv5XjB1nuuI8Y0lZ7tLoe7bVKfx5H1jDcREWhchg3qclVpTPXTGdF28qjBVuhqgywEQet0ji0X1EEjFE+8cpD8kps/OchXGSHyCpmklfhFsbwPg8xO4asHreeukvhNdO436BN1xPGUF6wGvAOqVMK5mCUr7EMMcqFo1WqeuTvneTMCQx+rpBxvnKv5j0NNyEQnOn0OK6Fy/8BzUYDhlL4hWwRBkk+nMwVM8lJ1Oe0LqijsSssx6VNPWhR0gTwfRqcoiYKqvGq0MyJKiwjDz7yEb5CFu9s+qEeSs7bo8lQEWsp+9E5KxJkWDoUHFJMzOKlSjNXqXpI/QQWShibYi7rFOBUwlyN7nehu+GOnWGNyd8tOJlhodhSKFUrdgHOcLLh1S40g/wrx5aMNW6iSf6PvEYNOYilpDI16O/ddCO33EouRI8FGBlB/AaqWvqauRi92M3ZQ38o3OFOli1iwgC/2EqaEgLPQNJN9XFQuB5n/SogVKKKi06CB7qixAu0+2htNaK9AFLaTie95djxVYxfk8z4rM9YQVr63AstO2qP12C4mh69kyrAU93cBziEFBIG7pkKMa9PQSDvC3FsRGLM+LWAFj7OoOkkoXt9UolAhmYQLEZF8PFisz41SiR09NJvp1jFDzP4q9N0vjSZYinszr2JiHx4Me9xGVJzICBwtE7tRZHn/onknucr0qUR4sBGLhI6/6XDcvWaK79D8tYEWg5FbAFdsAKPvosIr2pohNW2pqEYz5A1oYP1Vn8DDt8r4tBDLbESXFq4UhJRGYN5DEZ0ljv6YNrU6T7NiaNfgw= + role: assistant + created: 1794994579 + id: kHH9ar3cE--eqtsP_Iew-AM + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 174 + prompt_tokens: 20 + total_tokens: 493 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoic3RvcCIsImluZGV4IjowLCJtZXNzYWdlIjp7 + ImNvbnRlbnQiOiI8dGhvdWdodD4qKkZpbmRpbmcgdGhlIExlYXN0IENvbW1vbiBNdWx0aXBsZSAo + TENNKSoqXG5cbk9rYXksIG15IHRhc2sgaXMgY2xlYXI6IEkgbmVlZCB0byBkZXRlcm1pbmUgdGhl + IHNtYWxsZXN0IHBvc2l0aXZlIGludGVnZXIgdGhhdCdzIHBlcmZlY3RseSBkaXZpc2libGUgYnkg + NiwgOCwgYW5kIDkuICBJbiBlc3NlbmNlLCB0aGlzIGlzIGEgc3RyYWlnaHRmb3J3YXJkIExDTSBw + cm9ibGVtLiAgSSBrbm93IGJ5IGRlZmluaXRpb24gdGhhdCB0aGUgc21hbGxlc3Qgc3VjaCBpbnRl + Z2VyIGlzIHRoZSBMZWFzdCBDb21tb24gTXVsdGlwbGUgb2YgdGhlc2UgbnVtYmVycy5cblxuTGV0 + J3MgYnJlYWsgZG93biBlYWNoIG51bWJlciBpbnRvIGl0cyBwcmltZSBmYWN0b3JzLiAgSSd2ZSBn + b3Q6XG5cbiogICA2ID0gMiDDlyAzXG4qICAgOCA9IDIgw5cgMiDDlyAyLCB3aGljaCBpcyBtb3Jl + IGNvbmNpc2VseSB3cml0dGVuIGFzIDLCs1xuKiAgIDkgPSAzIMOXIDMgPSAzwrJcblxuTm93LCB0 + byBjYWxjdWxhdGUgdGhlIExDTSwgSSBuZWVkIHRvIGNvbnNpZGVyIHRoZSBoaWdoZXN0IHBvd2Vy + IG9mICplYWNoKiBwcmltZSBmYWN0b3IgcHJlc2VudCBpbiB0aGVzZSBmYWN0b3JpemF0aW9ucy4g + VGhlIHByaW1lIGZhY3RvcnMgaW52b2x2ZWQgaGVyZSBhcmUgMiBhbmQgMy5cblxuKiAgIFRoZSBo + aWdoZXN0IHBvd2VyIG9mIDIgaXMgY2xlYXJseSAywrMsIHdoaWNoIGVxdWFscyA4LlxuKiAgIFRo + ZSBoaWdoZXN0IHBvd2VyIG9mIDMgaXMgM8KyLCB3aGljaCBlcXVhbHMgOS5cblxuVGhlcmVmb3Jl + LCB0aGUgTENNIGlzIHRoZSBwcm9kdWN0IG9mIHRoZXNlIGhpZ2hlc3QgcG93ZXJzOiA4IMOXIDkg + PSA3Mi5cblxuTm93LCB0byBiZSBhYnNvbHV0ZWx5IHN1cmUsIEknbGwgcXVpY2tseSB2ZXJpZnkg + dGhhdCA3MiBpcyBpbmRlZWQgZGl2aXNpYmxlIGJ5IGFsbCB0aHJlZSBvcmlnaW5hbCBudW1iZXJz + OlxuXG4qICAgNzIgLyA2ID0gMTIgKFllcylcbiogICA3MiAvIDggPSA5IChZZXMpXG4qICAgNzIg + LyA5ID0gOCAoWWVzKVxuXG5TaW5jZSBJJ3ZlIHVzZWQgdGhlIGRlZmluaXRpb24gb2YgTENNLCB0 + aGlzICptdXN0KiBiZSB0aGUgc21hbGxlc3Qgc3VjaCBpbnRlZ2VyLiBTbywgdGhlIGFuc3dlciBp + cyA3Mi4gSSdsbCBzdGF0ZSBpdCBjbGVhcmx5LCBhbG9uZyB3aXRoIGFuIGV4cGxhbmF0aW9uIG9m + IGhvdyBJIGFycml2ZWQgYXQgdGhlIHNvbHV0aW9uLlxuXG5cbjwvdGhvdWdodD5UaGUgc21hbGxl + c3QgcG9zaXRpdmUgaW50ZWdlciBkaXZpc2libGUgYnkgNiwgOCwgYW5kIDkgaXMgKio3MioqLlxu + XG4jIyMgRXhwbGFuYXRpb246XG5UbyBmaW5kIHRoZSBzbWFsbGVzdCBudW1iZXIgZGl2aXNpYmxl + IGJ5IGEgc2V0IG9mIG51bWJlcnMsIHlvdSBuZWVkIHRvIGZpbmQgdGhlaXIgKipMZWFzdCBDb21t + b24gTXVsdGlwbGUgKExDTSkqKi4gWW91IGNhbiBkbyB0aGlzIGJ5IGxvb2tpbmcgYXQgdGhlIHBy + aW1lIGZhY3Rvcml6YXRpb24gb2YgZWFjaCBudW1iZXI6XG5cbiogICAqKjYqKiA9IDIgw5cgM1xu + KiAgICoqOCoqID0gMsKzXG4qICAgKio5KiogPSAzwrJcblxuVG8gY2FsY3VsYXRlIHRoZSBMQ00s + IHRha2UgdGhlIGhpZ2hlc3QgcG93ZXIgb2YgZWFjaCBwcmltZSBmYWN0b3IgdGhhdCBhcHBlYXJz + IGluIGFueSBvZiB0aGUgZmFjdG9yaXphdGlvbnM6XG4qICAgVGhlIGhpZ2hlc3QgcG93ZXIgb2Yg + KioyKiogaXMgMsKzICh3aGljaCBpcyA4KS5cbiogICBUaGUgaGlnaGVzdCBwb3dlciBvZiAqKjMq + KiBpcyAzwrIgKHdoaWNoIGlzIDkpLlxuXG5NdWx0aXBseSB0aGVzZSB0b2dldGhlcjogKio4IMOX + IDkgPSA3MioqLiIsImV4dHJhX2NvbnRlbnQiOnsiZ29vZ2xlIjp7InRob3VnaHQiOnRydWUsInRo + b3VnaHRfc2lnbmF0dXJlIjoiRXZnSEN2VUhBV2tVZlJNRWZEcVFIUWd6MjBDZjFNbFhTZ2lZSUl5 + YU9BZndDNnJVRDN4RzFQd2JSSklWbWpFMS9NUTVPekJReEV1SmluMmIvN0RYdEQ5endtVGlJdEQ0 + SlRUd0pPb1pZa1BEN2x1dE1FN2I3Y0p0N0lVbGZLQTdjY084R3o2cTlIRlNseENOWFN2MmwwSUdu + UzhIakRzTzI0VXBDVEdHMzAzNTlBQzJMcTY0UUxrTHROWG5LcFBlSlc0bzR6N3NOOE5hR3FwYTBH + eE5tMXU3OExsTHNNSy9XcGVOdWgxbm5GbnZ4QW96dDk3eUROWWc2SW9Db1dPRmwxQ3FDU0w2NVFq + Ukd1ZXpQUWl4bzlpaHl2V3dDMVB1eEVLdHNSVzJkWnZxalhmdzA4RmNmWGFuTnFWK0NnZWgvMHpP + aW12UlpUc2VBVUNqcnROZ2pyazVnMGIzRVFRKzdUMDJobGJMTm5ySENqdjRvelhKbU4rK0Vwektq + V3VmWXN5V1huNlJiZ0docHdEY0plYk9nWmFCQm15UWZKY2hoVU5uYm5leHJ6N1lnUjU4SDZ3SFJy + TjZpcGllMVpMaWNDanRoTERNMi9iOGgvOEswKzJnaXhjNURBWmVaTTNQeURYVFBJZFhsRjJwdDZs + U3l0QyszdkNodG5uanhmQWNBLyszTkRwM1JPUHdYYWtiOG1GaitiK1Z3bHNNaVlqWWFDSEpzdjVY + akIxbnV1SThZMGxaN3RMb2U3YlZLZng1SDFqRGNSRVdoY2hnM3FjbFZwVFBYVEdkRjI4cWpCVnVo + cWd5d0VRZXQwamkwWDFFRWpGRSs4Y3BEOGtwcy9PY2hYR1NIeUNwbWtsZmhGc2J3UGc4eE80YXNI + cmVldWt2aE5kTzQzNkJOMXhQR1VGNndHdkFPcVZNSzVtQ1VyN0VNTWNxRm8xV3FldVR2bmVUTUNR + eCtycEJ4dm5LdjVqME5OeUVRbk9uME9LNkZ5LzhCelVZRGhsTDRoV3dSQmtrK25Nd1ZNOGxKMU9l + MExxaWpzU3NzeDZWTlBXaFIwZ1R3ZlJxY29pWUtxdkdxME15Sktpd2pEejd5RWI1Q0Z1OXMrcUVl + U3M3Ym84bFFFV3NwKzlFNUt4SmtXRG9VSEZKTXpPS2xTak5YcVhwSS9RUVdTaGliWWk3ckZPQlV3 + bHlON25laHUrR09uV0dOeWQ4dE9KbGhvZGhTS0ZVcmRnSE9jTExoMVM0MGcvd3J4NWFNTlc2aVNm + NlB2RVlOT1lpbHBESTE2Ty9kZENPMzNFb3VSSThGR0JsQi9BYXFXdnFhdVJpOTJNM1pRMzhvM09G + T2xpMWl3Z0MvMkVxYUVnTFBRTkpOOVhGUXVCNW4vU29nVktLS2kwNkNCN3FpeEF1MCsyaHROYUs5 + QUZMYVRpZTk1ZGp4Vll4Zms4ejRyTTlZUVZyNjNBc3RPMnFQMTJDNG1oNjlreXJBVTkzY0J6aUVG + QklHN3BrS01hOVBRU0R2QzNGc1JHTE0rTFdBRmo3T29Pa2tvWHQ5VW9sQWhtWVFMRVpGOFBGaXN6 + NDFTaVIwOU5KdnAxakZEelA0cTlOMHZqU1pZaW5zenIySmlIeDRNZTl4R1ZKeklDQnd0RTd0UlpI + bi9vbmtudWNyMHFVUjRzQkdMaEk2LzZYRGN2V2FLNzlEOHRZRVdnNUZiQUZkc0FLUHZvc0lyMnBv + aE5XMnBxRVl6NUExb1lQMVZuOEREdDhyNHRCRExiRVNYRnE0VWhKUkdZTjVERVowbGp2NllOclU2 + VDdOaWFOZmd3PSJ9fSwicm9sZSI6ImFzc2lzdGFudCJ9fV0sImNyZWF0ZWQiOjE3OTQ5OTQ1Nzks + ImlkIjoia0hIOWFyM2NFLS1lcXRzUF9JZXctQU0iLCJtb2RlbCI6ImdlbWluaS0zLjEtZmxhc2gt + bGl0ZSIsIm9iamVjdCI6ImNoYXQuY29tcGxldGlvbiIsInVzYWdlIjp7ImNvbXBsZXRpb25fdG9r + ZW5zIjoxNzQsInByb21wdF90b2tlbnMiOjIwLCJ0b3RhbF90b2tlbnMiOjQ5M319 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:36:16.171704+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-mixed-01.yaml b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-mixed-01.yaml new file mode 100644 index 0000000..a8960a8 --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-mixed-01.yaml @@ -0,0 +1,176 @@ +filename: 2026-11-18-01a1ee03-a837-7802-bd1c-fcbc03553d2a +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + - extra_content: + google: + thought_signature: EvgHCvUHAWkUfRMEfDqQHQgz20Cf1MlXSgiYIIyaOAfwC6rUD3xG1PwbRJIVmjE1/MQ5OzBQxEuJin2b/7DXtD9zwmTiItD4JTTwJOoZYkPD7lutME7b7cJt7IUlfKA7ccO8Gz6q9HFSlxCNXSv2l0IGnS8HjDsO24UpCTGG30359AC2Lq64QLkLtNXnKpPeJW4o4z7sN8NaGqpa0GxNm1u78LlLsMK/WpeNuh1nnFnvxAozt97yDNYg6IoCoWOFl1CqCSL65QjRGuezPQixo9ihyvWwC1PuxEKtsRW2dZvqjXfw08FcfXanNqV+Cgeh/0zOimvRZTseAUCjrtNgjrk5g0b3EQQ+7T02hlbLNnrHCjv4ozXJmN++EpzKjWufYsyWXn6RbgGhpwDcJebOgZaBBmyQfJchhUNnbnexrz7YgR58H6wHRrN6ipie1ZLicCjthLDM2/b8h/8K0+2gixc5DAZeZM3PyDXTPIdXlF2pt6lSytC+3vChtnnjxfAcA/+3NDp3ROPwXakb8mFj+b+VwlsMiYjYaCHJsv5XjB1nuuI8Y0lZ7tLoe7bVKfx5H1jDcREWhchg3qclVpTPXTGdF28qjBVuhqgywEQet0ji0X1EEjFE+8cpD8kps/OchXGSHyCpmklfhFsbwPg8xO4asHreeukvhNdO436BN1xPGUF6wGvAOqVMK5mCUr7EMMcqFo1WqeuTvneTMCQx+rpBxvnKv5j0NNyEQnOn0OK6Fy/8BzUYDhlL4hWwRBkk+nMwVM8lJ1Oe0LqijsSssx6VNPWhR0gTwfRqcoiYKqvGq0MyJKiwjDz7yEb5CFu9s+qEeSs7bo8lQEWsp+9E5KxJkWDoUHFJMzOKlSjNXqXpI/QQWShibYi7rFOBUwlyN7nehu+GOnWGNyd8tOJlhodhSKFUrdgHOcLLh1S40g/wrx5aMNW6iSf6PvEYNOYilpDI16O/ddCO33EouRI8FGBlB/AaqWvqauRi92M3ZQ38o3OFOli1iwgC/2EqaEgLPQNJN9XFQuB5n/SogVKKKi06CB7qixAu0+2htNaK9AFLaTie95djxVYxfk8z4rM9YQVr63AstO2qP12C4mh69kyrAU93cBziEFBIG7pkKMa9PQSDvC3FsRGLM+LWAFj7OoOkkoXt9UolAhmYQLEZF8PFisz41SiR09NJvp1jFDzP4q9N0vjSZYinszr2JiHx4Me9xGVJzICBwtE7tRZHn/onknucr0qUR4sBGLhI6/6XDcvWaK79D8tYEWg5FbAFdsAKPvosIr2pohNW2pqEYz5A1oYP1Vn8DDt8r4tBDLbESXFq4UhJRGYN5DEZ0ljv6YNrU6T7NiaNfgw= + reasoning_content: '**Finding the Least Common Multiple (LCM)** + + + Okay, my task is clear: I need to determine the smallest positive integer + that''s perfectly divisible by 6, 8, and 9. In essence, this is a straightforward + LCM problem. I know by definition that the smallest such integer is the Least + Common Multiple of these numbers. + + + Let''s break down each number into its prime factors. I''ve got: + + + * 6 = 2 × 3 + + * 8 = 2 × 2 × 2, which is more concisely written as 2³ + + * 9 = 3 × 3 = 3² + + + Now, to calculate the LCM, I need to consider the highest power of *each* + prime factor present in these factorizations. The prime factors involved here + are 2 and 3. + + + * The highest power of 2 is clearly 2³, which equals 8. + + * The highest power of 3 is 3², which equals 9. + + + Therefore, the LCM is the product of these highest powers: 8 × 9 = 72. + + + Now, to be absolutely sure, I''ll quickly verify that 72 is indeed divisible + by all three original numbers: + + + * 72 / 6 = 12 (Yes) + + * 72 / 8 = 9 (Yes) + + * 72 / 9 = 8 (Yes) + + + Since I''ve used the definition of LCM, this *must* be the smallest such integer. + So, the answer is 72. I''ll state it clearly, along with an explanation of + how I arrived at the solution. + + + + The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + ### Explanation: + + To find the smallest number divisible by a set of numbers, you need to find + their **Least Common Multiple (LCM)**. You can do this by looking at the prime + factorization of each number: + + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To calculate the LCM, take the highest power of each prime factor that appears + in any of the factorizations: + + * The highest power of **2** is 2³ (which is 8). + + * The highest power of **3** is 3² (which is 9). + + + Multiply these together: **8 × 9 = 72**.' + role: assistant + - content: What is half that number? + role: user + model: gemini-3.1-flash-lite + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '3623' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee03-a837-7802-bd1c-fcbc03553d2a +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"To","role":"assistant"},"index":0}],"created":1794994580,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" find the smallest positive integer divisible + by 6, 8, and 9, we need to find their **Least Common Multiple (LCM)**","role":"assistant"},"index":0}],"created":1794994580,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" using prime factorization:\n\n* **6** + = 2 × 3\n* **8** = ","role":"assistant"},"index":0}],"created":1794994580,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"2³\n* **9** = 3²\n\nTo find the LCM, + we take the highest power of","role":"assistant"},"index":0}],"created":1794994580,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" each prime factor present:\n* Highest + power of 2 is **2³ (8)**\n* Highest power","role":"assistant"},"index":0}],"created":1794994580,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" of 3 is **3² (9)**\n\nLCM = 8 × 9 = **72**.\n\n**Half","role":"assistant"},"index":0}],"created":1794994580,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" of that number:**\n72 ÷ 2 = **36**.","role":"assistant"},"index":0}],"created":1794994580,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EtMICtAIAWkUfRMS3G7YeqPCPLwNPZJLqA6KzJ34CYcqRLdBF4qorct8uELCI+9bnxsrC6RKzRX5max3I1FeAmbUt5Wb5wLPJCjRKvlABNoqW06ekja6WkAgFLmNGyAQI6ZD77nHYE9OkJUd04rvpi26aLaMSPL+0T00P6UwP9w7feVYfzp5fUGH5VqH+wpNfvAwnRRlFwdI2z8s/Q8YaEi1uU89u4v8gGSlecczecDV9N6mXbjGeJC20rlk4cyvDQVLBkp8eaLHyJ6Qm2b/+TXibdDduxPHCvaLlvnBwrukXWivgnaI+VqK0/VUyZ8WNnzZMUns7gouVnrJHLWgetV7RwXB32RLwCMi4bSnjiMPC7ywV9AGEb83KTh1UzyOxeOfPtmWLDj3jgrrUkSBb5UZafg0HEGT1PYar545K0K2pyKklzPuD/lwt/KbjF6wzGHz+74SFDF6f8m/Pyq2NtIHkmSHZF+0SrP1zr/ACqu6GUUfKjh0p0gqwrllGev+yrUGKOUN3td330lAE6jznUWMRd2NLyRPpaSJPWssmJdbRSBO9u4ANJ1vYw3kf+a8lfgMxf+9nUebJAEm0qCLCDKmyBMof/6nYhFGtlnlYDrWhEAJrOp9RIjiMB9io4tSSTdamS05KHWsHFeBcuZvrSFyuCiSRsYy/aJL2ydw1xjG4+9Y1ft0mR1uLxN8zc4Gnb2ryNaonun2zavbckV3hzw4B3x5nNMfRGHQECElt9owbsPaJ99HtQroD64PYe0WsklAQ7VXyje7PELVaHxcVOfmpxH16CPOUdAmMEpDhVz8MDNpyA/vpq24ijzptyLuB3Oo8oJGY+fSFsR6HadLUAIl3TfjhuClE/MCbiq1jt9UF284wXMY+2uU7loLRahkw43VSPVNTDYj1ZG5hczq7miTGEjENJ9+qLUQpMY7xzSuujjYQHO28Y6gACOXWwXV0PSn7GJJ2xlWNIM9fophhfAgY+wp7OJMFZR7TRtA49ZMO/ItmgpSOpxxjWMH+HRjtg4blYN8kqUmZPwP2Lp4c178wZrTb5tuI8MiU8frqLXTCMT1eIH+UmLN8UKZEPyZTGeqLO+OrQHYI5nrkhekHktTbZSZTKHkMmNGCYjlLI1YK4aVoKEI32XwWQZMXac/h5k2F0kWdS1fH3Ow9aMP/UdjEzH/oBHpjiugo/J0VMtVhnJn4YdIA8pThEK3qXBDksVSTo5dbs96maVGlw3PWZNBo90NyoY1ALh4SYjMaXFUZplAiDul/H2L3LJ1cLB/++XnJ+ADgY2dDwkJqYHDq/S1UuwrihFvQTP49xGOOMcTjSPxvnpUeqTmvVpScNLSjcWthPzcolzk/T0LyF4lpaKD7hCG5alLA27YuPm5XpzF0xYCF6sEUlU9w6gXSiubdzpcVwZGVbwwu1KPsoTMqIl7SbG/dw7Uvs6B0/K/CaiK9qYZZfp2b15l4sjUOVwE+A5CRo3i"}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994581,"id":"k3H9apPtI6PnqtsP84GE8Ag","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:36:19.511274+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..243fc0f --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-non_stream-00.yaml @@ -0,0 +1,146 @@ +filename: 2026-11-18-01a1edfe-364f-7771-8770-50a5be0ae0ae +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + model: gemini-3.1-flash-lite + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '291' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-364f-7771-8770-50a5be0ae0ae +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: "**Finding the Least Common Multiple (LCM)**\n\nOkay, my\ + \ task is clear: I need to determine the smallest positive integer that's\ + \ divisible by 6, 8, and 9. I recognize this as finding the Least Common\ + \ Multiple (LCM) of these three numbers. Right, let's break this down systematically.\n\ + \nFirst, I'll prime factorize each number to identify the prime building\ + \ blocks.\n\n* 6 factors into 2 x 3\n* 8 factors into 2³\n* 9 factors\ + \ into 3²\n\nNow I remember how to calculate the LCM. I need to consider\ + \ each unique prime factor that appears in any of the factorizations and\ + \ raise it to its highest power across all the factorizations.\n\n* The\ + \ prime factors present are 2 and 3.\n* The highest power of 2 is 2³ (from\ + \ the factorization of 8).\n* The highest power of 3 is 3² (from the factorization\ + \ of 9).\n\nTherefore, the LCM is the product of these highest powers: 2³\ + \ * 3².\n\nThis calculates to 8 * 9, which equals 72.\n\nTo ensure this\ + \ is correct, I'll quickly verify that 72 is indeed divisible by all three\ + \ numbers. 72 divided by 6 is 12, divisible. 72 divided by 8 is 9, divisible.\ + \ 72 divided by 9 is 8, also divisible.\n\nTherefore, the final answer is\ + \ 72. I've stated the goal as the LCM, shown the prime factorization, and\ + \ calculated the correct result.\n\n\nTo find the smallest positive\ + \ integer divisible by 6, 8, and 9, you need to find their **Least Common\ + \ Multiple (LCM)**.\n\n### Step-by-Step Calculation:\n\n1. **Find the prime\ + \ factorization of each number:**\n * **6** = $2 \\times 3$\n *\ + \ **8** = $2^3$\n * **9** = $3^2$\n\n2. **Identify the highest power\ + \ of each prime factor present:**\n * The prime factors involved are\ + \ **2** and **3**.\n * The highest power of 2 is **$2^3$** (from 8).\n\ + \ * The highest power of 3 is **$3^2$** (from 9).\n\n3. **Multiply\ + \ these highest powers together:**\n * LCM = $2^3 \\times 3^2$\n \ + \ * LCM = $8 \\times 9$\n * LCM = **72**\n\n**Result:** The smallest\ + \ positive integer divisible by 6, 8, and 9 is **72**." + extra_content: + google: + thought: true + thought_signature: EuAHCt0HAWkUfROWTFcppcunA+BgWuAbfeoIFMelNhuhMrYJlCjStDvD0XWIbqnhFb/3WM4PUkv6l8mfuu6fBIZzHeTVimjC+u6Y0CsA9ezWlsV0KdgPGKDLLv0S2EMOneSm9jzOJ0jHmbt4SJsq5ndM3qxqdwfRqazeSwZ9+Rpy5T91n2Q/xI32CE/phzFOdtEfwDFgIG7LLXhc2l0kjM0OYkbGMVZ6+u9spvpM6eQXJQddso3PQeWoOAZjgKCQJX637qJsHdb1/mysQ0fxe2n/PNpMhNIx9HIE9R5moO5TB21bd+rfOnjDkAsVc8sPJurzpkw40wM6AffTMtruCV25o+8yCn/Dx1Ko6y/x8Sj30z6hsTgJvmpAE4laVfc4xOHLE7F4l9cKEafN57+YXLSy281vSByfcKSrW5kyx5uCY+ET2lp4C+CBK0qOUnRhK6T2FYOnj6gT44QB+/VdL9gJlmAO8zzGw2o4hGKPtz8xRNGAMFtNSdgkkpOjkfqIzjsnYKNBO7uaeOXwh5ru9tMu6DaHhOOQon4dbJ0ZVGHknWiwYn3jSvrdMkO+2MoxGQ8c4Z8Ay7WHolEbcgEJ2EgwKb8vO/2XwZAUXwxHDXXEQT0H120535owORV2PfOoHbf4MX4HcNsabIxHsZRyF8lBYzrrk1WrEm+GZv59X0GU7MM16k5nvfaRPzL3w6YX+ZK9W/rZ0fvD/hoFYogx+fzy/hl9mH6ghUANYRWgXdZpIXXkOUKCMovUT3CGi9Ji7P5Ho+jk29rhL839u5tMiYOpFOhhwjqSdwbELcSTbEEHOkbUP7+YP37VuDLMO5qUgpdwt353wPQGpT1tY+WkJCKtZauVoPi+26rM9qosEuoogUua7sfb85l2+7Jok2KPCxhZDoT/9dCEvCvB6Cd1L5mg3luei3iVtKSKJXZDC4Hz3406wEsa3WhuqRHy9EvXIqR4W3s7KSJm/CObgd53Ujz4sCFX98tpjbv7A/UmIheaaqQ0IsEomMU6al/uOKaCHvTk9w5XURdJRABJDCtT0gD7OmLywo9Lhir3OavddcDJnSQj5qDOFI5Wg7M6EaGvUAO64nJVUTMEKjV/+RiRIUR/3W42t/X2YjMfQiHBtW33sHDA8gJknknq5ZqffO7SN7Q7N/htigsyESqxr5sVohoSGRrU4qW+1mO2KdekKu5iOOaFrrniXCT01K1THZeJJ0HU/7SJ6IR5867sopd0PXRA6ChB/aCoOBnMncL4kVOzinJmTWNS4lMyq6CU11kSlHHcRemSqAXAzLMKrdOmj9IhRrDfSfPsLgm2DwL/1Y0Njf0= + role: assistant + created: 1794994226 + id: LnD9aufMLKnUz7IPhbuWsA8 + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 246 + prompt_tokens: 20 + total_tokens: 567 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoic3RvcCIsImluZGV4IjowLCJtZXNzYWdlIjp7 + ImNvbnRlbnQiOiI8dGhvdWdodD4qKkZpbmRpbmcgdGhlIExlYXN0IENvbW1vbiBNdWx0aXBsZSAo + TENNKSoqXG5cbk9rYXksIG15IHRhc2sgaXMgY2xlYXI6IEkgbmVlZCB0byBkZXRlcm1pbmUgdGhl + IHNtYWxsZXN0IHBvc2l0aXZlIGludGVnZXIgdGhhdCdzIGRpdmlzaWJsZSBieSA2LCA4LCBhbmQg + OS4gIEkgcmVjb2duaXplIHRoaXMgYXMgZmluZGluZyB0aGUgTGVhc3QgQ29tbW9uIE11bHRpcGxl + IChMQ00pIG9mIHRoZXNlIHRocmVlIG51bWJlcnMuIFJpZ2h0LCBsZXQncyBicmVhayB0aGlzIGRv + d24gc3lzdGVtYXRpY2FsbHkuXG5cbkZpcnN0LCBJJ2xsIHByaW1lIGZhY3Rvcml6ZSBlYWNoIG51 + bWJlciB0byBpZGVudGlmeSB0aGUgcHJpbWUgYnVpbGRpbmcgYmxvY2tzLlxuXG4qICAgNiBmYWN0 + b3JzIGludG8gMiB4IDNcbiogICA4IGZhY3RvcnMgaW50byAywrNcbiogICA5IGZhY3RvcnMgaW50 + byAzwrJcblxuTm93IEkgcmVtZW1iZXIgaG93IHRvIGNhbGN1bGF0ZSB0aGUgTENNLiAgSSBuZWVk + IHRvIGNvbnNpZGVyIGVhY2ggdW5pcXVlIHByaW1lIGZhY3RvciB0aGF0IGFwcGVhcnMgaW4gYW55 + IG9mIHRoZSBmYWN0b3JpemF0aW9ucyBhbmQgcmFpc2UgaXQgdG8gaXRzIGhpZ2hlc3QgcG93ZXIg + YWNyb3NzIGFsbCB0aGUgZmFjdG9yaXphdGlvbnMuXG5cbiogICBUaGUgcHJpbWUgZmFjdG9ycyBw + cmVzZW50IGFyZSAyIGFuZCAzLlxuKiAgIFRoZSBoaWdoZXN0IHBvd2VyIG9mIDIgaXMgMsKzIChm + cm9tIHRoZSBmYWN0b3JpemF0aW9uIG9mIDgpLlxuKiAgIFRoZSBoaWdoZXN0IHBvd2VyIG9mIDMg + aXMgM8KyIChmcm9tIHRoZSBmYWN0b3JpemF0aW9uIG9mIDkpLlxuXG5UaGVyZWZvcmUsIHRoZSBM + Q00gaXMgdGhlIHByb2R1Y3Qgb2YgdGhlc2UgaGlnaGVzdCBwb3dlcnM6IDLCsyAqIDPCsi5cblxu + VGhpcyBjYWxjdWxhdGVzIHRvIDggKiA5LCB3aGljaCBlcXVhbHMgNzIuXG5cblRvIGVuc3VyZSB0 + aGlzIGlzIGNvcnJlY3QsIEknbGwgcXVpY2tseSB2ZXJpZnkgdGhhdCA3MiBpcyBpbmRlZWQgZGl2 + aXNpYmxlIGJ5IGFsbCB0aHJlZSBudW1iZXJzLiA3MiBkaXZpZGVkIGJ5IDYgaXMgMTIsIGRpdmlz + aWJsZS4gNzIgZGl2aWRlZCBieSA4IGlzIDksIGRpdmlzaWJsZS4gNzIgZGl2aWRlZCBieSA5IGlz + IDgsIGFsc28gZGl2aXNpYmxlLlxuXG5UaGVyZWZvcmUsIHRoZSBmaW5hbCBhbnN3ZXIgaXMgNzIu + IEkndmUgc3RhdGVkIHRoZSBnb2FsIGFzIHRoZSBMQ00sIHNob3duIHRoZSBwcmltZSBmYWN0b3Jp + emF0aW9uLCBhbmQgY2FsY3VsYXRlZCB0aGUgY29ycmVjdCByZXN1bHQuXG5cblxuPC90aG91Z2h0 + PlRvIGZpbmQgdGhlIHNtYWxsZXN0IHBvc2l0aXZlIGludGVnZXIgZGl2aXNpYmxlIGJ5IDYsIDgs + IGFuZCA5LCB5b3UgbmVlZCB0byBmaW5kIHRoZWlyICoqTGVhc3QgQ29tbW9uIE11bHRpcGxlIChM + Q00pKiouXG5cbiMjIyBTdGVwLWJ5LVN0ZXAgQ2FsY3VsYXRpb246XG5cbjEuICAqKkZpbmQgdGhl + IHByaW1lIGZhY3Rvcml6YXRpb24gb2YgZWFjaCBudW1iZXI6KipcbiAgICAqICAgKio2KiogPSAk + MiBcXHRpbWVzIDMkXG4gICAgKiAgICoqOCoqID0gJDJeMyRcbiAgICAqICAgKio5KiogPSAkM14y + JFxuXG4yLiAgKipJZGVudGlmeSB0aGUgaGlnaGVzdCBwb3dlciBvZiBlYWNoIHByaW1lIGZhY3Rv + ciBwcmVzZW50OioqXG4gICAgKiAgIFRoZSBwcmltZSBmYWN0b3JzIGludm9sdmVkIGFyZSAqKjIq + KiBhbmQgKiozKiouXG4gICAgKiAgIFRoZSBoaWdoZXN0IHBvd2VyIG9mIDIgaXMgKiokMl4zJCoq + IChmcm9tIDgpLlxuICAgICogICBUaGUgaGlnaGVzdCBwb3dlciBvZiAzIGlzICoqJDNeMiQqKiAo + ZnJvbSA5KS5cblxuMy4gICoqTXVsdGlwbHkgdGhlc2UgaGlnaGVzdCBwb3dlcnMgdG9nZXRoZXI6 + KipcbiAgICAqICAgTENNID0gJDJeMyBcXHRpbWVzIDNeMiRcbiAgICAqICAgTENNID0gJDggXFx0 + aW1lcyA5JFxuICAgICogICBMQ00gPSAqKjcyKipcblxuKipSZXN1bHQ6KiogVGhlIHNtYWxsZXN0 + IHBvc2l0aXZlIGludGVnZXIgZGl2aXNpYmxlIGJ5IDYsIDgsIGFuZCA5IGlzICoqNzIqKi4iLCJl + eHRyYV9jb250ZW50Ijp7Imdvb2dsZSI6eyJ0aG91Z2h0Ijp0cnVlLCJ0aG91Z2h0X3NpZ25hdHVy + ZSI6IkV1QUhDdDBIQVdrVWZST1dURmNwcGN1bkErQmdXdUFiZmVvSUZNZWxOaHVoTXJZSmxDalN0 + RHZEMFhXSWJxbmhGYi8zV000UFVrdjZsOG1mdXU2ZkJJWnpIZVRWaW1qQyt1NlkwQ3NBOWV6V2xz + VjBLZGdQR0tETEx2MFMyRU1PbmVTbTlqek9KMGpIbWJ0NFNKc3E1bmRNM3F4cWR3ZlJxYXplU3da + OStScHk1VDkxbjJRL3hJMzJDRS9waHpGT2R0RWZ3REZnSUc3TExYaGMybDBrak0wT1lrYkdNVlo2 + K3U5c3B2cE02ZVFYSlFkZHNvM1BRZVdvT0FaamdLQ1FKWDYzN3FKc0hkYjEvbXlzUTBmeGUybi9Q + TnBNaE5JeDlISUU5UjVtb081VEIyMWJkK3JmT25qRGtBc1ZjOHNQSnVyenBrdzQwd002QWZmVE10 + cnVDVjI1bys4eUNuL0R4MUtvNnkveDhTajMwejZoc1RnSnZtcEFFNGxhVmZjNHhPSExFN0Y0bDlj + S0VhZk41NytZWExTeTI4MXZTQnlmY0tTclc1a3l4NXVDWStFVDJscDRDK0NCSzBxT1VuUmhLNlQy + RllPbmo2Z1Q0NFFCKy9WZEw5Z0psbUFPOHp6R3cybzRoR0tQdHo4eFJOR0FNRnROU2Rna2twT2pr + ZnFJempzbllLTkJPN3VhZU9Yd2g1cnU5dE11NkRhSGhPT1FvbjRkYkowWlZHSGtuV2l3WW4zalN2 + cmRNa08rMk1veEdROGM0WjhBeTdXSG9sRWJjZ0VKMkVnd0tiOHZPLzJYd1pBVVh3eEhEWFhFUVQw + SDEyMDUzNW93T1JWMlBmT29IYmY0TVg0SGNOc2FiSXhIc1pSeUY4bEJZenJyazFXckVtK0dadjU5 + WDBHVTdNTTE2azVudmZhUlB6TDN3NllYK1pLOVcvclowZnZEL2hvRllvZ3grZnp5L2hsOW1INmdo + VUFOWVJXZ1hkWnBJWFhrT1VLQ01vdlVUM0NHaTlKaTdQNUhvK2prMjlyaEw4Mzl1NXRNaVlPcEZP + aGh3anFTZHdiRUxjU1RiRUVIT2tiVVA3K1lQMzdWdURMTU81cVVncGR3dDM1M3dQUUdwVDF0WStX + a0pDS3RaYXVWb1BpKzI2ck05cW9zRXVvb2dVdWE3c2ZiODVsMis3Sm9rMktQQ3hoWkRvVC85ZENF + dkN2QjZDZDFMNW1nM2x1ZWkzaVZ0S1NLSlhaREM0SHozNDA2d0VzYTNXaHVxUkh5OUV2WElxUjRX + M3M3S1NKbS9DT2JnZDUzVWp6NHNDRlg5OHRwamJ2N0EvVW1JaGVhYXFRMElzRW9tTVU2YWwvdU9L + YUNIdlRrOXc1WFVSZEpSQUJKREN0VDBnRDdPbUx5d285TGhpcjNPYXZkZGNESm5TUWo1cURPRkk1 + V2c3TTZFYUd2VUFPNjRuSlZVVE1FS2pWLytSaVJJVVIvM1c0MnQvWDJZak1mUWlIQnRXMzNzSERB + OGdKa25rbnE1WnFmZk83U043UTdOL2h0aWdzeUVTcXhyNXNWb2hvU0dSclU0cVcrMW1PMktkZWtL + dTVpT09hRnJybmlYQ1QwMUsxVEhaZUpKMEhVLzdTSjZJUjU4Njdzb3BkMFBYUkE2Q2hCL2FDb09C + bk1uY0w0a1ZPemluSm1UV05TNGxNeXE2Q1UxMWtTbEhIY1JlbVNxQVhBekxNS3JkT21qOUloUnJE + ZlNmUHNMZ20yRHdMLzFZME5qZjA9In19LCJyb2xlIjoiYXNzaXN0YW50In19XSwiY3JlYXRlZCI6 + MTc5NDk5NDIyNiwiaWQiOiJMbkQ5YXVmTUxLblV6N0lQaGJ1V3NBOCIsIm1vZGVsIjoiZ2VtaW5p + LTMuMS1mbGFzaC1saXRlIiwib2JqZWN0IjoiY2hhdC5jb21wbGV0aW9uIiwidXNhZ2UiOnsiY29t + cGxldGlvbl90b2tlbnMiOjI0NiwicHJvbXB0X3Rva2VucyI6MjAsInRvdGFsX3Rva2VucyI6NTY3 + fX0= + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:30:22.671363+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..9e0f55a --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-non_stream-01.yaml @@ -0,0 +1,223 @@ +filename: 2026-11-18-01a1edfe-436e-75b2-9256-919a223254fb +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + - extra_content: + google: + thought_signature: EuAHCt0HAWkUfROWTFcppcunA+BgWuAbfeoIFMelNhuhMrYJlCjStDvD0XWIbqnhFb/3WM4PUkv6l8mfuu6fBIZzHeTVimjC+u6Y0CsA9ezWlsV0KdgPGKDLLv0S2EMOneSm9jzOJ0jHmbt4SJsq5ndM3qxqdwfRqazeSwZ9+Rpy5T91n2Q/xI32CE/phzFOdtEfwDFgIG7LLXhc2l0kjM0OYkbGMVZ6+u9spvpM6eQXJQddso3PQeWoOAZjgKCQJX637qJsHdb1/mysQ0fxe2n/PNpMhNIx9HIE9R5moO5TB21bd+rfOnjDkAsVc8sPJurzpkw40wM6AffTMtruCV25o+8yCn/Dx1Ko6y/x8Sj30z6hsTgJvmpAE4laVfc4xOHLE7F4l9cKEafN57+YXLSy281vSByfcKSrW5kyx5uCY+ET2lp4C+CBK0qOUnRhK6T2FYOnj6gT44QB+/VdL9gJlmAO8zzGw2o4hGKPtz8xRNGAMFtNSdgkkpOjkfqIzjsnYKNBO7uaeOXwh5ru9tMu6DaHhOOQon4dbJ0ZVGHknWiwYn3jSvrdMkO+2MoxGQ8c4Z8Ay7WHolEbcgEJ2EgwKb8vO/2XwZAUXwxHDXXEQT0H120535owORV2PfOoHbf4MX4HcNsabIxHsZRyF8lBYzrrk1WrEm+GZv59X0GU7MM16k5nvfaRPzL3w6YX+ZK9W/rZ0fvD/hoFYogx+fzy/hl9mH6ghUANYRWgXdZpIXXkOUKCMovUT3CGi9Ji7P5Ho+jk29rhL839u5tMiYOpFOhhwjqSdwbELcSTbEEHOkbUP7+YP37VuDLMO5qUgpdwt353wPQGpT1tY+WkJCKtZauVoPi+26rM9qosEuoogUua7sfb85l2+7Jok2KPCxhZDoT/9dCEvCvB6Cd1L5mg3luei3iVtKSKJXZDC4Hz3406wEsa3WhuqRHy9EvXIqR4W3s7KSJm/CObgd53Ujz4sCFX98tpjbv7A/UmIheaaqQ0IsEomMU6al/uOKaCHvTk9w5XURdJRABJDCtT0gD7OmLywo9Lhir3OavddcDJnSQj5qDOFI5Wg7M6EaGvUAO64nJVUTMEKjV/+RiRIUR/3W42t/X2YjMfQiHBtW33sHDA8gJknknq5ZqffO7SN7Q7N/htigsyESqxr5sVohoSGRrU4qW+1mO2KdekKu5iOOaFrrniXCT01K1THZeJJ0HU/7SJ6IR5867sopd0PXRA6ChB/aCoOBnMncL4kVOzinJmTWNS4lMyq6CU11kSlHHcRemSqAXAzLMKrdOmj9IhRrDfSfPsLgm2DwL/1Y0Njf0= + reasoning_content: "**Finding the Least Common Multiple (LCM)**\n\n\ + Okay, my task is clear: I need to determine the smallest positive integer\ + \ that's divisible by 6, 8, and 9. I recognize this as finding the Least\ + \ Common Multiple (LCM) of these three numbers. Right, let's break this down\ + \ systematically.\n\nFirst, I'll prime factorize each number to identify the\ + \ prime building blocks.\n\n* 6 factors into 2 x 3\n* 8 factors into 2³\n\ + * 9 factors into 3²\n\nNow I remember how to calculate the LCM. I need\ + \ to consider each unique prime factor that appears in any of the factorizations\ + \ and raise it to its highest power across all the factorizations.\n\n* \ + \ The prime factors present are 2 and 3.\n* The highest power of 2 is 2³\ + \ (from the factorization of 8).\n* The highest power of 3 is 3² (from the\ + \ factorization of 9).\n\nTherefore, the LCM is the product of these highest\ + \ powers: 2³ * 3².\n\nThis calculates to 8 * 9, which equals 72.\n\nTo ensure\ + \ this is correct, I'll quickly verify that 72 is indeed divisible by all\ + \ three numbers. 72 divided by 6 is 12, divisible. 72 divided by 8 is 9, divisible.\ + \ 72 divided by 9 is 8, also divisible.\n\nTherefore, the final answer is\ + \ 72. I've stated the goal as the LCM, shown the prime factorization, and\ + \ calculated the correct result.\n\n\nTo find the smallest positive\ + \ integer divisible by 6, 8, and 9, you need to find their **Least Common\ + \ Multiple (LCM)**.\n\n### Step-by-Step Calculation:\n\n1. **Find the prime\ + \ factorization of each number:**\n * **6** = $2 \\times 3$\n * \ + \ **8** = $2^3$\n * **9** = $3^2$\n\n2. **Identify the highest power\ + \ of each prime factor present:**\n * The prime factors involved are\ + \ **2** and **3**.\n * The highest power of 2 is **$2^3$** (from 8).\n\ + \ * The highest power of 3 is **$3^2$** (from 9).\n\n3. **Multiply these\ + \ highest powers together:**\n * LCM = $2^3 \\times 3^2$\n * LCM\ + \ = $8 \\times 9$\n * LCM = **72**\n\n**Result:** The smallest positive\ + \ integer divisible by 6, 8, and 9 is **72**." + role: assistant + - content: What is half that number? + role: user + model: gemini-3.1-flash-lite + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '3806' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-436e-75b2-9256-919a223254fb +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: '**My Thought Process: Finding the LCM and Halving It** + + + Alright, let''s break this down. My goal is to find the smallest positive + integer divisible by 6, 8, and 9. That means I need to calculate the Least + Common Multiple (LCM) of these numbers. + + + My approach will be straightforward: prime factorization. I''ll break down + each number into its prime factors: 6 is 2 x 3, 8 is 2³, and 9 is 3². To + find the LCM, I''ll take the highest power of each prime factor present + in any of the numbers. So, I see the primes 2 and 3. The highest power + of 2 is 2³ (from 8), which equals 8. The highest power of 3 is 3² (from + 9), which equals 9. + + + Therefore, the LCM is 8 multiplied by 9, which equals 72. I should probably + double-check that. Okay, let''s see: 72 divided by 6 is 12, 72 divided + by 8 is 9, and 72 divided by 9 is 8. That checks out. I''ll also do a quick + mental check to see if any smaller number works. It looks like 72 is the + smallest. + + + So, the answer to Task 1 is 72. For Task 2, I need to briefly explain this. + I''ll just say that to calculate the LCM, I used the prime factorization + method. The LCM has to include all the factors of each number, but only + at their highest frequency. + + + Finally, Task 3 is asking for half of 72. That''s a simple calculation, + it''s 36. + + + + The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + ### Explanation: + + To find this, you calculate the Least Common Multiple (LCM) by looking at + the prime factors of each number: + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To find the LCM, you take the highest power of each prime factor present + in these numbers: + + * The highest power of 2 is **2³ (8)**. + + * The highest power of 3 is **3² (9)**. + + + Multiplying these together: **8 × 9 = 72**. + + + ### Half of that number: + + Half of 72 is **36**.' + extra_content: + google: + thought: true + thought_signature: EuILCt8LAWkUfRMpxMglJWqOTzJ+CNMh77D6NXnd59+5CbFM5743hW0KPlr96j2IZoq04/XmOeIJ/W6GGnXtC5hAMycHE+YxqDBAV5ecd8dNQOIKwmkrtnYg0FFoSuoKS+slO3OX8pkgEUuKXpu7woeMw6QfudNacMeGZ+e4ZHPF3VYKgv3m+LactU14UhYzUaUQk1Ax4kwhutUlIN18aIKuL1noKMD5CAiQEbN5tMu5quvzB/AHAfKkHZXDve9a6BRFrYnG4Le6p0blQF+eJpxyge+i79CtCJcI/dDCo99Roc4lrk+y3OAjBO/mrl1dzs+zUworhAOEQqsKoYCY99Vm88aw7xli31gDloEvedNKHxyXFybIY9l72Kif5Qns9HBx9Lhg2JKIl825s1sRq0vFvx5zoeaMu0krUem3itl0HDi6ABLfsOrRQvNPS7hocWDJ6dVwC41irkfWYft3+7p6B/ZBGmOQkxtVFB+oBgPCe8OWxaBN0TxzeLtTv724MZpvZgb83ci5daYkQmgZxW3qQOkgMD3BqHANOox2aRqvgBrcJkFsrWErGahd5npFtoSV94iMDM02UmmRaIPT0BfQoQuMRpyl1QB5ZHbLeu23yAm2agSANdUGAt3fldHgUv9AlAMXL81OUTWK9gQidcnNrMYcPib1BoHBVIHhV5WEACOM/vYyP64BA2RI1COCHYHi4rBHokImuQGU8s028aOd/lanmGPgjOBksN0rozeFF74B3OS6jnqrbQTUh+wZtbuFw57w19HcW6miomg4IovM6PkG89BPs6ERAT2JflpDT3Uy0xwFjfdwN4/gu0Z/nHEdq8MYkMqQjUydDerO99lynOgrXs7GLrn8Yx9JlRUVUGHcSuIyFHulNxMLqEzp149cqw/pJunPgTDfVWD4ZhISC2u25/fLmmQMF2JvwMnR5MuAJO+9+vbSWicHRpLyfePR1N9ZBtfIldA2gwFhCmtmIIV0KilvTJB8h+4wzuIemO2X/rAoGbqXnnzwIH03XgbB6hVIwFoOD8ry7igrlVYEi8ZMPASCMq7vdsEIMLpwQT8GzVn78b7aDD5ucmaFk7F01wM1scyArc0lM96weeCuiga0CIFm6j+tpwlXfNKtF4GQx6B+2rk5se6duitMOmbHXCcvYZsw7ZvUUyfwi/yB3oGDv6U4FX6ehTpCfzuBVMc12cbgKgR932lMg8kreDk2ukkSFnw/aixvzF3m+5nf/GDQamyqqrc4fN9FvkylfBGQcs2MH1hFeofOxKMrKCzABxeEDWj1/a9qTk44zy8D/NfFfiL23zouv+gnswOxY+LX9iVLv9ej3xZ4Y9zj0OicwG135Ii0drvE367hcoKzHpao8+j9n0oZeI700Yzmp2gEN3hldsIJpTdYloIwmDZj0OKxlW8w07b/uErDreWu7qJGrczylNxMPl0peY5Lv8TAm4fAQ88ac5XRK3B76ogtTGIlvUah+Of9qzsuNCQ1DbkRgTDVSq5TTrOLs7qpLKP1XgJ8XJ21fyGCRnvM3SbgOLbYf6A8PLKhGATQpr6Q15Vg1zEH+7/WeUihcolokVbKjKXQJ/jHUXjOYvPT8KeI//5xEcI9prCtYccwqbkEgoOKyfXqUDencSc67ue+ANiCTqgJwc9R3KYi2Kw+NTIZyGUwP2zowR6+hKuab7HgfkPKLpv47CC55ukLy5YPF9IAmlrl+wSP9SHU2HK+ZCJH9RmXDbVeKIKShdyIFmGke09a4hxO46rjwdyeLN8KZc80WodUUTFG6s1R6NLBowAQw1MNxLJkjAMF+WnpVQx+tOaCIETIg0kttZ9n+BsoUohsqC8BEUYwsyUVswuDh8JpOasYiLFPZjWxmOaFh9pgVP6xbErlkbaBsSyYkjXbYZP/nujGPQkhwk52I+6VBwUTcde3f+/s0VA7Ch0nPynDjleHnketpVCXgnvihBEsHXlmo6n5PVNyx8tZYNbgSazpAWr7HFVuW5ttynbzVjRWFgxF + role: assistant + created: 1794994229 + id: MnD9as3tBYKrqtsPxfDcsQc + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 168 + prompt_tokens: 28 + total_tokens: 755 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoic3RvcCIsImluZGV4IjowLCJtZXNzYWdlIjp7 + ImNvbnRlbnQiOiI8dGhvdWdodD4qKk15IFRob3VnaHQgUHJvY2VzczogRmluZGluZyB0aGUgTENN + IGFuZCBIYWx2aW5nIEl0KipcblxuQWxyaWdodCwgbGV0J3MgYnJlYWsgdGhpcyBkb3duLiBNeSBn + b2FsIGlzIHRvIGZpbmQgdGhlIHNtYWxsZXN0IHBvc2l0aXZlIGludGVnZXIgZGl2aXNpYmxlIGJ5 + IDYsIDgsIGFuZCA5LiBUaGF0IG1lYW5zIEkgbmVlZCB0byBjYWxjdWxhdGUgdGhlIExlYXN0IENv + bW1vbiBNdWx0aXBsZSAoTENNKSBvZiB0aGVzZSBudW1iZXJzLlxuXG5NeSBhcHByb2FjaCB3aWxs + IGJlIHN0cmFpZ2h0Zm9yd2FyZDogcHJpbWUgZmFjdG9yaXphdGlvbi4gSSdsbCBicmVhayBkb3du + IGVhY2ggbnVtYmVyIGludG8gaXRzIHByaW1lIGZhY3RvcnM6IDYgaXMgMiB4IDMsIDggaXMgMsKz + LCBhbmQgOSBpcyAzwrIuICBUbyBmaW5kIHRoZSBMQ00sIEknbGwgdGFrZSB0aGUgaGlnaGVzdCBw + b3dlciBvZiBlYWNoIHByaW1lIGZhY3RvciBwcmVzZW50IGluIGFueSBvZiB0aGUgbnVtYmVycy4g + IFNvLCBJIHNlZSB0aGUgcHJpbWVzIDIgYW5kIDMuIFRoZSBoaWdoZXN0IHBvd2VyIG9mIDIgaXMg + MsKzIChmcm9tIDgpLCB3aGljaCBlcXVhbHMgOC4gVGhlIGhpZ2hlc3QgcG93ZXIgb2YgMyBpcyAz + wrIgKGZyb20gOSksIHdoaWNoIGVxdWFscyA5LlxuXG5UaGVyZWZvcmUsIHRoZSBMQ00gaXMgOCBt + dWx0aXBsaWVkIGJ5IDksIHdoaWNoIGVxdWFscyA3Mi4gSSBzaG91bGQgcHJvYmFibHkgZG91Ymxl + LWNoZWNrIHRoYXQuICBPa2F5LCBsZXQncyBzZWU6IDcyIGRpdmlkZWQgYnkgNiBpcyAxMiwgNzIg + ZGl2aWRlZCBieSA4IGlzIDksIGFuZCA3MiBkaXZpZGVkIGJ5IDkgaXMgOC4gVGhhdCBjaGVja3Mg + b3V0LiBJJ2xsIGFsc28gZG8gYSBxdWljayBtZW50YWwgY2hlY2sgdG8gc2VlIGlmIGFueSBzbWFs + bGVyIG51bWJlciB3b3Jrcy4gSXQgbG9va3MgbGlrZSA3MiBpcyB0aGUgc21hbGxlc3QuXG5cblNv + LCB0aGUgYW5zd2VyIHRvIFRhc2sgMSBpcyA3Mi4gRm9yIFRhc2sgMiwgSSBuZWVkIHRvIGJyaWVm + bHkgZXhwbGFpbiB0aGlzLiBJJ2xsIGp1c3Qgc2F5IHRoYXQgdG8gY2FsY3VsYXRlIHRoZSBMQ00s + IEkgdXNlZCB0aGUgcHJpbWUgZmFjdG9yaXphdGlvbiBtZXRob2QuIFRoZSBMQ00gaGFzIHRvIGlu + Y2x1ZGUgYWxsIHRoZSBmYWN0b3JzIG9mIGVhY2ggbnVtYmVyLCBidXQgb25seSBhdCB0aGVpciBo + aWdoZXN0IGZyZXF1ZW5jeS5cblxuRmluYWxseSwgVGFzayAzIGlzIGFza2luZyBmb3IgaGFsZiBv + ZiA3Mi4gVGhhdCdzIGEgc2ltcGxlIGNhbGN1bGF0aW9uLCBpdCdzIDM2LlxuXG5cbjwvdGhvdWdo + dD5UaGUgc21hbGxlc3QgcG9zaXRpdmUgaW50ZWdlciBkaXZpc2libGUgYnkgNiwgOCwgYW5kIDkg + aXMgKio3MioqLlxuXG4jIyMgRXhwbGFuYXRpb246XG5UbyBmaW5kIHRoaXMsIHlvdSBjYWxjdWxh + dGUgdGhlIExlYXN0IENvbW1vbiBNdWx0aXBsZSAoTENNKSBieSBsb29raW5nIGF0IHRoZSBwcmlt + ZSBmYWN0b3JzIG9mIGVhY2ggbnVtYmVyOlxuKiAgICoqNioqID0gMiDDlyAzXG4qICAgKio4Kiog + PSAywrNcbiogICAqKjkqKiA9IDPCslxuXG5UbyBmaW5kIHRoZSBMQ00sIHlvdSB0YWtlIHRoZSBo + aWdoZXN0IHBvd2VyIG9mIGVhY2ggcHJpbWUgZmFjdG9yIHByZXNlbnQgaW4gdGhlc2UgbnVtYmVy + czpcbiogICBUaGUgaGlnaGVzdCBwb3dlciBvZiAyIGlzICoqMsKzICg4KSoqLlxuKiAgIFRoZSBo + aWdoZXN0IHBvd2VyIG9mIDMgaXMgKiozwrIgKDkpKiouXG5cbk11bHRpcGx5aW5nIHRoZXNlIHRv + Z2V0aGVyOiAqKjggw5cgOSA9IDcyKiouXG5cbiMjIyBIYWxmIG9mIHRoYXQgbnVtYmVyOlxuSGFs + ZiBvZiA3MiBpcyAqKjM2KiouIiwiZXh0cmFfY29udGVudCI6eyJnb29nbGUiOnsidGhvdWdodCI6 + dHJ1ZSwidGhvdWdodF9zaWduYXR1cmUiOiJFdUlMQ3Q4TEFXa1VmUk1weE1nbEpXcU9UekorQ05N + aDc3RDZOWG5kNTkrNUNiRk01NzQzaFcwS1Bscjk2ajJJWm9xMDQvWG1PZUlKL1c2R0duWHRDNWhB + TXljSEUrWXhxREJBVjVlY2Q4ZE5RT0lLd21rcnRuWWcwRkZvU3VvS1Mrc2xPM09YOHBrZ0VVdUtY + cHU3d29lTXc2UWZ1ZE5hY01lR1orZTRaSFBGM1ZZS2d2M20rTGFjdFUxNFVoWXpVYVVRazFBeDRr + d2h1dFVsSU4xOGFJS3VMMW5vS01ENUNBaVFFYk41dE11NXF1dnpCL0FIQWZLa0haWER2ZTlhNkJS + RnJZbkc0TGU2cDBibFFGK2VKcHh5Z2UraTc5Q3RDSmNJL2REQ285OVJvYzRscmsreTNPQWpCTy9t + cmwxZHpzK3pVd29yaEFPRVFxc0tvWUNZOTlWbTg4YXc3eGxpMzFnRGxvRXZlZE5LSHh5WEZ5YklZ + OWw3MktpZjVRbnM5SEJ4OUxoZzJKS0lsODI1czFzUnEwdkZ2eDV6b2VhTXUwa3JVZW0zaXRsMEhE + aTZBQkxmc09yUlF2TlBTN2hvY1dESjZkVndDNDFpcmtmV1lmdDMrN3A2Qi9aQkdtT1FreHRWRkIr + b0JnUENlOE9XeGFCTjBUeHplTHRUdjcyNE1acHZaZ2I4M2NpNWRhWWtRbWdaeFczcVFPa2dNRDNC + cUhBTk9veDJhUnF2Z0JyY0prRnNyV0VyR2FoZDVucEZ0b1NWOTRpTURNMDJVbW1SYUlQVDBCZlFv + UXVNUnB5bDFRQjVaSGJMZXUyM3lBbTJhZ1NBTmRVR0F0M2ZsZEhnVXY5QWxBTVhMODFPVVRXSzln + UWlkY25Ock1ZY1BpYjFCb0hCVklIaFY1V0VBQ09NL3ZZeVA2NEJBMlJJMUNPQ0hZSGk0ckJIb2tJ + bXVRR1U4czAyOGFPZC9sYW5tR1Bnak9Ca3NOMHJvemVGRjc0QjNPUzZqbnFyYlFUVWgrd1p0YnVG + dzU3dzE5SGNXNm1pb21nNElvdk02UGtHODlCUHM2RVJBVDJKZmxwRFQzVXkweHdGamZkd040L2d1 + MFovbkhFZHE4TVlrTXFRalV5ZERlck85OWx5bk9nclhzN0dMcm44WXg5SmxSVVZVR0hjU3VJeUZI + dWxOeE1McUV6cDE0OWNxdy9wSnVuUGdURGZWV0Q0WmhJU0MydTI1L2ZMbW1RTUYySnZ3TW5SNU11 + QUpPKzkrdmJTV2ljSFJwTHlmZVBSMU45WkJ0ZklsZEEyZ3dGaENtdG1JSVYwS2lsdlRKQjhoKzR3 + enVJZW1PMlgvckFvR2JxWG5uendJSDAzWGdiQjZoVkl3Rm9PRDhyeTdpZ3JsVllFaThaTVBBU0NN + cTd2ZHNFSU1McHdRVDhHelZuNzhiN2FERDV1Y21hRms3RjAxd00xc2N5QXJjMGxNOTZ3ZWVDdWln + YTBDSUZtNmordHB3bFhmTkt0RjRHUXg2Qisycms1c2U2ZHVpdE1PbWJIWENjdllac3c3WnZVVXlm + d2kveUIzb0dEdjZVNEZYNmVoVHBDZnp1QlZNYzEyY2JnS2dSOTMybE1nOGtyZURrMnVra1NGbncv + YWl4dnpGM20rNW5mL0dEUWFteXFxcmM0Zk45RnZreWxmQkdRY3MyTUgxaEZlb2ZPeEtNcktDekFC + eGVFRFdqMS9hOXFUazQ0enk4RC9OZkZmaUwyM3pvdXYrZ25zd094WStMWDlpVkx2OWVqM3haNFk5 + emowT2ljd0cxMzVJaTBkcnZFMzY3aGNvS3pIcGFvOCtqOW4wb1plSTcwMFl6bXAyZ0VOM2hsZHNJ + SnBUZFlsb0l3bURaajBPS3hsVzh3MDdiL3VFckRyZVd1N3FKR3JjenlsTnhNUGwwcGVZNUx2OFRB + bTRmQVE4OGFjNVhSSzNCNzZvZ3RUR0lsdlVhaCtPZjlxenN1TkNRMURia1JnVERWU3E1VFRyT0xz + N3FwTEtQMVhnSjhYSjIxZnlHQ1Judk0zU2JnT0xiWWY2QThQTEtoR0FUUXByNlExNVZnMXpFSCs3 + L1dlVWloY29sb2tWYktqS1hRSi9qSFVYak9ZdlBUOEtlSS8vNXhFY0k5cHJDdFljY3dxYmtFZ29P + S3lmWHFVRGVuY1NjNjd1ZStBTmlDVHFnSndjOVIzS1lpMkt3K05USVp5R1V3UDJ6b3dSNitoS3Vh + YjdIZ2ZrUEtMcHY0N0NDNTV1a0x5NVlQRjlJQW1scmwrd1NQOVNIVTJISytaQ0pIOVJtWERiVmVL + SUtTaGR5SUZtR2tlMDlhNGh4TzQ2cmp3ZHllTE44S1pjODBXb2RVVVRGRzZzMVI2TkxCb3dBUXcx + TU54TEprakFNRitXbnBWUXgrdE9hQ0lFVElnMGt0dFo5bitCc29Vb2hzcUM4QkVVWXdzeVVWc3d1 + RGg4SnBPYXNZaUxGUFpqV3htT2FGaDlwZ1ZQNnhiRXJsa2JhQnNTeVlralhiWVpQL251akdQUWto + d2s1MkkrNlZCd1VUY2RlM2YrL3MwVkE3Q2gwblB5bkRqbGVIbmtldHBWQ1hnbnZpaEJFc0hYbG1v + Nm41UFZOeXg4dFpZTmJnU2F6cEFXcjdIRlZ1VzV0dHluYnpWalJXRmd4RiJ9fSwicm9sZSI6ImFz + c2lzdGFudCJ9fV0sImNyZWF0ZWQiOjE3OTQ5OTQyMjksImlkIjoiTW5EOWFzM3RCWUtycXRzUHhm + RGNzUWMiLCJtb2RlbCI6ImdlbWluaS0zLjEtZmxhc2gtbGl0ZSIsIm9iamVjdCI6ImNoYXQuY29t + cGxldGlvbiIsInVzYWdlIjp7ImNvbXBsZXRpb25fdG9rZW5zIjoxNjgsInByb21wdF90b2tlbnMi + OjI4LCJ0b3RhbF90b2tlbnMiOjc1NX19 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:30:26.030540+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-stream-00.yaml new file mode 100644 index 0000000..51aded0 --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-stream-00.yaml @@ -0,0 +1,104 @@ +filename: 2026-11-18-01a1edfe-24f0-7241-b2b1-7768073eac2e +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + model: gemini-3.1-flash-lite + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '290' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-24f0-7241-b2b1-7768073eac2e +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"The smallest positive integer divisible + by ","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"6, 8, and 9 is **72**.\n\n**Explanation:**\nTo + find the smallest number divisible by a","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" set of numbers, you need to find their + **Least Common Multiple (LCM)**. You can do this by looking at the","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" prime factorization of each number:\n\n* **6** + = 2 × 3\n* **8** = ","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"2³\n* **9** = 3²\n\nTo calculate the + LCM, take the highest power of each prime factor","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" present in the numbers:\n* The highest + power of 2 is **2³ (8)**.\n* The","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" highest power of 3 is **3² (9)**.\n\nMultiply + these together: **8 × 9 = ","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"72**.","role":"assistant"},"index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EtoHCtcHAWkUfRP/lJD4/ar0NXLDacHcmtfTzS0w+RWIb/cAXJPPhZOlPfzfLSlB/rsUfTMie4HMTpLfy7ayDDH9LVyPOnMHrQAVxkAjpEdy0MEDZTG+2rg5x0SsEfxY9cBWRSSw09ZZkRmaP2b2ab4PA0b8qCr8WonzWLg+QG1AYQ2PsMoopuC+i43951NKDFXEyLFs+Q+lr8sFK9VQi073xaF8Bve8yUtTgCcC42vBQ2O1e/1AWmtCCMamgN2qBP7BHjR6irMtSYmqOsZ/jfVQi0eIkxLiLAISJLbmzcSX0Rnp1P2GbS8UNtWfL4CeCR9rIK6PpzUpfuiZlXWmKQWYxD6XWCzt6MLCm5xVFDRk+tXZqjwRWX9sA1NXZIwSAjG7VmNSlIEV5/TxeECZ4yKMDRWN6MDxDA/1ZJwyzHIkN/Nqcn9IAvY2ImOvmenZHKG0VC5o2XfYwbRMz0C4lEMC4FnvSz8twiKksoyAibxCpe4Ox4EO7R47g1ltsG8hmrX662CyIm86iIiBrBbQfp20Jk3MAQT7RIaYZ/05SQJCOKMpaXECOr9GXy++D5MtykcTYzBXiDSMMoaYvYw920EcwUvbsBalilPtB5NLuMoR1lMg9uFyMT6lKCKlBeS7srtQ1/uwb65RCJ+p5DofTxHPEeoUZyjiZF7NJqxgR1rQ47AbJUMrJGF19Uef0O8vD/parv/YQ5fEkLcmljWlqrqMrFVjPLNNPe8rLcZSYnyuI1ABZvY2eqjTgvcWZ2Q1ErESSRvlp6hexQ/HLWNGXlgYkelIlUw5FY8rmIW6+GARYoAr4cK4XtD+eBt4C1iSMnwgcOFhTAYB76leabxkrpzW1+34+2j4D7K2a8IHR4oPdYxhVcKf0d6BaMn39tMNZxrTn8hjnifaAMmjEq0N+JwKIekJcVrriNsVsF63L4AYDX6LihKMaqF6bpSAL6CdLE/VcoNyEzqNDTbSqRvBjIduwz+MAVsCZOJylF/TE4Se1a5vNk6fqPQX+0Ezt5Sm1Tumy1LxbJ6dymdF7EqAWbox6owNV1EIHLPhJm078JPOs81kMyy+STS5q/0HGgPaf7+z827vQrkS0LT1Xg+8yPbqD935m3o8Do1o6pEM++99spgoP7aMceeVSZCTijPheCIXBcMyR+bnvDjUqudHKdlufn6CKMOVKOjzRmDWT9BrwOBUOLoJKQvD1RhTK7b3F7kwiQTDDz2SfWI+Oi1NdzlOJJoU2A7jXcgHmzFF94pL/oPgQoiublewyd9BpnRTaRjuU8wYpmEVfpx46SusQ7Lrxg6ZpL3yTqGegak="}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994219,"id":"KnD9atPxFvOjqtsPvYeG8AE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:30:18.224867+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-stream-01.yaml new file mode 100644 index 0000000..6fbaf83 --- /dev/null +++ b/tests/cassettes/upstream_ir/reasoning_text/gemini-chat_completions-stream-01.yaml @@ -0,0 +1,87 @@ +filename: 2026-11-18-01a1edfe-2aef-7d13-bd61-beffb232653c +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Find the smallest positive integer divisible by 6, 8 and 9. Explain + briefly. + role: user + - content: 'The smallest positive integer divisible by 6, 8, and 9 is **72**. + + + **Explanation:** + + To find the smallest number divisible by a set of numbers, you need to find + their **Least Common Multiple (LCM)**. You can do this by looking at the prime + factorization of each number: + + + * **6** = 2 × 3 + + * **8** = 2³ + + * **9** = 3² + + + To calculate the LCM, take the highest power of each prime factor present + in the numbers: + + * The highest power of 2 is **2³ (8)**. + + * The highest power of 3 is **3² (9)**. + + + Multiply these together: **8 × 9 = 72**.' + extra_content: + google: + thought_signature: EtoHCtcHAWkUfRP/lJD4/ar0NXLDacHcmtfTzS0w+RWIb/cAXJPPhZOlPfzfLSlB/rsUfTMie4HMTpLfy7ayDDH9LVyPOnMHrQAVxkAjpEdy0MEDZTG+2rg5x0SsEfxY9cBWRSSw09ZZkRmaP2b2ab4PA0b8qCr8WonzWLg+QG1AYQ2PsMoopuC+i43951NKDFXEyLFs+Q+lr8sFK9VQi073xaF8Bve8yUtTgCcC42vBQ2O1e/1AWmtCCMamgN2qBP7BHjR6irMtSYmqOsZ/jfVQi0eIkxLiLAISJLbmzcSX0Rnp1P2GbS8UNtWfL4CeCR9rIK6PpzUpfuiZlXWmKQWYxD6XWCzt6MLCm5xVFDRk+tXZqjwRWX9sA1NXZIwSAjG7VmNSlIEV5/TxeECZ4yKMDRWN6MDxDA/1ZJwyzHIkN/Nqcn9IAvY2ImOvmenZHKG0VC5o2XfYwbRMz0C4lEMC4FnvSz8twiKksoyAibxCpe4Ox4EO7R47g1ltsG8hmrX662CyIm86iIiBrBbQfp20Jk3MAQT7RIaYZ/05SQJCOKMpaXECOr9GXy++D5MtykcTYzBXiDSMMoaYvYw920EcwUvbsBalilPtB5NLuMoR1lMg9uFyMT6lKCKlBeS7srtQ1/uwb65RCJ+p5DofTxHPEeoUZyjiZF7NJqxgR1rQ47AbJUMrJGF19Uef0O8vD/parv/YQ5fEkLcmljWlqrqMrFVjPLNNPe8rLcZSYnyuI1ABZvY2eqjTgvcWZ2Q1ErESSRvlp6hexQ/HLWNGXlgYkelIlUw5FY8rmIW6+GARYoAr4cK4XtD+eBt4C1iSMnwgcOFhTAYB76leabxkrpzW1+34+2j4D7K2a8IHR4oPdYxhVcKf0d6BaMn39tMNZxrTn8hjnifaAMmjEq0N+JwKIekJcVrriNsVsF63L4AYDX6LihKMaqF6bpSAL6CdLE/VcoNyEzqNDTbSqRvBjIduwz+MAVsCZOJylF/TE4Se1a5vNk6fqPQX+0Ezt5Sm1Tumy1LxbJ6dymdF7EqAWbox6owNV1EIHLPhJm078JPOs81kMyy+STS5q/0HGgPaf7+z827vQrkS0LT1Xg+8yPbqD935m3o8Do1o6pEM++99spgoP7aMceeVSZCTijPheCIXBcMyR+bnvDjUqudHKdlufn6CKMOVKOjzRmDWT9BrwOBUOLoJKQvD1RhTK7b3F7kwiQTDDz2SfWI+Oi1NdzlOJJoU2A7jXcgHmzFF94pL/oPgQoiublewyd9BpnRTaRjuU8wYpmEVfpx46SusQ7Lrxg6ZpL3yTqGegak= + role: assistant + - content: What is half that number? + role: user + model: gemini-3.1-flash-lite + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2303' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-2aef-7d13-bd61-beffb232653c +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"Half of 72 is **36**.","role":"assistant"},"index":0}],"created":1794994220,"id":"K3D9aoa3M_6fz7IP0ea76A0","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EsECCr4CAWkUfRML2qWjmi1EJp4PAD6s1iceljjOjNniy9ATibB5NzrXbrfEdmn/6z3ZJV/lkWKeYHcjI7ZWfTskJt1h0wG40sZ2qkrzE4+0Q3leS3aWgpWp7XPv0QUGemik9bikeOGX/MTh+oqwuXQgOHK8O7qvQ6Lf1WSOF9xHQxz8FQSXUrSQZe/X01sCuV0kxbsgb+4fqbNzJdb9F45OhQebhliH9hl6IIgo6cgXRQdoX/BDFlf6YbpoooF+Z9Wmau+ZX1ufKLxYbMu8Vi0+hQsGI8EQkdX5ImTY7DaKD+MyEzpW2mkznbv5jO1moS/jjp0gQh1GUZJ96OBZHkq762BYNmY68xutHxFNYteCl3P5GvsiUPBS2aLFEO1kDFDOzHEArO2E3PqTZRPrV2dYNUPJVLBP7YQTLvvhF3p4VGv0"}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994220,"id":"K3D9aoa3M_6fz7IP0ea76A0","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:30:19.759890+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..e4430a6 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-non_stream-00.yaml @@ -0,0 +1,61 @@ +filename: 2026-11-05-01a1ac2f-950b-7090-8d60-7cc02c851248 +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: global.openai.gpt-5.6-luna + reasoning_effort: none + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '210' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-950b-7090-8d60-7cc02c851248 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + annotations: [] + content: SproutBot. + refusal: null + role: assistant + created: 1793890162 + id: chatcmpl-pwrs6d7jniyc45kywext3nyggitwyt3fzi6lkyvuxrtygf6aq7ma + model: global.openai.gpt-5.6-luna + object: chat.completion + service_tier: default + system_fingerprint: null + usage: + completion_tokens: 8 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 0 + rejected_prediction_tokens: 0 + prompt_tokens: 14 + prompt_tokens_details: + audio_tokens: 0 + cache_write_tokens: 0 + cached_tokens: 0 + total_tokens: 22 + headers: + connection: keep-alive + content-length: '622' + content-type: application/json + x-request-id: a961364d-e911-4a1d-9ae6-2b24611c2839 + status_code: 200 +timestamp: '2026-11-05T14:49:21.931990+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..5cf1ae0 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-non_stream-01.yaml @@ -0,0 +1,71 @@ +filename: 2026-11-05-01a1ac2f-97e2-7b03-8cc0-0fcb5982ca23 +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - annotations: [] + content: SproutBot. + refusal: null + role: assistant + - content: + - text: Explain why that name fits. + type: text + role: user + model: global.openai.gpt-5.6-luna + reasoning_effort: none + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '367' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-97e2-7b03-8cc0-0fcb5982ca23 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + annotations: [] + content: “SproutBot” fits because it combines **“sprout,”** a symbol of new + plant growth, with **“Bot,”** signaling a helpful robot. It sounds friendly, + memorable, and clearly suggests a machine designed to nurture gardens. + refusal: null + role: assistant + created: 1793890163 + id: chatcmpl-665j4euh2xd77u34imsnfv6awpkqazcfkl4tufifqkum3ns54k4q + model: global.openai.gpt-5.6-luna + object: chat.completion + service_tier: default + system_fingerprint: null + usage: + completion_tokens: 53 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 0 + rejected_prediction_tokens: 0 + prompt_tokens: 34 + prompt_tokens_details: + audio_tokens: 0 + cache_write_tokens: 0 + cached_tokens: 0 + total_tokens: 87 + headers: + connection: keep-alive + content-length: '839' + content-type: application/json + x-request-id: 4f833f06-da63-475d-91b3-a4d6f9407cee + status_code: 200 +timestamp: '2026-11-05T14:49:22.658177+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-stream-00.yaml new file mode 100644 index 0000000..8c89b11 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-stream-00.yaml @@ -0,0 +1,86 @@ +filename: 2026-11-05-01a1ac2f-8dd1-7691-82c6-b92edd6108f2 +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: global.openai.gpt-5.6-luna + reasoning_effort: none + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '249' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-8dd1-7691-82c6-b92edd6108f2 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: 9d29619b-8fc8-4169-b2b8-7fb4e2847944 + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant","refusal":null},"finish_reason":null,"index":0}],"created":1793890160,"id":"chatcmpl-ycvefv7mo6fy7ad2qroyk5rdsg3xpsh5653ngkfh4ip3zsibslva","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefgh"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Spr"},"finish_reason":null,"index":0}],"created":1793890160,"id":"chatcmpl-ycvefv7mo6fy7ad2qroyk5rdsg3xpsh5653ngkfh4ip3zsibslva","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyz"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"out"},"finish_reason":null,"index":0}],"created":1793890160,"id":"chatcmpl-ycvefv7mo6fy7ad2qroyk5rdsg3xpsh5653ngkfh4ip3zsibslva","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Bot"},"finish_reason":null,"index":0}],"created":1793890160,"id":"chatcmpl-ycvefv7mo6fy7ad2qroyk5rdsg3xpsh5653ngkfh4ip3zsibslva","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcde"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"."},"finish_reason":null,"index":0}],"created":1793890160,"id":"chatcmpl-ycvefv7mo6fy7ad2qroyk5rdsg3xpsh5653ngkfh4ip3zsibslva","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrst"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"stop","index":0}],"created":1793890160,"id":"chatcmpl-ycvefv7mo6fy7ad2qroyk5rdsg3xpsh5653ngkfh4ip3zsibslva","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHI"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1793890160,"id":"chatcmpl-ycvefv7mo6fy7ad2qroyk5rdsg3xpsh5653ngkfh4ip3zsibslva","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":8,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":14,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0},"total_tokens":22},"system_fingerprint":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:20.081125+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-stream-01.yaml new file mode 100644 index 0000000..cf177a9 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-chat_completions-stream-01.yaml @@ -0,0 +1,385 @@ +filename: 2026-11-05-01a1ac2f-910f-7f51-be4e-aca2ecd4ad1c +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - annotations: null + audio: null + content: SproutBot. + function_call: null + refusal: null + role: assistant + tool_calls: null + - content: + - text: Explain why that name fits. + type: text + role: user + model: global.openai.gpt-5.6-luna + reasoning_effort: none + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '460' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-910f-7f51-be4e-aca2ecd4ad1c +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: af52885d-7fb8-4f67-bafc-7dc1ff4b231b + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant","refusal":null},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"“"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Spr"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxy"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"out"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Bot"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"”"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvw"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" fits"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHI"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" because"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" it"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" combines"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" **"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuv"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"“"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"spr"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuv"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"out"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":",”"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvw"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"**"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGH"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" a"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" symbol"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJ"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" of"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzAB"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" new"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" plant"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGH"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" growth"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDE"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":","},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" with"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwx"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" **"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"“"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Bot"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefgh"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":",”"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"**"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwx"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" a"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCD"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" clear"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstu"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" reference"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCD"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" to"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCD"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" a"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"ab"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" robot"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJK"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"."},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" It"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmno"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" sounds"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" friendly"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGH"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":","},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" memorable"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFG"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":","},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" and"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" immediately"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" suggests"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrst"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" a"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijkl"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" machine"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" designed"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" to"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCD"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" help"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcde"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" plants"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzAB"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" grow"},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyz"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"."},"finish_reason":null,"index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyz"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"stop","index":0}],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGH"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1793890161,"id":"chatcmpl-mzdaovpmmlflnjno6u2polq6jrb2kie7qexlvmklmvlyoddw3d4q","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":56,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":34,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0},"total_tokens":90},"system_fingerprint":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:20.911708+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-messages-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-non_stream-00.yaml new file mode 100644 index 0000000..b00674f --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-non_stream-00.yaml @@ -0,0 +1,52 @@ +filename: 2026-11-16-01a1e429-0047-71d2-9d95-eb98e2c59a8b +request: + body: + max_tokens: 512 + messages: + - content: + - text: Write one short sentence about the ocean. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '199' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e429-0047-71d2-9d95-eb98e2c59a8b +response: + body: + container: null + content: + - text: The ocean covers more than seventy percent of Earth's surface and remains + largely unexplored. + type: text + id: msg_bdrk_wjfpb2urfnkymxrfgenlypi7caqthpppnrzhvumtysapqyba6hcq + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: end_turn + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 15 + output_tokens: 22 + service_tier: standard + headers: + connection: keep-alive + content-length: '583' + content-type: application/json + status_code: 200 +timestamp: '2026-11-16T11:40:54.727459+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-messages-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-non_stream-01.yaml new file mode 100644 index 0000000..9f70af3 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-non_stream-01.yaml @@ -0,0 +1,60 @@ +filename: 2026-11-16-01a1e429-0424-7ae1-a24e-78f0bf1009d3 +request: + body: + max_tokens: 512 + messages: + - content: + - text: Write one short sentence about the ocean. + type: text + role: user + - content: + - text: The ocean covers more than seventy percent of Earth's surface and remains + largely unexplored. + type: text + role: assistant + - content: + - text: Make that sentence shorter. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '432' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e429-0424-7ae1-a24e-78f0bf1009d3 +response: + body: + container: null + content: + - text: The ocean covers most of Earth's surface. + type: text + id: msg_bdrk_ulljohzzu6yuf3fiukvxkgxbbgwvvmyogrybfu3hiqizmfk5l7qq + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: end_turn + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 45 + output_tokens: 12 + service_tier: standard + headers: + connection: keep-alive + content-length: '531' + content-type: application/json + status_code: 200 +timestamp: '2026-11-16T11:40:55.716289+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-messages-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-stream-00.yaml new file mode 100644 index 0000000..ddaf550 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-stream-00.yaml @@ -0,0 +1,166 @@ +filename: 2026-11-16-01a1e428-ed3d-7dc2-acc2-214eb46b1c8c +request: + body: + max_tokens: 512 + messages: + - content: + - text: Write one short sentence about the ocean. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '198' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e428-ed3d-7dc2-acc2-214eb46b1c8c +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_gmbtebo4fcz5yvrmlmp43ucuduxjrft4ydpjgahwwm452p3vxnpq","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"The + ocean covers"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + most"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + of Earth''s surface and te"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ems + with life in depths"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + we"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"''re"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + still"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + exploring"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":23}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-16T11:40:49.853784+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-messages-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-stream-01.yaml new file mode 100644 index 0000000..721ad8e --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-messages-stream-01.yaml @@ -0,0 +1,108 @@ +filename: 2026-11-16-01a1e428-f577-7740-af0d-aed8441107f3 +request: + body: + max_tokens: 512 + messages: + - content: + - text: Write one short sentence about the ocean. + type: text + role: user + - content: + - citations: null + text: The ocean covers most of Earth's surface and teems with life in depths + we're still exploring. + type: text + role: assistant + - content: + - text: Make that sentence shorter. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '448' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e428-f577-7740-af0d-aed8441107f3 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_nvlbqvyjjonbs27tdd3hjq4zv5t4gfldqwp24637vtwfyfl332mq","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":46,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":7,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"The + ocean covers most of Earth and"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + teems with life."}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":46,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":15}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-16T11:40:51.959308+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-non_stream-00.yaml new file mode 100644 index 0000000..604daea --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-non_stream-00.yaml @@ -0,0 +1,96 @@ +filename: 2026-11-05-01a1aab8-e781-7160-af4d-e3fc69a81518 +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + reasoning: + effort: none + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '228' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-e781-7160-af4d-e3fc69a81518 +response: + body: + background: false + billing: + payer: developer + completed_at: 1793865607 + created_at: 1793865607 + error: null + frequency_penalty: 0.0 + id: resp_oqoih6h2g47bnceyx5wf72ho4o4gg5vxkjz3kl5kqlsm4tw6tqba + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: global.openai.gpt-5.6-luna + moderation: null + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: Rooty McSprout. + type: output_text + id: msg_009f98f3cf515552a462b5ce542f59f0 + phase: final_answer + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: in_memory + reasoning: + context: all_turns + effort: none + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: [] + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 14 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 10 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 24 + user: null + headers: + connection: keep-alive + content-length: '1254' + content-type: application/json + x-request-id: 7b94bef1-e188-4ecd-8938-8dcdf4126d76 + status_code: 200 +timestamp: '2026-11-05T08:00:07.041590+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-non_stream-01.yaml new file mode 100644 index 0000000..9be75d9 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-non_stream-01.yaml @@ -0,0 +1,120 @@ +filename: 2026-11-05-01a1aab8-eb06-71e2-8b54-d9dc91003d4a +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + - content: + - annotations: [] + logprobs: [] + text: Rooty McSprout. + type: output_text + id: msg_009f98f3cf515552a462b5ce542f59f0 + phase: final_answer + role: assistant + status: completed + type: message + - content: + - text: Explain why that name fits. + type: input_text + role: user + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + reasoning: + effort: none + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '532' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-eb06-71e2-8b54-d9dc91003d4a +response: + body: + background: false + billing: + payer: developer + completed_at: 1793865609 + created_at: 1793865608 + error: null + frequency_penalty: 0.0 + id: resp_zic253hopaobsxggujhowjeomvbjgnicbp5fi7qbjceyw56i3rsa + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: global.openai.gpt-5.6-luna + moderation: null + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: '“Rooty McSprout” fits because it combines two gardening ideas: + + + - **“Rooty”** suggests roots, soil, and healthy plant growth. + + - **“McSprout”** evokes new seedlings and gives the robot a friendly, playful + personality. + + + Together, the name sounds cheerful, memorable, and perfectly suited to a + robot that helps plants grow.' + type: output_text + id: msg_d714798895445093b95e6d5f51fa572a + phase: final_answer + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: in_memory + reasoning: + context: all_turns + effort: none + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: [] + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 36 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 77 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 113 + user: null + headers: + connection: keep-alive + content-length: '1577' + content-type: application/json + x-request-id: 77396da7-7b7d-400b-84ab-f59bba2bd231 + status_code: 200 +timestamp: '2026-11-05T08:00:07.942529+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-responses-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-stream-00.yaml new file mode 100644 index 0000000..b23f21b --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-stream-00.yaml @@ -0,0 +1,122 @@ +filename: 2026-11-05-01a1aab8-ded7-7ba0-8afa-477fd82f04be +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + reasoning: + effort: none + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '227' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-ded7-7ba0-8afa-477fd82f04be +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: b6cc9cdd-34ae-428e-9890-0b84c29d0a21 + sse: + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865605,"error":null,"frequency_penalty":0.0,"id":"resp_dvp5zzcciw2kmnbtey5csxisvsjb7n4oowmpu6sv74sz3vfny2pa","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":0,"type":"response.created"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865605,"error":null,"frequency_penalty":0.0,"id":"resp_dvp5zzcciw2kmnbtey5csxisvsjb7n4oowmpu6sv74sz3vfny2pa","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":1,"type":"response.in_progress"} + + ' + - ' + + ' + - 'data: {"item":{"content":[],"id":"msg_a4a4e9a05635556180b2632131a5ca20","phase":"final_answer","role":"assistant","status":"in_progress","type":"message"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_a4a4e9a05635556180b2632131a5ca20","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"","type":"output_text"},"sequence_number":3,"type":"response.content_part.added"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"Spr","item_id":"msg_a4a4e9a05635556180b2632131a5ca20","logprobs":[],"obfuscation":"abcdefg","output_index":0,"sequence_number":4,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"out","item_id":"msg_a4a4e9a05635556180b2632131a5ca20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuv","output_index":0,"sequence_number":5,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"-B","item_id":"msg_a4a4e9a05635556180b2632131a5ca20","logprobs":[],"obfuscation":"abcdefghijklmnopqr","output_index":0,"sequence_number":6,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"ot","item_id":"msg_a4a4e9a05635556180b2632131a5ca20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678","output_index":0,"sequence_number":7,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":".","item_id":"msg_a4a4e9a05635556180b2632131a5ca20","logprobs":[],"obfuscation":"abcdefg","output_index":0,"sequence_number":8,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_a4a4e9a05635556180b2632131a5ca20","logprobs":[],"output_index":0,"sequence_number":9,"text":"Sprout-Bot.","type":"response.output_text.done"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_a4a4e9a05635556180b2632131a5ca20","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"Sprout-Bot.","type":"output_text"},"sequence_number":10,"type":"response.content_part.done"} + + ' + - ' + + ' + - 'data: {"item":{"content":[{"annotations":[],"logprobs":[],"text":"Sprout-Bot.","type":"output_text"}],"id":"msg_a4a4e9a05635556180b2632131a5ca20","phase":"final_answer","role":"assistant","status":"completed","type":"message"},"output_index":0,"sequence_number":11,"type":"response.output_item.done"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":1793865605,"created_at":1793865605,"error":null,"frequency_penalty":0.0,"id":"resp_dvp5zzcciw2kmnbtey5csxisvsjb7n4oowmpu6sv74sz3vfny2pa","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[{"content":[{"annotations":[],"logprobs":[],"text":"Sprout-Bot.","type":"output_text"}],"id":"msg_a4a4e9a05635556180b2632131a5ca20","phase":"final_answer","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"default","status":"completed","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":14,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":9,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":23},"user":null,"moderation":null},"sequence_number":12,"type":"response.completed"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T08:00:04.823373+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/bedrock-responses-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-stream-01.yaml new file mode 100644 index 0000000..dd662da --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/bedrock-responses-stream-01.yaml @@ -0,0 +1,430 @@ +filename: 2026-11-05-01a1aab8-e336-7a83-ab05-dfe7677e1b97 +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + - content: + - annotations: [] + logprobs: [] + text: Sprout-Bot. + type: output_text + id: msg_a4a4e9a05635556180b2632131a5ca20 + phase: final_answer + role: assistant + status: completed + type: message + - content: + - text: Explain why that name fits. + type: input_text + role: user + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + reasoning: + effort: none + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '527' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-e336-7a83-ab05-dfe7677e1b97 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: 622603e3-4d9b-4e79-b055-42131ee44565 + sse: + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865606,"error":null,"frequency_penalty":0.0,"id":"resp_54by57osw7qqxd7ghsrulv7cskfnc2c5vprqkxh7htkbzrjhskva","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":0,"type":"response.created"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865606,"error":null,"frequency_penalty":0.0,"id":"resp_54by57osw7qqxd7ghsrulv7cskfnc2c5vprqkxh7htkbzrjhskva","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":1,"type":"response.in_progress"} + + ' + - ' + + ' + - 'data: {"item":{"content":[],"id":"msg_1f139e7eea3052f6b14c49d26458fc20","phase":"final_answer","role":"assistant","status":"in_progress","type":"message"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"","type":"output_text"},"sequence_number":3,"type":"response.content_part.added"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"“","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01","output_index":0,"sequence_number":4,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"Spr","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcd","output_index":0,"sequence_number":5,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"out","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrs","output_index":0,"sequence_number":6,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"-B","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST","output_index":0,"sequence_number":7,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"ot","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGH","output_index":0,"sequence_number":8,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"”","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghij","output_index":0,"sequence_number":9,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" fits","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL","output_index":0,"sequence_number":10,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" because","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234","output_index":0,"sequence_number":11,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" it","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklm","output_index":0,"sequence_number":12,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" combines","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijk","output_index":0,"sequence_number":13,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" **","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY","output_index":0,"sequence_number":14,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"“","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdef","output_index":0,"sequence_number":15,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"spr","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456","output_index":0,"sequence_number":16,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"out","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS","output_index":0,"sequence_number":17,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":",”","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcde","output_index":0,"sequence_number":18,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"**","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHI","output_index":0,"sequence_number":19,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" symbol","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234","output_index":0,"sequence_number":20,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"izing","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnop","output_index":0,"sequence_number":21,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" plants","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFG","output_index":0,"sequence_number":22,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" and","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrs","output_index":0,"sequence_number":23,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" new","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP","output_index":0,"sequence_number":24,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" growth","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvw","output_index":0,"sequence_number":25,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":",","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX","output_index":0,"sequence_number":26,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" with","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqr","output_index":0,"sequence_number":27,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" **","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST","output_index":0,"sequence_number":28,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"“","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijk","output_index":0,"sequence_number":29,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"bot","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGH","output_index":0,"sequence_number":30,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":",”","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST","output_index":0,"sequence_number":31,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"**","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234","output_index":0,"sequence_number":32,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" a","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01","output_index":0,"sequence_number":33,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" familiar","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdef","output_index":0,"sequence_number":34,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" shorthand","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567","output_index":0,"sequence_number":35,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" for","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyz","output_index":0,"sequence_number":36,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" robot","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvw","output_index":0,"sequence_number":37,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":".","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqr","output_index":0,"sequence_number":38,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" It","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmno","output_index":0,"sequence_number":39,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"’s","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP","output_index":0,"sequence_number":40,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" short","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCD","output_index":0,"sequence_number":41,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":",","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmn","output_index":0,"sequence_number":42,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" friendly","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHI","output_index":0,"sequence_number":43,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":",","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY","output_index":0,"sequence_number":44,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" and","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzA","output_index":0,"sequence_number":45,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" immediately","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmn","output_index":0,"sequence_number":46,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" suggests","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234","output_index":0,"sequence_number":47,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" a","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDE","output_index":0,"sequence_number":48,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" robot","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHI","output_index":0,"sequence_number":49,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" designed","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJK","output_index":0,"sequence_number":50,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" to","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012","output_index":0,"sequence_number":51,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" help","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzAB","output_index":0,"sequence_number":52,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" plants","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopq","output_index":0,"sequence_number":53,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" grow","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghij","output_index":0,"sequence_number":54,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":".","item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN","output_index":0,"sequence_number":55,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","logprobs":[],"output_index":0,"sequence_number":56,"text":"“Sprout-Bot” + fits because it combines **“sprout,”** symbolizing plants and new growth, with + **“bot,”** a familiar shorthand for robot. It’s short, friendly, and immediately + suggests a robot designed to help plants grow.","type":"response.output_text.done"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_1f139e7eea3052f6b14c49d26458fc20","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"“Sprout-Bot” + fits because it combines **“sprout,”** symbolizing plants and new growth, with + **“bot,”** a familiar shorthand for robot. It’s short, friendly, and immediately + suggests a robot designed to help plants grow.","type":"output_text"},"sequence_number":57,"type":"response.content_part.done"} + + ' + - ' + + ' + - 'data: {"item":{"content":[{"annotations":[],"logprobs":[],"text":"“Sprout-Bot” + fits because it combines **“sprout,”** symbolizing plants and new growth, with + **“bot,”** a familiar shorthand for robot. It’s short, friendly, and immediately + suggests a robot designed to help plants grow.","type":"output_text"}],"id":"msg_1f139e7eea3052f6b14c49d26458fc20","phase":"final_answer","role":"assistant","status":"completed","type":"message"},"output_index":0,"sequence_number":58,"type":"response.output_item.done"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":1793865606,"created_at":1793865606,"error":null,"frequency_penalty":0.0,"id":"resp_54by57osw7qqxd7ghsrulv7cskfnc2c5vprqkxh7htkbzrjhskva","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[{"content":[{"annotations":[],"logprobs":[],"text":"“Sprout-Bot” + fits because it combines **“sprout,”** symbolizing plants and new growth, with + **“bot,”** a familiar shorthand for robot. It’s short, friendly, and immediately + suggests a robot designed to help plants grow.","type":"output_text"}],"id":"msg_1f139e7eea3052f6b14c49d26458fc20","phase":"final_answer","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"default","status":"completed","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":35,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":56,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":91},"user":null,"moderation":null},"sequence_number":59,"type":"response.completed"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T08:00:05.942680+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..fe39ff8 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-non_stream-00.yaml @@ -0,0 +1,112 @@ +filename: 2026-11-05-01a1ac2f-b626-7822-abab-43d0a0994999 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning_effort: none + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '241' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-b626-7822-abab-43d0a0994999 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'Here are a few suggestions for a robot gardener, categorized by + the "vibe" you might be going for: + + + **Playful & Punny** + + * **Herbie** (A classic robot name, or a nod to the Love Bug car, but + for plants) + + * **Botany** (Simple, descriptive, and cute) + + * **Claudia** (Plays on "claws" – great for pruning shears) + + * **Sprout** (Small, cute, and implies growth) + + * **Green Bean** (A double entendre for a robot and a vegetable) + + + **Technical & Functional** + + * **Terra** (Latin for Earth/Earth-rover) + + * **Aeris** (Latin for air/flowers) + + * **Verdant** (Meaning green and lush) + + * **Nomad** (If it roams the garden) + + * **Sensus** (Latin for sense/perception – good for a robot that "feels" + the soil) + + + **Descriptive & Strong** + + * **The GardenBot** (The literal name) + + * **Harvest** (Focuses on the end goal) + + * **Mowbot** (If it does the lawn too) + + * **Root** (Solid, grounded, essential) + + * **Gyrus** (Scientific sounding, relates to the brain/control) + + + **Sci-Fi & Elegant** + + * **A.R.I.A.** (Autonomous Robot for Intelligent Agriculture) + + * **Eden** (A hopeful, classic name) + + * **Viridium** (A fancy word for greenery) + + * **Silas** (Sounds gentle and steady) + + + **My top pick:** **"Terra"** – it sounds professional, has a nice ring to + it, and fits the theme of earth and gardening perfectly.' + role: assistant + tools: null + created: 1793890171 + id: chatcmpl-2f8afb23159442b082b0f7e1c6ad9f5b + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 390 + completion_tokens_details: + reasoning_tokens: 0 + output_tokens_details: + reasoning_tokens: 0 + prompt_tokens: 26 + prompt_tokens_details: + cached_tokens: 25 + total_tokens: 416 + headers: + connection: keep-alive + content-length: '1831' + content-type: application/json + x-request-id: chatcmpl-2f8afb23159442b082b0f7e1c6ad9f5b + status_code: 200 +timestamp: '2026-11-05T14:49:30.406159+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..c3e4db3 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-non_stream-01.yaml @@ -0,0 +1,161 @@ +filename: 2026-11-05-01a1ac2f-bb8c-76d2-8e03-ddaee47c0ad1 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - content: 'Here are a few suggestions for a robot gardener, categorized by the + "vibe" you might be going for: + + + **Playful & Punny** + + * **Herbie** (A classic robot name, or a nod to the Love Bug car, but for + plants) + + * **Botany** (Simple, descriptive, and cute) + + * **Claudia** (Plays on "claws" – great for pruning shears) + + * **Sprout** (Small, cute, and implies growth) + + * **Green Bean** (A double entendre for a robot and a vegetable) + + + **Technical & Functional** + + * **Terra** (Latin for Earth/Earth-rover) + + * **Aeris** (Latin for air/flowers) + + * **Verdant** (Meaning green and lush) + + * **Nomad** (If it roams the garden) + + * **Sensus** (Latin for sense/perception – good for a robot that "feels" + the soil) + + + **Descriptive & Strong** + + * **The GardenBot** (The literal name) + + * **Harvest** (Focuses on the end goal) + + * **Mowbot** (If it does the lawn too) + + * **Root** (Solid, grounded, essential) + + * **Gyrus** (Scientific sounding, relates to the brain/control) + + + **Sci-Fi & Elegant** + + * **A.R.I.A.** (Autonomous Robot for Intelligent Agriculture) + + * **Eden** (A hopeful, classic name) + + * **Viridium** (A fancy word for greenery) + + * **Silas** (Sounds gentle and steady) + + + **My top pick:** **"Terra"** – it sounds professional, has a nice ring to + it, and fits the theme of earth and gardening perfectly.' + role: assistant + - content: + - text: Explain why that name fits. + type: text + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning_effort: none + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1703' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-bb8c-76d2-8e03-ddaee47c0ad1 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'The name **"Terra"** fits a robot gardener perfectly for several + reasons, ranging from its linguistic roots to its modern tech appeal: + + + **1. Literal Connection to the Earth** + + The word "Terra" originates from Latin, where it means **"Earth"** or **"Land."** + Since a gardener’s primary job is interacting with the soil and the ground, + the name creates an immediate, poetic link between the machine and the medium + it works with. It suggests a robot that is grounded, literal, and deeply + connected to the land. + + + **2. The "Terra" Prefix in Technology** + + In the world of robotics and sci-fi, "Terra" is often used to denote planetary + or ground-based operations. + + * **Terraforming:** The process of making a planet habitable. + + * **Terran:** Referring to the inhabitants of Earth (popularized by *StarCraft*). + + Using the name implies that this robot is built for the "ground game"—literally + working the soil rather than flying or floating. + + + **3. Softness and Growth** + + Despite being a technological term, "Terra" has a soft, earthy sound (the + "Ter" consonant blend). It avoids the harsh, mechanical sound of names like + "Robo-3000" or "Chassis." It feels organic and natural, which matches the + aesthetic of a garden—something growing, living, and green. + + + **4. Brevity and Brandability** + + "Terra" is short, punchy, and easy to remember. It works well as a simple + identifier (e.g., "Tell Terra to water the tomatoes") and has a professional, + commercial feel that would look great on a product box or a startup logo. + + + **In summary:** It is a name that bridges the gap between **nature** (the + garden) and **technology** (the robot), making it an ideal fit for a machine + designed to cultivate the earth.' + role: assistant + tools: null + created: 1793890172 + id: chatcmpl-68944382971c456cbbcf3a19dec88448 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 391 + completion_tokens_details: + reasoning_tokens: 0 + output_tokens_details: + reasoning_tokens: 0 + prompt_tokens: 434 + prompt_tokens_details: + cached_tokens: 25 + total_tokens: 825 + headers: + connection: keep-alive + content-length: '2221' + content-type: application/json + x-request-id: chatcmpl-68944382971c456cbbcf3a19dec88448 + status_code: 200 +timestamp: '2026-11-05T14:49:31.788953+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-stream-00.yaml new file mode 100644 index 0000000..cfde4b8 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-stream-00.yaml @@ -0,0 +1,2052 @@ +filename: 2026-11-05-01a1ac2f-a6e5-74c2-8251-38c51e96038b +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning_effort: none + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '280' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-a6e5-74c2-8251-38c51e96038b +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-1a8788878fd24f4caaa7f0325e84c1db + sse: + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Here"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + are"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + few"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + suggestions"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + for"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + gard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ener"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + categorized"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + by"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"v"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ibe"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + you"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + might"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + be"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + going"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + for"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":":\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Classic"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + &"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Functional"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Ag"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ri"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"-B"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Simple"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + professional"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + tells"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + you"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + exactly"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + what"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + does"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Terra"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Der"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ived"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + from"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Earth"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":",\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + sounding"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + gentle"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + grounded"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"V"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"erd"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + sophisticated"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + word"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + for"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + l"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ush"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + green"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + vegetation"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Play"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ful"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + &"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Pun"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ny"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Gr"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ass"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"h"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"opper"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + cute"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + nod"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + insects"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + might"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + chase"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + away"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Short"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + sweet"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + implies"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + growth"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"M"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ow"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Bot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + If"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + does"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + lawn"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + m"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"owing"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Root"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + play"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + on"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"rout"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + or"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + just"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + being"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + down"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"-to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"earth"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"High"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"-T"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ech"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + &"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Modern"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Nem"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"otron"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + ("},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"If"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + you"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + want"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + sci"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"-fi"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + feel"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":";"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + named"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + after"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + large"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + language"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + model"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + but"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + fits"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + smart"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + bot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":").\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ynthia"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Sounds"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + like"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"s"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ynthesis"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + or"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"photos"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ynthesis"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\"\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"xi"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"om"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Sounds"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + strong"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + reliable"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Nature"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"-The"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"med"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Fl"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ora"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + The"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Roman"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + goddess"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + flowers"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + or"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + simply"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pl"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ants"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\"\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"yl"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"van"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Rel"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ating"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + forests"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + wood"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"lands"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Pet"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"al"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + –"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Soft"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + delicate"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"My"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + top"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + recommendation"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":":**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + It"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"’s"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + friendly"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + memorable"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + fits"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + gard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ening"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + theme"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + perfectly"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"stop","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-1a8788878fd24f4caaa7f0325e84c1db","object":"chat.completion.chunk","created":1793890167,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":26,"total_tokens":333,"completion_tokens":307,"prompt_tokens_details":{"cached_tokens":25},"completion_tokens_details":{"reasoning_tokens":0},"output_tokens_details":{"reasoning_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:26.501470+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-stream-01.yaml new file mode 100644 index 0000000..0623248 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-chat_completions-stream-01.yaml @@ -0,0 +1,2843 @@ +filename: 2026-11-05-01a1ac2f-ae7c-7db1-8ebb-09224ddb13c5 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - content: 'Here are a few suggestions for a robot gardener, categorized by the + "vibe" you might be going for: + + + **Classic & Functional** + + * **Agri-Bot** – Simple, professional, and tells you exactly what it does. + + * **Terra** – Derived from "Earth," sounding gentle and grounded. + + * **Verdant** – A sophisticated word for lush, green vegetation. + + + **Playful & Punny** + + * **Grasshopper** – A cute nod to the insects it might chase away. + + * **Sprout** – Short, sweet, and implies growth. + + * **MowBot** – If it does the lawn mowing. + + * **Root** – A play on "rout" or just being down-to-earth. + + + **High-Tech & Modern** + + * **Nemotron** – (If you want a sci-fi feel; named after the large language + model, but fits a smart bot). + + * **Synthia** – Sounds like "synthesis" or "photosynthesis." + + * **Axiom** – Sounds strong and reliable. + + + **Nature-Themed** + + * **Flora** – The Roman goddess of flowers, or simply "plants." + + * **Sylvan** – Relating to forests and woodlands. + + * **Petal** – Soft and delicate. + + + **My top recommendation:** + + **Sprout**. It’s friendly, memorable, and fits the gardening theme perfectly.' + role: assistant + - content: + - text: Explain why that name fits. + type: text + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning_effort: none + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1559' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-ae7c-7db1-8ebb-09224ddb13c5 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-55078d3058c64109a1f62e52404d1861 + sse: + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"The"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + name"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + fits"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + gard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ener"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + perfectly"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + for"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + several"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + reasons"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + ranging"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + from"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + literal"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + definitions"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + psychological"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + associations"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":":\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"1"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Direct"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Connection"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Gard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ening"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"In"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + natural"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + world"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"s"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + very"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + first"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + stage"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + growth"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + It"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + represents"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + beginning"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + life"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + breaking"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + soil"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + promise"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + future"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + plant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Nam"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ing"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + gard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ening"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + immediately"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + communicates"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + its"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + purpose"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":":"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + catalyst"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + for"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + growth"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"2"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Symbol"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ism"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + N"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"urt"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"uring"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Gard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ening"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + fundamentally"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + about"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + care"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + nurt"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"uring"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + sp"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"rout"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + fragile"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + needs"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + attention"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + survive"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + G"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"iving"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + this"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + name"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + anthrop"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"omorph"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"izes"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + slightly"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"—"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + suggests"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + machine"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + isn"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"''t"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + just"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + cold"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + piece"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + machinery"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + but"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"guard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ian"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + young"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + plants"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + carefully"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + t"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ending"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + them"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + until"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + they"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + are"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + strong"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + enough"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + stand"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + on"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + their"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + own"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"3"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + The"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Und"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"erd"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"og"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Appeal"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Most"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robots"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + have"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + big"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + imposing"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + names"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + ("},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"like"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Atlas"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + or"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"Term"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"inator"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\")."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + small"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + un"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"assuming"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + soft"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + It"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + implies"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + that"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + this"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + approach"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"able"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + gentle"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + which"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + ideal"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + for"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + machine"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + working"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + around"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + delicate"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + flowers"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + or"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + vegetables"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + where"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + you"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + don"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"''t"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + want"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + heavy"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + machinery"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + crushing"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + soil"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"4"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Growth"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Progress"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"On"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + deeper"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + level"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + represents"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + progress"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + garden"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + doesn"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"''t"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + stay"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + same"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":";"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + evol"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ves"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + named"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + implies"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + system"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + that"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + constantly"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + learning"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + adapting"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + helping"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + garden"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + evolve"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + from"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + bar"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ren"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + patch"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + dirt"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + into"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + thr"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"iving"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + ecosystem"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"5"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Bre"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"vity"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Mem"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"or"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ability"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"From"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + branding"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + standpoint"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + it"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + short"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + easy"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + pron"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ounce"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + memorable"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + It"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + rolls"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + off"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + tongue"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + much"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + easier"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + than"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + technical"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + names"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + like"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + \""},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"A"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"gr"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"icultural"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + Autom"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"aton"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + "},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"3"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"0"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"0"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"0"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".\"\n\n"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"In"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + short"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"S"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"pro"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ut"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + captures"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + *"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ess"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ence"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + of"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + gard"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ening"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"—"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"growth"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + care"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":","},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + new"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + beginnings"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"—"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"while"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + giving"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + robot"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + personality"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + that"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + feels"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + helpful"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + rather"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + than"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + intimid"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ating"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"stop","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-55078d3058c64109a1f62e52404d1861","object":"chat.completion.chunk","created":1793890169,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":352,"total_tokens":764,"completion_tokens":412,"prompt_tokens_details":{"cached_tokens":25},"completion_tokens_details":{"reasoning_tokens":0},"output_tokens_details":{"reasoning_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:28.444627+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-non_stream-00.yaml new file mode 100644 index 0000000..335e7c9 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-non_stream-00.yaml @@ -0,0 +1,82 @@ +filename: 2026-11-04-01a1a478-4321-7d03-9d0a-cde0abf78b4e +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning: + effort: none + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '309' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a478-4321-7d03-9d0a-cde0abf78b4e +response: + body: + background: null + created_at: 1793760707 + error: null + id: resp_0cd27472747544c2b3fc4da53de85a04 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - content: + - annotations: [] + text: blue lantern + type: output_text + id: msg_2983636b54054819927fe8546d5b1264 + role: assistant + status: completed + type: message + parallel_tool_calls: true + previous_response_id: null + reasoning: + effort: none + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: auto + tools: [] + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 28 + input_tokens_details: + cached_tokens: 0 + output_tokens: 3 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 31 + user: null + headers: + connection: keep-alive + content-length: '910' + content-type: application/json + x-request-id: 9f2af716-06a0-4714-857e-7e476d9016ae + status_code: 200 +timestamp: '2026-11-04T02:51:47.361992+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-non_stream-01.yaml new file mode 100644 index 0000000..dd01b2a --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-non_stream-01.yaml @@ -0,0 +1,96 @@ +filename: 2026-11-04-01a1a478-46c0-7dd2-99f7-90e04e730096 +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + - content: + - annotations: [] + text: blue lantern + type: output_text + id: msg_2983636b54054819927fe8546d5b1264 + role: assistant + status: completed + type: message + - content: + - text: Repeat the phrase + type: input_text + - text: ' exactly, preserving its spaces.' + type: input_text + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning: + effort: none + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '627' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a478-46c0-7dd2-99f7-90e04e730096 +response: + body: + background: null + created_at: 1793760708 + error: null + id: resp_62ee9308fa5f4ef5a44ddecf8ef45c20 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - content: + - annotations: [] + text: blue lantern + type: output_text + id: msg_9aa4fd46af65433bbcba01eb85336aa2 + role: assistant + status: completed + type: message + parallel_tool_calls: true + previous_response_id: null + reasoning: + effort: none + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: auto + tools: [] + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 53 + input_tokens_details: + cached_tokens: 27 + output_tokens: 3 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 56 + user: null + headers: + connection: keep-alive + content-length: '911' + content-type: application/json + x-request-id: 1314e4df-c0e7-4fc3-8c31-034c9098c995 + status_code: 200 +timestamp: '2026-11-04T02:51:48.288316+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-responses-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-stream-00.yaml new file mode 100644 index 0000000..8280763 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-stream-00.yaml @@ -0,0 +1,112 @@ +filename: 2026-11-04-01a1a479-2350-7fc0-856e-232fda3aa49a +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning: + effort: none + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '308' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-2350-7fc0-856e-232fda3aa49a +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 1c044698-3a78-4aa3-ae45-ebb60c38aa96 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_7937cb8577cf43999e36cc99acfc712c","object":"response","created_at":1793760765,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_7937cb8577cf43999e36cc99acfc712c","object":"response","created_at":1793760765,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"message","id":"msg_b348b978c6df4705a726fd7db59e7bf2","status":"in_progress","role":"assistant","content":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_b348b978c6df4705a726fd7db59e7bf2","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_b348b978c6df4705a726fd7db59e7bf2","output_index":0,"content_index":0,"delta":"Blue","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_b348b978c6df4705a726fd7db59e7bf2","output_index":0,"content_index":0,"delta":" + lantern","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_b348b978c6df4705a726fd7db59e7bf2","output_index":0,"content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","sequence_number":7,"item_id":"msg_b348b978c6df4705a726fd7db59e7bf2","output_index":0,"content_index":0,"text":"Blue + lantern.","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","sequence_number":8,"item_id":"msg_b348b978c6df4705a726fd7db59e7bf2","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Blue + lantern.","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":9,"output_index":0,"item":{"type":"message","id":"msg_b348b978c6df4705a726fd7db59e7bf2","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Blue + lantern.","annotations":[]}]}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":10,"response":{"id":"resp_7937cb8577cf43999e36cc99acfc712c","object":"response","created_at":1793760765,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"msg_b348b978c6df4705a726fd7db59e7bf2","type":"message","role":"assistant","content":[{"type":"output_text","text":"Blue + lantern.","annotations":[]}],"status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":28,"output_tokens":4,"total_tokens":32,"input_tokens_details":{"cached_tokens":27},"output_tokens_details":{"reasoning_tokens":0}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:52:44.752590+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/fireworks-responses-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-stream-01.yaml new file mode 100644 index 0000000..ba9b3d0 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/fireworks-responses-stream-01.yaml @@ -0,0 +1,120 @@ +filename: 2026-11-04-01a1a479-2ac3-71d1-8f35-fe4669784e94 +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + - content: + - annotations: [] + text: Blue lantern. + type: output_text + id: msg_b348b978c6df4705a726fd7db59e7bf2 + role: assistant + status: completed + type: message + - content: + - text: Repeat the phrase + type: input_text + - text: ' exactly, preserving its spaces.' + type: input_text + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + reasoning: + effort: none + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '627' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-2ac3-71d1-8f35-fe4669784e94 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: c3bf94e2-c109-41ff-ae91-84ec90bc82c3 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_a7a5da5939d443bb8ccd933ffb2b6439","object":"response","created_at":1793760766,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_a7a5da5939d443bb8ccd933ffb2b6439","object":"response","created_at":1793760766,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"message","id":"msg_58e4d781c3324891bf487bde28670134","status":"in_progress","role":"assistant","content":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_58e4d781c3324891bf487bde28670134","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_58e4d781c3324891bf487bde28670134","output_index":0,"content_index":0,"delta":"blue","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_58e4d781c3324891bf487bde28670134","output_index":0,"content_index":0,"delta":" + lantern","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","sequence_number":6,"item_id":"msg_58e4d781c3324891bf487bde28670134","output_index":0,"content_index":0,"text":"blue + lantern","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","sequence_number":7,"item_id":"msg_58e4d781c3324891bf487bde28670134","output_index":0,"content_index":0,"part":{"type":"output_text","text":"blue + lantern","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":8,"output_index":0,"item":{"type":"message","id":"msg_58e4d781c3324891bf487bde28670134","status":"completed","role":"assistant","content":[{"type":"output_text","text":"blue + lantern","annotations":[]}]}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":9,"response":{"id":"resp_a7a5da5939d443bb8ccd933ffb2b6439","object":"response","created_at":1793760767,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"msg_58e4d781c3324891bf487bde28670134","type":"message","role":"assistant","content":[{"type":"output_text","text":"blue + lantern","annotations":[]}],"status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":54,"output_tokens":3,"total_tokens":57,"input_tokens_details":{"cached_tokens":27},"output_tokens_details":{"reasoning_tokens":0}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:52:46.659874+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..f554c31 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-non_stream-00.yaml @@ -0,0 +1,131 @@ +filename: 2026-11-06-01a1af0d-271b-7d42-abfc-dfdc607c2e35 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: gemini-3.1-flash-lite + reasoning_effort: minimal + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '209' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-271b-7d42-abfc-dfdc607c2e35 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'To choose the best name for a robot gardener, it helps to consider + the "vibe" of your robot. Here are several suggestions categorized by style: + + + ### Botanical & Nature-Inspired + + These names emphasize the robot’s connection to plants and growth. + + * **Floros:** A classic, tech-sounding name derived from "flora." + + * **Sprout:** Cute, simple, and perfect for a small helper. + + * **Chloris:** Named after the Greek nymph of flowers. + + * **Bud:** Friendly and short; implies growth. + + * **Terra:** Latin for earth/soil. + + * **Thistle:** A fun, slightly edgy name for a robot that handles weeds. + + * **Arbor:** Sounds sturdy and structural, like a tree. + + + ### Functional & Descriptive + + These names highlight the robot’s job and capabilities. + + * **GrowBot:** Straight to the point. + + * **Prunella:** A clever play on "pruning." + + * **Cultivator (or "Cully"):** Sounds professional and efficient. + + * **The Trowel:** A nod to the most essential gardening tool. + + * **Rooter:** Simple, punchy, and functional. + + * **WeedWiz:** If the robot is specifically good at weeding. + + + ### Playful & Whimsical + + If you want your robot to have personality. + + * **Wall-E (or "Wally"):** The gold standard for nature-loving bots. + + * **Petal Pusher:** A fun pun on "paper pusher." + + * **Green Thumb:** A classic, slightly ironic name for a machine. + + * **Twiggy:** Light, nimble, and plant-related. + + * **Bloom:** Short, sweet, and descriptive. + + * **Botany:** A clever pun on the field of study. + + + ### Sophisticated & Mythological + + These names sound a bit more "high-end" or elegant. + + * **Gaia:** The personification of the Earth itself. + + * **Demeter:** The Greek goddess of agriculture. + + * **Silvanus:** The Roman god of woods and fields. + + * **Verdant:** An adjective meaning green with grass or other rich vegetation. + + * **Eden:** Suggests the robot is creating a paradise. + + + ### My Personal Favorites: + + 1. **Sprout** (if it’s small and cute) + + 2. **Prunella** (if it’s precise and helpful) + + 3. **Terra** (if it’s a heavy-duty landscaping robot) + + 4. **Bud** (if it’s a friendly companion) + + + **Which one feels like the best fit for your robot''s personality?**' + extra_content: + google: + thought_signature: EnMKcQFpFH0TI4+252Fl0FAaX86pMAl+gciDec4Iol+aGKWnLaddBpKAZrHLCjY8NJHipy292S0D4IKlF5nncWMqOtiRlQvB61PWXVJbg0W/YuRzl/gnAFAlty+notTEppM9cGoWqdI1l5OFXQgpPEctBLPc + role: assistant + created: 1793938239 + id: PVPtaqTiGfyyytMPvoLJiQQ + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 592 + prompt_tokens: 9 + total_tokens: 601 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-06T04:10:37.211418+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..6f03f9f --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-non_stream-01.yaml @@ -0,0 +1,200 @@ +filename: 2026-11-06-01a1af0d-3158-7200-a9d1-36a9ac59013c +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - content: 'To choose the best name for a robot gardener, it helps to consider + the "vibe" of your robot. Here are several suggestions categorized by style: + + + ### Botanical & Nature-Inspired + + These names emphasize the robot’s connection to plants and growth. + + * **Floros:** A classic, tech-sounding name derived from "flora." + + * **Sprout:** Cute, simple, and perfect for a small helper. + + * **Chloris:** Named after the Greek nymph of flowers. + + * **Bud:** Friendly and short; implies growth. + + * **Terra:** Latin for earth/soil. + + * **Thistle:** A fun, slightly edgy name for a robot that handles weeds. + + * **Arbor:** Sounds sturdy and structural, like a tree. + + + ### Functional & Descriptive + + These names highlight the robot’s job and capabilities. + + * **GrowBot:** Straight to the point. + + * **Prunella:** A clever play on "pruning." + + * **Cultivator (or "Cully"):** Sounds professional and efficient. + + * **The Trowel:** A nod to the most essential gardening tool. + + * **Rooter:** Simple, punchy, and functional. + + * **WeedWiz:** If the robot is specifically good at weeding. + + + ### Playful & Whimsical + + If you want your robot to have personality. + + * **Wall-E (or "Wally"):** The gold standard for nature-loving bots. + + * **Petal Pusher:** A fun pun on "paper pusher." + + * **Green Thumb:** A classic, slightly ironic name for a machine. + + * **Twiggy:** Light, nimble, and plant-related. + + * **Bloom:** Short, sweet, and descriptive. + + * **Botany:** A clever pun on the field of study. + + + ### Sophisticated & Mythological + + These names sound a bit more "high-end" or elegant. + + * **Gaia:** The personification of the Earth itself. + + * **Demeter:** The Greek goddess of agriculture. + + * **Silvanus:** The Roman god of woods and fields. + + * **Verdant:** An adjective meaning green with grass or other rich vegetation. + + * **Eden:** Suggests the robot is creating a paradise. + + + ### My Personal Favorites: + + 1. **Sprout** (if it’s small and cute) + + 2. **Prunella** (if it’s precise and helpful) + + 3. **Terra** (if it’s a heavy-duty landscaping robot) + + 4. **Bud** (if it’s a friendly companion) + + + **Which one feels like the best fit for your robot''s personality?**' + extra_content: + google: + thought_signature: EnMKcQFpFH0TI4+252Fl0FAaX86pMAl+gciDec4Iol+aGKWnLaddBpKAZrHLCjY8NJHipy292S0D4IKlF5nncWMqOtiRlQvB61PWXVJbg0W/YuRzl/gnAFAlty+notTEppM9cGoWqdI1l5OFXQgpPEctBLPc + role: assistant + - content: + - text: Explain why that name fits. + type: text + role: user + model: gemini-3.1-flash-lite + reasoning_effort: minimal + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2738' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-3158-7200-a9d1-36a9ac59013c +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'To give you the best explanation, I have selected the four that + hold the most "character" and explained the logic behind why they work so + well as a robot gardener''s identity: + + + ### 1. Sprout (The "Cute & Capable" Choice) + + * **Why it fits:** The name "Sprout" implies the beginning of growth. + For a robot, it creates an endearing irony: a machine built from cold metal + and code is named after the most delicate, fragile stage of a plant’s life. + It makes the robot seem like a "nurturer" rather than just a machine, which + creates an emotional connection for the human owner. It suggests that while + the robot is technical, its purpose is to protect life. + + + ### 2. Prunella (The "Precision & Professional" Choice) + + * **Why it fits:** This is a play on the word "pruning," but it sounds + like a sophisticated, Victorian-era name. It gives the robot a "human" identity + while immediately signaling its specific skill set. It sounds like an efficient, + highly capable robot that takes its job very seriously. It’s perfect for + a sleek, precise machine that meticulously maintains hedges and roses. + + + ### 3. Terra (The "Foundation & Power" Choice) + + * **Why it fits:** In Latin, *Terra* means Earth. It sounds grounded, + solid, and vast. If your robot is a larger model—perhaps one that handles + heavy-duty landscaping, rototilling, or large-scale irrigation—"Terra" makes + it sound like a force of nature. It elevates the robot from a mere "tool" + to a steward of the environment, implying that the machine is an extension + of the garden itself. + + + ### 4. Bud (The "Friendly Companion" Choice) + + * **Why it fits:** "Bud" serves a double meaning: it refers to both a + plant bud and the slang for "friend" (buddy). It is short, punchy, and incredibly + accessible. It’s the perfect name for a robot that interacts with people, + perhaps one that follows a gardener around or works in a community garden. + It suggests a low-maintenance, reliable, and friendly partner that is always + there to help out. + + + *** + + + **How to decide?** + + * **If the robot looks small/cute:** Go with **Sprout**. + + * **If the robot looks precise/technical:** Go with **Prunella**. + + * **If the robot is large/heavy-duty:** Go with **Terra**. + + * **If the robot is meant to be a helpful companion:** Go with **Bud**. + + + **Which one feels most like your robot?** If you tell me a little about + what the robot *looks* like (e.g., is it a small spider-like drone, a bulky + tracked vehicle, or a humanoid figure?), I can help you narrow it down further!' + extra_content: + google: + thought_signature: EnMKcQFpFH0TiYhg91jnxObJefxsMyAumTGblU6l0dyji2duPSmvRyNj9p6o/b9lv4DRfUIRIXffUSgg8rcn3Uz8WwupQURGqQ3Cjz7LpRqau/BXBNAgAMzkfSaHwdqv4wGB+5xj/4uyPPkSMV1DAGgfq0bY + role: assistant + created: 1793938242 + id: QFPtauZmzqrK0w-6oLj4DQ + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 608 + prompt_tokens: 609 + total_tokens: 1217 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-06T04:10:39.832330+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-stream-00.yaml new file mode 100644 index 0000000..9960ea4 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-stream-00.yaml @@ -0,0 +1,202 @@ +filename: 2026-11-06-01a1af0d-1449-7083-9df6-5b57d3d63851 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: gemini-3.1-flash-lite + reasoning_effort: minimal + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '248' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-1449-7083-9df6-5b57d3d63851 +response: + error_event: false + headers: + cache-control: private + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"To choose the best name for a robot gardener, + it helps to decide","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":14,"prompt_tokens":9,"total_tokens":23}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" on the \"personality\" you want it to + have. Here are a few suggestions broken down by category:\n\n### Friendly & Helpful","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":40,"prompt_tokens":9,"total_tokens":49}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"\n* **Sprout:** Simple, classic, and + suggests new growth.\n* **Buddy:** Sounds like a reliable, approachable","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":68,"prompt_tokens":9,"total_tokens":77}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" companion.\n* **Petal:** Gentle and + nature-focused.\n* **Gardner:** A play","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":92,"prompt_tokens":9,"total_tokens":101}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" on \"gardener\" that feels like a robot + name.\n* **Moss:** Perfect if the robot is small","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":116,"prompt_tokens":9,"total_tokens":125}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":", green, or rugged.\n\n### Tech-Focused + & Clever\n* **Bot-anist:** The gold standard","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":141,"prompt_tokens":9,"total_tokens":150}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" for a robot gardener pun.\n* **Terra:** + Latin for Earth; sounds futuristic but grounded.\n* **Root","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":167,"prompt_tokens":9,"total_tokens":176}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"-R:** A play on \"Router,\" but for a + plant-based robot.\n* **S.O.I.L","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":195,"prompt_tokens":9,"total_tokens":204}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":". (System for Organic Integrated Life):** + An acronym name sounds very \"robot-like.\"\n* **Cult","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":219,"prompt_tokens":9,"total_tokens":228}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"ivator-9:** Sounds professional and industrial.\n\n### + Whimsical & Fun\n* **Thistle:** A bit","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":245,"prompt_tokens":9,"total_tokens":254}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" prickly, but charming.\n* **Flowerpot:** + Cute, especially if the robot has a storage compartment.\n* **","role":"assistant"},"index":0}],"created":1793938233,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":272,"prompt_tokens":9,"total_tokens":281}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Digby:** Sounds like a helpful little + guy who loves to dig in the dirt.\n* **Clippy:** A nod","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":298,"prompt_tokens":9,"total_tokens":307}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" to the old Microsoft assistant (but hopefully + much more useful).\n* **Dewey:** A play on \"morning","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":322,"prompt_tokens":9,"total_tokens":331}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" dew\" and a friendly name.\n\n### Sophisticated + & Elegant\n* **Flora:** Timeless and perfectly suited","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":346,"prompt_tokens":9,"total_tokens":355}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" for a green space.\n* **Silvan:** Derived + from the Latin word for \"woods\" or \"forest.\"","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":371,"prompt_tokens":9,"total_tokens":380}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"\n* **Arbor:** Sounds sturdy, structural, + and sophisticated.\n* **Verde:** Spanish/","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":395,"prompt_tokens":9,"total_tokens":404}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Italian for green; sounds sleek.\n* **Gaia:** + Named after the personification of the Earth.\n\n###","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":419,"prompt_tokens":9,"total_tokens":428}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" If you want to get creative:\n* **Combine + your favorite plant with a robot term:** (e.g., **","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":445,"prompt_tokens":9,"total_tokens":454}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"Fern-droid**, **Rose-o-matic**, **Cactus-bot**)\n* **Use + an acronym","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":469,"prompt_tokens":9,"total_tokens":478}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":":** (e.g., **G.R.E.E.N.** – Garden Robotic + Ecosystem Engineer Node)\n\n**My","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":496,"prompt_tokens":9,"total_tokens":505}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" top recommendation:** If you want something + charming, go with **Sprout**. If you want something clever, go with **Bot-an","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":523,"prompt_tokens":9,"total_tokens":532}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"ist**.","role":"assistant"},"index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":525,"prompt_tokens":9,"total_tokens":534}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EnMKcQFpFH0TNsLpBCRAwxC25RsdOMMSlbUxFGz669CzKl/7EoUKw7QVBn0kL1l9ny7ACRc0jkYIL3GqdjpedlVyKmpV8wuT67dBKnBb9AvnIt930RaGiRkDCcE0a2P+IvmMx2AEdBWynXAla7Kps1dTIiEV"}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1793938234,"id":"OFPtap_mKpuB1sgPmYaBqQI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":525,"prompt_tokens":9,"total_tokens":534}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-06T04:10:32.393603+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-stream-01.yaml new file mode 100644 index 0000000..ff98a76 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/gemini-chat_completions-stream-01.yaml @@ -0,0 +1,266 @@ +filename: 2026-11-06-01a1af0d-1e34-7a61-8b70-a9bfcaeb950c +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - content: 'To choose the best name for a robot gardener, it helps to decide on + the "personality" you want it to have. Here are a few suggestions broken down + by category: + + + ### Friendly & Helpful + + * **Sprout:** Simple, classic, and suggests new growth. + + * **Buddy:** Sounds like a reliable, approachable companion. + + * **Petal:** Gentle and nature-focused. + + * **Gardner:** A play on "gardener" that feels like a robot name. + + * **Moss:** Perfect if the robot is small, green, or rugged. + + + ### Tech-Focused & Clever + + * **Bot-anist:** The gold standard for a robot gardener pun. + + * **Terra:** Latin for Earth; sounds futuristic but grounded. + + * **Root-R:** A play on "Router," but for a plant-based robot. + + * **S.O.I.L. (System for Organic Integrated Life):** An acronym name sounds + very "robot-like." + + * **Cultivator-9:** Sounds professional and industrial. + + + ### Whimsical & Fun + + * **Thistle:** A bit prickly, but charming. + + * **Flowerpot:** Cute, especially if the robot has a storage compartment. + + * **Digby:** Sounds like a helpful little guy who loves to dig in the dirt. + + * **Clippy:** A nod to the old Microsoft assistant (but hopefully much more + useful). + + * **Dewey:** A play on "morning dew" and a friendly name. + + + ### Sophisticated & Elegant + + * **Flora:** Timeless and perfectly suited for a green space. + + * **Silvan:** Derived from the Latin word for "woods" or "forest." + + * **Arbor:** Sounds sturdy, structural, and sophisticated. + + * **Verde:** Spanish/Italian for green; sounds sleek. + + * **Gaia:** Named after the personification of the Earth. + + + ### If you want to get creative: + + * **Combine your favorite plant with a robot term:** (e.g., **Fern-droid**, + **Rose-o-matic**, **Cactus-bot**) + + * **Use an acronym:** (e.g., **G.R.E.E.N.** – Garden Robotic Ecosystem Engineer + Node) + + + **My top recommendation:** If you want something charming, go with **Sprout**. + If you want something clever, go with **Bot-anist**.' + extra_content: + google: + thought_signature: EnMKcQFpFH0TNsLpBCRAwxC25RsdOMMSlbUxFGz669CzKl/7EoUKw7QVBn0kL1l9ny7ACRc0jkYIL3GqdjpedlVyKmpV8wuT67dBKnBb9AvnIt930RaGiRkDCcE0a2P+IvmMx2AEdBWynXAla7Kps1dTIiEV + role: assistant + - content: + - text: Explain why that name fits. + type: text + role: user + model: gemini-3.1-flash-lite + reasoning_effort: minimal + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2545' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-1e34-7a61-8b70-a9bfcaeb950c +response: + error_event: false + headers: + cache-control: private + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"Since","role":"assistant"},"index":0}],"created":1793938235,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":1,"prompt_tokens":542,"total_tokens":543}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" I recommended **Sprout** and **Bot-anist** + as the top choices, here","role":"assistant"},"index":0}],"created":1793938235,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":20,"prompt_tokens":542,"total_tokens":562}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" is why each name perfectly captures the + \"vibe\" of a robot gardener:\n\n### Why \"Sprout\" works:\n","role":"assistant"},"index":0}],"created":1793938235,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":46,"prompt_tokens":542,"total_tokens":588}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"* **The Emotional Connection:** \"Sprout\" + implies potential. Because a robot is a machine, people often view them","role":"assistant"},"index":0}],"created":1793938235,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":71,"prompt_tokens":542,"total_tokens":613}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" as cold or technical; naming it Sprout + humanizes it. It frames the robot’s job not just as \"maintenance","role":"assistant"},"index":0}],"created":1793938235,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":96,"prompt_tokens":542,"total_tokens":638}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":",\" but as \"nurturing.\"\n* **Simplicity:** + It is short, easy to say, and easy for a voice","role":"assistant"},"index":0}],"created":1793938235,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":124,"prompt_tokens":542,"total_tokens":666}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"-activated system to recognize. It feels + like the name of a loyal sidekick in a Pixar movie.\n* **Visual Contrast","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":151,"prompt_tokens":542,"total_tokens":693}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":":** There is a delightful irony in a machine + (made of metal, circuits, and wires) having a name that represents","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":175,"prompt_tokens":542,"total_tokens":717}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" the most delicate, organic stage of plant + life. It suggests that the robot understands the fragility of the things it is + growing","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":199,"prompt_tokens":542,"total_tokens":741}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":".\n\n### Why \"Bot-anist\" works:\n* **The + \"Double Meaning\" Payoff:** It is a","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":226,"prompt_tokens":542,"total_tokens":768}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" clever, high-IQ pun. It explicitly states + exactly what the machine is (a *bot*) and exactly what it","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":250,"prompt_tokens":542,"total_tokens":792}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" does (it is an *anist* / botanist). \n* **Professional + Authority:** While \"Sprout\" sounds","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":277,"prompt_tokens":542,"total_tokens":819}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" like a pet, \"Bot-anist\" sounds like + an expert. If your robot is sophisticated—meaning it has sensors for soil","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":304,"prompt_tokens":542,"total_tokens":846}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" acidity, light levels, and hydration—this + name gives it a sense of scientific purpose.\n* **Memorable Branding","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":329,"prompt_tokens":542,"total_tokens":871}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":":** If you were to paint this name on + the side of the robot, it would immediately tell anyone who sees it exactly","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":353,"prompt_tokens":542,"total_tokens":895}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" what it’s for. It’s witty, punchy, and + feels like something a scientist or a high-tech gardener would genuinely","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":381,"prompt_tokens":542,"total_tokens":923}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" name their invention.\n\n***\n\n**How + to decide between the two:**\n\n* Choose **Sprout** if your","role":"assistant"},"index":0}],"created":1793938236,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":406,"prompt_tokens":542,"total_tokens":948}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" robot is small, cute, rounded in shape, + or meant to be a friendly helper for a home garden.\n* Choose","role":"assistant"},"index":0}],"created":1793938237,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":432,"prompt_tokens":542,"total_tokens":974}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" **Bot-anist** if your robot is more functional, + tech-forward, analytical, or has a professional \"","role":"assistant"},"index":0}],"created":1793938237,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":456,"prompt_tokens":542,"total_tokens":998}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"research-lab\" aesthetic.","role":"assistant"},"index":0}],"created":1793938237,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":462,"prompt_tokens":542,"total_tokens":1004}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EnMKcQFpFH0T1cwJYPvzREudpqMGFsZQZOKibfwFCPKDH1HInC20Xk3/5IyO2WHJQjg0QPhcByGUKwqNKjKjyknSPojBSDyyYZ83sYKsnTHXjbnT3MSpqJUKX6bMfjY2EHhjGTPq994ZBFbL2oL/gU2dTMI5"}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1793938237,"id":"O1Ptar_6Cs6tytMP1PeV6Q4","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":462,"prompt_tokens":542,"total_tokens":1004}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-06T04:10:34.932037+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/openrouter-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-non_stream-00.yaml new file mode 100644 index 0000000..58a90f0 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-non_stream-00.yaml @@ -0,0 +1,100 @@ +filename: 2026-11-04-01a1a488-970a-7372-9853-00b5185d8f8e +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + max_output_tokens: 1024 + model: nvidia/nemotron-3.5-lightning:free + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: none + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '376' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a488-970a-7372-9853-00b5185d8f8e +response: + body: + access_programs: null + background: false + completed_at: 1793761777 + created_at: 1793761777 + error: null + frequency_penalty: 0 + id: gen-1793761777-n7Dtm311SaMJBZL9FiGB + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: nvidia/nemotron-3.5-lightning:free + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: Blue lantern. + type: output_text + id: msg_tmp_hgffyg7nbyn + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_options: null + reasoning: + effort: none + safety_identifier: null + service_tier: auto + status: completed + store: false + temperature: 1 + text: + format: + type: text + tool_choice: auto + tools: [] + top_logprobs: 0 + top_p: 1 + truncation: disabled + usage: + cost: 0 + cost_details: + upstream_inference_cost: 0 + upstream_inference_input_cost: 0 + upstream_inference_output_cost: 0 + input_tokens: 28 + input_tokens_details: + cached_tokens: 0 + is_byok: false + output_tokens: 4 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 32 + headers: + connection: keep-alive + content-type: application/json + status_code: 200 +timestamp: '2026-11-04T03:09:37.418820+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/openrouter-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-non_stream-01.yaml new file mode 100644 index 0000000..cbe80c5 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-non_stream-01.yaml @@ -0,0 +1,115 @@ +filename: 2026-11-04-01a1a488-998f-78c3-b53d-ce3a18152d42 +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + - content: + - annotations: [] + logprobs: [] + text: Blue lantern. + type: output_text + id: msg_tmp_hgffyg7nbyn + role: assistant + status: completed + type: message + - content: + - text: Repeat the phrase + type: input_text + - text: ' exactly, preserving its spaces.' + type: input_text + role: user + max_output_tokens: 1024 + model: nvidia/nemotron-3.5-lightning:free + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: none + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '692' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a488-998f-78c3-b53d-ce3a18152d42 +response: + body: + access_programs: null + background: false + completed_at: 1793761778 + created_at: 1793761778 + error: null + frequency_penalty: 0 + id: gen-1793761778-uyHAwoDvSLdfs2Ymk5pj + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: nvidia/nemotron-3.5-lightning:free + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: blue lantern + type: output_text + id: msg_tmp_rb0pum20tf + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_options: null + reasoning: + effort: none + safety_identifier: null + service_tier: auto + status: completed + store: false + temperature: 1 + text: + format: + type: text + tool_choice: auto + tools: [] + top_logprobs: 0 + top_p: 1 + truncation: disabled + usage: + cost: 0 + cost_details: + upstream_inference_cost: 0 + upstream_inference_input_cost: 0 + upstream_inference_output_cost: 0 + input_tokens: 54 + input_tokens_details: + cached_tokens: 0 + is_byok: false + output_tokens: 4 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 58 + headers: + connection: keep-alive + content-type: application/json + status_code: 200 +timestamp: '2026-11-04T03:09:38.063778+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/openrouter-responses-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-stream-00.yaml new file mode 100644 index 0000000..a8f5d72 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-stream-00.yaml @@ -0,0 +1,117 @@ +filename: 2026-11-04-01a1a489-9291-7ca3-9323-e38dd7bc0647 +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + max_output_tokens: 1024 + model: nvidia/nemotron-3.5-lightning:free + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: none + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '375' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a489-9291-7ca3-9323-e38dd7bc0647 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + sse: + - 'data: {"type":"response.created","response":{"id":"gen-1793761841-VpKMVsEG87mVkDeD21SR","object":"response","created_at":1793761841,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[],"tool_choice":"auto","parallel_tool_calls":true,"max_output_tokens":1024,"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":"none"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":0} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","response":{"id":"gen-1793761841-VpKMVsEG87mVkDeD21SR","object":"response","created_at":1793761841,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[],"tool_choice":"auto","parallel_tool_calls":true,"max_output_tokens":1024,"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":"none"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":1} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_tmp_9je8kf4lbol","type":"message","status":"in_progress","role":"assistant","content":[]},"sequence_number":2} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","output_index":0,"item_id":"msg_tmp_9je8kf4lbol","content_index":0,"part":{"type":"output_text","text":"","annotations":[],"logprobs":[]},"sequence_number":3} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":0,"item_id":"msg_tmp_9je8kf4lbol","content_index":0,"delta":"blue","logprobs":[],"sequence_number":4} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":0,"item_id":"msg_tmp_9je8kf4lbol","content_index":0,"delta":" + lantern","logprobs":[],"sequence_number":5} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","output_index":0,"item_id":"msg_tmp_9je8kf4lbol","content_index":0,"text":"blue + lantern","logprobs":[],"sequence_number":6} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","output_index":0,"item_id":"msg_tmp_9je8kf4lbol","content_index":0,"part":{"type":"output_text","text":"blue + lantern","annotations":[],"logprobs":[]},"sequence_number":7} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_tmp_9je8kf4lbol","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"blue + lantern","annotations":[],"logprobs":[]}]},"sequence_number":8} + + ' + - ' + + ' + - 'data: {"type":"response.completed","response":{"id":"gen-1793761841-VpKMVsEG87mVkDeD21SR","object":"response","created_at":1793761841,"model":"nvidia/nemotron-3.5-lightning:free","status":"completed","completed_at":1793761842,"output":[{"id":"msg_tmp_9je8kf4lbol","type":"message","role":"assistant","status":"completed","content":[{"type":"output_text","text":"blue + lantern","annotations":[],"logprobs":[]}]}],"error":null,"incomplete_details":null,"access_programs":null,"tools":[],"tool_choice":"auto","parallel_tool_calls":true,"max_output_tokens":1024,"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":"none"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":{"input_tokens":28,"input_tokens_details":{"cached_tokens":0},"output_tokens":3,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":31,"cost":0,"is_byok":false,"cost_details":{"upstream_inference_cost":0,"upstream_inference_input_cost":0,"upstream_inference_output_cost":0}}},"sequence_number":9} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-04T03:10:41.809748+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/openrouter-responses-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-stream-01.yaml new file mode 100644 index 0000000..c6280af --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/openrouter-responses-stream-01.yaml @@ -0,0 +1,132 @@ +filename: 2026-11-04-01a1a489-985f-7d50-953f-708adb71b035 +request: + body: + input: + - content: + - text: 'Remember the exact phrase: blue lantern.' + type: input_text + - text: Reply briefly. + type: input_text + role: user + - content: + - annotations: [] + logprobs: [] + text: blue lantern + type: output_text + id: msg_tmp_9je8kf4lbol + role: assistant + status: completed + type: message + - content: + - text: Repeat the phrase + type: input_text + - text: ' exactly, preserving its spaces.' + type: input_text + role: user + max_output_tokens: 1024 + model: nvidia/nemotron-3.5-lightning:free + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: none + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '690' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a489-985f-7d50-953f-708adb71b035 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + sse: + - 'data: {"type":"response.created","response":{"id":"gen-1793761843-nn9lX6sVIH8WGNHkcT6U","object":"response","created_at":1793761843,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[],"tool_choice":"auto","parallel_tool_calls":true,"max_output_tokens":1024,"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":"none"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":0} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","response":{"id":"gen-1793761843-nn9lX6sVIH8WGNHkcT6U","object":"response","created_at":1793761843,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[],"tool_choice":"auto","parallel_tool_calls":true,"max_output_tokens":1024,"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":"none"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":1} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_tmp_9tlzcmt0drn","type":"message","status":"in_progress","role":"assistant","content":[]},"sequence_number":2} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","output_index":0,"item_id":"msg_tmp_9tlzcmt0drn","content_index":0,"part":{"type":"output_text","text":"","annotations":[],"logprobs":[]},"sequence_number":3} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":0,"item_id":"msg_tmp_9tlzcmt0drn","content_index":0,"delta":"blue","logprobs":[],"sequence_number":4} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":0,"item_id":"msg_tmp_9tlzcmt0drn","content_index":0,"delta":" + lantern","logprobs":[],"sequence_number":5} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","output_index":0,"item_id":"msg_tmp_9tlzcmt0drn","content_index":0,"text":"blue + lantern","logprobs":[],"sequence_number":6} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","output_index":0,"item_id":"msg_tmp_9tlzcmt0drn","content_index":0,"part":{"type":"output_text","text":"blue + lantern","annotations":[],"logprobs":[]},"sequence_number":7} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_tmp_9tlzcmt0drn","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"blue + lantern","annotations":[],"logprobs":[]}]},"sequence_number":8} + + ' + - ' + + ' + - 'data: {"type":"response.completed","response":{"id":"gen-1793761843-nn9lX6sVIH8WGNHkcT6U","object":"response","created_at":1793761843,"model":"nvidia/nemotron-3.5-lightning:free","status":"completed","completed_at":1793761843,"output":[{"id":"msg_tmp_9tlzcmt0drn","type":"message","role":"assistant","status":"completed","content":[{"type":"output_text","text":"blue + lantern","annotations":[],"logprobs":[]}]}],"error":null,"incomplete_details":null,"access_programs":null,"tools":[],"tool_choice":"auto","parallel_tool_calls":true,"max_output_tokens":1024,"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":"none"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":{"input_tokens":53,"input_tokens_details":{"cached_tokens":0},"output_tokens":3,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":56,"cost":0,"is_byok":false,"cost_details":{"upstream_inference_cost":0,"upstream_inference_input_cost":0,"upstream_inference_output_cost":0}}},"sequence_number":9} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-04T03:10:43.295304+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..9e5f118 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-non_stream-00.yaml @@ -0,0 +1,124 @@ +filename: 2026-11-05-01a1ac2e-eed8-71e3-ac1d-6c85448d51d2 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: Qwen/Qwen3.5-9B + reasoning: + enabled: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '204' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2e-eed8-71e3-ac1d-6c85448d51d2 +response: + body: + choices: + - finish_reason: stop + index: 0 + matched_stop: 248046 + message: + content: 'Here are a few name suggestions for a robot gardener, categorized + by the "vibe" they project: + + + ### Nature-Inspired & Whimsical + + *These names blend gardening terminology with soft, organic sounds.* + + * **Chloris** (Greek goddess of flowers) + + * **Verdant** + + * **Bloom** + + * **Petra** (Latin for rock/stones, but sounds like "spore") + + * **Seedling** + + * **Fern & Rust** + + * **Petunia Bot** + + + ### Tech-Savvy & Functional + + *These sound like practical tools designed for efficiency and precision.* + + * **AgriBot 3000** + + * **ProGroom** + + * **GreenLogic** + + * **SoilSync** + + * **Hortus AI** + + * **RootSeeker** + + * **CropGuard** + + + ### Friendly & Personable + + *Names that make the machine seem like a helpful neighbor or a pet.* + + * **Genny** + + * **Bud** + + * **Pluck** + + * **Otto the Oaktress** + + * **Sprouty** + + * **Thumb** (as in "my little oatmeal thumb") + + * **Willow** + + + ### My Top Recommendation + + **"Simeris"** + + It sounds elegant and futuristic (like a code name), but it closely mimics + the sound of "simmering" soil or the gentle sound of rain falling on leaves. + It implies a machine that understands the delicate balance of a garden. + + + **Which style fits your robot best?** Do you want it to feel more like a + high-tech engineering marvel or a charming garden companion?' + reasoning_content: null + role: assistant + created: 1793890119 + id: 39aa6c1c-aws_as1 + model: Qwen/Qwen3.5-9B + object: chat.completion + system_fingerprint: default + usage: + completion_tokens: 373 + prompt_tokens: 22 + prompt_tokens_details: + cached_tokens: 0 + total_tokens: 395 + headers: + connection: keep-alive + content-type: application/json + x-request-id: 39aa6c1c-aws_as1 + status_code: 200 +timestamp: '2026-11-05T14:48:39.384697+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..ff05d56 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-non_stream-01.yaml @@ -0,0 +1,193 @@ +filename: 2026-11-05-01a1ac2e-fac1-76c0-a973-a8f3b3fc66c0 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - content: 'Here are a few name suggestions for a robot gardener, categorized + by the "vibe" they project: + + + ### Nature-Inspired & Whimsical + + *These names blend gardening terminology with soft, organic sounds.* + + * **Chloris** (Greek goddess of flowers) + + * **Verdant** + + * **Bloom** + + * **Petra** (Latin for rock/stones, but sounds like "spore") + + * **Seedling** + + * **Fern & Rust** + + * **Petunia Bot** + + + ### Tech-Savvy & Functional + + *These sound like practical tools designed for efficiency and precision.* + + * **AgriBot 3000** + + * **ProGroom** + + * **GreenLogic** + + * **SoilSync** + + * **Hortus AI** + + * **RootSeeker** + + * **CropGuard** + + + ### Friendly & Personable + + *Names that make the machine seem like a helpful neighbor or a pet.* + + * **Genny** + + * **Bud** + + * **Pluck** + + * **Otto the Oaktress** + + * **Sprouty** + + * **Thumb** (as in "my little oatmeal thumb") + + * **Willow** + + + ### My Top Recommendation + + **"Simeris"** + + It sounds elegant and futuristic (like a code name), but it closely mimics + the sound of "simmering" soil or the gentle sound of rain falling on leaves. + It implies a machine that understands the delicate balance of a garden. + + + **Which style fits your robot best?** Do you want it to feel more like a high-tech + engineering marvel or a charming garden companion?' + reasoning_content: null + role: assistant + - content: + - text: Explain why that name fits. + type: text + role: user + model: Qwen/Qwen3.5-9B + reasoning: + enabled: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1651' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2e-fac1-76c0-a973-a8f3b3fc66c0 +response: + body: + choices: + - finish_reason: stop + index: 0 + matched_stop: 248046 + message: + content: 'Here is a breakdown of why **"Simeris"** is a compelling choice + for a robot gardener, analyzing its linguistic roots, phonetic vibe, and + symbolic meaning: + + + ### 1. Etymology: A Blend of Nature and Action + + The name is constructed to sound like two distinct concepts merged together: + + * **"Simmer":** This verb implies a gentle, sustained heat. In cooking, + it''s low and steady; in gardening, it mirrors the ideal soil temperature + where seeds germinate and roots expand slowly without burning out. It suggests + a patient, low-energy constant, which is perfect for a machine that tends + to living things rather than ripping them apart. + + * **"Miris" (from *Perfume* or *Aroma*):** This suffix evokes the word + "outrigger" or "mirro" but leans heavily toward "mirth" (joy) or "flavor/aroma." + It connects to the smell of the garden—the scent of blooming flowers or + damp earth after a rain. + + + ### 2. The Phonetic Vibe + + * **Soft Consonants:** The name starts with an ''S'' (shh) and flows into + a soft ''m'' and ''r''. Unlike names like "Basher" or "Cutter" which sound + aggressive, "Simeris" sounds whisper-soft. It creates a mental image of + a quiet hum or the rustling of a gentle breeze, rather than the clanking + of heavy machinery. + + * **Double ''i'' Vocalic Echo:** The "i" sounds in the middle give the + name a lift, making it feel energetic yet delicate, much like a sprouting + seed pushing through soil. + + + ### 3. Symbolic Dual Nature + + A robot gardener walks a fine line between **artificial intelligence** and + **organic life**. + + * **The Tech Side:** The "S" and the rhythmic, almost syllabic structure + give it a slightly futuristic, coded feel. It sounds like a sophisticated + algorithm designed to optimize growth. + + * **The Organic Side:** The reference to "simmering" and "aroma" grounds + it firmly in the natural world. It hasn''t just been named; it feels like + it *belongs* there. + + + ### 4. Narrative Potential + + Using this name allows for cute character quirks: + + * *"Don''t worry, Simeris won''t overwork the soil; he knows exactly when + to simmer the nutrients."* + + * *"The garden smells wonderful today; I think Simeris hit the sweet spot + on the humidity sensors."* + + + **In short:** **Simeris** fits because it transforms the concept of a machine + from something cold and industrial into something warm, patient, and essential + to the life cycle of a plant. It sounds less like a tool and more like a + partner.' + reasoning_content: null + role: assistant + created: 1793890122 + id: bea9a980-aws_as1 + model: Qwen/Qwen3.5-9B + object: chat.completion + system_fingerprint: default + usage: + completion_tokens: 586 + prompt_tokens: 411 + prompt_tokens_details: + cached_tokens: 0 + total_tokens: 997 + headers: + connection: keep-alive + content-type: application/json + x-request-id: bea9a980-aws_as1 + status_code: 200 +timestamp: '2026-11-05T14:48:42.433990+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-stream-00.yaml new file mode 100644 index 0000000..e9ff678 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-stream-00.yaml @@ -0,0 +1,3641 @@ +filename: 2026-11-05-01a1ac2e-cf55-7f11-85c0-021526b47895 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + model: Qwen/Qwen3.5-9B + reasoning: + enabled: false + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '243' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2e-cf55-7f11-85c0-021526b47895 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 429f400e-aws_as1 + sse: + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Here","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + are","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + several","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + name","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + suggestions","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + gard","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ener","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + categorized","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + by","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"v","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ibe","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + they","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + project","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"###","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Cle","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ver","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + &","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + P","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"uns","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"These","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + names","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + play","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + on","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + gardening","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + terms","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + combined","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + with","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + technology","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"T","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"erra","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Bot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"A","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + classic","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + mix","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"T","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"erra","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"/m","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"atter","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"We","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ed","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Out","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Simple","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + direct","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + slightly","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + aggressive","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + pruning","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + bot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Al","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"go","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"B","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"loom","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"S","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"uggest","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"s","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + algorithms","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + helping","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + flowers","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + grow","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Pr","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"un","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"imus","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Sounds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + like","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Pr","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"un","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"us","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + genus","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + cher","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ries","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"/","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"pe","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"aches","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + but","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + implies","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"''s","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"first","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + pr","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"uner","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ch","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"lor","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"oph","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"yll","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"1","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"A","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + scientific","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + nod","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + green","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + life","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + nurt","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ures","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"RC","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Spr","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"out","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Remote","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Control","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Spr","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"out","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"###","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Nature","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-In","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"sp","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ired","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + &","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Wh","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ims","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ical","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Names","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sound","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + friendly","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + organic","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + gentle","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + perfect","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + house","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"plant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + caret","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"aker","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ver","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"dia","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Short","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + vegetation","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sounds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + elegant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"S","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"olan","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"um","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"A","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + genus","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + night","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"sh","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ades","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sounds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sophisticated","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Leaf","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"gard","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"A","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + gentle","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + blend","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Leaf","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Guard","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ian","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"B","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"am","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"boo","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Automatic","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Fern","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + &","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Steel","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"S","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ylv","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"an","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Associated","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + with","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + forests","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sounds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + magical","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"###","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Functional","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + &","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Industrial","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"If","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + this","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + large","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + agricultural","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + serious","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + tool","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + these","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + names","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sound","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robust","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + efficient","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ap","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ex","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Cult","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"iv","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ator","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Root","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Sync","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Har","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"vest","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Logic","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Nit","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ro","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"G","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"rowth","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"A","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"egis","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Earth","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"A","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"egis","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + means","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + protection","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"C","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ult","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ivo","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"###","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Character","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ready","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Names","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"If","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + has","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + personality","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + part","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + story","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"/game","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Gr","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"izzly","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"For","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + tough","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + pl","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ow","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-like","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"B","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"loss","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"om","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"For","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + small","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + delicate","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + pol","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ishes","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + leaves","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"P","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ulse","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Because","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + plants","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + need","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + water","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + rhythm","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Echo","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Listening","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + soil","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Chip","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"As","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + in","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"chip","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + away","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + at","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + weeds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Which","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + style","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + fits","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + best","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"?**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"cute","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + assistant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + an","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + apartment","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + balcony","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"?","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Go","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + with","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ver","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"dia","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"B","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"loss","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"om","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*.","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"farm","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + work","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"horse","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**?","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Go","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + with","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ap","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ex","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Cult","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"iv","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ator","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"T","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"erra","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Bot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*.","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Do","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + you","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + want","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + something","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"hum","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"orous","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**?","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Go","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + with","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"We","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ed","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Out","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Root","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Sync","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*.","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":null},"logprobs":null,"finish_reason":"stop","matched_stop":248046}]} + + ' + - ' + + ' + - 'data: {"id":"429f400e-aws_as1","object":"chat.completion.chunk","created":1793890111,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":22,"completion_tokens":557,"total_tokens":579,"prompt_tokens_details":{"cached_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:48:31.317431+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-stream-01.yaml new file mode 100644 index 0000000..31c1bf1 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-chat_completions-stream-01.yaml @@ -0,0 +1,3970 @@ +filename: 2026-11-05-01a1ac2e-df2b-71d2-a073-a4cb6314a1e6 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Suggest a name for a robot gardener. + type: text + role: user + - annotations: null + audio: null + content: 'Here are several name suggestions for a robot gardener, categorized + by the "vibe" they project: + + + ### Clever & Puns + + These names play on gardening terms combined with technology. + + * **TerraBot** (A classic mix of "Terra/matter" and Robot) + + * **WeedOut** (Simple, direct, and slightly aggressive for a pruning bot) + + * **AlgoBloom** (Suggests algorithms helping flowers grow) + + * **Prunimus** (Sounds like "Prunus," the genus for cherries/peaches, but + implies it''s the *first* pruner) + + * **Chlorophyll-1** (A scientific nod to the green life it nurtures) + + * **RC Sprout** (Remote Control Sprout) + + + ### Nature-Inspired & Whimsical + + Names that sound friendly, organic, and gentle, perfect for a houseplant caretaker. + + * **Verdia** (Short for vegetation, sounds elegant) + + * **Solanum** (A genus of nightshades, sounds sophisticated) + + * **Leafgard** (A gentle blend of "Leaf" and "Guardian") + + * **Bamboo** (Automatic) + + * **Fern & Steel** + + * **Sylvan** (Associated with forests, sounds magical) + + + ### Functional & Industrial + + If this is a large agricultural robot or a serious tool, these names sound + robust and efficient. + + * **Apex Cultivator** + + * **RootSync** + + * **Harvest Logic** + + * **NitroGrowth** + + * **Aegis Earth** (Aegis means protection) + + * **Cultivo** + + + ### Character-Ready Names + + If the robot has a personality or is part of a story/game. + + * **Grizzly** (For a tough, plow-like robot) + + * **Blossom** (For a small, delicate robot that polishes leaves) + + * **Pulse** (Because plants need water and rhythm) + + * **Echo** (Listening to the soil) + + * **Chip** (As in "chip away at the weeds") + + + **Which style fits best?** + + * Is it a **cute assistant** for an apartment balcony? Go with *Verdia* + or *Blossom*. + + * Is it a **farm workhorse**? Go with *Apex Cultivator* or *TerraBot*. + + * Do you want something **humorous**? Go with *WeedOut* or *RootSync*.' + function_call: null + reasoning_content: null + refusal: null + role: assistant + tool_calls: null + - content: + - text: Explain why that name fits. + type: text + role: user + model: Qwen/Qwen3.5-9B + reasoning: + enabled: false + stream: true + stream_options: + include_usage: true + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2383' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2e-df2b-71d2-a073-a4cb6314a1e6 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 4563d175-aws_as1 + sse: + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Since","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + I","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + provided","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + wide","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + variety","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + options","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + in","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + previous","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + step","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"best","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + explanation","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + depends","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + on","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + which","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + specific","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + name","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + reson","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ated","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + with","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + you","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Here","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + are","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + deep","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + dives","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + into","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"three","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + distinct","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + favorites","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + show","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"why","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + name","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + works","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + ranging","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + from","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + pun","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ny","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + profound","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"###","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"1","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + P","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"unny","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Choice","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"We","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ed","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Out","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Why","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + fits","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + This","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + name","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + relies","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + on","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + double","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + entendre","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + which","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + makes","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robots","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + memorable","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Literal","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Meaning","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + It","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + describes","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + primary","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + function","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + gard","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ener","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"—","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"rem","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"oving","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + unwanted","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + weeds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Code","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Reference","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + In","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + programming","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"weed","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + out","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + means","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + remove","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + bad","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + data","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + errors","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + from","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + system","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + leaving","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + only","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + clean","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + efficient","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + code","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + V","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ibe","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + It","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + suggests","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + not","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + just","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + helpful","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + but","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"essential","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + maintaining","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + order","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + It","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sounds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + slightly","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + aggressive","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"good","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + pruning","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + bot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + unmistak","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ably","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + clear","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + about","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + its","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + job","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"###","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"2","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Elegant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Choice","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ver","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"dia","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Why","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + fits","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + This","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + name","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + bridges","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + gap","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + between","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + high","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-end","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + technology","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + organic","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + life","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Et","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ymology","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + It","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + derives","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + from","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Latin","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ver","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"green","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"/s","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"pring","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":")","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + suggests","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"veget","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ation","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"verd","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ph","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"on","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"etics","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"-","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ia","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + ending","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + gives","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + soft","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + human","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-like","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + quality","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + (","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"similar","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + names","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + like","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Am","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"alia","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Cam","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"illa","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":").","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + It","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + doesn","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"''t","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sound","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + like","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + cold","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + machine","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":";","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sounds","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + like","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + partner","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + V","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ibe","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Perfect","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + for","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + sophisticated","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + indoor","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + plant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + assistant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + hosts","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + house","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"plants","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + monitors","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + humidity","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + releases","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + calming","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + mist","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + It","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + implies","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + understands","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"spirit","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + green","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ery","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + not","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + just","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + mechanics","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + watering","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"###","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"3","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Sci","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-Fi","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Choice","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Ch","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"lor","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"oph","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"yll","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"1","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Why","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + fits","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + This","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + name","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + leans","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + into","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + biological","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + miracle","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + what","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + protecting","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"Scient","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ific","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Precision","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Chlor","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"oph","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"yll","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + specific","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + pigment","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + allows","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + plants","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + perform","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + photos","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ynthesis","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + turn","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + light","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + into","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + food","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + Naming","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + after","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"source","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + life","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + elev","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ates","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + its","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + purpose","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + from","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"maintenance","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"s","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ust","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"enance","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".\"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + \"","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"1","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\":","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + suffix","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + implies","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + first","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + its","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + kind","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + prototype","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + leader","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + fleet","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" ","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + **","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + V","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ibe","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":":**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + This","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + feels","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + like","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + character","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + from","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + high","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"-con","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"cept","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + science","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + fiction","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + story","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + It","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + suggests","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + robot","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + is","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + so","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + advanced","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + it","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + can","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + optimize","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + photos","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ynthesis","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + rates","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + detect","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + nutrient","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + deficiencies","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + before","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + human","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + ever","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + notices","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + yellow","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + leaf","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"***","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"If","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + you","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + had","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + a","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + specific","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + name","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + in","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + mind","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + from","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + original","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + list","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + *","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"doesn","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"''t","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"*","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + have","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + an","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + explanation","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + here","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + or","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + if","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + you","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + want","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + to","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + refine","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + one","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + of","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + these","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + further","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":",","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + just","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + let","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + me","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + know","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"!**","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":null},"logprobs":null,"finish_reason":"stop","matched_stop":248046}]} + + ' + - ' + + ' + - 'data: {"id":"4563d175-aws_as1","object":"chat.completion.chunk","created":1793890115,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":595,"completion_tokens":575,"total_tokens":1170,"prompt_tokens_details":{"cached_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:48:35.371921+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-non_stream-00.yaml new file mode 100644 index 0000000..9a6e546 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-non_stream-00.yaml @@ -0,0 +1,111 @@ +filename: 2026-11-05-01a1a9c9-a113-77e1-b1e0-826cbff9b63a +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + reasoning: + effort: minimal + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '220' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9c9-a113-77e1-b1e0-826cbff9b63a +response: + body: + background: false + completed_at: 1793849928 + created_at: 1793849926 + error: null + frequency_penalty: 0.0 + id: resp_01a1a9c9-a27b-7162-8c19-affa897ead99 + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - content: + - annotations: [] + text: "Here are several name suggestions for a robot gardener, broken down\ + \ by the \"vibe\" you might be going for:\n\n**Botanical & Mechanical (Punny\ + \ & Clever)**\n* **Mechanibloom**\n* **Robo-Rooter**\n* **Sproutnik**\n\ + * **Bot-anical**\n* **Turflink**\n* **Metalleaf**\n* **Thornbot**\n\ + * **Circuit-Sprout**\n\n**Cute & Friendly (Great for a home garden)**\n\ + * **BloomBot**\n* **Sprig**\n* **Pip**\n* **Dewey**\n* **Flora**\n\ + * **Sunny**\n* **Bud-E** (Buddy)\n* **Petal**\n\n**Nature & Mythology\ + \ Inspired (Elegant or poetic)**\n* **Sylvia** (Derived from *Silva*,\ + \ Latin for forest)\n* **Demeter** (Greek goddess of the harvest)\n* \ + \ **Flora** (Roman goddess of flowers)\n* **Ceres** (Roman goddess of\ + \ agriculture)\n* **Verdant**\n* **Gaia**\n\n**Sci-Fi & Futuristic (Sleek\ + \ and professional)**\n* **CultiBot**\n* **Green-Drive**\n* **TerraDroid**\n\ + * **Aero-G**\n* **VegiTech**\n* **Sentinel-Sprout**\n* **Bio-Mech**\n\ + \n**Specific Task Names (If it does one thing really well)**\n* **Clipper**\ + \ (For a pruning/hedge-trimming robot)\n* **Digger** (For planting/bulbing)\n\ + * **Sprinkles** (For a watering robot)\n* **Weeder**\n* **Harvestor**\n\ + \n**My Top 3 Recommendations:**\n1. **Sproutnik** – It’s memorable, fun\ + \ to say, and perfectly blends the idea of a new plant sprout with Sputnik\ + \ (the famous robot/satellite). \n2. **BloomBot** – Classic, alliterative,\ + \ and immediately tells you exactly what the robot does.\n3. **Sylvia**\ + \ – A great name if you want something that sounds like a helpful companion\ + \ rather than a machine. \n\nWhat kind of vibe are you going for with your\ + \ robot?" + type: output_text + id: msg_8d272d0e-aws_as1-01a1a9c9-a27b-7162-8c19-b00a4cc7a324 + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: minimal + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: [] + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 16 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 498 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 514 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: 8d272d0e-aws_as1 + status_code: 200 +timestamp: '2026-11-05T03:38:45.907749+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-non_stream-01.yaml new file mode 100644 index 0000000..b1190f7 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-non_stream-01.yaml @@ -0,0 +1,160 @@ +filename: 2026-11-05-01a1a9c9-d98a-75a0-9bf1-35306c219561 +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + - content: + - annotations: [] + text: "Here are several name suggestions for a robot gardener, broken down\ + \ by the \"vibe\" you might be going for:\n\n**Botanical & Mechanical (Punny\ + \ & Clever)**\n* **Mechanibloom**\n* **Robo-Rooter**\n* **Sproutnik**\n\ + * **Bot-anical**\n* **Turflink**\n* **Metalleaf**\n* **Thornbot**\n\ + * **Circuit-Sprout**\n\n**Cute & Friendly (Great for a home garden)**\n\ + * **BloomBot**\n* **Sprig**\n* **Pip**\n* **Dewey**\n* **Flora**\n\ + * **Sunny**\n* **Bud-E** (Buddy)\n* **Petal**\n\n**Nature & Mythology\ + \ Inspired (Elegant or poetic)**\n* **Sylvia** (Derived from *Silva*,\ + \ Latin for forest)\n* **Demeter** (Greek goddess of the harvest)\n* \ + \ **Flora** (Roman goddess of flowers)\n* **Ceres** (Roman goddess of\ + \ agriculture)\n* **Verdant**\n* **Gaia**\n\n**Sci-Fi & Futuristic (Sleek\ + \ and professional)**\n* **CultiBot**\n* **Green-Drive**\n* **TerraDroid**\n\ + * **Aero-G**\n* **VegiTech**\n* **Sentinel-Sprout**\n* **Bio-Mech**\n\ + \n**Specific Task Names (If it does one thing really well)**\n* **Clipper**\ + \ (For a pruning/hedge-trimming robot)\n* **Digger** (For planting/bulbing)\n\ + * **Sprinkles** (For a watering robot)\n* **Weeder**\n* **Harvestor**\n\ + \n**My Top 3 Recommendations:**\n1. **Sproutnik** – It’s memorable, fun\ + \ to say, and perfectly blends the idea of a new plant sprout with Sputnik\ + \ (the famous robot/satellite). \n2. **BloomBot** – Classic, alliterative,\ + \ and immediately tells you exactly what the robot does.\n3. **Sylvia**\ + \ – A great name if you want something that sounds like a helpful companion\ + \ rather than a machine. \n\nWhat kind of vibe are you going for with your\ + \ robot?" + type: output_text + id: msg_8d272d0e-aws_as1-01a1a9c9-a27b-7162-8c19-b00a4cc7a324 + role: assistant + status: completed + type: message + - content: + - text: Explain why that name fits. + type: input_text + role: user + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + reasoning: + effort: minimal + store: false + stream: false + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '2139' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9c9-d98a-75a0-9bf1-35306c219561 +response: + body: + background: false + completed_at: 1793849951 + created_at: 1793849946 + error: null + frequency_penalty: 0.0 + id: resp_01a1a9c9-f30f-7e40-8cdb-3e1e534c693b + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - content: + - annotations: [] + text: "To explain why these names fit, we have to look at what a robot gardener\ + \ actually does: it blends technology, nature, care, and physical labor.\ + \ The best names bridge the gap between cold mechanics and warm, organic\ + \ life. \n\nHere is why certain names from the list work perfectly based\ + \ on the \"vibe\" they are going for:\n\n**1. Sproutnik (The Fun & Memorable\ + \ Pick)**\n* **Why it fits:** This name is a portmanteau of \"sprout\"\ + \ (the beginning of a plant's life) and \"Sputnik\" (the famous Soviet satellite\ + \ that kicked off the space age). It perfectly captures the essence of a\ + \ robot gardener: it's a piece of advanced technology whose entire purpose\ + \ is to foster new, organic life. It sounds friendly, slightly retro-futuristic,\ + \ and highly approachable.\n\n**2. BloomBot (The Classic Alliteration)**\n\ + * **Why it fits:** This uses alliteration (the repeating \"B\" sound),\ + \ which makes it catchy and easy for humans to say. \"Bloom\" implies health,\ + \ vitality, and the successful result of gardening, while \"Bot\" leaves\ + \ no ambiguity about what the object is. It fits perfectly in a home setting\ + \ where the robot is seen as a helpful household companion.\n\n**3. Sylvia\ + \ (The Elegant / Companion Pick)**\n* **Why it fits:** This name is rooted\ + \ in the Latin word *silva*, meaning \"forest\" or \"woods.\" By giving\ + \ the robot a traditional human name with a hidden botanical meaning, it\ + \ changes the user's relationship with the machine. Instead of treating\ + \ it like an appliance (like a lawnmower or a vacuum), the user will likely\ + \ treat it more like a dedicated assistant or a friend. It softens the mechanical\ + \ nature of the robot. \n\n**4. CultiBot (The Professional / Sci-Fi Pick)**\n\ + * **Why it fits:** This is a blending of \"cultivate\" (to prepare and\ + \ use land for crops, or to promote the growth of) and \"robot.\" It sounds\ + \ like a piece of professional agricultural equipment or a high-end consumer\ + \ product. It fits perfectly if the robot is designed for heavy-duty work—like\ + \ tilling soil, planting seeds, or managing a large greenhouse. \n\n**5.\ + \ Sprig (The Minimalist / Cute Pick)**\n* **Why it fits:** A \"sprig\"\ + \ is a small stem or twig with leaves. It’s a very delicate, organic word.\ + \ Naming a big, metal robot \"Sprig\" creates a fun juxtaposition—it’s a\ + \ massive piece of hardware with a cute, earthy name. It fits perfectly\ + \ for a small, roving robot that tends to indoor plants or a small balcony\ + \ garden. \n\nUltimately, the name you choose should reflect the robot's\ + \ primary function. If it's a heavy-duty outdoor machine, a name like **CultiBot**\ + \ or **TerraDroid** grounds it in utility. If it's a small, friendly robot\ + \ that keeps your houseplants alive, **Sprig** or **BloomBot** makes it\ + \ feel like part of the family." + type: output_text + id: msg_4c6b7efc-aws_as1-01a1a9c9-f310-7831-821a-2d2893466adb + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: minimal + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: [] + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 525 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 640 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 1165 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: 4c6b7efc-aws_as1 + status_code: 200 +timestamp: '2026-11-05T03:39:00.362701+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-responses-stream-00.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-stream-00.yaml new file mode 100644 index 0000000..8df8aff --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-stream-00.yaml @@ -0,0 +1,2217 @@ +filename: 2026-11-05-01a1a9c7-4e6b-7d13-88d0-84ff5c0a64e4 +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + reasoning: + effort: minimal + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '219' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9c7-4e6b-7d13-88d0-84ff5c0a64e4 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: b096134a-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1a9c7-9d8b-7310-83e0-42b18fbda1f0","object":"response","created_at":1793849793,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1a9c7-9d8b-7310-83e0-42b18fbda1f0","object":"response","created_at":1793849793,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_01a1a9c79dda7060afc2980080dc45ba","type":"message","role":"assistant","status":"in_progress","content":[]}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":4,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"Here","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":5,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + are several","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":6,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + name suggestions","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":7,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + for a robot gardener,","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":8,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + broken down by the \"","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":9,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"vibe\" + you might be","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":10,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + going for:\n\n**C","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":11,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ute + & Friendly**\n","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":12,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"* **Spr","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":13,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"out:** + Simple","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":14,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + friendly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":15,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + and perfect","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":16,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + for a robot","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":17,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + that helps things","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":18,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + grow.\n* **B","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":19,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"loomie","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":20,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Sounds","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":21,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + like a helpful","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":22,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + happy","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":23,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + little companion.\n* **","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":24,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"P","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":25,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"etal","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":26,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Gentle","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":27,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + and sweet","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":28,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + great","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":29,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + for a robot","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":30,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + that tends","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":31,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + to flowers.\n","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":32,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"* **Leaf","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":33,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"y:** + A playful","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":34,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":",","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":35,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + approach","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":36,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"able + name.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":37,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + \n* **D","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":38,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"andy","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":39,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Inspired","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":40,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + by the d","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":41,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"andelion, + giving","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":42,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + it","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":43,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + a whims","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":44,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ical + feel","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":45,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":".\n","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":46,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"* **Bud","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":47,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Short","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":48,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + classic","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":49,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + and implies","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":50,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + a growing","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":51,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + friendship","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":52,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":".\n\n**Botanical + & Scientific","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":53,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"**\n* **Ch","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":54,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"loris","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":55,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Named","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":56,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + after the Greek goddess of flowers","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":57,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + (","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":58,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"also","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":59,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + where","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":60,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":61,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + word chlor","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":62,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ophyll + comes","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":63,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + from).\n* **Fl","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":64,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"orig","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":65,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"en","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":66,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Named","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":67,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + after the hormone","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":68,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + in","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":69,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + plants that tells","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":70,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + them to flower","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":71,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":72,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + Sounds","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":73,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + very high","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":74,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-tech.\n* **A","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":75,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ero:** + A nod","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":76,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + to aerop","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":77,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"onics + and","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":78,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + aer","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":79,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"odynamics. + \n* **","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":80,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"F","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":81,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"olia","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":82,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Derived","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":83,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + from *","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":84,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"foliage* + (le","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":85,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"aves).\n","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":86,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"* **Ar","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":87,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"bor:** + A classic","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":88,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + word","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":89,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + for trees","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":90,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + giving","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":91,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":92,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + robot a sturdy","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":93,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + reliable feel.\n\n","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":94,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"**Tech + & Mechanical","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":95,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"**\n* **Green","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":96,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-B","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":97,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ot:** + Straight","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":98,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"forward + and classic.\n* ","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":99,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + **Rob","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":100,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"o-","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":101,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"We","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":102,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ed","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":103,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Great","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":104,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + if","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":105,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + the robot''s","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":106,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + primary job is pulling","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":107,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + weeds.\n* **V","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":108,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ine","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":109,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-O","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":110,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + A pun","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":111,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + on \"","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":112,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"D","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":113,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ino,\"","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":114,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + but referencing","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":115,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + creeping","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":116,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + vines.\n* **M","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":117,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"echa","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":118,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-S","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":119,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"prout:** + For","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":120,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + a slightly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":121,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + more heavy","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":122,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-duty + gardening","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":123,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + robot.\n* **T","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":124,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"erra","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":125,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-D","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":126,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"roid:** + \"","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":127,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"Terra\" + meaning","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":128,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + earth/","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":129,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"soil,","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":130,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + combined","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":131,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + with a robotic","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":132,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + suffix.\n","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":133,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"* **Root","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":134,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-R","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":135,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"over","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":136,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Sounds","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":137,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + like a rover","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":138,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + exploring","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":139,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + a","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":140,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + garden planet","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":141,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":".\n\n**P","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":142,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"uns","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":143,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + & Play","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":144,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ful**\n* **R","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":145,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"2","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":146,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":147,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"Seed2","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":148,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + The","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":149,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + ultimate Star Wars-inspired","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":150,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + gard","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":151,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ener + pun","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":152,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":".\n* **Wall","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":153,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-Eed","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":154,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + A play on Wall","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":155,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-E + and weed","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":156,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-p","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":157,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ulling.\n* **Opt","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":158,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"imus","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":159,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + Rh","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":160,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"iz","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":161,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ome:** + A botanical","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":162,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + take","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":163,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + on Optim","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":164,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"us + Prime (","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":165,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"rhizomes + are underground","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":166,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + plant stems).\n* **","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":167,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"T","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":168,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"rowel","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":169,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-Tron:** + A classic","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":170,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + robot name merged","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":171,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + with a gardening","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":172,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + tool.\n* **Mul","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":173,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ch-O","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":174,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":":** + Sounds","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":175,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + like a friendly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":176,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":", + mud","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":177,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-loving","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":178,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + robot.\n\n**How","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":179,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + to choose the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":180,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + best one:**\n* ","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":181,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + If it''s","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":182,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + a **small","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":183,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + indoor","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":184,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + robot** that","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":185,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + potted","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":186,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + plants, go","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":187,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + with something","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":188,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + cute like *","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":189,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"Sprout* + or *B","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":190,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"ud*.\n* If","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":191,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + it''s a **large outdoor","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":192,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + farming","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":193,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + robot**,","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":194,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + go with something stronger","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":195,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + like *Terra-Droid","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":196,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"* + or *Arbor*","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":197,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":".\n* If + it''s","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":198,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + a **smart","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":199,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":",","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":200,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + app","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":201,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"-controlled","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":202,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + robot**,","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":203,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + a","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":204,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + sleek","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":205,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + name","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":206,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":" + like *Fl","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":207,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"origen* + or *F","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":208,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":"olia* + works beautifully","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":209,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":210,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"text":"Here + are several name suggestions for a robot gardener, broken down by the \"vibe\" + you might be going for:\n\n**Cute & Friendly**\n* **Sprout:** Simple, friendly, + and perfect for a robot that helps things grow.\n* **Bloomie:** Sounds like + a helpful, happy little companion.\n* **Petal:** Gentle and sweet, great for + a robot that tends to flowers.\n* **Leafy:** A playful, approachable name. \n* **Dandy:** + Inspired by the dandelion, giving it a whimsical feel.\n* **Bud:** Short, classic, + and implies a growing friendship.\n\n**Botanical & Scientific**\n* **Chloris:** + Named after the Greek goddess of flowers (also where the word chlorophyll comes + from).\n* **Florigen:** Named after the hormone in plants that tells them to + flower. Sounds very high-tech.\n* **Aero:** A nod to aeroponics and aerodynamics. + \n* **Folia:** Derived from *foliage* (leaves).\n* **Arbor:** A classic word + for trees, giving the robot a sturdy, reliable feel.\n\n**Tech & Mechanical**\n* **Green-Bot:** + Straightforward and classic.\n* **Robo-Weed:** Great if the robot''s primary + job is pulling weeds.\n* **Vine-O:** A pun on \"Dino,\" but referencing creeping + vines.\n* **Mecha-Sprout:** For a slightly more heavy-duty gardening robot.\n* **Terra-Droid:** + \"Terra\" meaning earth/soil, combined with a robotic suffix.\n* **Root-Rover:** + Sounds like a rover exploring a garden planet.\n\n**Puns & Playful**\n* **R2-Seed2:** + The ultimate Star Wars-inspired gardener pun.\n* **Wall-Eed:** A play on Wall-E + and weed-pulling.\n* **Optimus Rhizome:** A botanical take on Optimus Prime + (rhizomes are underground plant stems).\n* **Trowel-Tron:** A classic robot + name merged with a gardening tool.\n* **Mulch-O:** Sounds like a friendly, mud-loving + robot.\n\n**How to choose the best one:**\n* If it''s a **small indoor robot** + that potted plants, go with something cute like *Sprout* or *Bud*.\n* If it''s + a **large outdoor farming robot**, go with something stronger like *Terra-Droid* + or *Arbor*.\n* If it''s a **smart, app-controlled robot**, a sleek name like + *Florigen* or *Folia* works beautifully.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":211,"output_index":0,"item_id":"msg_01a1a9c79dda7060afc2980080dc45ba","content_index":0,"part":{"type":"output_text","text":"Here + are several name suggestions for a robot gardener, broken down by the \"vibe\" + you might be going for:\n\n**Cute & Friendly**\n* **Sprout:** Simple, friendly, + and perfect for a robot that helps things grow.\n* **Bloomie:** Sounds like + a helpful, happy little companion.\n* **Petal:** Gentle and sweet, great for + a robot that tends to flowers.\n* **Leafy:** A playful, approachable name. \n* **Dandy:** + Inspired by the dandelion, giving it a whimsical feel.\n* **Bud:** Short, classic, + and implies a growing friendship.\n\n**Botanical & Scientific**\n* **Chloris:** + Named after the Greek goddess of flowers (also where the word chlorophyll comes + from).\n* **Florigen:** Named after the hormone in plants that tells them to + flower. Sounds very high-tech.\n* **Aero:** A nod to aeroponics and aerodynamics. + \n* **Folia:** Derived from *foliage* (leaves).\n* **Arbor:** A classic word + for trees, giving the robot a sturdy, reliable feel.\n\n**Tech & Mechanical**\n* **Green-Bot:** + Straightforward and classic.\n* **Robo-Weed:** Great if the robot''s primary + job is pulling weeds.\n* **Vine-O:** A pun on \"Dino,\" but referencing creeping + vines.\n* **Mecha-Sprout:** For a slightly more heavy-duty gardening robot.\n* **Terra-Droid:** + \"Terra\" meaning earth/soil, combined with a robotic suffix.\n* **Root-Rover:** + Sounds like a rover exploring a garden planet.\n\n**Puns & Playful**\n* **R2-Seed2:** + The ultimate Star Wars-inspired gardener pun.\n* **Wall-Eed:** A play on Wall-E + and weed-pulling.\n* **Optimus Rhizome:** A botanical take on Optimus Prime + (rhizomes are underground plant stems).\n* **Trowel-Tron:** A classic robot + name merged with a gardening tool.\n* **Mulch-O:** Sounds like a friendly, mud-loving + robot.\n\n**How to choose the best one:**\n* If it''s a **small indoor robot** + that potted plants, go with something cute like *Sprout* or *Bud*.\n* If it''s + a **large outdoor farming robot**, go with something stronger like *Terra-Droid* + or *Arbor*.\n* If it''s a **smart, app-controlled robot**, a sleek name like + *Florigen* or *Folia* works beautifully.","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":212,"output_index":0,"item":{"id":"msg_01a1a9c79dda7060afc2980080dc45ba","type":"message","role":"assistant","content":[{"type":"output_text","text":"Here + are several name suggestions for a robot gardener, broken down by the \"vibe\" + you might be going for:\n\n**Cute & Friendly**\n* **Sprout:** Simple, friendly, + and perfect for a robot that helps things grow.\n* **Bloomie:** Sounds like + a helpful, happy little companion.\n* **Petal:** Gentle and sweet, great for + a robot that tends to flowers.\n* **Leafy:** A playful, approachable name. \n* **Dandy:** + Inspired by the dandelion, giving it a whimsical feel.\n* **Bud:** Short, classic, + and implies a growing friendship.\n\n**Botanical & Scientific**\n* **Chloris:** + Named after the Greek goddess of flowers (also where the word chlorophyll comes + from).\n* **Florigen:** Named after the hormone in plants that tells them to + flower. Sounds very high-tech.\n* **Aero:** A nod to aeroponics and aerodynamics. + \n* **Folia:** Derived from *foliage* (leaves).\n* **Arbor:** A classic word + for trees, giving the robot a sturdy, reliable feel.\n\n**Tech & Mechanical**\n* **Green-Bot:** + Straightforward and classic.\n* **Robo-Weed:** Great if the robot''s primary + job is pulling weeds.\n* **Vine-O:** A pun on \"Dino,\" but referencing creeping + vines.\n* **Mecha-Sprout:** For a slightly more heavy-duty gardening robot.\n* **Terra-Droid:** + \"Terra\" meaning earth/soil, combined with a robotic suffix.\n* **Root-Rover:** + Sounds like a rover exploring a garden planet.\n\n**Puns & Playful**\n* **R2-Seed2:** + The ultimate Star Wars-inspired gardener pun.\n* **Wall-Eed:** A play on Wall-E + and weed-pulling.\n* **Optimus Rhizome:** A botanical take on Optimus Prime + (rhizomes are underground plant stems).\n* **Trowel-Tron:** A classic robot + name merged with a gardening tool.\n* **Mulch-O:** Sounds like a friendly, mud-loving + robot.\n\n**How to choose the best one:**\n* If it''s a **small indoor robot** + that potted plants, go with something cute like *Sprout* or *Bud*.\n* If it''s + a **large outdoor farming robot**, go with something stronger like *Terra-Droid* + or *Arbor*.\n* If it''s a **smart, app-controlled robot**, a sleek name like + *Florigen* or *Folia* works beautifully.","annotations":[]}],"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":213,"response":{"id":"resp_01a1a9c7-9d8b-7310-83e0-42b18fbda1f0","object":"response","created_at":1793849793,"completed_at":1793849796,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"msg_01a1a9c79dda7060afc2980080dc45ba","type":"message","role":"assistant","content":[{"type":"output_text","text":"Here + are several name suggestions for a robot gardener, broken down by the \"vibe\" + you might be going for:\n\n**Cute & Friendly**\n* **Sprout:** Simple, friendly, + and perfect for a robot that helps things grow.\n* **Bloomie:** Sounds like + a helpful, happy little companion.\n* **Petal:** Gentle and sweet, great for + a robot that tends to flowers.\n* **Leafy:** A playful, approachable name. \n* **Dandy:** + Inspired by the dandelion, giving it a whimsical feel.\n* **Bud:** Short, classic, + and implies a growing friendship.\n\n**Botanical & Scientific**\n* **Chloris:** + Named after the Greek goddess of flowers (also where the word chlorophyll comes + from).\n* **Florigen:** Named after the hormone in plants that tells them to + flower. Sounds very high-tech.\n* **Aero:** A nod to aeroponics and aerodynamics. + \n* **Folia:** Derived from *foliage* (leaves).\n* **Arbor:** A classic word + for trees, giving the robot a sturdy, reliable feel.\n\n**Tech & Mechanical**\n* **Green-Bot:** + Straightforward and classic.\n* **Robo-Weed:** Great if the robot''s primary + job is pulling weeds.\n* **Vine-O:** A pun on \"Dino,\" but referencing creeping + vines.\n* **Mecha-Sprout:** For a slightly more heavy-duty gardening robot.\n* **Terra-Droid:** + \"Terra\" meaning earth/soil, combined with a robotic suffix.\n* **Root-Rover:** + Sounds like a rover exploring a garden planet.\n\n**Puns & Playful**\n* **R2-Seed2:** + The ultimate Star Wars-inspired gardener pun.\n* **Wall-Eed:** A play on Wall-E + and weed-pulling.\n* **Optimus Rhizome:** A botanical take on Optimus Prime + (rhizomes are underground plant stems).\n* **Trowel-Tron:** A classic robot + name merged with a gardening tool.\n* **Mulch-O:** Sounds like a friendly, mud-loving + robot.\n\n**How to choose the best one:**\n* If it''s a **small indoor robot** + that potted plants, go with something cute like *Sprout* or *Bud*.\n* If it''s + a **large outdoor farming robot**, go with something stronger like *Terra-Droid* + or *Arbor*.\n* If it''s a **smart, app-controlled robot**, a sleek name like + *Florigen* or *Folia* works beautifully.","annotations":[]}],"status":"completed"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":16,"output_tokens":561,"total_tokens":577,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-05T03:36:13.675202+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/text_chat/togetherai-responses-stream-01.yaml b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-stream-01.yaml new file mode 100644 index 0000000..2b27e45 --- /dev/null +++ b/tests/cassettes/upstream_ir/text_chat/togetherai-responses-stream-01.yaml @@ -0,0 +1,2204 @@ +filename: 2026-11-05-01a1a9c8-4533-7840-939d-ce49666302b3 +request: + body: + input: + - content: + - text: Suggest a name for a robot gardener. + type: input_text + role: user + - content: + - annotations: [] + text: "Here are several name suggestions for a robot gardener, broken down\ + \ by the \"vibe\" you might be going for:\n\n**Cute & Friendly**\n* **Sprout:**\ + \ Simple, friendly, and perfect for a robot that helps things grow.\n* \ + \ **Bloomie:** Sounds like a helpful, happy little companion.\n* **Petal:**\ + \ Gentle and sweet, great for a robot that tends to flowers.\n* **Leafy:**\ + \ A playful, approachable name. \n* **Dandy:** Inspired by the dandelion,\ + \ giving it a whimsical feel.\n* **Bud:** Short, classic, and implies\ + \ a growing friendship.\n\n**Botanical & Scientific**\n* **Chloris:**\ + \ Named after the Greek goddess of flowers (also where the word chlorophyll\ + \ comes from).\n* **Florigen:** Named after the hormone in plants that\ + \ tells them to flower. Sounds very high-tech.\n* **Aero:** A nod to aeroponics\ + \ and aerodynamics. \n* **Folia:** Derived from *foliage* (leaves).\n\ + * **Arbor:** A classic word for trees, giving the robot a sturdy, reliable\ + \ feel.\n\n**Tech & Mechanical**\n* **Green-Bot:** Straightforward and\ + \ classic.\n* **Robo-Weed:** Great if the robot's primary job is pulling\ + \ weeds.\n* **Vine-O:** A pun on \"Dino,\" but referencing creeping vines.\n\ + * **Mecha-Sprout:** For a slightly more heavy-duty gardening robot.\n\ + * **Terra-Droid:** \"Terra\" meaning earth/soil, combined with a robotic\ + \ suffix.\n* **Root-Rover:** Sounds like a rover exploring a garden planet.\n\ + \n**Puns & Playful**\n* **R2-Seed2:** The ultimate Star Wars-inspired\ + \ gardener pun.\n* **Wall-Eed:** A play on Wall-E and weed-pulling.\n\ + * **Optimus Rhizome:** A botanical take on Optimus Prime (rhizomes are\ + \ underground plant stems).\n* **Trowel-Tron:** A classic robot name merged\ + \ with a gardening tool.\n* **Mulch-O:** Sounds like a friendly, mud-loving\ + \ robot.\n\n**How to choose the best one:**\n* If it's a **small indoor\ + \ robot** that potted plants, go with something cute like *Sprout* or *Bud*.\n\ + * If it's a **large outdoor farming robot**, go with something stronger\ + \ like *Terra-Droid* or *Arbor*.\n* If it's a **smart, app-controlled\ + \ robot**, a sleek name like *Florigen* or *Folia* works beautifully." + type: output_text + id: msg_01a1a9c79dda7060afc2980080dc45ba + role: assistant + status: completed + type: message + - content: + - text: Explain why that name fits. + type: input_text + role: user + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + reasoning: + effort: minimal + store: false + stream: true + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '2594' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9c8-4533-7840-939d-ce49666302b3 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 4088251b-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1a9c8-ca9a-7ec1-8b54-9377a627ea3f","object":"response","created_at":1793849871,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1a9c8-ca9a-7ec1-8b54-9377a627ea3f","object":"response","created_at":1793849871,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","type":"message","role":"assistant","status":"in_progress","content":[]}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":4,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"Because","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":5,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + I gave","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":6,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + you a list of several","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":7,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + names","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":8,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + I will","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":9,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + pick the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":10,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + standout","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":11,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + favorite","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":12,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + from each category and explain exactly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":13,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + why it makes","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":14,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":15,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + perfect fit for a robot gard","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":16,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"ener. + \n\nHere","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":17,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + is why","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":18,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + those specific","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":19,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + names work so","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":20,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + well:\n\n**","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":21,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"1. + Sprout (","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":22,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"The","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":23,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + Cute & Friendly Option","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":24,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":")**\n* **Why","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":25,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + it fits:** The","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":26,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + word \"sprout\" represents","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":27,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + the very beginning of a plant","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":28,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"''s + life—the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":29,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + moment a seed pushes","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":30,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + through the soil.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":31,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + This","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":32,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + makes","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":33,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + it the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":34,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + perfect name","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":35,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + for a robot whose","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":36,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + entire","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":37,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + purpose","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":38,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + is to nurture","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":39,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + and protect","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":40,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + young","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":41,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":",","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":42,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + growing plants. Furthermore","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":43,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + the word has","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":44,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a naturally","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":45,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + friendly, soft","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":46,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + and approach","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":47,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"able + sound.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":48,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + If","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":49,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":50,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + robot is meant","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":51,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + to be a","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":52,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + household companion that","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":53,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + people","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":54,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + interact with daily","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":55,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + (like a Ro","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":56,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"omba),","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":57,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + \"Sprout\" makes","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":58,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + it feel","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":59,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + less","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":60,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + like a cold","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":61,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + machine and more like a helpful","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":62,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + little pet.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":63,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + \n\n**2. Fl","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":64,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"origen + (The Scientific","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":65,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + & Sle","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":66,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"ek + Option)**\n* ","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":67,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + **Why it fits:** Fl","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":68,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"origen + is the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":69,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + real","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":70,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"-life","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":71,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + name","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":72,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + of","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":73,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + the protein","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":74,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + hormone in plants that triggers","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":75,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + them","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":76,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + to bloom","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":77,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + and","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":78,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + flower. By","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":79,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + naming a","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":80,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + robot Fl","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":81,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"origen, + you","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":82,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + are implying","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":83,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + that the machine","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":84,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + is the *","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":85,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"mechanical + equivalent","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":86,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"* + of that","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":87,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + hormone","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":88,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"—it + is the catalyst","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":89,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + that makes the garden","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":90,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + thrive. It sounds","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":91,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + incredibly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":92,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + high","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":93,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"-tech, + precise","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":94,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + and smart","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":95,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":". + This","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":96,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + name is","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":97,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":98,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + perfect fit for a highly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":99,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + advanced, app","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":100,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"-controlled + robot","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":101,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + that uses","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":102,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + sensors to","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":103,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + monitor soil moisture, pH","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":104,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":",","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":105,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + and light levels.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":106,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + \n\n**3. Terra-D","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":107,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"roid + (The Heavy","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":108,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"-Duty/","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":109,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"Outdoor + Option)**\n* ","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":110,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + **Why it fits:** \"","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":111,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"Terra\" + is Latin","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":112,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + for earth","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":113,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + or","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":114,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + soil, and \"","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":115,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"Droid\" + immediately","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":116,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + communicates","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":117,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + that","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":118,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + this","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":119,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + is an","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":120,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + autonomous machine. Put","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":121,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + together, it","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":122,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + literally translates","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":123,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + to \"Earth Robot","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":124,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":".\" + This name fits","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":125,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a larger","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":126,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + more","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":127,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + rugged robot","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":128,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + perfectly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":129,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"—something","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":130,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + that","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":131,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + roams outdoor","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":132,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + garden","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":133,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + beds, t","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":134,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"ills + soil, or pulls","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":135,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + heavy weeds. It has","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":136,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a sturdy","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":137,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + industrial ring to it,","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":138,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + letting","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":139,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + the user know that this","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":140,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + robot can handle the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":141,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + dirty","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":142,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":",","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":143,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + heavy","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":144,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + lifting of outdoor","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":145,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + gardening","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":146,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":".\n\n**4. + R","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":147,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"2-Seed2 + (The","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":148,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + Play","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":149,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"ful/P","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":150,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"un + Option)**\n* ","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":151,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + **Why it fits:** This","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":152,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + name","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":153,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + works","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":154,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + on","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":155,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + two","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":156,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + levels. First","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":157,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":158,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + phon","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":159,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"etic + similarity","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":160,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + to Star","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":161,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + Wars'' R","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":162,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"2-D","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":163,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"2 + instantly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":164,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + gives","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":165,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + the robot","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":166,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a lo","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":167,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"vable, + be","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":168,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"eping, + helpful","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":169,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + personality that","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":170,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + pop","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":171,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"-c","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":172,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"ulture + fans will","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":173,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + immediately connect","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":174,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + with. Secondly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":175,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":", + swapping","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":176,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + \"D","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":177,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"2\" + for","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":178,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + \"Seed2\" explicitly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":179,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + states","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":180,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":181,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + robot''s function. The","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":182,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + name itself","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":183,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + becomes","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":184,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a conversation","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":185,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + starter and","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":186,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + instantly","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":187,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + brings","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":188,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + a smile to the user","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":189,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":"''s + face,","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":190,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + which","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":191,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + is","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":192,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + exactly the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":193,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + kind of emotional","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":194,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + connection","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":195,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + you","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":196,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + want a","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":197,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + household","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":198,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"delta":" + robot to have.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":199,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"text":"Because + I gave you a list of several names, I will pick the standout favorite from each + category and explain exactly why it makes a perfect fit for a robot gardener. + \n\nHere is why those specific names work so well:\n\n**1. Sprout (The Cute & + Friendly Option)**\n* **Why it fits:** The word \"sprout\" represents the very + beginning of a plant''s life—the moment a seed pushes through the soil. This makes + it the perfect name for a robot whose entire purpose is to nurture and protect + young, growing plants. Furthermore, the word has a naturally friendly, soft, and + approachable sound. If the robot is meant to be a household companion that people + interact with daily (like a Roomba), \"Sprout\" makes it feel less like a cold + machine and more like a helpful little pet. \n\n**2. Florigen (The Scientific + & Sleek Option)**\n* **Why it fits:** Florigen is the real-life name of the + protein hormone in plants that triggers them to bloom and flower. By naming a + robot Florigen, you are implying that the machine is the *mechanical equivalent* + of that hormone—it is the catalyst that makes the garden thrive. It sounds incredibly + high-tech, precise, and smart. This name is a perfect fit for a highly advanced, + app-controlled robot that uses sensors to monitor soil moisture, pH, and light + levels. \n\n**3. Terra-Droid (The Heavy-Duty/Outdoor Option)**\n* **Why it fits:** + \"Terra\" is Latin for earth or soil, and \"Droid\" immediately communicates that + this is an autonomous machine. Put together, it literally translates to \"Earth + Robot.\" This name fits a larger, more rugged robot perfectly—something that roams + outdoor garden beds, tills soil, or pulls heavy weeds. It has a sturdy, industrial + ring to it, letting the user know that this robot can handle the dirty, heavy + lifting of outdoor gardening.\n\n**4. R2-Seed2 (The Playful/Pun Option)**\n* **Why + it fits:** This name works on two levels. First, the phonetic similarity to Star + Wars'' R2-D2 instantly gives the robot a lovable, beeping, helpful personality + that pop-culture fans will immediately connect with. Secondly, swapping \"D2\" + for \"Seed2\" explicitly states the robot''s function. The name itself becomes + a conversation starter and instantly brings a smile to the user''s face, which + is exactly the kind of emotional connection you want a household robot to have.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":200,"output_index":0,"item_id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","content_index":0,"part":{"type":"output_text","text":"Because + I gave you a list of several names, I will pick the standout favorite from each + category and explain exactly why it makes a perfect fit for a robot gardener. + \n\nHere is why those specific names work so well:\n\n**1. Sprout (The Cute & + Friendly Option)**\n* **Why it fits:** The word \"sprout\" represents the very + beginning of a plant''s life—the moment a seed pushes through the soil. This makes + it the perfect name for a robot whose entire purpose is to nurture and protect + young, growing plants. Furthermore, the word has a naturally friendly, soft, and + approachable sound. If the robot is meant to be a household companion that people + interact with daily (like a Roomba), \"Sprout\" makes it feel less like a cold + machine and more like a helpful little pet. \n\n**2. Florigen (The Scientific + & Sleek Option)**\n* **Why it fits:** Florigen is the real-life name of the + protein hormone in plants that triggers them to bloom and flower. By naming a + robot Florigen, you are implying that the machine is the *mechanical equivalent* + of that hormone—it is the catalyst that makes the garden thrive. It sounds incredibly + high-tech, precise, and smart. This name is a perfect fit for a highly advanced, + app-controlled robot that uses sensors to monitor soil moisture, pH, and light + levels. \n\n**3. Terra-Droid (The Heavy-Duty/Outdoor Option)**\n* **Why it fits:** + \"Terra\" is Latin for earth or soil, and \"Droid\" immediately communicates that + this is an autonomous machine. Put together, it literally translates to \"Earth + Robot.\" This name fits a larger, more rugged robot perfectly—something that roams + outdoor garden beds, tills soil, or pulls heavy weeds. It has a sturdy, industrial + ring to it, letting the user know that this robot can handle the dirty, heavy + lifting of outdoor gardening.\n\n**4. R2-Seed2 (The Playful/Pun Option)**\n* **Why + it fits:** This name works on two levels. First, the phonetic similarity to Star + Wars'' R2-D2 instantly gives the robot a lovable, beeping, helpful personality + that pop-culture fans will immediately connect with. Secondly, swapping \"D2\" + for \"Seed2\" explicitly states the robot''s function. The name itself becomes + a conversation starter and instantly brings a smile to the user''s face, which + is exactly the kind of emotional connection you want a household robot to have.","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":201,"output_index":0,"item":{"id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","type":"message","role":"assistant","content":[{"type":"output_text","text":"Because + I gave you a list of several names, I will pick the standout favorite from each + category and explain exactly why it makes a perfect fit for a robot gardener. + \n\nHere is why those specific names work so well:\n\n**1. Sprout (The Cute & + Friendly Option)**\n* **Why it fits:** The word \"sprout\" represents the very + beginning of a plant''s life—the moment a seed pushes through the soil. This makes + it the perfect name for a robot whose entire purpose is to nurture and protect + young, growing plants. Furthermore, the word has a naturally friendly, soft, and + approachable sound. If the robot is meant to be a household companion that people + interact with daily (like a Roomba), \"Sprout\" makes it feel less like a cold + machine and more like a helpful little pet. \n\n**2. Florigen (The Scientific + & Sleek Option)**\n* **Why it fits:** Florigen is the real-life name of the + protein hormone in plants that triggers them to bloom and flower. By naming a + robot Florigen, you are implying that the machine is the *mechanical equivalent* + of that hormone—it is the catalyst that makes the garden thrive. It sounds incredibly + high-tech, precise, and smart. This name is a perfect fit for a highly advanced, + app-controlled robot that uses sensors to monitor soil moisture, pH, and light + levels. \n\n**3. Terra-Droid (The Heavy-Duty/Outdoor Option)**\n* **Why it fits:** + \"Terra\" is Latin for earth or soil, and \"Droid\" immediately communicates that + this is an autonomous machine. Put together, it literally translates to \"Earth + Robot.\" This name fits a larger, more rugged robot perfectly—something that roams + outdoor garden beds, tills soil, or pulls heavy weeds. It has a sturdy, industrial + ring to it, letting the user know that this robot can handle the dirty, heavy + lifting of outdoor gardening.\n\n**4. R2-Seed2 (The Playful/Pun Option)**\n* **Why + it fits:** This name works on two levels. First, the phonetic similarity to Star + Wars'' R2-D2 instantly gives the robot a lovable, beeping, helpful personality + that pop-culture fans will immediately connect with. Secondly, swapping \"D2\" + for \"Seed2\" explicitly states the robot''s function. The name itself becomes + a conversation starter and instantly brings a smile to the user''s face, which + is exactly the kind of emotional connection you want a household robot to have.","annotations":[]}],"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":202,"response":{"id":"resp_01a1a9c8-ca9a-7ec1-8b54-9377a627ea3f","object":"response","created_at":1793849871,"completed_at":1793849873,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"msg_01a1a9c8cafb75e3aaf690ee57e0fd00","type":"message","role":"assistant","content":[{"type":"output_text","text":"Because + I gave you a list of several names, I will pick the standout favorite from each + category and explain exactly why it makes a perfect fit for a robot gardener. + \n\nHere is why those specific names work so well:\n\n**1. Sprout (The Cute & + Friendly Option)**\n* **Why it fits:** The word \"sprout\" represents the very + beginning of a plant''s life—the moment a seed pushes through the soil. This makes + it the perfect name for a robot whose entire purpose is to nurture and protect + young, growing plants. Furthermore, the word has a naturally friendly, soft, and + approachable sound. If the robot is meant to be a household companion that people + interact with daily (like a Roomba), \"Sprout\" makes it feel less like a cold + machine and more like a helpful little pet. \n\n**2. Florigen (The Scientific + & Sleek Option)**\n* **Why it fits:** Florigen is the real-life name of the + protein hormone in plants that triggers them to bloom and flower. By naming a + robot Florigen, you are implying that the machine is the *mechanical equivalent* + of that hormone—it is the catalyst that makes the garden thrive. It sounds incredibly + high-tech, precise, and smart. This name is a perfect fit for a highly advanced, + app-controlled robot that uses sensors to monitor soil moisture, pH, and light + levels. \n\n**3. Terra-Droid (The Heavy-Duty/Outdoor Option)**\n* **Why it fits:** + \"Terra\" is Latin for earth or soil, and \"Droid\" immediately communicates that + this is an autonomous machine. Put together, it literally translates to \"Earth + Robot.\" This name fits a larger, more rugged robot perfectly—something that roams + outdoor garden beds, tills soil, or pulls heavy weeds. It has a sturdy, industrial + ring to it, letting the user know that this robot can handle the dirty, heavy + lifting of outdoor gardening.\n\n**4. R2-Seed2 (The Playful/Pun Option)**\n* **Why + it fits:** This name works on two levels. First, the phonetic similarity to Star + Wars'' R2-D2 instantly gives the robot a lovable, beeping, helpful personality + that pop-culture fans will immediately connect with. Secondly, swapping \"D2\" + for \"Seed2\" explicitly states the robot''s function. The name itself becomes + a conversation starter and instantly brings a smile to the user''s face, which + is exactly the kind of emotional connection you want a household robot to have.","annotations":[]}],"status":"completed"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":587,"output_tokens":525,"total_tokens":1112,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-05T03:37:16.851861+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..aa648af --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-00.yaml @@ -0,0 +1,84 @@ +filename: 2026-11-05-01a1ac2f-a527-72b1-8d51-f62738ddb154 +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning_effort: none + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '595' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-a527-72b1-8d51-f62738ddb154 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + annotations: [] + content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_773902313372537881e8bd033b9b4546 + type: function + created: 1793890166 + id: chatcmpl-azgzfauele2vm5ariumnrbwsarymg3iatl26ja7spuhtdggvgzuq + model: global.openai.gpt-5.6-luna + object: chat.completion + service_tier: default + system_fingerprint: null + usage: + completion_tokens: 19 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 0 + rejected_prediction_tokens: 0 + prompt_tokens: 149 + prompt_tokens_details: + audio_tokens: 0 + cache_write_tokens: 0 + cached_tokens: 0 + total_tokens: 168 + headers: + connection: keep-alive + content-length: '774' + content-type: application/json + x-request-id: 49db7bdf-180a-4c4d-88b9-2b49f60fe833 + status_code: 200 +timestamp: '2026-11-05T14:49:26.055251+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..7420490 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-01.yaml @@ -0,0 +1,97 @@ +filename: 2026-11-05-01a1ac2f-a9bc-7963-928c-827849dd00f5 +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - annotations: [] + content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_773902313372537881e8bd033b9b4546 + type: function + - content: garden.txt + role: tool + tool_call_id: call_773902313372537881e8bd033b9b4546 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning_effort: none + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '908' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-a9bc-7963-928c-827849dd00f5 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + annotations: [] + content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_9a637b01109954889f09e3b8592b7833 + type: function + created: 1793890167 + id: chatcmpl-mjl2vx5byltmy7yym2jxwudxnvqsaq3zluexv5uyqkix26ttovcq + model: global.openai.gpt-5.6-luna + object: chat.completion + service_tier: default + system_fingerprint: null + usage: + completion_tokens: 19 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 0 + rejected_prediction_tokens: 0 + prompt_tokens: 180 + prompt_tokens_details: + audio_tokens: 0 + cache_write_tokens: 0 + cached_tokens: 0 + total_tokens: 199 + headers: + connection: keep-alive + content-length: '775' + content-type: application/json + x-request-id: 039240b6-535e-4caf-bc38-0b0740da2d8a + status_code: 200 +timestamp: '2026-11-05T14:49:27.228145+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..6bb28db --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-non_stream-02.yaml @@ -0,0 +1,104 @@ +filename: 2026-11-05-01a1ac2f-acc5-7960-b017-e08ca49d6573 +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - annotations: [] + content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_773902313372537881e8bd033b9b4546 + type: function + - content: garden.txt + role: tool + tool_call_id: call_773902313372537881e8bd033b9b4546 + - annotations: [] + content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_9a637b01109954889f09e3b8592b7833 + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: call_9a637b01109954889f09e3b8592b7833 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning_effort: none + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1268' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-acc5-7960-b017-e08ca49d6573 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + annotations: [] + content: Water the tomatoes every morning and harvest the ripe fruit. + refusal: null + role: assistant + created: 1793890168 + id: chatcmpl-ti7or4xjtkpf33cj3q75edk6kw6aiimdjywop6pdzs3ydtk52sca + model: global.openai.gpt-5.6-luna + object: chat.completion + service_tier: default + system_fingerprint: null + usage: + completion_tokens: 15 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 0 + rejected_prediction_tokens: 0 + prompt_tokens: 219 + prompt_tokens_details: + audio_tokens: 0 + cache_write_tokens: 0 + cached_tokens: 0 + total_tokens: 234 + headers: + connection: keep-alive + content-length: '675' + content-type: application/json + x-request-id: 9887ee99-142b-4832-9e8f-8996c25779b8 + status_code: 200 +timestamp: '2026-11-05T14:49:28.005757+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-00.yaml new file mode 100644 index 0000000..3c20e34 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-00.yaml @@ -0,0 +1,121 @@ +filename: 2026-11-05-01a1ac2f-9bde-75f0-b071-ffb1c61ea9cb +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning_effort: none + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '634' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-9bde-75f0-b071-ffb1c61ea9cb +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: a398188a-ad5a-43bd-bc5e-e82dce44b90f + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant","refusal":null},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"","name":"read_file"},"id":"call_4ec5112ac9b6527986ce6d4ff0540948","index":0,"type":"function"}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"{\""},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmno"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"path"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"\":\""},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"index"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":".txt"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"\"}"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopq"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"tool_calls","index":0}],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1793890164,"id":"chatcmpl-ywd7d2vrp735e4wegtza2mils3lzmg746ball6nj6xn4xnfhfecq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":19,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":149,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0},"total_tokens":168},"system_fingerprint":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCD"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:23.678294+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-01.yaml new file mode 100644 index 0000000..5374aa5 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-01.yaml @@ -0,0 +1,137 @@ +filename: 2026-11-05-01a1ac2f-9ee6-74f1-aee6-c590343d1a2c +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - annotations: null + audio: null + content: '' + function_call: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_4ec5112ac9b6527986ce6d4ff0540948 + index: 0 + type: function + - content: garden.txt + role: tool + tool_call_id: call_4ec5112ac9b6527986ce6d4ff0540948 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning_effort: none + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '991' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-9ee6-74f1-aee6-c590343d1a2c +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: bce97c20-f9cc-490b-9cf2-7719448067e1 + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant","refusal":null},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdef"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"","name":"read_file"},"id":"call_e9430643fb64556f86892032ed2c5b41","index":0,"type":"function"}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghi"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"{\""},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"path"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghij"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"\":\""},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"garden"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqr"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":".txt"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrs"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"\"}"},"index":0}]},"finish_reason":null,"index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJ"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"tool_calls","index":0}],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdef"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1793890164,"id":"chatcmpl-akcsduzgsyziliskwy5c4w6kh6a5bf5ah27fqu753amgcxzyyoha","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":19,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":186,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0},"total_tokens":205},"system_fingerprint":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:24.454344+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-02.yaml new file mode 100644 index 0000000..7bab9ea --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-chat_completions-stream-02.yaml @@ -0,0 +1,201 @@ +filename: 2026-11-05-01a1ac2f-a202-7b02-a09b-80a9e2fad679 +request: + body: + max_completion_tokens: 512 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - annotations: null + audio: null + content: '' + function_call: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_4ec5112ac9b6527986ce6d4ff0540948 + index: 0 + type: function + - content: garden.txt + role: tool + tool_call_id: call_4ec5112ac9b6527986ce6d4ff0540948 + - annotations: null + audio: null + content: '' + function_call: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_e9430643fb64556f86892032ed2c5b41 + index: 0 + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: call_e9430643fb64556f86892032ed2c5b41 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning_effort: none + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1395' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-a202-7b02-a09b-80a9e2fad679 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: 16a7d27a-e03e-43b2-a6f6-26108af4cb0e + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant","refusal":null},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefgh"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"The"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcd"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" file"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstu"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" says"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" to"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" water"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstu"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" the"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" tomatoes"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklm"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" every"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFG"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" morning"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"ab"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" and"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEF"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" harvest"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmno"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" the"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDE"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" ripe"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" fruit"},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFG"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"."},"finish_reason":null,"index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrst"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"stop","index":0}],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","system_fingerprint":null,"usage":null,"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1793890165,"id":"chatcmpl-6q6bt6pwqj34geo3xiz75etgivd42ckrfzai6hbuhysonzhdrpxq","model":"global.openai.gpt-5.6-luna","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":19,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":231,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0},"total_tokens":250},"system_fingerprint":null,"obfuscation":"abcdefghijklmnopqrst"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:25.250358+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-00.yaml new file mode 100644 index 0000000..42ce34a --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-00.yaml @@ -0,0 +1,75 @@ +filename: 2026-11-16-01a1e429-06c0-7383-af83-2a305dd3cc8d +request: + body: + max_tokens: 512 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + tool_choice: + disable_parallel_tool_use: true + name: add + type: tool + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '595' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e429-06c0-7383-af83-2a305dd3cc8d +response: + body: + container: null + content: + - id: toolu_bdrk_01R4Q8DYNcXziUU4fDWYLh3w + input: + a: 2 + b: 3 + name: add + type: tool_use + id: msg_bdrk_fqxuspmhfa5ecgxxccoew6xlrecgitexxbm64r74s3rypa7mzg7a + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: tool_use + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 711 + output_tokens: 41 + service_tier: standard + headers: + connection: keep-alive + content-length: '563' + content-type: application/json + status_code: 200 +timestamp: '2026-11-16T11:40:56.384967+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-01.yaml new file mode 100644 index 0000000..2d1f2c8 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-01.yaml @@ -0,0 +1,88 @@ +filename: 2026-11-16-01a1e429-09ae-7321-b723-f6b8fbb75e61 +request: + body: + max_tokens: 512 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - id: toolu_bdrk_01R4Q8DYNcXziUU4fDWYLh3w + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01R4Q8DYNcXziUU4fDWYLh3w + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + tool_choice: + disable_parallel_tool_use: true + name: add + type: tool + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '843' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e429-09ae-7321-b723-f6b8fbb75e61 +response: + body: + container: null + content: + - id: toolu_bdrk_01TkfzG59NgrqYWmUh62CK5K + input: + a: 5 + b: 7 + name: add + type: tool_use + id: msg_bdrk_2vn3xpefjhslqu2aq6bg5ege5k5lgozzpuvxde4u6hu26x7dt3iq + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: tool_use + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 792 + output_tokens: 41 + service_tier: standard + headers: + connection: keep-alive + content-length: '563' + content-type: application/json + status_code: 200 +timestamp: '2026-11-16T11:40:57.134280+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-02.yaml new file mode 100644 index 0000000..181d2e4 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-non_stream-02.yaml @@ -0,0 +1,95 @@ +filename: 2026-11-16-01a1e429-0ca2-7a01-8818-8a92f77ef077 +request: + body: + max_tokens: 512 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - id: toolu_bdrk_01R4Q8DYNcXziUU4fDWYLh3w + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01R4Q8DYNcXziUU4fDWYLh3w + type: tool_result + role: user + - content: + - id: toolu_bdrk_01TkfzG59NgrqYWmUh62CK5K + input: + a: 5 + b: 7 + name: add + type: tool_use + role: assistant + - content: + - content: '12' + tool_use_id: toolu_bdrk_01TkfzG59NgrqYWmUh62CK5K + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + tool_choice: + type: none + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '1046' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e429-0ca2-7a01-8818-8a92f77ef077 +response: + body: + container: null + content: + - text: '12' + type: text + id: msg_bdrk_goquapu5d3ofqdn4mxwmxmyrjix6o67kxwhzpsc5tokzyjyo3tya + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: end_turn + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 778 + output_tokens: 4 + service_tier: standard + headers: + connection: keep-alive + content-length: '492' + content-type: application/json + status_code: 200 +timestamp: '2026-11-16T11:40:57.890238+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-00.yaml new file mode 100644 index 0000000..75a4f26 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-00.yaml @@ -0,0 +1,136 @@ +filename: 2026-11-16-01a1e428-f805-7b90-9f20-43d7e27fe073 +request: + body: + max_tokens: 512 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + tool_choice: + disable_parallel_tool_use: true + name: add + type: tool + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '594' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e428-f805-7b90-9f20-43d7e27fe073 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_i7lx36vccpi4ju2dsqdqo6iti3a2wo4rftl2cjwatsr4z24komqq","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":711,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":16,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_bdrk_01MRf2YGse3ggT8mU62ATMgr","name":"add","input":{}}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"a\": + 2"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", + \"b\": "}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"3}"}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":711,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":41}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-16T11:40:52.613434+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-01.yaml new file mode 100644 index 0000000..88b91d9 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-01.yaml @@ -0,0 +1,150 @@ +filename: 2026-11-16-01a1e428-fabb-7c81-9ced-f8c8ff9a9cf5 +request: + body: + max_tokens: 512 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - caller: null + id: toolu_bdrk_01MRf2YGse3ggT8mU62ATMgr + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01MRf2YGse3ggT8mU62ATMgr + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + tool_choice: + disable_parallel_tool_use: true + name: add + type: tool + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '856' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e428-fabb-7c81-9ced-f8c8ff9a9cf5 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_oljtpkvrgmpkywo7ximrqtpf7mkxavuo3uymlnsobdwbjv52jz6a","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":792,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":11,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_bdrk_01JeEJ76ECHzhLBC1ytVArtX","name":"add","input":{}}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"a\": + 5"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", + \"b\": "}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"7}"}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":792,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":41}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-16T11:40:53.307517+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-02.yaml new file mode 100644 index 0000000..22b5d2f --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-messages-stream-02.yaml @@ -0,0 +1,133 @@ +filename: 2026-11-16-01a1e428-fddf-7371-9e0d-6d0eaae31e01 +request: + body: + max_tokens: 512 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - caller: null + id: toolu_bdrk_01MRf2YGse3ggT8mU62ATMgr + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01MRf2YGse3ggT8mU62ATMgr + type: tool_result + role: user + - content: + - caller: null + id: toolu_bdrk_01JeEJ76ECHzhLBC1ytVArtX + input: + a: 5 + b: 7 + name: add + type: tool_use + role: assistant + - content: + - content: '12' + tool_use_id: toolu_bdrk_01JeEJ76ECHzhLBC1ytVArtX + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + tool_choice: + type: none + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '1073' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1e428-fddf-7371-9e0d-6d0eaae31e01 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_mb4ztvgolxb4n46ocy7tui3furwya6vvpg6ompq6skwaeefnhj2a","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":778,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"12"}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":778,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":4}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-16T11:40:54.111526+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-00.yaml new file mode 100644 index 0000000..7fd6704 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-00.yaml @@ -0,0 +1,121 @@ +filename: 2026-11-05-01a1aab8-faea-7501-b4ab-05661ca5e241 +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: false + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '600' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-faea-7501-b4ab-05661ca5e241 +response: + body: + background: false + billing: + payer: developer + completed_at: 1793865612 + created_at: 1793865612 + error: null + frequency_penalty: 0.0 + id: resp_o2lhgi3icp3gi2d6bbsjj2orjfs6v6nyx3djaiynvdqjoaw2atva + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: global.openai.gpt-5.6-luna + moderation: null + object: response + output: + - arguments: '{"path":"index.txt"}' + call_id: call_d8cbc14ba1615d1cb00ff5ae0440a064 + id: fc_97193d754f4b5bb5b859e17c66e15fd6 + name: read_file + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: in_memory + reasoning: + context: all_turns + effort: none + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + output_schema: null + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 149 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 19 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 168 + user: null + headers: + connection: keep-alive + content-length: '1472' + content-type: application/json + x-request-id: dec5833a-e5b5-4de1-93b9-b424342298ed + status_code: 200 +timestamp: '2026-11-05T08:00:12.010751+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-01.yaml new file mode 100644 index 0000000..4652eed --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-01.yaml @@ -0,0 +1,132 @@ +filename: 2026-11-05-01a1aab8-feba-7f22-8cd7-4637f72f5907 +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_d8cbc14ba1615d1cb00ff5ae0440a064 + id: fc_97193d754f4b5bb5b859e17c66e15fd6 + name: read_file + status: completed + type: function_call + - call_id: call_d8cbc14ba1615d1cb00ff5ae0440a064 + output: + - text: garden.txt + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: false + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '932' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-feba-7f22-8cd7-4637f72f5907 +response: + body: + background: false + billing: + payer: developer + completed_at: 1793865613 + created_at: 1793865613 + error: null + frequency_penalty: 0.0 + id: resp_h7ynxg3b6hnepi57rhbi473ypgr2uljipxud23hrga2zj7cjevkq + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: global.openai.gpt-5.6-luna + moderation: null + object: response + output: + - arguments: '{"path":"garden.txt"}' + call_id: call_469bebd283a75af8acf30338358f397d + id: fc_6ecc9173dc445e26b71fa574fb4bd957 + name: read_file + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: in_memory + reasoning: + context: all_turns + effort: none + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + output_schema: null + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 181 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 19 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 200 + user: null + headers: + connection: keep-alive + content-length: '1473' + content-type: application/json + x-request-id: 6d8f6132-aae6-494c-9a06-f0b8b91a3717 + status_code: 200 +timestamp: '2026-11-05T08:00:12.987009+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-02.yaml new file mode 100644 index 0000000..bd6040d --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-non_stream-02.yaml @@ -0,0 +1,147 @@ +filename: 2026-11-05-01a1aab9-0245-7e13-9b33-dfdc8dd65069 +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_d8cbc14ba1615d1cb00ff5ae0440a064 + id: fc_97193d754f4b5bb5b859e17c66e15fd6 + name: read_file + status: completed + type: function_call + - call_id: call_d8cbc14ba1615d1cb00ff5ae0440a064 + output: + - text: garden.txt + type: input_text + type: function_call_output + - arguments: '{"path":"garden.txt"}' + call_id: call_469bebd283a75af8acf30338358f397d + id: fc_6ecc9173dc445e26b71fa574fb4bd957 + name: read_file + status: completed + type: function_call + - call_id: call_469bebd283a75af8acf30338358f397d + output: + - text: Water the tomatoes every morning and harvest ripe fruit. + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: false + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1311' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab9-0245-7e13-9b33-dfdc8dd65069 +response: + body: + background: false + billing: + payer: developer + completed_at: 1793865614 + created_at: 1793865614 + error: null + frequency_penalty: 0.0 + id: resp_vzttezwexrtaxb4nfvyymp2wpk22nfua4ayge4wytrmxcmy3y2ka + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: global.openai.gpt-5.6-luna + moderation: null + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: Water the tomatoes every morning and harvest ripe fruit. + type: output_text + id: msg_377e2b3c3cef5ef19ffccf7854c7839b + phase: final_answer + role: assistant + status: completed + type: message + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: in_memory + reasoning: + context: all_turns + effort: none + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + output_schema: null + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 221 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 14 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 235 + user: null + headers: + connection: keep-alive + content-length: '1533' + content-type: application/json + x-request-id: cec737a5-3d2c-4ebd-a386-a7d51eda1f5d + status_code: 200 +timestamp: '2026-11-05T08:00:13.893057+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-00.yaml new file mode 100644 index 0000000..eaad92e --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-00.yaml @@ -0,0 +1,135 @@ +filename: 2026-11-05-01a1aab8-efb2-7fd3-acd6-bf2ca1c479a4 +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: true + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '599' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-efb2-7fd3-acd6-bf2ca1c479a4 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: 13855726-3e73-4e13-a15e-cff3576cbf4c + sse: + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865609,"error":null,"frequency_penalty":0.0,"id":"resp_655qwwnojkpejgvpgs2f5d2tmroenlsy2tvndmyki4lzpok2wllq","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":0,"type":"response.created"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865609,"error":null,"frequency_penalty":0.0,"id":"resp_655qwwnojkpejgvpgs2f5d2tmroenlsy2tvndmyki4lzpok2wllq","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":1,"type":"response.in_progress"} + + ' + - ' + + ' + - 'data: {"item":{"arguments":"","call_id":"call_c80a312cdcb9565ba95378477b5a66cc","id":"fc_952eccd443bc551ea316b2dfc89f16af","name":"read_file","status":"in_progress","type":"function_call"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"} + + ' + - ' + + ' + - 'data: {"delta":"{\"","item_id":"fc_952eccd443bc551ea316b2dfc89f16af","obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123","output_index":0,"sequence_number":3,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"path","item_id":"fc_952eccd443bc551ea316b2dfc89f16af","obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345","output_index":0,"sequence_number":4,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"\":\"","item_id":"fc_952eccd443bc551ea316b2dfc89f16af","obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN","output_index":0,"sequence_number":5,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"index","item_id":"fc_952eccd443bc551ea316b2dfc89f16af","obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJK","output_index":0,"sequence_number":6,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":".txt","item_id":"fc_952eccd443bc551ea316b2dfc89f16af","obfuscation":"abcdefghijklmnopqrstuvwxyz","output_index":0,"sequence_number":7,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"\"}","item_id":"fc_952eccd443bc551ea316b2dfc89f16af","obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567","output_index":0,"sequence_number":8,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"arguments":"{\"path\":\"index.txt\"}","item_id":"fc_952eccd443bc551ea316b2dfc89f16af","output_index":0,"sequence_number":9,"type":"response.function_call_arguments.done"} + + ' + - ' + + ' + - 'data: {"item":{"arguments":"{\"path\":\"index.txt\"}","call_id":"call_c80a312cdcb9565ba95378477b5a66cc","id":"fc_952eccd443bc551ea316b2dfc89f16af","name":"read_file","status":"completed","type":"function_call"},"output_index":0,"sequence_number":10,"type":"response.output_item.done"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":1793865609,"created_at":1793865609,"error":null,"frequency_penalty":0.0,"id":"resp_655qwwnojkpejgvpgs2f5d2tmroenlsy2tvndmyki4lzpok2wllq","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[{"arguments":"{\"path\":\"index.txt\"}","call_id":"call_c80a312cdcb9565ba95378477b5a66cc","id":"fc_952eccd443bc551ea316b2dfc89f16af","name":"read_file","status":"completed","type":"function_call"}],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"default","status":"completed","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":149,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":19,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":168},"user":null,"moderation":null},"sequence_number":11,"type":"response.completed"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T08:00:09.138339+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-01.yaml new file mode 100644 index 0000000..26e0c34 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-01.yaml @@ -0,0 +1,146 @@ +filename: 2026-11-05-01a1aab8-f354-77e0-ba3b-bb78b5ed058e +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_c80a312cdcb9565ba95378477b5a66cc + id: fc_952eccd443bc551ea316b2dfc89f16af + name: read_file + status: completed + type: function_call + - call_id: call_c80a312cdcb9565ba95378477b5a66cc + output: + - text: garden.txt + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: true + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '931' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-f354-77e0-ba3b-bb78b5ed058e +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: 9b1c2ad4-057a-4130-a960-b3e3f53f25cb + sse: + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865610,"error":null,"frequency_penalty":0.0,"id":"resp_nukjjaf42tep7ovkqftyottixuqnxxax4p7weuu5b43cmytp725q","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":0,"type":"response.created"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865610,"error":null,"frequency_penalty":0.0,"id":"resp_nukjjaf42tep7ovkqftyottixuqnxxax4p7weuu5b43cmytp725q","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":1,"type":"response.in_progress"} + + ' + - ' + + ' + - 'data: {"item":{"arguments":"","call_id":"call_832dd15bb178544bbaf5f59cb6c66241","id":"fc_cabb51fd142754369edc77b439734db5","name":"read_file","status":"in_progress","type":"function_call"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"} + + ' + - ' + + ' + - 'data: {"delta":"{\"","item_id":"fc_cabb51fd142754369edc77b439734db5","obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR","output_index":0,"sequence_number":3,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"path","item_id":"fc_cabb51fd142754369edc77b439734db5","obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01","output_index":0,"sequence_number":4,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"\":\"","item_id":"fc_cabb51fd142754369edc77b439734db5","obfuscation":"abcdefghijklmnopqrstuvwxy","output_index":0,"sequence_number":5,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"garden","item_id":"fc_cabb51fd142754369edc77b439734db5","obfuscation":"abcdefghijklmn","output_index":0,"sequence_number":6,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":".txt","item_id":"fc_cabb51fd142754369edc77b439734db5","obfuscation":"abcdefghijklmnopqrstuvwxyzABCD","output_index":0,"sequence_number":7,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"delta":"\"}","item_id":"fc_cabb51fd142754369edc77b439734db5","obfuscation":"abcdef","output_index":0,"sequence_number":8,"type":"response.function_call_arguments.delta"} + + ' + - ' + + ' + - 'data: {"arguments":"{\"path\":\"garden.txt\"}","item_id":"fc_cabb51fd142754369edc77b439734db5","output_index":0,"sequence_number":9,"type":"response.function_call_arguments.done"} + + ' + - ' + + ' + - 'data: {"item":{"arguments":"{\"path\":\"garden.txt\"}","call_id":"call_832dd15bb178544bbaf5f59cb6c66241","id":"fc_cabb51fd142754369edc77b439734db5","name":"read_file","status":"completed","type":"function_call"},"output_index":0,"sequence_number":10,"type":"response.output_item.done"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":1793865611,"created_at":1793865610,"error":null,"frequency_penalty":0.0,"id":"resp_nukjjaf42tep7ovkqftyottixuqnxxax4p7weuu5b43cmytp725q","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[{"arguments":"{\"path\":\"garden.txt\"}","call_id":"call_832dd15bb178544bbaf5f59cb6c66241","id":"fc_cabb51fd142754369edc77b439734db5","name":"read_file","status":"completed","type":"function_call"}],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"default","status":"completed","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":181,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":19,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":200},"user":null,"moderation":null},"sequence_number":11,"type":"response.completed"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T08:00:10.068955+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-02.yaml new file mode 100644 index 0000000..f655fed --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/bedrock-responses-stream-02.yaml @@ -0,0 +1,197 @@ +filename: 2026-11-05-01a1aab8-f7a9-7140-ba69-93624ea286ab +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_c80a312cdcb9565ba95378477b5a66cc + id: fc_952eccd443bc551ea316b2dfc89f16af + name: read_file + status: completed + type: function_call + - call_id: call_c80a312cdcb9565ba95378477b5a66cc + output: + - text: garden.txt + type: input_text + type: function_call_output + - arguments: '{"path":"garden.txt"}' + call_id: call_832dd15bb178544bbaf5f59cb6c66241 + id: fc_cabb51fd142754369edc77b439734db5 + name: read_file + status: completed + type: function_call + - call_id: call_832dd15bb178544bbaf5f59cb6c66241 + output: + - text: Water the tomatoes every morning and harvest ripe fruit. + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: global.openai.gpt-5.6-luna + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: true + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1310' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /openai/v1/responses + query_params: {} +request_id: 01a1aab8-f7a9-7140-ba69-93624ea286ab +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + x-request-id: d79dad9a-9a51-40da-b844-ba3aaf1aff0c + sse: + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865611,"error":null,"frequency_penalty":0.0,"id":"resp_jdxo56t7dvjd4rto2ebrnpapecby25y3vu4y5uvd377g4lk24dgq","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":0,"type":"response.created"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":null,"created_at":1793865611,"error":null,"frequency_penalty":0.0,"id":"resp_jdxo56t7dvjd4rto2ebrnpapecby25y3vu4y5uvd377g4lk24dgq","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"moderation":null},"sequence_number":1,"type":"response.in_progress"} + + ' + - ' + + ' + - 'data: {"item":{"content":[],"id":"msg_b97e18ab57da56d89a6008b7604beea8","phase":"final_answer","role":"assistant","status":"in_progress","type":"message"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_b97e18ab57da56d89a6008b7604beea8","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"","type":"output_text"},"sequence_number":3,"type":"response.content_part.added"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":"Water","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDE","output_index":0,"sequence_number":4,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" the","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJ","output_index":0,"sequence_number":5,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" tomatoes","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefgh","output_index":0,"sequence_number":6,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" every","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDE","output_index":0,"sequence_number":7,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" morning","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY","output_index":0,"sequence_number":8,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" and","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO","output_index":0,"sequence_number":9,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" harvest","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012","output_index":0,"sequence_number":10,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" ripe","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijk","output_index":0,"sequence_number":11,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":" fruit","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklm","output_index":0,"sequence_number":12,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"delta":".","item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"obfuscation":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU","output_index":0,"sequence_number":13,"type":"response.output_text.delta"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_b97e18ab57da56d89a6008b7604beea8","logprobs":[],"output_index":0,"sequence_number":14,"text":"Water + the tomatoes every morning and harvest ripe fruit.","type":"response.output_text.done"} + + ' + - ' + + ' + - 'data: {"content_index":0,"item_id":"msg_b97e18ab57da56d89a6008b7604beea8","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"Water + the tomatoes every morning and harvest ripe fruit.","type":"output_text"},"sequence_number":15,"type":"response.content_part.done"} + + ' + - ' + + ' + - 'data: {"item":{"content":[{"annotations":[],"logprobs":[],"text":"Water the tomatoes + every morning and harvest ripe fruit.","type":"output_text"}],"id":"msg_b97e18ab57da56d89a6008b7604beea8","phase":"final_answer","role":"assistant","status":"completed","type":"message"},"output_index":0,"sequence_number":16,"type":"response.output_item.done"} + + ' + - ' + + ' + - 'data: {"response":{"background":false,"completed_at":1793865611,"created_at":1793865611,"error":null,"frequency_penalty":0.0,"id":"resp_jdxo56t7dvjd4rto2ebrnpapecby25y3vu4y5uvd377g4lk24dgq","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"global.openai.gpt-5.6-luna","object":"response","output":[{"content":[{"annotations":[],"logprobs":[],"text":"Water + the tomatoes every morning and harvest ripe fruit.","type":"output_text"}],"id":"msg_b97e18ab57da56d89a6008b7604beea8","phase":"final_answer","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":false,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"summary":null,"effort":"none","context":"all_turns"},"safety_identifier":null,"service_tier":"default","status":"completed","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Read + a file by its path.","name":"read_file","output_schema":null,"parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false,"type":"function"}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":221,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":14,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":235},"user":null,"moderation":null},"sequence_number":17,"type":"response.completed"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T08:00:11.177722+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..559a6fb --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-00.yaml @@ -0,0 +1,80 @@ +filename: 2026-11-05-01a1ac2f-c79c-78c0-b1e7-7c1abd0135c3 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: none + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '626' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-c79c-78c0-b1e7-7c1abd0135c3 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + content: '' + role: assistant + tool_calls: + - function: + arguments: '{"path": "index.txt"}' + name: read_file + id: chatcmpl-tool-994c8fb2cc9445e6 + index: 0 + name: null + type: function + tools: null + created: 1793890175 + id: chatcmpl-ed8a5f067641484e98b8ff1658586f71 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 26 + completion_tokens_details: + reasoning_tokens: 0 + output_tokens_details: + reasoning_tokens: 0 + prompt_tokens: 304 + prompt_tokens_details: + cached_tokens: 303 + total_tokens: 330 + headers: + connection: keep-alive + content-length: '658' + content-type: application/json + x-request-id: chatcmpl-ed8a5f067641484e98b8ff1658586f71 + status_code: 200 +timestamp: '2026-11-05T14:49:34.876886+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..0947408 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-01.yaml @@ -0,0 +1,92 @@ +filename: 2026-11-05-01a1ac2f-c9d0-7232-a1e2-635b60b7f357 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - content: '' + role: assistant + tool_calls: + - function: + arguments: '{"path": "index.txt"}' + name: read_file + id: chatcmpl-tool-994c8fb2cc9445e6 + index: 0 + type: function + - content: garden.txt + role: tool + tool_call_id: chatcmpl-tool-994c8fb2cc9445e6 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: none + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '902' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-c9d0-7232-a1e2-635b60b7f357 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + content: '' + role: assistant + tool_calls: + - function: + arguments: '{"path": "garden.txt"}' + name: read_file + id: chatcmpl-tool-aca9f1448e2aa8f3 + index: 0 + name: null + type: function + tools: null + created: 1793890176 + id: chatcmpl-6ba8a0480db84186b4728e87653ce818 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 27 + completion_tokens_details: + reasoning_tokens: 0 + output_tokens_details: + reasoning_tokens: 0 + prompt_tokens: 350 + prompt_tokens_details: + cached_tokens: 0 + total_tokens: 377 + headers: + connection: keep-alive + content-length: '657' + content-type: application/json + x-request-id: chatcmpl-6ba8a0480db84186b4728e87653ce818 + status_code: 200 +timestamp: '2026-11-05T14:49:35.440664+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..6c415b0 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-non_stream-02.yaml @@ -0,0 +1,97 @@ +filename: 2026-11-05-01a1ac2f-cbc4-7152-9ed6-7c1db56f3006 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - content: '' + role: assistant + tool_calls: + - function: + arguments: '{"path": "index.txt"}' + name: read_file + id: chatcmpl-tool-994c8fb2cc9445e6 + index: 0 + type: function + - content: garden.txt + role: tool + tool_call_id: chatcmpl-tool-994c8fb2cc9445e6 + - content: '' + role: assistant + tool_calls: + - function: + arguments: '{"path": "garden.txt"}' + name: read_file + id: chatcmpl-tool-aca9f1448e2aa8f3 + index: 0 + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: chatcmpl-tool-aca9f1448e2aa8f3 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: none + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1225' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-cbc4-7152-9ed6-7c1db56f3006 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'The garden.txt file contains a single sentence: "Water the tomatoes + every morning and harvest ripe fruit."' + role: assistant + tools: null + created: 1793890176 + id: chatcmpl-7d77f28829ee48e3807c661d7118c793 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 21 + completion_tokens_details: + reasoning_tokens: 0 + output_tokens_details: + reasoning_tokens: 0 + prompt_tokens: 403 + prompt_tokens_details: + cached_tokens: 349 + total_tokens: 424 + headers: + connection: keep-alive + content-length: '593' + content-type: application/json + x-request-id: chatcmpl-7d77f28829ee48e3807c661d7118c793 + status_code: 200 +timestamp: '2026-11-05T14:49:35.940052+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-00.yaml new file mode 100644 index 0000000..32e5391 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-00.yaml @@ -0,0 +1,110 @@ +filename: 2026-11-05-01a1ac2f-c1b0-7853-82d9-591f4779d3c7 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: none + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '665' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-c1b0-7853-82d9-591f4779d3c7 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-6e70a859ea3c4485a6d1b5248db86537 + sse: + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"chatcmpl-tool-9e4b1d2fe8c72961","type":"function","function":{"name":"read_file","arguments":""}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"path\": + \""}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"index"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"tool_calls","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-6e70a859ea3c4485a6d1b5248db86537","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":304,"total_tokens":330,"completion_tokens":26,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":0},"output_tokens_details":{"reasoning_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:33.360212+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-01.yaml new file mode 100644 index 0000000..f0f2a6d --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-01.yaml @@ -0,0 +1,127 @@ +filename: 2026-11-05-01a1ac2f-c399-7763-a293-098c1af77e02 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - role: assistant + tool_calls: + - function: + arguments: '{"path": "index.txt"}' + name: read_file + id: chatcmpl-tool-9e4b1d2fe8c72961 + index: 0 + type: function + - content: garden.txt + role: tool + tool_call_id: chatcmpl-tool-9e4b1d2fe8c72961 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: none + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '928' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-c399-7763-a293-098c1af77e02 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-9683ed81783f432c9a2ed0bd96bbde04 + sse: + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"chatcmpl-tool-bffccb6cb252e0d8","type":"function","function":{"name":"read_file","arguments":""}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"path\": + \""}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"g"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"arden"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"tool_calls","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-9683ed81783f432c9a2ed0bd96bbde04","object":"chat.completion.chunk","created":1793890174,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":350,"total_tokens":377,"completion_tokens":27,"prompt_tokens_details":{"cached_tokens":303},"completion_tokens_details":{"reasoning_tokens":0},"output_tokens_details":{"reasoning_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:33.849520+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-02.yaml new file mode 100644 index 0000000..45124b6 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-chat_completions-stream-02.yaml @@ -0,0 +1,244 @@ +filename: 2026-11-05-01a1ac2f-c596-7bd0-af6e-422f5e240059 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - role: assistant + tool_calls: + - function: + arguments: '{"path": "index.txt"}' + name: read_file + id: chatcmpl-tool-9e4b1d2fe8c72961 + index: 0 + type: function + - content: garden.txt + role: tool + tool_call_id: chatcmpl-tool-9e4b1d2fe8c72961 + - role: assistant + tool_calls: + - function: + arguments: '{"path": "garden.txt"}' + name: read_file + id: chatcmpl-tool-bffccb6cb252e0d8 + index: 0 + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: chatcmpl-tool-bffccb6cb252e0d8 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: none + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1238' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ac2f-c596-7bd0-af6e-422f5e240059 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-05568d8489e94c378f0766f9a6927207 + sse: + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"The"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + file"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + garden"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":".txt"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + contains"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + single"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + sentence"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + instruct"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"ing"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + water"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + tomatoes"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + every"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + morning"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + harvest"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + ripe"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + fruit"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"stop","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-05568d8489e94c378f0766f9a6927207","object":"chat.completion.chunk","created":1793890175,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":403,"total_tokens":425,"completion_tokens":22,"prompt_tokens_details":{"cached_tokens":349},"completion_tokens_details":{"reasoning_tokens":0},"output_tokens_details":{"reasoning_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:34.358694+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-00.yaml new file mode 100644 index 0000000..6acd313 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-00.yaml @@ -0,0 +1,112 @@ +filename: 2026-11-04-01a1a479-3920-75e2-8891-7d59ab220d38 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '588' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-3920-75e2-8891-7d59ab220d38 +response: + body: + background: null + created_at: 1793760770 + error: null + id: resp_422ccdbecde248769df4d281b44096dd + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-b5fe5a18789bed43 + id: fc_a41631b60d3748b3877834672cfd85fb + name: add + status: completed + type: function_call + parallel_tool_calls: false + previous_response_id: null + reasoning: + effort: none + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 325 + input_tokens_details: + cached_tokens: 0 + output_tokens: 31 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 356 + user: null + headers: + connection: keep-alive + content-length: '1151' + content-type: application/json + x-request-id: 3dfbfddf-bd70-45a4-b511-e770bae3b646 + status_code: 200 +timestamp: '2026-11-04T02:52:50.336420+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-01.yaml new file mode 100644 index 0000000..12ce323 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-01.yaml @@ -0,0 +1,121 @@ +filename: 2026-11-04-01a1a479-3ca7-7e32-84aa-5ca8ec32ac30 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-b5fe5a18789bed43 + id: fc_a41631b60d3748b3877834672cfd85fb + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-b5fe5a18789bed43 + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '856' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-3ca7-7e32-84aa-5ca8ec32ac30 +response: + body: + background: null + created_at: 1793760771 + error: null + id: resp_f59dba79b3a24d17a4e016d2de882bbe + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - arguments: '{"a": 5, "b": 4}' + call_id: chatcmpl-tool-bb94cf4a6795034f + id: fc_6e9d59f1a9f94f57a826f8ee13d97f35 + name: add + status: completed + type: function_call + parallel_tool_calls: false + previous_response_id: null + reasoning: + effort: none + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 375 + input_tokens_details: + cached_tokens: 324 + output_tokens: 31 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 406 + user: null + headers: + connection: keep-alive + content-length: '1153' + content-type: application/json + x-request-id: d065ff0e-6d9b-470b-b3e0-302b4826357d + status_code: 200 +timestamp: '2026-11-04T02:52:51.239960+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-02.yaml new file mode 100644 index 0000000..495e69b --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-non_stream-02.yaml @@ -0,0 +1,128 @@ +filename: 2026-11-04-01a1a479-3f9b-7632-be50-6f95cb0f280b +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-b5fe5a18789bed43 + id: fc_a41631b60d3748b3877834672cfd85fb + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-b5fe5a18789bed43 + output: '5' + type: function_call_output + - arguments: '{"a": 5, "b": 4}' + call_id: chatcmpl-tool-bb94cf4a6795034f + id: fc_6e9d59f1a9f94f57a826f8ee13d97f35 + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-bb94cf4a6795034f + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: false + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1098' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-3f9b-7632-be50-6f95cb0f280b +response: + body: + background: null + created_at: 1793760772 + error: null + id: resp_dec370d7818b47aebcdce61706ef8c82 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - content: + - annotations: [] + text: The final answer is 9. + type: output_text + id: msg_49196a1274414e8cbcca6f8ae754d850 + role: assistant + status: completed + type: message + parallel_tool_calls: false + previous_response_id: null + reasoning: + effort: none + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 146 + input_tokens_details: + cached_tokens: 0 + output_tokens: 8 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 154 + user: null + headers: + connection: keep-alive + content-length: '1131' + content-type: application/json + x-request-id: c126d604-fcb8-4aff-ac48-c0707f3decb7 + status_code: 200 +timestamp: '2026-11-04T02:52:51.995238+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-00.yaml new file mode 100644 index 0000000..11b48c0 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-00.yaml @@ -0,0 +1,119 @@ +filename: 2026-11-04-01a1a479-4d46-7d13-b5b1-7a82e46888a3 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '587' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-4d46-7d13-b5b1-7a82e46888a3 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 8764e915-c874-4450-bcd8-21946e65f337 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_fca348903bbc49ce8056b1d07c5b7d52","object":"response","created_at":1793760775,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_fca348903bbc49ce8056b1d07c5b7d52","object":"response","created_at":1793760775,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"function_call","id":"fc_885d0b3c71cf42a5a856d31915d77ece","status":"in_progress","call_id":"chatcmpl-tool-bf4314efe4595302","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":3,"item_id":"fc_885d0b3c71cf42a5a856d31915d77ece","output_index":0,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":4,"item_id":"fc_885d0b3c71cf42a5a856d31915d77ece","output_index":0,"delta":"2, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_885d0b3c71cf42a5a856d31915d77ece","output_index":0,"delta":"3}"} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":6,"item_id":"fc_885d0b3c71cf42a5a856d31915d77ece","output_index":0,"arguments":"{\"a\": + 2, \"b\": 3}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":7,"output_index":0,"item":{"type":"function_call","id":"fc_885d0b3c71cf42a5a856d31915d77ece","status":"completed","call_id":"chatcmpl-tool-bf4314efe4595302","name":"add","arguments":"{\"a\": + 2, \"b\": 3}"}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":8,"response":{"id":"resp_fca348903bbc49ce8056b1d07c5b7d52","object":"response","created_at":1793760776,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"fc_885d0b3c71cf42a5a856d31915d77ece","type":"function_call","call_id":"chatcmpl-tool-bf4314efe4595302","name":"add","arguments":"{\"a\": + 2, \"b\": 3}","status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":325,"output_tokens":31,"total_tokens":356,"input_tokens_details":{"cached_tokens":324},"output_tokens_details":{"reasoning_tokens":0}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:52:55.494432+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-01.yaml new file mode 100644 index 0000000..3217be3 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-01.yaml @@ -0,0 +1,128 @@ +filename: 2026-11-04-01a1a479-53a6-7053-adfb-bf546bf0e004 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-bf4314efe4595302 + id: fc_885d0b3c71cf42a5a856d31915d77ece + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-bf4314efe4595302 + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '855' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-53a6-7053-adfb-bf546bf0e004 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 3eb0684a-367a-4fe7-9cb8-58922d190d70 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_51408536dfa84b55a32efa380cac3a7a","object":"response","created_at":1793760777,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_51408536dfa84b55a32efa380cac3a7a","object":"response","created_at":1793760777,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"function_call","id":"fc_b965613629284107a80239de17b03e8d","status":"in_progress","call_id":"chatcmpl-tool-bde540262d899c7f","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":3,"item_id":"fc_b965613629284107a80239de17b03e8d","output_index":0,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":4,"item_id":"fc_b965613629284107a80239de17b03e8d","output_index":0,"delta":"5, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_b965613629284107a80239de17b03e8d","output_index":0,"delta":"4}"} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":6,"item_id":"fc_b965613629284107a80239de17b03e8d","output_index":0,"arguments":"{\"a\": + 5, \"b\": 4}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":7,"output_index":0,"item":{"type":"function_call","id":"fc_b965613629284107a80239de17b03e8d","status":"completed","call_id":"chatcmpl-tool-bde540262d899c7f","name":"add","arguments":"{\"a\": + 5, \"b\": 4}"}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":8,"response":{"id":"resp_51408536dfa84b55a32efa380cac3a7a","object":"response","created_at":1793760777,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"fc_b965613629284107a80239de17b03e8d","type":"function_call","call_id":"chatcmpl-tool-bde540262d899c7f","name":"add","arguments":"{\"a\": + 5, \"b\": 4}","status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":375,"output_tokens":31,"total_tokens":406,"input_tokens_details":{"cached_tokens":374},"output_tokens_details":{"reasoning_tokens":0}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:52:57.126660+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-02.yaml new file mode 100644 index 0000000..ef2f6bc --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/fireworks-responses-stream-02.yaml @@ -0,0 +1,192 @@ +filename: 2026-11-04-01a1a479-5646-7cf0-8750-549f9e33ed1e +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-bf4314efe4595302 + id: fc_885d0b3c71cf42a5a856d31915d77ece + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-bf4314efe4595302 + output: '5' + type: function_call_output + - arguments: '{"a": 5, "b": 4}' + call_id: chatcmpl-tool-bde540262d899c7f + id: fc_b965613629284107a80239de17b03e8d + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-bde540262d899c7f + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: none + store: false + stream: true + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1097' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-5646-7cf0-8750-549f9e33ed1e +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 559cdcfe-8fb9-4b9a-8410-12048f7d13f7 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_0c90cf2322234b22ad5183d9b59861a2","object":"response","created_at":1793760777,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_0c90cf2322234b22ad5183d9b59861a2","object":"response","created_at":1793760777,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"message","id":"msg_eeedea70eadd486083e1cf10ab828020","status":"in_progress","role":"assistant","content":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":"The","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":" + final","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":" + answer","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":" + is","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":"9","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":" ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":"\n","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"delta":"6","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","sequence_number":14,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"text":"The + final answer is 9. \n6","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","sequence_number":15,"item_id":"msg_eeedea70eadd486083e1cf10ab828020","output_index":0,"content_index":0,"part":{"type":"output_text","text":"The + final answer is 9. \n6","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":16,"output_index":0,"item":{"type":"message","id":"msg_eeedea70eadd486083e1cf10ab828020","status":"completed","role":"assistant","content":[{"type":"output_text","text":"The + final answer is 9. \n6","annotations":[]}]}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":17,"response":{"id":"resp_0c90cf2322234b22ad5183d9b59861a2","object":"response","created_at":1793760778,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"msg_eeedea70eadd486083e1cf10ab828020","type":"message","role":"assistant","content":[{"type":"output_text","text":"The + final answer is 9. \n6","annotations":[]}],"status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":146,"output_tokens":11,"total_tokens":157,"input_tokens_details":{"cached_tokens":145},"output_tokens_details":{"reasoning_tokens":0}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:52:57.798928+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..885dfbe --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-00.yaml @@ -0,0 +1,70 @@ +filename: 2026-11-06-01a1af0d-4638-7d01-befb-3c9686d2e070 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: gemini-3.1-flash-lite + parallel_tool_calls: false + reasoning_effort: minimal + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '594' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-4638-7d01-befb-3c9686d2e070 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0T6SCCimkhPCQSO5eGtVGq6G0HBFdCkpxca5AjDbs/sFSD7U3o8+a/X8pqjYGmKKt8xyDbUSYDuM0kK8NjfiRpNCSJaDQwOBtCNM/nZ9A+dKGlA0QGyK9PGXKu2LyJQ0PVis6NAYn1eiiq6dt0 + function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_14462867661861740233 + type: function + created: 1793938245 + id: RVPtasDMFNWEytMPucGewAI + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 18 + prompt_tokens: 75 + total_tokens: 93 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-06T04:10:45.176067+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..d201ddb --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-01.yaml @@ -0,0 +1,83 @@ +filename: 2026-11-06-01a1af0d-4876-7922-81cb-450444ee4f5c +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0T6SCCimkhPCQSO5eGtVGq6G0HBFdCkpxca5AjDbs/sFSD7U3o8+a/X8pqjYGmKKt8xyDbUSYDuM0kK8NjfiRpNCSJaDQwOBtCNM/nZ9A+dKGlA0QGyK9PGXKu2LyJQ0PVis6NAYn1eiiq6dt0 + function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_14462867661861740233 + type: function + - content: garden.txt + role: tool + tool_call_id: call_14462867661861740233 + model: gemini-3.1-flash-lite + parallel_tool_calls: false + reasoning_effort: minimal + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1044' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-4876-7922-81cb-450444ee4f5c +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0TBTxFH37SuNO5TucmgeOU0UnuKRqRa1izfZY5KYP+PRvZMLE/tW3Nl6gmiIS0rWAUuYqCOIYgzFsXmnSIlAqZtCt/xn2dYriFlMhGSn5XirTmVOEnFBhJwqVVWeTVJ6nruuAGJfyMurHG8fht + function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_10396871796320240256 + type: function + created: 1793938246 + id: RVPtaqyJN5bfytMPrcuRuAI + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 18 + prompt_tokens: 109 + total_tokens: 127 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-06T04:10:45.750785+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..0f21554 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-non_stream-02.yaml @@ -0,0 +1,92 @@ +filename: 2026-11-06-01a1af0d-4b37-7f81-a427-c507e25db9f7 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0T6SCCimkhPCQSO5eGtVGq6G0HBFdCkpxca5AjDbs/sFSD7U3o8+a/X8pqjYGmKKt8xyDbUSYDuM0kK8NjfiRpNCSJaDQwOBtCNM/nZ9A+dKGlA0QGyK9PGXKu2LyJQ0PVis6NAYn1eiiq6dt0 + function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_14462867661861740233 + type: function + - content: garden.txt + role: tool + tool_call_id: call_14462867661861740233 + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0TBTxFH37SuNO5TucmgeOU0UnuKRqRa1izfZY5KYP+PRvZMLE/tW3Nl6gmiIS0rWAUuYqCOIYgzFsXmnSIlAqZtCt/xn2dYriFlMhGSn5XirTmVOEnFBhJwqVVWeTVJ6nruuAGJfyMurHG8fht + function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_10396871796320240256 + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: call_10396871796320240256 + model: gemini-3.1-flash-lite + parallel_tool_calls: false + reasoning_effort: minimal + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1541' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-4b37-7f81-a427-c507e25db9f7 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: The document provides instructions to water tomato plants every morning + and harvest the fruit once ripe. + extra_content: + google: + thought_signature: EnMKcQFpFH0T76NfxMGqIgbHIghfsbt7w9NQ3tIJ7cb05DnQY5DyayumFeZzlo60tV4okEXZOhI9Bj3kPraJ34hIyQnw2ZC2ddSGS+n/2FJUt1EeffyVEULJAc4yBs6vG/mcECoNjnNdefcji99kEfBqfSve + role: assistant + created: 1793938247 + id: RlPtapWuJeThytMPteOWwAE + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 17 + prompt_tokens: 150 + total_tokens: 167 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-06T04:10:46.455825+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-00.yaml new file mode 100644 index 0000000..0862ffb --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-00.yaml @@ -0,0 +1,71 @@ +filename: 2026-11-06-01a1af0d-3d24-76b3-977f-82ee94478583 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: gemini-3.1-flash-lite + parallel_tool_calls: false + reasoning_effort: minimal + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '633' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-3d24-76b3-977f-82ee94478583 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"role":"assistant","tool_calls":[{"extra_content":{"google":{"thought_signature":"EnMKcQFpFH0TBCf3MhrW5EPapkFsL4ST3JJ/OPCqi+MtWEkiDq6ffxc2TtAGZA20egiuVTqmyyVEVJRJjpRSBolUxs+eN0OyqdD72aLBfG1HI8aZE/pvrFgRsgl7AMl5WR7u3T3qTpGOcMcU7QX7pVP7dD9l"}},"function":{"arguments":"{\"path\":\"index.txt\"}","name":"read_file"},"id":"call_17906014837408201138","type":"function"}]},"index":0}],"created":1793938243,"id":"Q1Ptapm3A9-xuMYPz9-jsAI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":18,"prompt_tokens":75,"total_tokens":93}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"role":"assistant"},"finish_reason":"stop","index":0}],"created":1793938243,"id":"Q1Ptapm3A9-xuMYPz9-jsAI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":18,"prompt_tokens":75,"total_tokens":93}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-06T04:10:42.852359+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-01.yaml new file mode 100644 index 0000000..2bc6df2 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-01.yaml @@ -0,0 +1,84 @@ +filename: 2026-11-06-01a1af0d-3fea-76d3-8e0e-7af288a71cb2 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0TBCf3MhrW5EPapkFsL4ST3JJ/OPCqi+MtWEkiDq6ffxc2TtAGZA20egiuVTqmyyVEVJRJjpRSBolUxs+eN0OyqdD72aLBfG1HI8aZE/pvrFgRsgl7AMl5WR7u3T3qTpGOcMcU7QX7pVP7dD9l + function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_17906014837408201138 + type: function + - content: garden.txt + role: tool + tool_call_id: call_17906014837408201138 + model: gemini-3.1-flash-lite + parallel_tool_calls: false + reasoning_effort: minimal + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1083' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-3fea-76d3-8e0e-7af288a71cb2 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"role":"assistant","tool_calls":[{"extra_content":{"google":{"thought_signature":"EnMKcQFpFH0TnD9yNQ7UjAisfTTr7kiJhpVqui8fz4/yLFokDYnxW3jfYVKD/XeH7Djx3BLwPQ9EY8vakquXM97L+WZG4ekwD+iYMv4ZkEkbuKHEQODlsHv9NAWP2msJXzu7GuJtH0kDMRiT1JA6pA0hqQk1"}},"function":{"arguments":"{\"path\":\"garden.txt\"}","name":"read_file"},"id":"call_2523317766613766412","type":"function"}]},"index":0}],"created":1793938244,"id":"Q1PtaqmTLuWtuMYPz5aQqAI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":18,"prompt_tokens":109,"total_tokens":127}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"role":"assistant"},"finish_reason":"stop","index":0}],"created":1793938244,"id":"Q1PtaqmTLuWtuMYPz5aQqAI","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":18,"prompt_tokens":109,"total_tokens":127}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-06T04:10:43.562780+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-02.yaml new file mode 100644 index 0000000..c106a0a --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/gemini-chat_completions-stream-02.yaml @@ -0,0 +1,111 @@ +filename: 2026-11-06-01a1af0d-4312-7af2-b5f9-2269a64e88ef +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0TBCf3MhrW5EPapkFsL4ST3JJ/OPCqi+MtWEkiDq6ffxc2TtAGZA20egiuVTqmyyVEVJRJjpRSBolUxs+eN0OyqdD72aLBfG1HI8aZE/pvrFgRsgl7AMl5WR7u3T3qTpGOcMcU7QX7pVP7dD9l + function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_17906014837408201138 + type: function + - content: garden.txt + role: tool + tool_call_id: call_17906014837408201138 + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EnMKcQFpFH0TnD9yNQ7UjAisfTTr7kiJhpVqui8fz4/yLFokDYnxW3jfYVKD/XeH7Djx3BLwPQ9EY8vakquXM97L+WZG4ekwD+iYMv4ZkEkbuKHEQODlsHv9NAWP2msJXzu7GuJtH0kDMRiT1JA6pA0hqQk1 + function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_2523317766613766412 + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: call_2523317766613766412 + model: gemini-3.1-flash-lite + parallel_tool_calls: false + reasoning_effort: minimal + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1578' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1af0d-4312-7af2-b5f9-2269a64e88ef +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"This","role":"assistant"},"index":0}],"created":1793938245,"id":"RFPtauT8IaKO1sgPpeLp8QE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":1,"prompt_tokens":150,"total_tokens":151}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" text provides instructions for maintaining + a tomato plant, specifically advising that it be watered every","role":"assistant"},"index":0}],"created":1793938245,"id":"RFPtauT8IaKO1sgPpeLp8QE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":17,"prompt_tokens":150,"total_tokens":167}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":" morning and that ripe fruit should be + harvested.","role":"assistant"},"index":0}],"created":1793938245,"id":"RFPtauT8IaKO1sgPpeLp8QE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":26,"prompt_tokens":150,"total_tokens":176}} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EnMKcQFpFH0TzkHQdm5/P0OvnM2takhCxvdKxVGMg2EnUZzX+zjE8qZVLmvPpexJ6pD8yYQqzCtZWzOostdaikJpDmes5aVujqYEGwB2c0QJLXM35bIAuh66dmfulTdll1eL1D2f80HsyIgiU/Q+FnZp1UCV"}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1793938245,"id":"RFPtauT8IaKO1sgPpeLp8QE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk","usage":{"completion_tokens":26,"prompt_tokens":150,"total_tokens":176}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-06T04:10:44.370114+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-00.yaml new file mode 100644 index 0000000..b6f17bc --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-00.yaml @@ -0,0 +1,130 @@ +filename: 2026-11-04-01a1a489-c140-7c31-aaf2-46a14bcfd428 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 1024 + model: nvidia/nemotron-3.5-lightning:free + parallel_tool_calls: false + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: none + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '655' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a489-c140-7c31-aaf2-46a14bcfd428 +response: + body: + access_programs: null + background: false + completed_at: 1793761854 + created_at: 1793761853 + error: null + frequency_penalty: 0 + id: gen-1793761853-OkSXGYRZKQ9cjET5sYIr + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: nvidia/nemotron-3.5-lightning:free + object: response + output: + - arguments: "{\n \"a\": 2,\n \"b\": 3\n}" + call_id: call-8c844a23-0c02-41a4-977b-449244714607 + id: fc_tmp_gkvflek9nk4 + name: add + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_options: null + reasoning: + effort: none + safety_identifier: null + service_tier: auto + status: completed + store: false + temperature: 1 + text: + format: + type: text + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + strict: null + type: function + top_logprobs: 0 + top_p: 1 + truncation: disabled + usage: + cost: 0 + cost_details: + upstream_inference_cost: 0 + upstream_inference_input_cost: 0 + upstream_inference_output_cost: 0 + input_tokens: 324 + input_tokens_details: + cached_tokens: 0 + is_byok: false + output_tokens: 17 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 341 + headers: + connection: keep-alive + content-type: application/json + status_code: 200 +timestamp: '2026-11-04T03:10:53.761005+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-01.yaml new file mode 100644 index 0000000..f9444a9 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-01.yaml @@ -0,0 +1,139 @@ +filename: 2026-11-04-01a1a489-c48d-7883-9d54-8123763449aa +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - arguments: "{\n \"a\": 2,\n \"b\": 3\n}" + call_id: call-8c844a23-0c02-41a4-977b-449244714607 + id: fc_tmp_gkvflek9nk4 + name: add + status: completed + type: function_call + - call_id: call-8c844a23-0c02-41a4-977b-449244714607 + output: '5' + type: function_call_output + max_output_tokens: 1024 + model: nvidia/nemotron-3.5-lightning:free + parallel_tool_calls: false + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: none + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '937' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a489-c48d-7883-9d54-8123763449aa +response: + body: + access_programs: null + background: false + completed_at: 1793761855 + created_at: 1793761854 + error: null + frequency_penalty: 0 + id: gen-1793761854-6ITQQDAOFYotfXztJ2hy + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: nvidia/nemotron-3.5-lightning:free + object: response + output: + - arguments: '{ "a": 5, "b": 4 }' + call_id: call-4cf2492f-dc77-4855-a424-e9a5c45fb859 + id: fc_tmp_wcw53tswhdb + name: add + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_options: null + reasoning: + effort: none + safety_identifier: null + service_tier: auto + status: completed + store: false + temperature: 1 + text: + format: + type: text + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + strict: null + type: function + top_logprobs: 0 + top_p: 1 + truncation: disabled + usage: + cost: 0 + cost_details: + upstream_inference_cost: 0 + upstream_inference_input_cost: 0 + upstream_inference_output_cost: 0 + input_tokens: 374 + input_tokens_details: + cached_tokens: 0 + is_byok: false + output_tokens: 14 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 388 + headers: + connection: keep-alive + content-type: application/json + status_code: 200 +timestamp: '2026-11-04T03:10:54.605734+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-02.yaml new file mode 100644 index 0000000..6210310 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/openrouter-responses-non_stream-02.yaml @@ -0,0 +1,147 @@ +filename: 2026-11-04-01a1a489-c7b3-7de1-8fdf-32558b93a45f +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - arguments: "{\n \"a\": 2,\n \"b\": 3\n}" + call_id: call-8c844a23-0c02-41a4-977b-449244714607 + id: fc_tmp_gkvflek9nk4 + name: add + status: completed + type: function_call + - call_id: call-8c844a23-0c02-41a4-977b-449244714607 + output: '5' + type: function_call_output + - arguments: '{ "a": 5, "b": 4 }' + call_id: call-4cf2492f-dc77-4855-a424-e9a5c45fb859 + id: fc_tmp_wcw53tswhdb + name: add + status: completed + type: function_call + - call_id: call-4cf2492f-dc77-4855-a424-e9a5c45fb859 + output: '9' + type: function_call_output + max_output_tokens: 1024 + model: nvidia/nemotron-3.5-lightning:free + parallel_tool_calls: false + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: none + store: false + stream: false + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1186' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a489-c7b3-7de1-8fdf-32558b93a45f +response: + body: + access_programs: null + background: false + completed_at: 1793761855 + created_at: 1793761855 + error: null + frequency_penalty: 0 + id: gen-1793761855-Lzd1WrGruzJRPaaph72s + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: nvidia/nemotron-3.5-lightning:free + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: The final answer is 9. + type: output_text + id: msg_tmp_jpnts83gb0l + role: assistant + status: completed + type: message + parallel_tool_calls: false + presence_penalty: 0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_options: null + reasoning: + effort: none + safety_identifier: null + service_tier: auto + status: completed + store: false + temperature: 1 + text: + format: + type: text + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + strict: null + type: function + top_logprobs: 0 + top_p: 1 + truncation: disabled + usage: + cost: 0 + cost_details: + upstream_inference_cost: 0 + upstream_inference_input_cost: 0 + upstream_inference_output_cost: 0 + input_tokens: 146 + input_tokens_details: + cached_tokens: 0 + is_byok: false + output_tokens: 8 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 154 + headers: + connection: keep-alive + content-type: application/json + status_code: 200 +timestamp: '2026-11-04T03:10:55.411275+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..6fb3f67 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-00.yaml @@ -0,0 +1,75 @@ +filename: 2026-11-05-01a1ac2f-f33a-7363-867d-6ab8b11a7a3a +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: Qwen/Qwen3.5-9B + parallel_tool_calls: false + reasoning: + enabled: false + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '589' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2f-f33a-7363-867d-6ab8b11a7a3a +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + matched_stop: 248046 + message: + reasoning_content: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_01a1ac2ff5767011ac9a00e7 + type: function + created: 1793890186 + id: 6eb500e9-aws_as1 + model: Qwen/Qwen3.5-9B + object: chat.completion + system_fingerprint: default + usage: + completion_tokens: 26 + prompt_tokens: 308 + prompt_tokens_details: + cached_tokens: 256 + total_tokens: 334 + headers: + connection: keep-alive + content-type: application/json + x-request-id: 6eb500e9-aws_as1 + status_code: 200 +timestamp: '2026-11-05T14:49:46.042564+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..a53c27e --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-01.yaml @@ -0,0 +1,86 @@ +filename: 2026-11-05-01a1ac2f-f5de-7a50-91e5-91c3595d8a6b +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - reasoning_content: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_01a1ac2ff5767011ac9a00e7 + type: function + - content: garden.txt + role: tool + tool_call_id: call_01a1ac2ff5767011ac9a00e7 + model: Qwen/Qwen3.5-9B + parallel_tool_calls: false + reasoning: + enabled: false + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '864' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2f-f5de-7a50-91e5-91c3595d8a6b +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + matched_stop: 248046 + message: + reasoning_content: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_01a1ac2ff7357f11a7334c0b + type: function + created: 1793890186 + id: 07ec4dd2-aws_as1 + model: Qwen/Qwen3.5-9B + object: chat.completion + system_fingerprint: default + usage: + completion_tokens: 27 + prompt_tokens: 354 + prompt_tokens_details: + cached_tokens: 0 + total_tokens: 381 + headers: + connection: keep-alive + content-type: application/json + x-request-id: 07ec4dd2-aws_as1 + status_code: 200 +timestamp: '2026-11-05T14:49:46.718723+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..b184ab4 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-non_stream-02.yaml @@ -0,0 +1,93 @@ +filename: 2026-11-05-01a1ac2f-f7a1-79c0-b86f-e6b63706fd6e +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - reasoning_content: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"index.txt"}' + name: read_file + id: call_01a1ac2ff5767011ac9a00e7 + type: function + - content: garden.txt + role: tool + tool_call_id: call_01a1ac2ff5767011ac9a00e7 + - reasoning_content: null + role: assistant + tool_calls: + - function: + arguments: '{"path":"garden.txt"}' + name: read_file + id: call_01a1ac2ff7357f11a7334c0b + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: call_01a1ac2ff7357f11a7334c0b + model: Qwen/Qwen3.5-9B + parallel_tool_calls: false + reasoning: + enabled: false + stream: false + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1186' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2f-f7a1-79c0-b86f-e6b63706fd6e +response: + body: + choices: + - finish_reason: stop + index: 0 + matched_stop: 248046 + message: + content: The file describes a routine for watering tomatoes daily and harvesting + the ripe ones. + reasoning_content: null + role: assistant + created: 1793890187 + id: 0dcc2f5e-aws_as1 + model: Qwen/Qwen3.5-9B + object: chat.completion + system_fingerprint: default + usage: + completion_tokens: 16 + prompt_tokens: 408 + prompt_tokens_details: + cached_tokens: 320 + total_tokens: 424 + headers: + connection: keep-alive + content-type: application/json + x-request-id: 0dcc2f5e-aws_as1 + status_code: 200 +timestamp: '2026-11-05T14:49:47.169721+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-00.yaml new file mode 100644 index 0000000..f8383c8 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-00.yaml @@ -0,0 +1,100 @@ +filename: 2026-11-05-01a1ac2f-ed36-7de3-a615-28ba500698cb +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + model: Qwen/Qwen3.5-9B + parallel_tool_calls: false + reasoning: + enabled: false + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '628' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2f-ed36-7de3-a615-28ba500698cb +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: ef57d52e-aws_as1 + sse: + - 'data: {"id":"ef57d52e-aws_as1","object":"chat.completion.chunk","created":1793890184,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"ef57d52e-aws_as1","object":"chat.completion.chunk","created":1793890184,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","tool_calls":[{"index":0,"id":"call_01a1ac2feea07fe2b00e3a32","type":"function","function":{"name":"read_file"}}],"reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"ef57d52e-aws_as1","object":"chat.completion.chunk","created":1793890184,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"{\"path\": + \"index.txt\""}}],"reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"ef57d52e-aws_as1","object":"chat.completion.chunk","created":1793890184,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"}"}}],"reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"ef57d52e-aws_as1","object":"chat.completion.chunk","created":1793890184,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":null},"logprobs":null,"finish_reason":"tool_calls","matched_stop":248046}]} + + ' + - ' + + ' + - 'data: {"id":"ef57d52e-aws_as1","object":"chat.completion.chunk","created":1793890184,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":308,"completion_tokens":26,"total_tokens":334,"prompt_tokens_details":{"cached_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:44.502596+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-01.yaml new file mode 100644 index 0000000..a1691f4 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-01.yaml @@ -0,0 +1,116 @@ +filename: 2026-11-05-01a1ac2f-ef7d-74d3-a8a3-79e66e3c21e6 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - annotations: null + audio: null + content: null + function_call: null + reasoning_content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path": "index.txt"}' + name: read_file + id: call_01a1ac2feea07fe2b00e3a32 + type: function + - content: garden.txt + role: tool + tool_call_id: call_01a1ac2feea07fe2b00e3a32 + model: Qwen/Qwen3.5-9B + parallel_tool_calls: false + reasoning: + enabled: false + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '987' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2f-ef7d-74d3-a8a3-79e66e3c21e6 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: a42f4dd2-aws_as1 + sse: + - 'data: {"id":"a42f4dd2-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"a42f4dd2-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","tool_calls":[{"index":0,"id":"call_01a1ac2ff05a7671aecc4e96","type":"function","function":{"name":"read_file"}}],"reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"a42f4dd2-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"{\"path\": + \"garden.txt\""}}],"reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"a42f4dd2-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"}"}}],"reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"a42f4dd2-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":null},"logprobs":null,"finish_reason":"tool_calls","matched_stop":248046}]} + + ' + - ' + + ' + - 'data: {"id":"a42f4dd2-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":354,"completion_tokens":27,"total_tokens":381,"prompt_tokens_details":{"cached_tokens":256}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:45.085233+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-02.yaml new file mode 100644 index 0000000..8afd0de --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-chat_completions-stream-02.yaml @@ -0,0 +1,236 @@ +filename: 2026-11-05-01a1ac2f-f143-7980-a76d-4396736d7336 +request: + body: + max_completion_tokens: 1024 + messages: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: text + role: user + - annotations: null + audio: null + content: null + function_call: null + reasoning_content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path": "index.txt"}' + name: read_file + id: call_01a1ac2feea07fe2b00e3a32 + type: function + - content: garden.txt + role: tool + tool_call_id: call_01a1ac2feea07fe2b00e3a32 + - annotations: null + audio: null + content: null + function_call: null + reasoning_content: null + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"path": "garden.txt"}' + name: read_file + id: call_01a1ac2ff05a7671aecc4e96 + type: function + - content: Water the tomatoes every morning and harvest ripe fruit. + role: tool + tool_call_id: call_01a1ac2ff05a7671aecc4e96 + model: Qwen/Qwen3.5-9B + parallel_tool_calls: false + reasoning: + enabled: false + stream: true + stream_options: + include_usage: true + tool_choice: auto + tools: + - function: + description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1393' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ac2f-f143-7980-a76d-4396736d7336 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 3a954993-aws_as1 + sse: + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"The","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + instructions","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + state","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + that","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + tomatoes","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + should","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + be","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + water","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"ed","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + every","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + morning","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + and","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + ripe","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + fruit","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + should","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + be","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + harvested","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":".","reasoning_content":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":null},"logprobs":null,"finish_reason":"stop","matched_stop":248046}]} + + ' + - ' + + ' + - 'data: {"id":"3a954993-aws_as1","object":"chat.completion.chunk","created":1793890185,"model":"Qwen/Qwen3.5-9B","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":408,"completion_tokens":19,"total_tokens":427,"prompt_tokens_details":{"cached_tokens":256}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-05T14:49:45.539766+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-00.yaml new file mode 100644 index 0000000..67f2e8b --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-00.yaml @@ -0,0 +1,115 @@ +filename: 2026-11-05-01a1a9cb-0bd2-7431-a1ba-d41e005db75a +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: minimal + store: false + stream: false + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '592' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9cb-0bd2-7431-a1ba-d41e005db75a +response: + body: + background: false + completed_at: 1793850019 + created_at: 1793850019 + error: null + frequency_penalty: 0.0 + id: resp_01a1a9cb-0d88-7242-99a0-a8f41c235b85 + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - arguments: '{"path":"index.txt"}' + call_id: call_01a1a9cb0df07a72b0092b2f + id: fc_call_01a1a9cb0df07a72b0092b2f + name: read_file + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: minimal + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 182 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 128 + output_tokens: 12 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 194 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: e0d08ad2-aws_as1 + status_code: 200 +timestamp: '2026-11-05T03:40:18.770770+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-01.yaml new file mode 100644 index 0000000..c66d8b3 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-01.yaml @@ -0,0 +1,135 @@ +filename: 2026-11-05-01a1a9cb-4d12-7ff3-bf9a-b7a28d308e3d +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_01a1a9cb0df07a72b0092b2f + id: fc_call_01a1a9cb0df07a72b0092b2f + name: read_file + status: completed + type: function_call + - call_id: call_01a1a9cb0df07a72b0092b2f + output: + - text: garden.txt + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: minimal + store: false + stream: false + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '905' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9cb-4d12-7ff3-bf9a-b7a28d308e3d +response: + body: + background: false + completed_at: 1793850037 + created_at: 1793850037 + error: null + frequency_penalty: 0.0 + id: resp_01a1a9cb-5571-7541-962e-9147370622cb + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - content: + - annotations: [] + text: The file `index.txt` contains the path `garden.txt`. Let me read that + file now. + type: output_text + id: msg_0f26025d-aws_as1-01a1a9cb-5572-7e32-8fd7-61aeed733e54 + role: assistant + status: completed + type: message + - arguments: '{"path":"garden.txt"}' + call_id: call_01a1a9cb561876b2be7c103a + id: fc_call_01a1a9cb561876b2be7c103a + name: read_file + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: minimal + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 203 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 192 + output_tokens: 34 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 237 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: 0f26025d-aws_as1 + status_code: 200 +timestamp: '2026-11-05T03:40:35.474314+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-02.yaml new file mode 100644 index 0000000..a4cbef1 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-non_stream-02.yaml @@ -0,0 +1,149 @@ +filename: 2026-11-05-01a1a9cc-b0bd-7eb3-b7b4-be8d805f1873 +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_01a1a9cb0df07a72b0092b2f + id: fc_call_01a1a9cb0df07a72b0092b2f + name: read_file + status: completed + type: function_call + - call_id: call_01a1a9cb0df07a72b0092b2f + output: + - text: garden.txt + type: input_text + type: function_call_output + - content: + - annotations: [] + text: The file `index.txt` contains the path `garden.txt`. Let me read that + file now. + type: output_text + id: msg_0f26025d-aws_as1-01a1a9cb-5572-7e32-8fd7-61aeed733e54 + role: assistant + status: completed + type: message + - arguments: '{"path":"garden.txt"}' + call_id: call_01a1a9cb561876b2be7c103a + id: fc_call_01a1a9cb561876b2be7c103a + name: read_file + status: completed + type: function_call + - call_id: call_01a1a9cb561876b2be7c103a + output: + - text: Water the tomatoes every morning and harvest ripe fruit. + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: minimal + store: false + stream: false + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1530' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9cc-b0bd-7eb3-b7b4-be8d805f1873 +response: + body: + background: false + completed_at: 1793850127 + created_at: 1793850126 + error: null + frequency_penalty: 0.0 + id: resp_01a1a9cc-b20b-71f1-88e0-7f8d870bc148 + incomplete_details: null + instructions: null + max_output_tokens: 1024 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - content: + - annotations: [] + text: '**Summary:** The file provides simple gardening instructions to water + the tomatoes every morning and harvest the ripe fruit.' + type: output_text + id: msg_92cbcebe-aws_as1-01a1a9cc-b20c-7a90-8156-cfa51f6f6c1c + role: assistant + status: completed + type: message + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: minimal + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 252 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 192 + output_tokens: 22 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 274 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: 92cbcebe-aws_as1 + status_code: 200 +timestamp: '2026-11-05T03:42:06.525572+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-00.yaml new file mode 100644 index 0000000..44220eb --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-00.yaml @@ -0,0 +1,130 @@ +filename: 2026-11-05-01a1a9ca-8f09-7a30-a977-77693e8c3274 +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: minimal + store: false + stream: true + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '591' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9ca-8f09-7a30-a977-77693e8c3274 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: efb6bf28-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1a9ca-90d7-7421-8836-3be1c2fd1314","object":"response","created_at":1793849987,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1a9ca-90d7-7421-8836-3be1c2fd1314","object":"response","created_at":1793849987,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"fc_01a1a9ca90e4743198b7c811b5cdc615","type":"function_call","call_id":"call_01a1a9ca90e4743198b7c803","name":"read_file","arguments":"","status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":3,"output_index":0,"item_id":"fc_01a1a9ca90e4743198b7c811b5cdc615","delta":"{"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":4,"output_index":0,"item_id":"fc_01a1a9ca90e4743198b7c811b5cdc615","delta":"\"path\":\"index.txt\"}"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.done + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":5,"output_index":0,"item_id":"fc_01a1a9ca90e4743198b7c811b5cdc615","arguments":"{\"path\":\"index.txt\"}"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":6,"output_index":0,"item":{"id":"fc_01a1a9ca90e4743198b7c811b5cdc615","type":"function_call","call_id":"call_01a1a9ca90e4743198b7c803","name":"read_file","arguments":"{\"path\":\"index.txt\"}","status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":7,"response":{"id":"resp_01a1a9ca-90d7-7421-8836-3be1c2fd1314","object":"response","created_at":1793849987,"completed_at":1793849987,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"fc_01a1a9ca90e4743198b7c811b5cdc615","type":"function_call","call_id":"call_01a1a9ca90e4743198b7c803","name":"read_file","arguments":"{\"path\":\"index.txt\"}","status":"completed"}],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":182,"output_tokens":12,"total_tokens":194,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-05T03:39:46.825069+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-01.yaml new file mode 100644 index 0000000..180eb24 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-01.yaml @@ -0,0 +1,141 @@ +filename: 2026-11-05-01a1a9ca-aaec-79e1-a783-95edfae820f4 +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_01a1a9ca90e4743198b7c803 + id: fc_01a1a9ca90e4743198b7c811b5cdc615 + name: read_file + status: completed + type: function_call + - call_id: call_01a1a9ca90e4743198b7c803 + output: + - text: garden.txt + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: minimal + store: false + stream: true + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '907' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9ca-aaec-79e1-a783-95edfae820f4 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 00cc9cde-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1a9ca-abda-75e1-bff4-c047cdffa5f3","object":"response","created_at":1793849994,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1a9ca-abda-75e1-bff4-c047cdffa5f3","object":"response","created_at":1793849994,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"fc_01a1a9caabe878038524494e70b5f268","type":"function_call","call_id":"call_01a1a9caabe8780385244934","name":"read_file","arguments":"","status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":3,"output_index":0,"item_id":"fc_01a1a9caabe878038524494e70b5f268","delta":"{"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":4,"output_index":0,"item_id":"fc_01a1a9caabe878038524494e70b5f268","delta":"\"path\":\"garden.txt\"}"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.done + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":5,"output_index":0,"item_id":"fc_01a1a9caabe878038524494e70b5f268","arguments":"{\"path\":\"garden.txt\"}"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":6,"output_index":0,"item":{"id":"fc_01a1a9caabe878038524494e70b5f268","type":"function_call","call_id":"call_01a1a9caabe8780385244934","name":"read_file","arguments":"{\"path\":\"garden.txt\"}","status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":7,"response":{"id":"resp_01a1a9ca-abda-75e1-bff4-c047cdffa5f3","object":"response","created_at":1793849994,"completed_at":1793849994,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"fc_01a1a9caabe878038524494e70b5f268","type":"function_call","call_id":"call_01a1a9caabe8780385244934","name":"read_file","arguments":"{\"path\":\"garden.txt\"}","status":"completed"}],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":203,"output_tokens":13,"total_tokens":216,"input_tokens_details":{"cached_tokens":128,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-05T03:39:53.964962+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-02.yaml new file mode 100644 index 0000000..b887c76 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use/togetherai-responses-stream-02.yaml @@ -0,0 +1,205 @@ +filename: 2026-11-05-01a1a9ca-db7a-7520-8f28-c4142a26861f +request: + body: + input: + - content: + - text: Read index.txt using read_file. It contains the path of another file. + Read that file too, then summarize its contents in one sentence. + type: input_text + role: user + - arguments: '{"path":"index.txt"}' + call_id: call_01a1a9ca90e4743198b7c803 + id: fc_01a1a9ca90e4743198b7c811b5cdc615 + name: read_file + status: completed + type: function_call + - call_id: call_01a1a9ca90e4743198b7c803 + output: + - text: garden.txt + type: input_text + type: function_call_output + - arguments: '{"path":"garden.txt"}' + call_id: call_01a1a9caabe8780385244934 + id: fc_01a1a9caabe878038524494e70b5f268 + name: read_file + status: completed + type: function_call + - call_id: call_01a1a9caabe8780385244934 + output: + - text: Water the tomatoes every morning and harvest ripe fruit. + type: input_text + type: function_call_output + max_output_tokens: 1024 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: minimal + store: false + stream: true + tool_choice: auto + tools: + - description: Read a file by its path. + name: read_file + parameters: + additionalProperties: false + properties: + path: + type: string + required: + - path + type: object + strict: false + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1270' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1a9ca-db7a-7520-8f28-c4142a26861f +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: c543e33a-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1a9ca-dcd8-7c12-bfc3-273bfc7add97","object":"response","created_at":1793850006,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1a9ca-dcd8-7c12-bfc3-273bfc7add97","object":"response","created_at":1793850006,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"msg_01a1a9cadcd87c12bfc327544be648e5","type":"message","role":"assistant","status":"in_progress","content":[]}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":4,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"delta":"The","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":5,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"delta":" + file instruct","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":6,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"delta":"s + to water the tomatoes every","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":7,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"delta":" + morning and harvest the","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":8,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"delta":" + ripe fruit.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":9,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"text":"The + file instructs to water the tomatoes every morning and harvest the ripe fruit.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":10,"output_index":0,"item_id":"msg_01a1a9cadcd87c12bfc327544be648e5","content_index":0,"part":{"type":"output_text","text":"The + file instructs to water the tomatoes every morning and harvest the ripe fruit.","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":11,"output_index":0,"item":{"id":"msg_01a1a9cadcd87c12bfc327544be648e5","type":"message","role":"assistant","content":[{"type":"output_text","text":"The + file instructs to water the tomatoes every morning and harvest the ripe fruit.","annotations":[]}],"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":12,"response":{"id":"resp_01a1a9ca-dcd8-7c12-bfc3-273bfc7add97","object":"response","created_at":1793850006,"completed_at":1793850006,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"msg_01a1a9cadcd87c12bfc327544be648e5","type":"message","role":"assistant","content":[{"type":"output_text","text":"The + file instructs to water the tomatoes every morning and harvest the ripe fruit.","annotations":[]}],"status":"completed"}],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"minimal","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"function","name":"read_file","description":"Read + a file by its path.","parameters":{"additionalProperties":false,"properties":{"path":{"type":"string"}},"required":["path"],"type":"object"},"strict":false}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":232,"output_tokens":17,"total_tokens":249,"input_tokens_details":{"cached_tokens":192,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-05T03:40:06.394430+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-non_stream-00.yaml new file mode 100644 index 0000000..bccee00 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-non_stream-00.yaml @@ -0,0 +1,114 @@ +filename: 2026-11-04-01a1a479-66a6-7e01-bebc-bc8af91a976e +request: + body: + input: + - content: 'Call add twice in parallel: first 2 and 3, then 7 and 4. Then give + both results.' + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: true + reasoning: + effort: none + store: false + stream: false + tool_choice: required + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '542' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-66a6-7e01-bebc-bc8af91a976e +response: + body: + background: null + created_at: 1793760783 + error: null + id: resp_24d416566c804ae0a8edbfd5892c36ce + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-bb79d0bb1ef0d867 + id: fc_9951c655d7874688924376a022f80351 + name: add + status: completed + type: function_call + - arguments: '{"a": 7, "b": 4}' + call_id: chatcmpl-tool-af0f5743e61b4170 + id: fc_1e4743b1fd2948f9b30a72ffac19a4b5 + name: add + status: completed + type: function_call + parallel_tool_calls: true + previous_response_id: null + reasoning: + effort: none + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: required + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 320 + input_tokens_details: + cached_tokens: 0 + output_tokens: 61 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 381 + user: null + headers: + connection: keep-alive + content-length: '1308' + content-type: application/json + x-request-id: 4896f76d-35c8-468c-9b45-b00e930065bf + status_code: 200 +timestamp: '2026-11-04T02:53:01.990733+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-non_stream-01.yaml new file mode 100644 index 0000000..7299ed6 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-non_stream-01.yaml @@ -0,0 +1,133 @@ +filename: 2026-11-04-01a1a479-6e72-7951-91b7-8eb3882713c0 +request: + body: + input: + - content: 'Call add twice in parallel: first 2 and 3, then 7 and 4. Then give + both results.' + role: user + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-bb79d0bb1ef0d867 + id: fc_9951c655d7874688924376a022f80351 + name: add + status: completed + type: function_call + - arguments: '{"a": 7, "b": 4}' + call_id: chatcmpl-tool-af0f5743e61b4170 + id: fc_1e4743b1fd2948f9b30a72ffac19a4b5 + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-bb79d0bb1ef0d867 + output: '5' + type: function_call_output + - call_id: chatcmpl-tool-af0f5743e61b4170 + output: '11' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: true + reasoning: + effort: none + store: false + stream: false + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1075' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-6e72-7951-91b7-8eb3882713c0 +response: + body: + background: null + created_at: 1793760785 + error: null + id: resp_cdd2d56240a3455cb6491b8cf5567c7b + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - content: + - annotations: [] + text: 'Here are the results from the two additions in parallel: + + + * 2 + 3 = **5** + + * 7 + 4 = **11**' + type: output_text + id: msg_98a517ce9e5846dabb5dfbbfe6b585aa + role: assistant + status: completed + type: message + parallel_tool_calls: true + previous_response_id: null + reasoning: + effort: none + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 126 + input_tokens_details: + cached_tokens: 0 + output_tokens: 35 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 161 + user: null + headers: + connection: keep-alive + content-length: '1206' + content-type: application/json + x-request-id: 2b1fbc48-6145-461b-ae4e-3834288a3b15 + status_code: 200 +timestamp: '2026-11-04T02:53:03.986259+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-stream-00.yaml new file mode 100644 index 0000000..e4418f4 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-stream-00.yaml @@ -0,0 +1,158 @@ +filename: 2026-11-04-01a1a479-7e00-7951-98ee-32573dd402c6 +request: + body: + input: + - content: 'Call add twice in parallel: first 2 and 3, then 7 and 4. Then give + both results.' + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: true + reasoning: + effort: none + store: false + stream: true + tool_choice: required + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '541' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-7e00-7951-98ee-32573dd402c6 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 846998ef-4b53-41f9-9113-9e716da053f8 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_44b508d0927e47c3bb22f4c79972f083","object":"response","created_at":1793760788,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"required","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_44b508d0927e47c3bb22f4c79972f083","object":"response","created_at":1793760788,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"required","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"function_call","id":"fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7","status":"in_progress","call_id":"chatcmpl-tool-a630711f382d718e","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":3,"item_id":"fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7","output_index":0,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":4,"item_id":"fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7","output_index":0,"delta":"2, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":5,"item_id":"fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7","output_index":0,"delta":"3}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":6,"output_index":1,"item":{"type":"function_call","id":"fc_f393ec47f62942a29937cb8dfe7397b0","status":"in_progress","call_id":"chatcmpl-tool-b644be70919a8670","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":7,"item_id":"fc_f393ec47f62942a29937cb8dfe7397b0","output_index":1,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":8,"item_id":"fc_f393ec47f62942a29937cb8dfe7397b0","output_index":1,"delta":"7, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":9,"item_id":"fc_f393ec47f62942a29937cb8dfe7397b0","output_index":1,"delta":"4}"} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":10,"item_id":"fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7","output_index":0,"arguments":"{\"a\": + 2, \"b\": 3}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":11,"output_index":0,"item":{"type":"function_call","id":"fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7","status":"completed","call_id":"chatcmpl-tool-a630711f382d718e","name":"add","arguments":"{\"a\": + 2, \"b\": 3}"}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":12,"item_id":"fc_f393ec47f62942a29937cb8dfe7397b0","output_index":1,"arguments":"{\"a\": + 7, \"b\": 4}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":13,"output_index":1,"item":{"type":"function_call","id":"fc_f393ec47f62942a29937cb8dfe7397b0","status":"completed","call_id":"chatcmpl-tool-b644be70919a8670","name":"add","arguments":"{\"a\": + 7, \"b\": 4}"}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":14,"response":{"id":"resp_44b508d0927e47c3bb22f4c79972f083","object":"response","created_at":1793760788,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7","type":"function_call","call_id":"chatcmpl-tool-a630711f382d718e","name":"add","arguments":"{\"a\": + 2, \"b\": 3}","status":"completed"},{"id":"fc_f393ec47f62942a29937cb8dfe7397b0","type":"function_call","call_id":"chatcmpl-tool-b644be70919a8670","name":"add","arguments":"{\"a\": + 7, \"b\": 4}","status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":320,"output_tokens":61,"total_tokens":381,"input_tokens_details":{"cached_tokens":319},"output_tokens_details":{"reasoning_tokens":0}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"required","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:53:07.968453+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-stream-01.yaml new file mode 100644 index 0000000..5e8b9e1 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_parallel/fireworks-responses-stream-01.yaml @@ -0,0 +1,698 @@ +filename: 2026-11-04-01a1a479-864a-7303-8f1f-f695dfba9a34 +request: + body: + input: + - content: 'Call add twice in parallel: first 2 and 3, then 7 and 4. Then give + both results.' + role: user + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-a630711f382d718e + id: fc_9fc68cf37d3c4b2bba4bc3ffcc5479a7 + name: add + status: completed + type: function_call + - arguments: '{"a": 7, "b": 4}' + call_id: chatcmpl-tool-b644be70919a8670 + id: fc_f393ec47f62942a29937cb8dfe7397b0 + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-a630711f382d718e + output: '5' + type: function_call_output + - call_id: chatcmpl-tool-b644be70919a8670 + output: '11' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: true + reasoning: + effort: none + store: false + stream: true + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1074' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a479-864a-7303-8f1f-f695dfba9a34 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 1ba0a3c4-8533-4f93-80c4-ccf6ab474ad5 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_1cb642ef7ff04070b00a4f3b0ea29f84","object":"response","created_at":1793760790,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_1cb642ef7ff04070b00a4f3b0ea29f84","object":"response","created_at":1793760790,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"message","id":"msg_643d2c873b1549ada11b06f43806940b","status":"in_progress","role":"assistant","content":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":4,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"The","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":5,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + results","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + are","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":":","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"2","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + +","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"3","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + =","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"5","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + and","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"7","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + +","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"4","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + =","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":23,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":24,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"5","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":25,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + and","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":26,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":27,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"7","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":28,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + +","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":29,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":30,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"4","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":31,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + =","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":32,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":33,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"1","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":34,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"1","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":35,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":36,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"The","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":37,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + results","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":38,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + of","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":39,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + the","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":40,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + parallel","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":41,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + additions","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":42,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":":","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":43,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":44,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"2","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":45,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + +","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":46,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":47,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"3","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":48,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + =","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":49,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":50,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"5","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":51,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + and","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":52,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":53,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"7","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":54,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + +","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":55,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":56,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"4","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":57,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + are","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":58,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":59,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"1","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":60,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"1","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":61,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":62,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"Here","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":63,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + are","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":64,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + the","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":65,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + results","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":66,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + of","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":67,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + the","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":68,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + parallel","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":69,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + additions","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":70,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":71,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + First","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":72,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":",","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":73,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":74,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"2","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":75,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + +","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":76,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":77,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"3","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":78,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + and","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":79,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":80,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"4","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":81,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + +","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":82,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":83,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"7","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":84,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + =","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":85,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":86,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"1","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":87,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":"1","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":88,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","sequence_number":89,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"text":"The + results are: 2 + 3 = 5 and 7 + 4 = 5 and 7 + 4 = 11.The results of the parallel + additions: 2 + 3 = 5 and 7 + 4 are 11.Here are the results of the parallel additions. + First, 2 + 3 and 4 + 7 = 11.","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","sequence_number":90,"item_id":"msg_643d2c873b1549ada11b06f43806940b","output_index":0,"content_index":0,"part":{"type":"output_text","text":"The + results are: 2 + 3 = 5 and 7 + 4 = 5 and 7 + 4 = 11.The results of the parallel + additions: 2 + 3 = 5 and 7 + 4 are 11.Here are the results of the parallel additions. + First, 2 + 3 and 4 + 7 = 11.","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":91,"output_index":0,"item":{"type":"message","id":"msg_643d2c873b1549ada11b06f43806940b","status":"completed","role":"assistant","content":[{"type":"output_text","text":"The + results are: 2 + 3 = 5 and 7 + 4 = 5 and 7 + 4 = 11.The results of the parallel + additions: 2 + 3 = 5 and 7 + 4 are 11.Here are the results of the parallel additions. + First, 2 + 3 and 4 + 7 = 11.","annotations":[]}]}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":92,"response":{"id":"resp_1cb642ef7ff04070b00a4f3b0ea29f84","object":"response","created_at":1793760894,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"msg_643d2c873b1549ada11b06f43806940b","type":"message","role":"assistant","content":[{"type":"output_text","text":"The + results are: 2 + 3 = 5 and 7 + 4 = 5 and 7 + 4 = 11.The results of the parallel + additions: 2 + 3 = 5 and 7 + 4 are 11.Here are the results of the parallel additions. + First, 2 + 3 and 4 + 7 = 11.","annotations":[]}],"status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":126,"output_tokens":88,"total_tokens":214,"input_tokens_details":{"cached_tokens":125},"output_tokens_details":{"reasoning_tokens":0}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":true,"reasoning":{"effort":"none"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:53:10.090725+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-00.yaml new file mode 100644 index 0000000..0df98a3 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-00.yaml @@ -0,0 +1,941 @@ +filename: 2026-11-04-01a1a47b-780c-7f62-8647-e0bd1492ca07 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '586' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a47b-780c-7f62-8647-e0bd1492ca07 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: f57cad2f-a84e-403b-a53b-723a054e0669 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_42b88977f0884e78b28dd169207af04a","object":"response","created_at":1793760917,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_42b88977f0884e78b28dd169207af04a","object":"response","created_at":1793760917,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"reasoning","id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","status":"in_progress","summary":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.added","sequence_number":3,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":""}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":4,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"We"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":5,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + need"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":6,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + to"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":7,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":8,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 2"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":9,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + and"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":10,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 3"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":11,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + =>"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":12,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":13,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":14,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + Then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":15,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":16,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + result"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":17,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + ("} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":18,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":19,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":")"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":20,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + and"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":21,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 4"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":22,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + =>"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":23,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 9"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":24,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":25,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + Use"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":26,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + the"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":27,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":28,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + tool"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":29,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + twice"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":30,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":31,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + The"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":32,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + instruction"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":33,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + says"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":34,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":":"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":35,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + \""} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":36,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"Use"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":37,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":38,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + to"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":39,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":40,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 2"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":41,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + and"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":42,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 3"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":43,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":44,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + After"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":45,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + the"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":46,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + result"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":47,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":","} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":48,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + use"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":49,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":50,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + to"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":51,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":52,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + that"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":53,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + result"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":54,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + and"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":55,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 4"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":56,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":57,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + Then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":58,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + give"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":59,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + the"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":60,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + final"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":61,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + answer"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":62,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":".\""} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":63,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"\n\nWe"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":64,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + need"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":65,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + to"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":66,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + call"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":67,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":68,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + function"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":69,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + twice"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":70,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":71,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + First"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":72,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + call"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":73,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":":"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":74,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + a"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":75,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":76,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"2"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":77,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":",b"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":78,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":79,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"3"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":80,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":81,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + Then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":82,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + get"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":83,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + result"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":84,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":85,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":86,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + Then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":87,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + second"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":88,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + call"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":89,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":":"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":90,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + a"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":91,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":92,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":93,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":",b"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":94,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":95,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"4"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":96,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":97,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + Then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":98,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + final"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":99,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + answer"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":100,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + 9"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":101,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":102,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"\n\nWe"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":103,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + must"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":104,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + output"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":105,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + calls"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":106,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + to"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":107,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + function"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":108,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + namespace"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":109,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":110,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + Use"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":111,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + the"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":112,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + functions"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":113,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":".add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":114,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":" + tool"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":115,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":116,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"\n\nPro"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":117,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"ceed"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":118,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":119,"output_index":1,"item":{"type":"function_call","id":"fc_7e9c320c47f8441e96bd857c74c588e2","status":"in_progress","call_id":"chatcmpl-tool-815ddc71f6a8125e","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":120,"item_id":"fc_7e9c320c47f8441e96bd857c74c588e2","output_index":1,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":121,"item_id":"fc_7e9c320c47f8441e96bd857c74c588e2","output_index":1,"delta":"2, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":122,"item_id":"fc_7e9c320c47f8441e96bd857c74c588e2","output_index":1,"delta":"3}"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.done","sequence_number":123,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"text":"We + need to add 2 and 3 => 5. Then add result (5) and 4 => 9. Use the add tool twice. + The instruction says: \"Use add to add 2 and 3. After the result, use add to add + that result and 4. Then give the final answer.\"\n\nWe need to call add function + twice. First call: a=2,b=3. Then get result 5. Then second call: a=5,b=4. Then + final answer 9.\n\nWe must output calls to function namespace. Use the functions.add + tool.\n\nProceed."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.done","sequence_number":124,"item_id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":"We + need to add 2 and 3 => 5. Then add result (5) and 4 => 9. Use the add tool twice. + The instruction says: \"Use add to add 2 and 3. After the result, use add to add + that result and 4. Then give the final answer.\"\n\nWe need to call add function + twice. First call: a=2,b=3. Then get result 5. Then second call: a=5,b=4. Then + final answer 9.\n\nWe must output calls to function namespace. Use the functions.add + tool.\n\nProceed."}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":125,"output_index":0,"item":{"type":"reasoning","id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","status":"completed","summary":[{"type":"summary_text","text":"We + need to add 2 and 3 => 5. Then add result (5) and 4 => 9. Use the add tool twice. + The instruction says: \"Use add to add 2 and 3. After the result, use add to add + that result and 4. Then give the final answer.\"\n\nWe need to call add function + twice. First call: a=2,b=3. Then get result 5. Then second call: a=5,b=4. Then + final answer 9.\n\nWe must output calls to function namespace. Use the functions.add + tool.\n\nProceed."}]}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":126,"item_id":"fc_7e9c320c47f8441e96bd857c74c588e2","output_index":1,"arguments":"{\"a\": + 2, \"b\": 3}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":127,"output_index":1,"item":{"type":"function_call","id":"fc_7e9c320c47f8441e96bd857c74c588e2","status":"completed","call_id":"chatcmpl-tool-815ddc71f6a8125e","name":"add","arguments":"{\"a\": + 2, \"b\": 3}"}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":128,"response":{"id":"resp_42b88977f0884e78b28dd169207af04a","object":"response","created_at":1793760918,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"rs_81dd79c26a1148e48ab6f2ba1f320b29","type":"reasoning","summary":[{"type":"summary_text","text":"We + need to add 2 and 3 => 5. Then add result (5) and 4 => 9. Use the add tool twice. + The instruction says: \"Use add to add 2 and 3. After the result, use add to add + that result and 4. Then give the final answer.\"\n\nWe need to call add function + twice. First call: a=2,b=3. Then get result 5. Then second call: a=5,b=4. Then + final answer 9.\n\nWe must output calls to function namespace. Use the functions.add + tool.\n\nProceed."}]},{"id":"fc_7e9c320c47f8441e96bd857c74c588e2","type":"function_call","call_id":"chatcmpl-tool-815ddc71f6a8125e","name":"add","arguments":"{\"a\": + 2, \"b\": 3}","status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":325,"output_tokens":157,"total_tokens":482,"input_tokens_details":{"cached_tokens":324},"output_tokens_details":{"reasoning_tokens":125}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:55:17.516044+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-01.yaml new file mode 100644 index 0000000..e774708 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-01.yaml @@ -0,0 +1,233 @@ +filename: 2026-11-04-01a1a47b-8072-7743-8410-673ee5c6e5a1 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - id: rs_81dd79c26a1148e48ab6f2ba1f320b29 + summary: + - text: 'We need to add 2 and 3 => 5. Then add result (5) and 4 => 9. Use the + add tool twice. The instruction says: "Use add to add 2 and 3. After the + result, use add to add that result and 4. Then give the final answer." + + + We need to call add function twice. First call: a=2,b=3. Then get result + 5. Then second call: a=5,b=4. Then final answer 9. + + + We must output calls to function namespace. Use the functions.add tool. + + + Proceed.' + type: summary_text + type: reasoning + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-815ddc71f6a8125e + id: fc_7e9c320c47f8441e96bd857c74c588e2 + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-815ddc71f6a8125e + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1392' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a47b-8072-7743-8410-673ee5c6e5a1 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: c5b4cda8-b1e4-40f6-962f-cd7644c42730 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_f8eb2feb71a945f996ff2e09cfe3d327","object":"response","created_at":1793760919,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_f8eb2feb71a945f996ff2e09cfe3d327","object":"response","created_at":1793760919,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"reasoning","id":"rs_94c9d1d5f230459c8678dc7ec82280b6","status":"in_progress","summary":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.added","sequence_number":3,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":""}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":4,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":"Now"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":5,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":" + second"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":6,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":7,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":" + with"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":8,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":" + 5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":9,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":" + and"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":10,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":" + 4"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":11,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":12,"output_index":1,"item":{"type":"function_call","id":"fc_a1d436a8ace6446591d3f0116f074001","status":"in_progress","call_id":"chatcmpl-tool-8a59de4f19e9a6a9","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":13,"item_id":"fc_a1d436a8ace6446591d3f0116f074001","output_index":1,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":14,"item_id":"fc_a1d436a8ace6446591d3f0116f074001","output_index":1,"delta":"5, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":15,"item_id":"fc_a1d436a8ace6446591d3f0116f074001","output_index":1,"delta":"4}"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.done","sequence_number":16,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"text":"Now + second add with 5 and 4."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.done","sequence_number":17,"item_id":"rs_94c9d1d5f230459c8678dc7ec82280b6","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":"Now + second add with 5 and 4."}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":18,"output_index":0,"item":{"type":"reasoning","id":"rs_94c9d1d5f230459c8678dc7ec82280b6","status":"completed","summary":[{"type":"summary_text","text":"Now + second add with 5 and 4."}]}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":19,"item_id":"fc_a1d436a8ace6446591d3f0116f074001","output_index":1,"arguments":"{\"a\": + 5, \"b\": 4}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":20,"output_index":1,"item":{"type":"function_call","id":"fc_a1d436a8ace6446591d3f0116f074001","status":"completed","call_id":"chatcmpl-tool-8a59de4f19e9a6a9","name":"add","arguments":"{\"a\": + 5, \"b\": 4}"}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":21,"response":{"id":"resp_f8eb2feb71a945f996ff2e09cfe3d327","object":"response","created_at":1793760920,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"rs_94c9d1d5f230459c8678dc7ec82280b6","type":"reasoning","summary":[{"type":"summary_text","text":"Now + second add with 5 and 4."}]},{"id":"fc_a1d436a8ace6446591d3f0116f074001","type":"function_call","call_id":"chatcmpl-tool-8a59de4f19e9a6a9","name":"add","arguments":"{\"a\": + 5, \"b\": 4}","status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":501,"output_tokens":42,"total_tokens":543,"input_tokens_details":{"cached_tokens":324},"output_tokens_details":{"reasoning_tokens":10}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:55:19.666736+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-02.yaml new file mode 100644 index 0000000..399252e --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/fireworks-responses-stream-02.yaml @@ -0,0 +1,297 @@ +filename: 2026-11-04-01a1a47b-8380-79d3-875c-94f46a493788 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - id: rs_81dd79c26a1148e48ab6f2ba1f320b29 + summary: + - text: 'We need to add 2 and 3 => 5. Then add result (5) and 4 => 9. Use the + add tool twice. The instruction says: "Use add to add 2 and 3. After the + result, use add to add that result and 4. Then give the final answer." + + + We need to call add function twice. First call: a=2,b=3. Then get result + 5. Then second call: a=5,b=4. Then final answer 9. + + + We must output calls to function namespace. Use the functions.add tool. + + + Proceed.' + type: summary_text + type: reasoning + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-815ddc71f6a8125e + id: fc_7e9c320c47f8441e96bd857c74c588e2 + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-815ddc71f6a8125e + output: '5' + type: function_call_output + - id: rs_94c9d1d5f230459c8678dc7ec82280b6 + summary: + - text: Now second add with 5 and 4. + type: summary_text + type: reasoning + - arguments: '{"a": 5, "b": 4}' + call_id: chatcmpl-tool-8a59de4f19e9a6a9 + id: fc_a1d436a8ace6446591d3f0116f074001 + name: add + status: completed + type: function_call + - call_id: chatcmpl-tool-8a59de4f19e9a6a9 + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1772' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1a47b-8380-79d3-875c-94f46a493788 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 75d0bf5a-e2dc-44e6-bde4-a14e02a56582 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_1d6b3afa66bc42ec8a0f0d3ec4f7dcfb","object":"response","created_at":1793760920,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_1d6b3afa66bc42ec8a0f0d3ec4f7dcfb","object":"response","created_at":1793760920,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"reasoning","id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","status":"in_progress","summary":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.added","sequence_number":3,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":""}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":4,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":"We"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":5,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":" + have"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":6,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":" + final"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":7,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":" + answer"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":8,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":" + 9"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":9,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":10,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":" + Provide"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":11,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":" + final"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":12,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":" + answer"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":13,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":14,"output_index":1,"item":{"type":"message","id":"msg_1b88a034fa254802b693024c041b8f9c","status":"in_progress","role":"assistant","content":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","sequence_number":15,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"delta":"The","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"delta":" + final","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"delta":" + answer","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"delta":" + is","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"delta":" + **","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"delta":"9","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"delta":"**.","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.done","sequence_number":23,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"text":"We + have final answer 9. Provide final answer."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.done","sequence_number":24,"item_id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":"We + have final answer 9. Provide final answer."}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":25,"output_index":0,"item":{"type":"reasoning","id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","status":"completed","summary":[{"type":"summary_text","text":"We + have final answer 9. Provide final answer."}]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","sequence_number":26,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"text":"The + final answer is **9**.","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","sequence_number":27,"item_id":"msg_1b88a034fa254802b693024c041b8f9c","output_index":1,"content_index":0,"part":{"type":"output_text","text":"The + final answer is **9**.","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":28,"output_index":1,"item":{"type":"message","id":"msg_1b88a034fa254802b693024c041b8f9c","status":"completed","role":"assistant","content":[{"type":"output_text","text":"The + final answer is **9**.","annotations":[]}]}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":29,"response":{"id":"resp_1d6b3afa66bc42ec8a0f0d3ec4f7dcfb","object":"response","created_at":1793760921,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"rs_e5180fa79f8e4c6ebd3c6e323abc0318","type":"reasoning","summary":[{"type":"summary_text","text":"We + have final answer 9. Provide final answer."}]},{"id":"msg_1b88a034fa254802b693024c041b8f9c","type":"message","role":"assistant","content":[{"type":"output_text","text":"The + final answer is **9**.","annotations":[]}],"status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":283,"output_tokens":20,"total_tokens":303,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":11}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-04T02:55:20.448944+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-00.yaml new file mode 100644 index 0000000..c77e4fd --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-00.yaml @@ -0,0 +1,139 @@ +filename: 2026-11-18-01a1ee03-ae1f-7dd3-8a79-5a2cfb8dc950 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + model: gemini-3.1-flash-lite + stream: false + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '529' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee03-ae1f-7dd3-8a79-5a2cfb8dc950 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + content: '**My Calculation Process** + + + Alright, let''s break this down. My goal is to add some numbers together + in a series of steps. It''s a straightforward arithmetic problem, really. + I need to use an "add" tool for this, which seems simple enough. + + + First, I''ll take 2 and 3 and add them together. The system is instructing + me to call the "add" function with those specific numbers. The expected + outcome here should be 5, which seems correct. I''ll mentally check it to + be sure. + + + Next, I take the result from that first calculation, which is 5, and I add + 4 to it, again using the "add" tool. I expect to get 9 here. + + + Finally, I just have to report the final result, which is the 9 from the + second calculation. Basically, it’s a two-step process: `add(2, 3)` then + `add(result_from_step1, 4)`, and finally, the output. + + + + ' + extra_content: + google: + thought: true + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EuEECt4EAWkUfROlRmusje4h46Y+IE1KD5GkENSXTTrHbWBVozezh6zEjYscYBgY0QokZRG2eg3DJk8mVSxxDtkhpx1mU1CIgpkcvqdpTK9irMmC7uz+6QEwfofVGiijnm0cr7k1Nlg9qt35+pdIHq1o4dn3B1xn+ouiSq2y69PLSMmjKRstyi1WB87YvrBXLXBbmWJZH0W2/w1OPdVLra69XF5yUj7mSDS3L1Y42LYVAxS1LuG9T3mxwpw/QzGrT61leKL+nAiEgGnmvZCaLjUpoQN2+Bu6sURto5djHLB/RtOkCE6BQ2el1MT2ynR+Sg8x2P1qV/ZCVOnYsua0ALzbpSSGg2MduXwplP6u71YRxuA6aRdFJa29jDZ98T26UwtPCCNn7fdKhGht/cKizhb8Ebj6xBI2F2X1QpQh2p9LxTfgkUPuWHEGYO8DfcHzNjoFz2mkP5QFfDDR0qyooNfGWLM6bczIAXW8Xyr/MN7PNLe8fujNRZCop1DYjBTE4dH5Y67+NJLqdTw6VDCgDTobZQArlHzqNQQyfqU5ttDAlPnyAxKtjl0BdSxHkFQgiVY6j5N5l/p/FqQD+emQP2RqP1YEsJ8BXvMq9Oiga1ncPr3Rxx5fUlBMzy8DrjidQusEuSuEzOCXzeD2n3wUE7Wsehi9TKkVU4aPA3pVSoSa0Vxf5UVtdpXqJiwbYz4LDOlNNqo5UCeuYyCwXwVWnEF4mWrq4G1xb/xQ5R8VIvd30q/Lqk9AlHF+AMYTxzl04UD7yQfsOiY3s9WkuGmkwlimsLGrEVk3RRMOXWHtUSw0cnnb + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_1242298174733071490 + type: function + created: 1794994583 + id: lXH9arrDBbjtz7IPnvqfyAs + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 16 + prompt_tokens: 77 + total_tokens: 272 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoidG9vbF9jYWxscyIsImluZGV4IjowLCJtZXNz + YWdlIjp7ImNvbnRlbnQiOiI8dGhvdWdodD4qKk15IENhbGN1bGF0aW9uIFByb2Nlc3MqKlxuXG5B + bHJpZ2h0LCBsZXQncyBicmVhayB0aGlzIGRvd24uIE15IGdvYWwgaXMgdG8gYWRkIHNvbWUgbnVt + YmVycyB0b2dldGhlciBpbiBhIHNlcmllcyBvZiBzdGVwcy4gSXQncyBhIHN0cmFpZ2h0Zm9yd2Fy + ZCBhcml0aG1ldGljIHByb2JsZW0sIHJlYWxseS4gSSBuZWVkIHRvIHVzZSBhbiBcImFkZFwiIHRv + b2wgZm9yIHRoaXMsIHdoaWNoIHNlZW1zIHNpbXBsZSBlbm91Z2guXG5cbkZpcnN0LCBJJ2xsIHRh + a2UgMiBhbmQgMyBhbmQgYWRkIHRoZW0gdG9nZXRoZXIuIFRoZSBzeXN0ZW0gaXMgaW5zdHJ1Y3Rp + bmcgbWUgdG8gY2FsbCB0aGUgXCJhZGRcIiBmdW5jdGlvbiB3aXRoIHRob3NlIHNwZWNpZmljIG51 + bWJlcnMuIFRoZSBleHBlY3RlZCBvdXRjb21lIGhlcmUgc2hvdWxkIGJlIDUsIHdoaWNoIHNlZW1z + IGNvcnJlY3QuIEknbGwgbWVudGFsbHkgY2hlY2sgaXQgdG8gYmUgc3VyZS5cblxuTmV4dCwgSSB0 + YWtlIHRoZSByZXN1bHQgZnJvbSB0aGF0IGZpcnN0IGNhbGN1bGF0aW9uLCB3aGljaCBpcyA1LCBh + bmQgSSBhZGQgNCB0byBpdCwgYWdhaW4gdXNpbmcgdGhlIFwiYWRkXCIgdG9vbC4gSSBleHBlY3Qg + dG8gZ2V0IDkgaGVyZS5cblxuRmluYWxseSwgSSBqdXN0IGhhdmUgdG8gcmVwb3J0IHRoZSBmaW5h + bCByZXN1bHQsIHdoaWNoIGlzIHRoZSA5IGZyb20gdGhlIHNlY29uZCBjYWxjdWxhdGlvbi4gQmFz + aWNhbGx5LCBpdOKAmXMgYSB0d28tc3RlcCBwcm9jZXNzOiBgYWRkKDIsIDMpYCB0aGVuIGBhZGQo + cmVzdWx0X2Zyb21fc3RlcDEsIDQpYCwgYW5kIGZpbmFsbHksIHRoZSBvdXRwdXQuXG5cblxuPC90 + aG91Z2h0PiIsImV4dHJhX2NvbnRlbnQiOnsiZ29vZ2xlIjp7InRob3VnaHQiOnRydWV9fSwicm9s + ZSI6ImFzc2lzdGFudCIsInRvb2xfY2FsbHMiOlt7ImV4dHJhX2NvbnRlbnQiOnsiZ29vZ2xlIjp7 + InRob3VnaHRfc2lnbmF0dXJlIjoiRXVFRUN0NEVBV2tVZlJPbFJtdXNqZTRoNDZZK0lFMUtENUdr + RU5TWFRUckhiV0JWb3plemg2ekVqWXNjWUJnWTBRb2taUkcyZWczREprOG1WU3h4RHRraHB4MW1V + MUNJZ3BrY3ZxZHBUSzlpck1tQzd1eis2UUV3Zm9mVkdpaWpubTBjcjdrMU5sZzlxdDM1K3BkSUhx + MW80ZG4zQjF4bitvdWlTcTJ5NjlQTFNNbWpLUnN0eWkxV0I4N1l2ckJYTFhCYm1XSlpIMFcyL3cx + T1BkVkxyYTY5WEY1eVVqN21TRFMzTDFZNDJMWVZBeFMxTHVHOVQzbXh3cHcvUXpHclQ2MWxlS0wr + bkFpRWdHbm12WkNhTGpVcG9RTjIrQnU2c1VSdG81ZGpITEIvUnRPa0NFNkJRMmVsMU1UMnluUitT + Zzh4MlAxcVYvWkNWT25Zc3VhMEFMemJwU1NHZzJNZHVYd3BsUDZ1NzFZUnh1QTZhUmRGSmEyOWpE + Wjk4VDI2VXd0UENDTm43ZmRLaEdodC9jS2l6aGI4RWJqNnhCSTJGMlgxUXBRaDJwOUx4VGZna1VQ + dVdIRUdZTzhEZmNIek5qb0Z6Mm1rUDVRRmZERFIwcXlvb05mR1dMTTZiY3pJQVhXOFh5ci9NTjdQ + TkxlOGZ1ak5SWkNvcDFEWWpCVEU0ZEg1WTY3K05KTHFkVHc2VkRDZ0RUb2JaUUFybEh6cU5RUXlm + cVU1dHREQWxQbnlBeEt0amwwQmRTeEhrRlFnaVZZNmo1TjVsL3AvRnFRRCtlbVFQMlJxUDFZRXNK + OEJYdk1xOU9pZ2ExbmNQcjNSeHg1ZlVsQk16eThEcmppZFF1c0V1U3VFek9DWHplRDJuM3dVRTdX + c2VoaTlUS2tWVTRhUEEzcFZTb1NhMFZ4ZjVVVnRkcFhxSml3Yll6NExET2xOTnFvNVVDZXVZeUN3 + WHdWV25FRjRtV3JxNEcxeGIveFE1UjhWSXZkMzBxL0xxazlBbEhGK0FNWVR4emwwNFVEN3lRZnNP + aVkzczlXa3VHbWt3bGltc0xHckVWazNSUk1PWFdIdFVTdzBjbm5iIn19LCJmdW5jdGlvbiI6eyJh + cmd1bWVudHMiOiJ7XCJiXCI6MyxcImFcIjoyfSIsIm5hbWUiOiJhZGQifSwiaWQiOiJjYWxsXzEy + NDIyOTgxNzQ3MzMwNzE0OTAiLCJ0eXBlIjoiZnVuY3Rpb24ifV19fV0sImNyZWF0ZWQiOjE3OTQ5 + OTQ1ODMsImlkIjoibFhIOWFyckRCYmp0ejdJUG52cWZ5QXMiLCJtb2RlbCI6ImdlbWluaS0zLjEt + Zmxhc2gtbGl0ZSIsIm9iamVjdCI6ImNoYXQuY29tcGxldGlvbiIsInVzYWdlIjp7ImNvbXBsZXRp + b25fdG9rZW5zIjoxNiwicHJvbXB0X3Rva2VucyI6NzcsInRvdGFsX3Rva2VucyI6MjcyfX0= + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:36:21.023880+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-01.yaml new file mode 100644 index 0000000..86abd4d --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-01.yaml @@ -0,0 +1,108 @@ +filename: 2026-11-18-01a1ee03-b6c1-7333-be31-2bf80c750131 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + - reasoning_content: '**My Calculation Process** + + + Alright, let''s break this down. My goal is to add some numbers together in + a series of steps. It''s a straightforward arithmetic problem, really. I need + to use an "add" tool for this, which seems simple enough. + + + First, I''ll take 2 and 3 and add them together. The system is instructing + me to call the "add" function with those specific numbers. The expected outcome + here should be 5, which seems correct. I''ll mentally check it to be sure. + + + Next, I take the result from that first calculation, which is 5, and I add + 4 to it, again using the "add" tool. I expect to get 9 here. + + + Finally, I just have to report the final result, which is the 9 from the second + calculation. Basically, it’s a two-step process: `add(2, 3)` then `add(result_from_step1, + 4)`, and finally, the output. + + + + ' + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EuEECt4EAWkUfROlRmusje4h46Y+IE1KD5GkENSXTTrHbWBVozezh6zEjYscYBgY0QokZRG2eg3DJk8mVSxxDtkhpx1mU1CIgpkcvqdpTK9irMmC7uz+6QEwfofVGiijnm0cr7k1Nlg9qt35+pdIHq1o4dn3B1xn+ouiSq2y69PLSMmjKRstyi1WB87YvrBXLXBbmWJZH0W2/w1OPdVLra69XF5yUj7mSDS3L1Y42LYVAxS1LuG9T3mxwpw/QzGrT61leKL+nAiEgGnmvZCaLjUpoQN2+Bu6sURto5djHLB/RtOkCE6BQ2el1MT2ynR+Sg8x2P1qV/ZCVOnYsua0ALzbpSSGg2MduXwplP6u71YRxuA6aRdFJa29jDZ98T26UwtPCCNn7fdKhGht/cKizhb8Ebj6xBI2F2X1QpQh2p9LxTfgkUPuWHEGYO8DfcHzNjoFz2mkP5QFfDDR0qyooNfGWLM6bczIAXW8Xyr/MN7PNLe8fujNRZCop1DYjBTE4dH5Y67+NJLqdTw6VDCgDTobZQArlHzqNQQyfqU5ttDAlPnyAxKtjl0BdSxHkFQgiVY6j5N5l/p/FqQD+emQP2RqP1YEsJ8BXvMq9Oiga1ncPr3Rxx5fUlBMzy8DrjidQusEuSuEzOCXzeD2n3wUE7Wsehi9TKkVU4aPA3pVSoSa0Vxf5UVtdpXqJiwbYz4LDOlNNqo5UCeuYyCwXwVWnEF4mWrq4G1xb/xQ5R8VIvd30q/Lqk9AlHF+AMYTxzl04UD7yQfsOiY3s9WkuGmkwlimsLGrEVk3RRMOXWHtUSw0cnnb + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_1242298174733071490 + type: function + - content: '5' + role: tool + tool_call_id: call_1242298174733071490 + model: gemini-3.1-flash-lite + stream: true + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2482' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee03-b6c1-7333-be31-2bf80c750131 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"role":"assistant","tool_calls":[{"extra_content":{"google":{"thought_signature":"EvsBCvgBAWkUfRPgh75DaYBo716Q7SUvSFq+qFmiPT6YTRyjEEXEs/2wpA+eDigzPL3ODKIzcdnjaj3mqwmCBWqvtN+BSSO7MOwl5/tfPo2Uq18oIPwOwvznhB1XuOY/bqi0L9pvnYuNJ29XLSIKhdttIgAgDD4DFA2sv8Q/VdZPxopC20pZfLOPPHIOouBfoyRhFweZPitZDf2r/QYaPGp0mJDJSdiBLerIZu73pxDsRnDMt1euRagGHeLqYoVOULqgtP2UU9qi2YEQe69uJKM6jFLK4fCRDiHIwnpUVYmjf/EHzBogeoiFuRCCBlCMOJDzB8Qte4xq1CwEqso="}},"function":{"arguments":"{\"b\":4,\"a\":5}","name":"add"},"id":"call_7085737281323246864","type":"function"}]},"index":0}],"created":1794994583,"id":"l3H9apPeEuiEz7IPurXFuAs","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994583,"id":"l3H9apPeEuiEz7IPurXFuAs","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:36:23.233360+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-02.yaml new file mode 100644 index 0000000..5f414b7 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-mixed-02.yaml @@ -0,0 +1,121 @@ +filename: 2026-11-18-01a1ee03-b8f6-7963-b774-497ec7491cd0 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + - reasoning_content: '**My Calculation Process** + + + Alright, let''s break this down. My goal is to add some numbers together in + a series of steps. It''s a straightforward arithmetic problem, really. I need + to use an "add" tool for this, which seems simple enough. + + + First, I''ll take 2 and 3 and add them together. The system is instructing + me to call the "add" function with those specific numbers. The expected outcome + here should be 5, which seems correct. I''ll mentally check it to be sure. + + + Next, I take the result from that first calculation, which is 5, and I add + 4 to it, again using the "add" tool. I expect to get 9 here. + + + Finally, I just have to report the final result, which is the 9 from the second + calculation. Basically, it’s a two-step process: `add(2, 3)` then `add(result_from_step1, + 4)`, and finally, the output. + + + + ' + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EuEECt4EAWkUfROlRmusje4h46Y+IE1KD5GkENSXTTrHbWBVozezh6zEjYscYBgY0QokZRG2eg3DJk8mVSxxDtkhpx1mU1CIgpkcvqdpTK9irMmC7uz+6QEwfofVGiijnm0cr7k1Nlg9qt35+pdIHq1o4dn3B1xn+ouiSq2y69PLSMmjKRstyi1WB87YvrBXLXBbmWJZH0W2/w1OPdVLra69XF5yUj7mSDS3L1Y42LYVAxS1LuG9T3mxwpw/QzGrT61leKL+nAiEgGnmvZCaLjUpoQN2+Bu6sURto5djHLB/RtOkCE6BQ2el1MT2ynR+Sg8x2P1qV/ZCVOnYsua0ALzbpSSGg2MduXwplP6u71YRxuA6aRdFJa29jDZ98T26UwtPCCNn7fdKhGht/cKizhb8Ebj6xBI2F2X1QpQh2p9LxTfgkUPuWHEGYO8DfcHzNjoFz2mkP5QFfDDR0qyooNfGWLM6bczIAXW8Xyr/MN7PNLe8fujNRZCop1DYjBTE4dH5Y67+NJLqdTw6VDCgDTobZQArlHzqNQQyfqU5ttDAlPnyAxKtjl0BdSxHkFQgiVY6j5N5l/p/FqQD+emQP2RqP1YEsJ8BXvMq9Oiga1ncPr3Rxx5fUlBMzy8DrjidQusEuSuEzOCXzeD2n3wUE7Wsehi9TKkVU4aPA3pVSoSa0Vxf5UVtdpXqJiwbYz4LDOlNNqo5UCeuYyCwXwVWnEF4mWrq4G1xb/xQ5R8VIvd30q/Lqk9AlHF+AMYTxzl04UD7yQfsOiY3s9WkuGmkwlimsLGrEVk3RRMOXWHtUSw0cnnb + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_1242298174733071490 + type: function + - content: '5' + role: tool + tool_call_id: call_1242298174733071490 + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EvsBCvgBAWkUfRPgh75DaYBo716Q7SUvSFq+qFmiPT6YTRyjEEXEs/2wpA+eDigzPL3ODKIzcdnjaj3mqwmCBWqvtN+BSSO7MOwl5/tfPo2Uq18oIPwOwvznhB1XuOY/bqi0L9pvnYuNJ29XLSIKhdttIgAgDD4DFA2sv8Q/VdZPxopC20pZfLOPPHIOouBfoyRhFweZPitZDf2r/QYaPGp0mJDJSdiBLerIZu73pxDsRnDMt1euRagGHeLqYoVOULqgtP2UU9qi2YEQe69uJKM6jFLK4fCRDiHIwnpUVYmjf/EHzBogeoiFuRCCBlCMOJDzB8Qte4xq1CwEqso= + function: + arguments: '{"b":4,"a":5}' + name: add + id: call_7085737281323246864 + type: function + - content: '9' + role: tool + tool_call_id: call_7085737281323246864 + model: gemini-3.1-flash-lite + stream: true + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '3092' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1ee03-b8f6-7963-b774-497ec7491cd0 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"The final answer is 9.","role":"assistant"},"index":0}],"created":1794994584,"id":"l3H9ao_LNLS-qtsP1JXPwQk","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EsMBCsABAWkUfRM6J/tDzSM3oUllV1LwSNVldJ9NEKls758Z5WaXWvrrtEn7LexXypUfnlOl3wqynvgqW1hm7MjS2VzECKa1mAVHqWbQc2lCl0Iy3FN4Ap0l2E8Oo46LkO7dZ7OoKlbiP/sy9wfzz6OoNcAv/oxnveED4s/GaAjnz3GyuPVKQ5b9NSSUmrw71YN9jAbkTOorZF//DNP9ZBXXtFgqGxcNxt7stBUvOBSfkgcqPJlA7eXjEsbNhMCN8BIGK91X"}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994584,"id":"l3H9ao_LNLS-qtsP1JXPwQk","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:36:23.798199+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..03fd9ad --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-00.yaml @@ -0,0 +1,146 @@ +filename: 2026-11-18-01a1edfe-523a-7f81-b266-3d88c2d0beb4 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + model: gemini-3.1-flash-lite + stream: false + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '529' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-523a-7f81-b266-3d88c2d0beb4 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + content: 'Okay, let''s break this down systematically. Here''s what + I''m thinking: + + + **My Computational Approach** + + + Alright, I''m presented with a straightforward arithmetic problem disguised + as a series of function calls. My immediate approach is to break it down + into a sequence of operations. The core of the issue is multi-step addition, + to be carried out programmatically. + + + First, I need to execute a function call, `add(a=2, b=3)`. That''s the initial + calculation. I expect a result of 5. Seems simple enough. + + + Next, the prompt instructs me to take the *result* from the previous step + (which I just calculated in my head and confirmed), and use it in another + function call: `add(a=5, b=4)`. This is a clear indicator of a sequential + dependency. Now, with the result of `5` from the first call, `add(5, 4)` + should yield `9`. + + + Finally, after these two steps are complete, I have to state the *final + answer* explicitly. So, from `add(a=5, b=4)` I arrive at `9`, and that is + my final response to the problem. The goal is to obtain `9` and report it. + + + + ' + extra_content: + google: + thought: true + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: Es0DCsoDAWkUfROwLl4EXnEvffvRw6/YVLSRIGUzjSYkEDtoKPYmG6IXrHMgNmyaK02e1Ka5ZjMDmdZL3kBBu5+u1JCp7hozMm8uYaZBcAHVpnZerQFY6dSzLiPwzIfU++GwosYg/2CGku3fYcDNfF9nPAm0nXNRUn1ozTAm9V9g0WnnfrD+7842sr/BzGfclmXS2xNv4JeLhunaDB2peujcomFIqkmHCJOCCiBj1qOiwWR7G5rtKLNP64CFw8fPxq3BZJBSvyEFt6cL6NYEGroOg7aLjsmcdtiMwD+6Gya7X6MBwQzWy6Cvc2nyyYpGctd1mVpxmRs7DScRS1ByzQ8hr2qBNKe3a5Iy4yei737lfLEkCBWJ0w/OBrf4w0M/cx+fIM4NqJD4PuMB6yrmjc8/o5DBOSXJ8estqvsFGvl12JA+AwGQ+09Xuy7OsbIx7mBElmx5ejDiH2GRgVYCvwwOhBNWE8RPzXjdiWTkkBP22E57ZxxEe2vK+VR38EjendNke2PZ0ohn8uY6Fto3pt/T6MozGZbcH0LHvO+cvNAHWy6SmO9pLBXyJ6y2VAJUr+GKTuBpkvbM3WMZLB/OYSjjuPXki9NMCWjHrvEx9CQ= + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_11668853144820697279 + type: function + created: 1794994232 + id: NXD9aqKVNdiGz7IPjZOosQs + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 16 + prompt_tokens: 77 + total_tokens: 213 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoidG9vbF9jYWxscyIsImluZGV4IjowLCJtZXNz + YWdlIjp7ImNvbnRlbnQiOiI8dGhvdWdodD5Pa2F5LCBsZXQncyBicmVhayB0aGlzIGRvd24gc3lz + dGVtYXRpY2FsbHkuIEhlcmUncyB3aGF0IEknbSB0aGlua2luZzpcblxuKipNeSBDb21wdXRhdGlv + bmFsIEFwcHJvYWNoKipcblxuQWxyaWdodCwgSSdtIHByZXNlbnRlZCB3aXRoIGEgc3RyYWlnaHRm + b3J3YXJkIGFyaXRobWV0aWMgcHJvYmxlbSBkaXNndWlzZWQgYXMgYSBzZXJpZXMgb2YgZnVuY3Rp + b24gY2FsbHMuIE15IGltbWVkaWF0ZSBhcHByb2FjaCBpcyB0byBicmVhayBpdCBkb3duIGludG8g + YSBzZXF1ZW5jZSBvZiBvcGVyYXRpb25zLiBUaGUgY29yZSBvZiB0aGUgaXNzdWUgaXMgbXVsdGkt + c3RlcCBhZGRpdGlvbiwgdG8gYmUgY2FycmllZCBvdXQgcHJvZ3JhbW1hdGljYWxseS5cblxuRmly + c3QsIEkgbmVlZCB0byBleGVjdXRlIGEgZnVuY3Rpb24gY2FsbCwgYGFkZChhPTIsIGI9MylgLiBU + aGF0J3MgdGhlIGluaXRpYWwgY2FsY3VsYXRpb24uIEkgZXhwZWN0IGEgcmVzdWx0IG9mIDUuIFNl + ZW1zIHNpbXBsZSBlbm91Z2guXG5cbk5leHQsIHRoZSBwcm9tcHQgaW5zdHJ1Y3RzIG1lIHRvIHRh + a2UgdGhlICpyZXN1bHQqIGZyb20gdGhlIHByZXZpb3VzIHN0ZXAgKHdoaWNoIEkganVzdCBjYWxj + dWxhdGVkIGluIG15IGhlYWQgYW5kIGNvbmZpcm1lZCksIGFuZCB1c2UgaXQgaW4gYW5vdGhlciBm + dW5jdGlvbiBjYWxsOiBgYWRkKGE9NSwgYj00KWAuIFRoaXMgaXMgYSBjbGVhciBpbmRpY2F0b3Ig + b2YgYSBzZXF1ZW50aWFsIGRlcGVuZGVuY3kuIE5vdywgd2l0aCB0aGUgcmVzdWx0IG9mIGA1YCBm + cm9tIHRoZSBmaXJzdCBjYWxsLCBgYWRkKDUsIDQpYCBzaG91bGQgeWllbGQgYDlgLlxuXG5GaW5h + bGx5LCBhZnRlciB0aGVzZSB0d28gc3RlcHMgYXJlIGNvbXBsZXRlLCBJIGhhdmUgdG8gc3RhdGUg + dGhlICpmaW5hbCBhbnN3ZXIqIGV4cGxpY2l0bHkuIFNvLCBmcm9tIGBhZGQoYT01LCBiPTQpYCBJ + IGFycml2ZSBhdCBgOWAsIGFuZCB0aGF0IGlzIG15IGZpbmFsIHJlc3BvbnNlIHRvIHRoZSBwcm9i + bGVtLiBUaGUgZ29hbCBpcyB0byBvYnRhaW4gYDlgIGFuZCByZXBvcnQgaXQuXG5cblxuPC90aG91 + Z2h0PiIsImV4dHJhX2NvbnRlbnQiOnsiZ29vZ2xlIjp7InRob3VnaHQiOnRydWV9fSwicm9sZSI6 + ImFzc2lzdGFudCIsInRvb2xfY2FsbHMiOlt7ImV4dHJhX2NvbnRlbnQiOnsiZ29vZ2xlIjp7InRo + b3VnaHRfc2lnbmF0dXJlIjoiRXMwRENzb0RBV2tVZlJPd0xsNEVYbkV2ZmZ2Unc2L1lWTFNSSUdV + empTWWtFRHRvS1BZbUc2SVhySE1nTm15YUswMmUxS2E1WmpNRG1kWkwza0JCdTUrdTFKQ3A3aG96 + TW04dVlhWkJjQUhWcG5aZXJRRlk2ZFN6TGlQd3pJZlUrK0d3b3NZZy8yQ0drdTNmWWNETmZGOW5Q + QW0wblhOUlVuMW96VEFtOVY5ZzBXbm5mckQrNzg0MnNyL0J6R2ZjbG1YUzJ4TnY0SmVMaHVuYURC + MnBldWpjb21GSXFrbUhDSk9DQ2lCajFxT2l3V1I3RzVydEtMTlA2NENGdzhmUHhxM0JaSkJTdnlF + RnQ2Y0w2TllFR3JvT2c3YUxqc21jZHRpTXdEKzZHeWE3WDZNQndReld5NkN2YzJueXlZcEdjdGQx + bVZweG1SczdEU2NSUzFCeXpROGhyMnFCTktlM2E1SXk0eWVpNzM3bGZMRWtDQldKMHcvT0JyZjR3 + ME0vY3grZklNNE5xSkQ0UHVNQjZ5cm1qYzgvbzVEQk9TWEo4ZXN0cXZzRkd2bDEySkErQXdHUSsw + OVh1eTdPc2JJeDdtQkVsbXg1ZWpEaUgyR1JnVllDdnd3T2hCTldFOFJQelhqZGlXVGtrQlAyMkU1 + N1p4eEVlMnZLK1ZSMzhFamVuZE5rZTJQWjBvaG44dVk2RnRvM3B0L1Q2TW96R1piY0gwTEh2Tytj + dk5BSFd5NlNtTzlwTEJYeUo2eTJWQUpVcitHS1R1QnBrdmJNM1dNWkxCL09ZU2pqdVBYa2k5Tk1D + V2pIcnZFeDlDUT0ifX0sImZ1bmN0aW9uIjp7ImFyZ3VtZW50cyI6IntcImJcIjozLFwiYVwiOjJ9 + IiwibmFtZSI6ImFkZCJ9LCJpZCI6ImNhbGxfMTE2Njg4NTMxNDQ4MjA2OTcyNzkiLCJ0eXBlIjoi + ZnVuY3Rpb24ifV19fV0sImNyZWF0ZWQiOjE3OTQ5OTQyMzIsImlkIjoiTlhEOWFxS1ZOZGlHejdJ + UGpaT29zUXMiLCJtb2RlbCI6ImdlbWluaS0zLjEtZmxhc2gtbGl0ZSIsIm9iamVjdCI6ImNoYXQu + Y29tcGxldGlvbiIsInVzYWdlIjp7ImNvbXBsZXRpb25fdG9rZW5zIjoxNiwicHJvbXB0X3Rva2Vu + cyI6NzcsInRvdGFsX3Rva2VucyI6MjEzfX0= + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:30:29.818811+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..b5963bc --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-01.yaml @@ -0,0 +1,169 @@ +filename: 2026-11-18-01a1edfe-5b89-7b40-a630-660d56d87af7 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + - reasoning_content: 'Okay, let''s break this down systematically. Here''s + what I''m thinking: + + + **My Computational Approach** + + + Alright, I''m presented with a straightforward arithmetic problem disguised + as a series of function calls. My immediate approach is to break it down into + a sequence of operations. The core of the issue is multi-step addition, to + be carried out programmatically. + + + First, I need to execute a function call, `add(a=2, b=3)`. That''s the initial + calculation. I expect a result of 5. Seems simple enough. + + + Next, the prompt instructs me to take the *result* from the previous step + (which I just calculated in my head and confirmed), and use it in another + function call: `add(a=5, b=4)`. This is a clear indicator of a sequential + dependency. Now, with the result of `5` from the first call, `add(5, 4)` should + yield `9`. + + + Finally, after these two steps are complete, I have to state the *final answer* + explicitly. So, from `add(a=5, b=4)` I arrive at `9`, and that is my final + response to the problem. The goal is to obtain `9` and report it. + + + + ' + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: Es0DCsoDAWkUfROwLl4EXnEvffvRw6/YVLSRIGUzjSYkEDtoKPYmG6IXrHMgNmyaK02e1Ka5ZjMDmdZL3kBBu5+u1JCp7hozMm8uYaZBcAHVpnZerQFY6dSzLiPwzIfU++GwosYg/2CGku3fYcDNfF9nPAm0nXNRUn1ozTAm9V9g0WnnfrD+7842sr/BzGfclmXS2xNv4JeLhunaDB2peujcomFIqkmHCJOCCiBj1qOiwWR7G5rtKLNP64CFw8fPxq3BZJBSvyEFt6cL6NYEGroOg7aLjsmcdtiMwD+6Gya7X6MBwQzWy6Cvc2nyyYpGctd1mVpxmRs7DScRS1ByzQ8hr2qBNKe3a5Iy4yei737lfLEkCBWJ0w/OBrf4w0M/cx+fIM4NqJD4PuMB6yrmjc8/o5DBOSXJ8estqvsFGvl12JA+AwGQ+09Xuy7OsbIx7mBElmx5ejDiH2GRgVYCvwwOhBNWE8RPzXjdiWTkkBP22E57ZxxEe2vK+VR38EjendNke2PZ0ohn8uY6Fto3pt/T6MozGZbcH0LHvO+cvNAHWy6SmO9pLBXyJ6y2VAJUr+GKTuBpkvbM3WMZLB/OYSjjuPXki9NMCWjHrvEx9CQ= + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_11668853144820697279 + type: function + - content: '5' + role: tool + tool_call_id: call_11668853144820697279 + model: gemini-3.1-flash-lite + stream: false + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2514' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-5b89-7b40-a630-660d56d87af7 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + content: 'Okay, here''s my take on those thoughts, tailored for an + expert audience: + + + **Internal Arithmetic and Incremental Calculation** + + + Alright, so the initial operation, 2 + 3, that''s straightforward - we arrive + at 5. No surprises there. The interesting part, from my perspective, is + the *immediacy* of the next step. It''s not just a declaration of the outcome + of the first operation; it''s the *imperative* to increment that result + by 4. This signifies a fundamental understanding of sequential computation. + We''re not revisiting the initial operands or seeking an alternative path; + we''re using the previous outcome as the explicit input for the next operation. + This approach highlights an efficient and direct method, reflecting procedural + thinking. It''s a foundational process to any more complex computation. + + + + ' + extra_content: + google: + thought: true + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EtoBCtcBAWkUfRP4qlwQiw2zyqBRctLaCpa2vntiAZwS2cW1oIi1kNNCKBI6HTozzX4zINOJYt4jyCpUGQ5CYuEsxbO+d8DmiZUCi6XKvNfV7IJd/AAQVuPzij8Yd4Pz98isvJ/3F7zz5AvY9dj4aJUupWCHnY3uchNzTFSh6N+ScBfiRkUWgmDLcMsf6cVCFv+jQ49hEvOJKT7zJjRuTsIxovtJI7A5OdCJ+7YZYMVSMzRHmzOabRLxuDCs6icxQrK1LBReGUQOYFQoH715ZR6JPs3thdBtIFZz3VE= + function: + arguments: '{"b":4,"a":5}' + name: add + id: call_1952945104862225886 + type: function + created: 1794994234 + id: OHD9at7fD427qtsPrZibiAk + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 16 + prompt_tokens: 225 + total_tokens: 265 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoidG9vbF9jYWxscyIsImluZGV4IjowLCJtZXNz + YWdlIjp7ImNvbnRlbnQiOiI8dGhvdWdodD5Pa2F5LCBoZXJlJ3MgbXkgdGFrZSBvbiB0aG9zZSB0 + aG91Z2h0cywgdGFpbG9yZWQgZm9yIGFuIGV4cGVydCBhdWRpZW5jZTpcblxuKipJbnRlcm5hbCBB + cml0aG1ldGljIGFuZCBJbmNyZW1lbnRhbCBDYWxjdWxhdGlvbioqXG5cbkFscmlnaHQsIHNvIHRo + ZSBpbml0aWFsIG9wZXJhdGlvbiwgMiArIDMsIHRoYXQncyBzdHJhaWdodGZvcndhcmQgLSB3ZSBh + cnJpdmUgYXQgNS4gTm8gc3VycHJpc2VzIHRoZXJlLiBUaGUgaW50ZXJlc3RpbmcgcGFydCwgZnJv + bSBteSBwZXJzcGVjdGl2ZSwgaXMgdGhlICppbW1lZGlhY3kqIG9mIHRoZSBuZXh0IHN0ZXAuIEl0 + J3Mgbm90IGp1c3QgYSBkZWNsYXJhdGlvbiBvZiB0aGUgb3V0Y29tZSBvZiB0aGUgZmlyc3Qgb3Bl + cmF0aW9uOyBpdCdzIHRoZSAqaW1wZXJhdGl2ZSogdG8gaW5jcmVtZW50IHRoYXQgcmVzdWx0IGJ5 + IDQuIFRoaXMgc2lnbmlmaWVzIGEgZnVuZGFtZW50YWwgdW5kZXJzdGFuZGluZyBvZiBzZXF1ZW50 + aWFsIGNvbXB1dGF0aW9uLiBXZSdyZSBub3QgcmV2aXNpdGluZyB0aGUgaW5pdGlhbCBvcGVyYW5k + cyBvciBzZWVraW5nIGFuIGFsdGVybmF0aXZlIHBhdGg7IHdlJ3JlIHVzaW5nIHRoZSBwcmV2aW91 + cyBvdXRjb21lIGFzIHRoZSBleHBsaWNpdCBpbnB1dCBmb3IgdGhlIG5leHQgb3BlcmF0aW9uLiBU + aGlzIGFwcHJvYWNoIGhpZ2hsaWdodHMgYW4gZWZmaWNpZW50IGFuZCBkaXJlY3QgbWV0aG9kLCBy + ZWZsZWN0aW5nIHByb2NlZHVyYWwgdGhpbmtpbmcuIEl0J3MgYSBmb3VuZGF0aW9uYWwgcHJvY2Vz + cyB0byBhbnkgbW9yZSBjb21wbGV4IGNvbXB1dGF0aW9uLlxuXG5cbjwvdGhvdWdodD4iLCJleHRy + YV9jb250ZW50Ijp7Imdvb2dsZSI6eyJ0aG91Z2h0Ijp0cnVlfX0sInJvbGUiOiJhc3Npc3RhbnQi + LCJ0b29sX2NhbGxzIjpbeyJleHRyYV9jb250ZW50Ijp7Imdvb2dsZSI6eyJ0aG91Z2h0X3NpZ25h + dHVyZSI6IkV0b0JDdGNCQVdrVWZSUDRxbHdRaXcyenlxQlJjdExhQ3BhMnZudGlBWndTMmNXMW9J + aTFrTk5DS0JJNkhUb3p6WDR6SU5PSll0NGp5Q3BVR1E1Q1l1RXN4Yk8rZDhEbWlaVUNpNlhLdk5m + VjdJSmQvQUFRVnVQemlqOFlkNFB6OThpc3ZKLzNGN3p6NUF2WTlkajRhSlV1cFdDSG5ZM3VjaE56 + VEZTaDZOK1NjQmZpUmtVV2dtRExjTXNmNmNWQ0Z2K2pRNDloRXZPSktUN3pKalJ1VHNJeG92dEpJ + N0E1T2RDSis3WVpZTVZTTXpSSG16T2FiUkx4dURDczZpY3hRcksxTEJSZUdVUU9ZRlFvSDcxNVpS + NkpQczN0aGRCdElGWnozVkU9In19LCJmdW5jdGlvbiI6eyJhcmd1bWVudHMiOiJ7XCJiXCI6NCxc + ImFcIjo1fSIsIm5hbWUiOiJhZGQifSwiaWQiOiJjYWxsXzE5NTI5NDUxMDQ4NjIyMjU4ODYiLCJ0 + eXBlIjoiZnVuY3Rpb24ifV19fV0sImNyZWF0ZWQiOjE3OTQ5OTQyMzQsImlkIjoiT0hEOWF0N2ZE + NDI3cXRzUHJaaWJpQWsiLCJtb2RlbCI6ImdlbWluaS0zLjEtZmxhc2gtbGl0ZSIsIm9iamVjdCI6 + ImNoYXQuY29tcGxldGlvbiIsInVzYWdlIjp7ImNvbXBsZXRpb25fdG9rZW5zIjoxNiwicHJvbXB0 + X3Rva2VucyI6MjI1LCJ0b3RhbF90b2tlbnMiOjI2NX19 + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:30:32.201911+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..5d28260 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-non_stream-02.yaml @@ -0,0 +1,187 @@ +filename: 2026-11-18-01a1edfe-62d4-7690-9a3f-58bf31512fa7 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + - reasoning_content: 'Okay, let''s break this down systematically. Here''s + what I''m thinking: + + + **My Computational Approach** + + + Alright, I''m presented with a straightforward arithmetic problem disguised + as a series of function calls. My immediate approach is to break it down into + a sequence of operations. The core of the issue is multi-step addition, to + be carried out programmatically. + + + First, I need to execute a function call, `add(a=2, b=3)`. That''s the initial + calculation. I expect a result of 5. Seems simple enough. + + + Next, the prompt instructs me to take the *result* from the previous step + (which I just calculated in my head and confirmed), and use it in another + function call: `add(a=5, b=4)`. This is a clear indicator of a sequential + dependency. Now, with the result of `5` from the first call, `add(5, 4)` should + yield `9`. + + + Finally, after these two steps are complete, I have to state the *final answer* + explicitly. So, from `add(a=5, b=4)` I arrive at `9`, and that is my final + response to the problem. The goal is to obtain `9` and report it. + + + + ' + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: Es0DCsoDAWkUfROwLl4EXnEvffvRw6/YVLSRIGUzjSYkEDtoKPYmG6IXrHMgNmyaK02e1Ka5ZjMDmdZL3kBBu5+u1JCp7hozMm8uYaZBcAHVpnZerQFY6dSzLiPwzIfU++GwosYg/2CGku3fYcDNfF9nPAm0nXNRUn1ozTAm9V9g0WnnfrD+7842sr/BzGfclmXS2xNv4JeLhunaDB2peujcomFIqkmHCJOCCiBj1qOiwWR7G5rtKLNP64CFw8fPxq3BZJBSvyEFt6cL6NYEGroOg7aLjsmcdtiMwD+6Gya7X6MBwQzWy6Cvc2nyyYpGctd1mVpxmRs7DScRS1ByzQ8hr2qBNKe3a5Iy4yei737lfLEkCBWJ0w/OBrf4w0M/cx+fIM4NqJD4PuMB6yrmjc8/o5DBOSXJ8estqvsFGvl12JA+AwGQ+09Xuy7OsbIx7mBElmx5ejDiH2GRgVYCvwwOhBNWE8RPzXjdiWTkkBP22E57ZxxEe2vK+VR38EjendNke2PZ0ohn8uY6Fto3pt/T6MozGZbcH0LHvO+cvNAHWy6SmO9pLBXyJ6y2VAJUr+GKTuBpkvbM3WMZLB/OYSjjuPXki9NMCWjHrvEx9CQ= + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_11668853144820697279 + type: function + - content: '5' + role: tool + tool_call_id: call_11668853144820697279 + - reasoning_content: 'Okay, here''s my take on those thoughts, tailored + for an expert audience: + + + **Internal Arithmetic and Incremental Calculation** + + + Alright, so the initial operation, 2 + 3, that''s straightforward - we arrive + at 5. No surprises there. The interesting part, from my perspective, is the + *immediacy* of the next step. It''s not just a declaration of the outcome + of the first operation; it''s the *imperative* to increment that result by + 4. This signifies a fundamental understanding of sequential computation. We''re + not revisiting the initial operands or seeking an alternative path; we''re + using the previous outcome as the explicit input for the next operation. This + approach highlights an efficient and direct method, reflecting procedural + thinking. It''s a foundational process to any more complex computation. + + + + ' + role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EtoBCtcBAWkUfRP4qlwQiw2zyqBRctLaCpa2vntiAZwS2cW1oIi1kNNCKBI6HTozzX4zINOJYt4jyCpUGQ5CYuEsxbO+d8DmiZUCi6XKvNfV7IJd/AAQVuPzij8Yd4Pz98isvJ/3F7zz5AvY9dj4aJUupWCHnY3uchNzTFSh6N+ScBfiRkUWgmDLcMsf6cVCFv+jQ49hEvOJKT7zJjRuTsIxovtJI7A5OdCJ+7YZYMVSMzRHmzOabRLxuDCs6icxQrK1LBReGUQOYFQoH715ZR6JPs3thdBtIFZz3VE= + function: + arguments: '{"b":4,"a":5}' + name: add + id: call_1952945104862225886 + type: function + - content: '9' + role: tool + tool_call_id: call_1952945104862225886 + model: gemini-3.1-flash-lite + stream: false + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '3934' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-62d4-7690-9a3f-58bf31512fa7 +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: 'Here''s my attempt at summarizing the thought process, + tailored for an expert audience: + + + **Procedural Verification and Resultant Value** + + + Alright, let''s break this down. My internal state at this point is pretty + straightforward. I''ve initiated a computation: 5 + 4. The mechanics are + simple – applying the addition operation to the operands. I''ve executed + the operation, and arrived at the final digit, "9." This outcome represents + the validated result of the initial equation. It''s confirmation that the + system is functioning as expected and adheres to the established mathematical + principles. I can move on, as the process is complete. + + + + The final answer is 9.' + extra_content: + google: + thought: true + thought_signature: EtIBCs8BAWkUfRPMcl8JM4TblPsD0j2mYAbBiQcp2RObG9bwb+iGLQeLZ8xt/84VlZQZ2s60VOJRaULSahahlKDUlNsY7Aw/jCqYRqzCFu5/Z5fUkfj+c85SIUhI/QQkJNmyt8HLghyWAxlXPDu1QV3nZ9aU6uf9TrMR41+rcPusPS9HjSsoMIV+1BufoHZ+oo+IOy9llIqlQcz1UZjpuzoutU0OgPMaIkflZjKwQAr6RlMjOzInXRuPaoxsizELCLvsAAka0fO5wDAbkBHetklIGYlP + role: assistant + created: 1794994235 + id: OnD9auXdBubVz7IPz57J8QE + model: gemini-3.1-flash-lite + object: chat.completion + usage: + completion_tokens: 7 + prompt_tokens: 277 + total_tokens: 303 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoic3RvcCIsImluZGV4IjowLCJtZXNzYWdlIjp7 + ImNvbnRlbnQiOiI8dGhvdWdodD5IZXJlJ3MgbXkgYXR0ZW1wdCBhdCBzdW1tYXJpemluZyB0aGUg + dGhvdWdodCBwcm9jZXNzLCB0YWlsb3JlZCBmb3IgYW4gZXhwZXJ0IGF1ZGllbmNlOlxuXG4qKlBy + b2NlZHVyYWwgVmVyaWZpY2F0aW9uIGFuZCBSZXN1bHRhbnQgVmFsdWUqKlxuXG5BbHJpZ2h0LCBs + ZXQncyBicmVhayB0aGlzIGRvd24uIE15IGludGVybmFsIHN0YXRlIGF0IHRoaXMgcG9pbnQgaXMg + cHJldHR5IHN0cmFpZ2h0Zm9yd2FyZC4gSSd2ZSBpbml0aWF0ZWQgYSBjb21wdXRhdGlvbjogNSAr + IDQuIFRoZSBtZWNoYW5pY3MgYXJlIHNpbXBsZSDigJMgYXBwbHlpbmcgdGhlIGFkZGl0aW9uIG9w + ZXJhdGlvbiB0byB0aGUgb3BlcmFuZHMuIEkndmUgZXhlY3V0ZWQgdGhlIG9wZXJhdGlvbiwgYW5k + IGFycml2ZWQgYXQgdGhlIGZpbmFsIGRpZ2l0LCBcIjkuXCIgVGhpcyBvdXRjb21lIHJlcHJlc2Vu + dHMgdGhlIHZhbGlkYXRlZCByZXN1bHQgb2YgdGhlIGluaXRpYWwgZXF1YXRpb24uIEl0J3MgY29u + ZmlybWF0aW9uIHRoYXQgdGhlIHN5c3RlbSBpcyBmdW5jdGlvbmluZyBhcyBleHBlY3RlZCBhbmQg + YWRoZXJlcyB0byB0aGUgZXN0YWJsaXNoZWQgbWF0aGVtYXRpY2FsIHByaW5jaXBsZXMuIEkgY2Fu + IG1vdmUgb24sIGFzIHRoZSBwcm9jZXNzIGlzIGNvbXBsZXRlLlxuXG5cbjwvdGhvdWdodD5UaGUg + ZmluYWwgYW5zd2VyIGlzIDkuIiwiZXh0cmFfY29udGVudCI6eyJnb29nbGUiOnsidGhvdWdodCI6 + dHJ1ZSwidGhvdWdodF9zaWduYXR1cmUiOiJFdElCQ3M4QkFXa1VmUlBNY2w4Sk00VGJsUHNEMGoy + bVlBYkJpUWNwMlJPYkc5YndiK2lHTFFlTFo4eHQvODRWbFpRWjJzNjBWT0pSYVVMU2FoYWhsS0RV + bE5zWTdBdy9qQ3FZUnF6Q0Z1NS9aNWZVa2ZqK2M4NVNJVWhJL1FRa0pObXl0OEhMZ2h5V0F4bFhQ + RHUxUVYzblo5YVU2dWY5VHJNUjQxK3JjUHVzUFM5SGpTc29NSVYrMUJ1Zm9IWitvbytJT3k5bGxJ + cWxRY3oxVVpqcHV6b3V0VTBPZ1BNYUlrZmxaakt3UUFyNlJsTWpPekluWFJ1UGFveHNpekVMQ0x2 + c0FBa2EwZk81d0RBYmtCSGV0a2xJR1lsUCJ9fSwicm9sZSI6ImFzc2lzdGFudCJ9fV0sImNyZWF0 + ZWQiOjE3OTQ5OTQyMzUsImlkIjoiT25EOWF1WGRCdWJWejdJUHo1N0o4UUUiLCJtb2RlbCI6Imdl + bWluaS0zLjEtZmxhc2gtbGl0ZSIsIm9iamVjdCI6ImNoYXQuY29tcGxldGlvbiIsInVzYWdlIjp7 + ImNvbXBsZXRpb25fdG9rZW5zIjo3LCJwcm9tcHRfdG9rZW5zIjoyNzcsInRvdGFsX3Rva2VucyI6 + MzAzfX0= + headers: + content-type: application/json + status_code: 200 +timestamp: '2026-11-18T09:30:34.068362+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-00.yaml new file mode 100644 index 0000000..c5bb978 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-00.yaml @@ -0,0 +1,71 @@ +filename: 2026-11-18-01a1edfe-2df1-7220-97c6-9947867dc6e9 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + model: gemini-3.1-flash-lite + stream: true + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '528' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-2df1-7220-97c6-9947867dc6e9 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"role":"assistant","tool_calls":[{"extra_content":{"google":{"thought_signature":"EpsECpgEAWkUfRMaa4l7GL2O/RbefI5wzWz/3Pl5njQH3LZ03VrIfCEKUrrs5ttOJg+AbeulKTfOhIvTWfgVCYNbYoI8gC0jpV6KdBCTp369TIlE/dPyMGewAF9y8YFnyevSgaPeVwiKazcxnzpME5ocLVl+wNbjgVmD21Bp1qJotDXnw3S90d4/HmRX0jaylK9hrVDeowebcU09qk0MGt9AuiYYoEBLrU5CeeU4GGoNGcxn6a/qveuzlT2M95GJcqL587W4ZTAO20/9Bi3ZCSilroaCkyQ99DMcUtOKRrM2LH1x/f2LckfgAFUEf6RHZA/dR5pr1OaPEuoxl0glv44M2pqPFBkuQZzNg2hADX+vPNBmbMSJn8DQZ5Kz/G6Idq05sLU2YsrBSeCHi7nyzfA78sgTwRHAuvDMy90tNg6vVrND47F3VJfQiOKWXzKquHM1LPuwPnukE5xkbsIqUnotFahkoihkQnezjmSDy/WktqgMws6y/652287/fs+laLmIlbmYw02IK92TfQXrGWvTuVXSHrj3476nRJFu0HFcWAq4jvvH2hwhdDLuDWn7FL2/mcRpruE8H3S9Psf1ugCKcxqrzKFXOk6o5aMnOp9mAAPg5WI/8Z0/g1vaEFwzTDU8ue0WSrw+Fp8Lgfn7kNkfPI8qGt3kIFrDYLYm1VmLNdD1cH/F0++4WSHotWJ+5ZqWkx1VV4NWep9niZ8="}},"function":{"arguments":"{\"b\":3,\"a\":2}","name":"add"},"id":"call_3788929684196399234","type":"function"}]},"index":0}],"created":1794994221,"id":"LHD9aseMJcqtmtkP4qnqgQE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994221,"id":"LHD9aseMJcqtmtkP4qnqgQE","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:30:20.529458+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-01.yaml new file mode 100644 index 0000000..d6e64a5 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-01.yaml @@ -0,0 +1,84 @@ +filename: 2026-11-18-01a1edfe-3126-71b0-9464-e8a366a58134 +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EpsECpgEAWkUfRMaa4l7GL2O/RbefI5wzWz/3Pl5njQH3LZ03VrIfCEKUrrs5ttOJg+AbeulKTfOhIvTWfgVCYNbYoI8gC0jpV6KdBCTp369TIlE/dPyMGewAF9y8YFnyevSgaPeVwiKazcxnzpME5ocLVl+wNbjgVmD21Bp1qJotDXnw3S90d4/HmRX0jaylK9hrVDeowebcU09qk0MGt9AuiYYoEBLrU5CeeU4GGoNGcxn6a/qveuzlT2M95GJcqL587W4ZTAO20/9Bi3ZCSilroaCkyQ99DMcUtOKRrM2LH1x/f2LckfgAFUEf6RHZA/dR5pr1OaPEuoxl0glv44M2pqPFBkuQZzNg2hADX+vPNBmbMSJn8DQZ5Kz/G6Idq05sLU2YsrBSeCHi7nyzfA78sgTwRHAuvDMy90tNg6vVrND47F3VJfQiOKWXzKquHM1LPuwPnukE5xkbsIqUnotFahkoihkQnezjmSDy/WktqgMws6y/652287/fs+laLmIlbmYw02IK92TfQXrGWvTuVXSHrj3476nRJFu0HFcWAq4jvvH2hwhdDLuDWn7FL2/mcRpruE8H3S9Psf1ugCKcxqrzKFXOk6o5aMnOp9mAAPg5WI/8Z0/g1vaEFwzTDU8ue0WSrw+Fp8Lgfn7kNkfPI8qGt3kIFrDYLYm1VmLNdD1cH/F0++4WSHotWJ+5ZqWkx1VV4NWep9niZ8= + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_3788929684196399234 + type: function + - content: '5' + role: tool + tool_call_id: call_3788929684196399234 + model: gemini-3.1-flash-lite + stream: true + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '1522' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-3126-71b0-9464-e8a366a58134 +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"role":"assistant","tool_calls":[{"extra_content":{"google":{"thought_signature":"Eo8CCowCAWkUfRMwIxJ2oZCY1HKYAMBnqlgeIHb+L7LQ4an8Tf+yDylDNWtK7eC8GNyTtxh/svb9HKzoOcUULJh35B0ycyAs2zY+PrjdibGcvPI1Ocz1bLJq81SieYQNG4IXyD7hcsyjc0L3/R4SlcyzlQF4lSWOwJO+8w35TJ33PMxei9Sk1v3VwPmZTo7bpMRuLc6Jg03en5f2SOl3Km06F7Yw+wp/Ep35/dDrKe8MJDJRhjwD+MP8PppEQXEFQF4l9OjzvDtPFHG1B5dbFMj5o9/4JjkWeYvEnnjB56OnznmjmkVNYa/Pb6f7WBUuvFmSxUvj1xMzdx56AxWUKqWeS79eceeNRwse1iRf9+oLfw=="}},"function":{"arguments":"{\"b\":4,\"a\":5}","name":"add"},"id":"call_16136726645732575664","type":"function"}]},"index":0}],"created":1794994222,"id":"LXD9aqDyGMuJz7IP-vrY2Qs","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994222,"id":"LXD9aqDyGMuJz7IP-vrY2Qs","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:30:21.350515+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-02.yaml new file mode 100644 index 0000000..4646e36 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/gemini-chat_completions-stream-02.yaml @@ -0,0 +1,97 @@ +filename: 2026-11-18-01a1edfe-33da-7d90-a859-0a519b0d807e +request: + body: + extra_body: + google: + thinking_config: + include_thoughts: true + thinking_level: medium + max_completion_tokens: 2048 + messages: + - content: Use add for 2 + 3, then use add for that result + 4, then report the + final answer. + role: user + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: EpsECpgEAWkUfRMaa4l7GL2O/RbefI5wzWz/3Pl5njQH3LZ03VrIfCEKUrrs5ttOJg+AbeulKTfOhIvTWfgVCYNbYoI8gC0jpV6KdBCTp369TIlE/dPyMGewAF9y8YFnyevSgaPeVwiKazcxnzpME5ocLVl+wNbjgVmD21Bp1qJotDXnw3S90d4/HmRX0jaylK9hrVDeowebcU09qk0MGt9AuiYYoEBLrU5CeeU4GGoNGcxn6a/qveuzlT2M95GJcqL587W4ZTAO20/9Bi3ZCSilroaCkyQ99DMcUtOKRrM2LH1x/f2LckfgAFUEf6RHZA/dR5pr1OaPEuoxl0glv44M2pqPFBkuQZzNg2hADX+vPNBmbMSJn8DQZ5Kz/G6Idq05sLU2YsrBSeCHi7nyzfA78sgTwRHAuvDMy90tNg6vVrND47F3VJfQiOKWXzKquHM1LPuwPnukE5xkbsIqUnotFahkoihkQnezjmSDy/WktqgMws6y/652287/fs+laLmIlbmYw02IK92TfQXrGWvTuVXSHrj3476nRJFu0HFcWAq4jvvH2hwhdDLuDWn7FL2/mcRpruE8H3S9Psf1ugCKcxqrzKFXOk6o5aMnOp9mAAPg5WI/8Z0/g1vaEFwzTDU8ue0WSrw+Fp8Lgfn7kNkfPI8qGt3kIFrDYLYm1VmLNdD1cH/F0++4WSHotWJ+5ZqWkx1VV4NWep9niZ8= + function: + arguments: '{"b":3,"a":2}' + name: add + id: call_3788929684196399234 + type: function + - content: '5' + role: tool + tool_call_id: call_3788929684196399234 + - role: assistant + tool_calls: + - extra_content: + google: + thought_signature: Eo8CCowCAWkUfRMwIxJ2oZCY1HKYAMBnqlgeIHb+L7LQ4an8Tf+yDylDNWtK7eC8GNyTtxh/svb9HKzoOcUULJh35B0ycyAs2zY+PrjdibGcvPI1Ocz1bLJq81SieYQNG4IXyD7hcsyjc0L3/R4SlcyzlQF4lSWOwJO+8w35TJ33PMxei9Sk1v3VwPmZTo7bpMRuLc6Jg03en5f2SOl3Km06F7Yw+wp/Ep35/dDrKe8MJDJRhjwD+MP8PppEQXEFQF4l9OjzvDtPFHG1B5dbFMj5o9/4JjkWeYvEnnjB56OnznmjmkVNYa/Pb6f7WBUuvFmSxUvj1xMzdx56AxWUKqWeS79eceeNRwse1iRf9+oLfw== + function: + arguments: '{"b":4,"a":5}' + name: add + id: call_16136726645732575664 + type: function + - content: '9' + role: tool + tool_call_id: call_16136726645732575664 + model: gemini-3.1-flash-lite + stream: true + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate + authorization: Bearer *** + connection: keep-alive + content-length: '2162' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1beta/openai/chat/completions + query_params: {} +request_id: 01a1edfe-33da-7d90-a859-0a519b0d807e +response: + error_event: false + headers: + content-type: text/event-stream + sse: + - 'data: {"choices":[{"delta":{"content":"The final answer is 9.","role":"assistant"},"index":0}],"created":1794994222,"id":"LnD9arTkBvGHz7IP0LvYgA0","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"extra_content":{"google":{"thought_signature":"EsQBCsEBAWkUfRNpiWqNAktgxStHkQ2Nkym2wgyDYBKobIYpnUjF+XQ4ppg3MP+kra6a/zdtOpYdsCS4Zv4/XYDNoVy88ozK63OFEk5iD5GQEQx5NwhkoVh1RBFBQoYexcWLtVpsz305nK7Z5ghBvCV73YtHPAhUQndM3JRZGNuezjbLcIN6DxEBJ6xF210DOqWDdiQM5735K+dWtUR1iBQLMP9ePDpNGBKkAWV+N5Z/Izgkc3JY9fiEnzYgahtMYHJE7kD8UA=="}},"role":"assistant"},"finish_reason":"stop","index":0}],"created":1794994222,"id":"LnD9arTkBvGHz7IP0LvYgA0","model":"gemini-3.1-flash-lite","object":"chat.completion.chunk"} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-18T09:30:22.042678+00:00' +upstream_url: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-00.yaml new file mode 100644 index 0000000..7793f48 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-00.yaml @@ -0,0 +1,821 @@ +filename: 2026-11-04-01a1a48b-917a-7e93-9cdf-6c74f01838ab +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: nvidia/nemotron-3.5-lightning:free + parallel_tool_calls: false + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '653' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a48b-917a-7e93-9cdf-6c74f01838ab +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + sse: + - 'data: {"type":"response.created","response":{"id":"gen-1793761972-ceDTcK3tNCa44UBQ7mYh","object":"response","created_at":1793761972,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":{"type":"function","name":"add"},"parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":0} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","response":{"id":"gen-1793761972-ceDTcK3tNCa44UBQ7mYh","object":"response","created_at":1793761972,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":{"type":"function","name":"add"},"parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":1} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":0,"item":{"id":"rs_tmp_jz24fy2z9lc","type":"reasoning","status":"in_progress","summary":[]},"sequence_number":2} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"part":{"type":"reasoning_text","text":""},"sequence_number":3} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"The","sequence_number":4} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + user","sequence_number":5} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + wants","sequence_number":6} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":":","sequence_number":7} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + Use","sequence_number":8} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + add","sequence_number":9} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + to","sequence_number":10} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + add","sequence_number":11} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 2","sequence_number":12} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + and","sequence_number":13} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 3","sequence_number":14} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":15} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + Then","sequence_number":16} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + use","sequence_number":17} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + add","sequence_number":18} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + to","sequence_number":19} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + add","sequence_number":20} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + that","sequence_number":21} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + result","sequence_number":22} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + and","sequence_number":23} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 4","sequence_number":24} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":25} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + Then","sequence_number":26} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + give","sequence_number":27} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + final","sequence_number":28} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + answer","sequence_number":29} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":30} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"\n\nWe","sequence_number":31} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + need","sequence_number":32} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + to","sequence_number":33} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + call","sequence_number":34} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + add","sequence_number":35} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + function","sequence_number":36} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + twice","sequence_number":37} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":":","sequence_number":38} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + first","sequence_number":39} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + add","sequence_number":40} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 2","sequence_number":41} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + and","sequence_number":42} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 3","sequence_number":43} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + =>","sequence_number":44} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + result","sequence_number":45} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 5","sequence_number":46} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":47} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + Then","sequence_number":48} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + add","sequence_number":49} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + that","sequence_number":50} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + result","sequence_number":51} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + (","sequence_number":52} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"5","sequence_number":53} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":")","sequence_number":54} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + and","sequence_number":55} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 4","sequence_number":56} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + =>","sequence_number":57} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 9","sequence_number":58} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":59} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + Then","sequence_number":60} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + answer","sequence_number":61} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + final","sequence_number":62} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + answer","sequence_number":63} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + 9","sequence_number":64} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":65} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"\n\nWe","sequence_number":66} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + need","sequence_number":67} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + to","sequence_number":68} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + use","sequence_number":69} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + the","sequence_number":70} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + functions","sequence_number":71} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + tool","sequence_number":72} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":73} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + So","sequence_number":74} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + first","sequence_number":75} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + call","sequence_number":76} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + functions","sequence_number":77} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".add","sequence_number":78} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + with","sequence_number":79} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + a","sequence_number":80} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"=2,","sequence_number":81} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + b","sequence_number":82} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"=","sequence_number":83} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"3","sequence_number":84} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":85} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + Then","sequence_number":86} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + call","sequence_number":87} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + again","sequence_number":88} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + with","sequence_number":89} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + a","sequence_number":90} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"=","sequence_number":91} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + result","sequence_number":92} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":",","sequence_number":93} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + b","sequence_number":94} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"=","sequence_number":95} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":"4","sequence_number":96} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":97} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + Then","sequence_number":98} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":" + respond","sequence_number":99} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"delta":".","sequence_number":100} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.done","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"text":"The + user wants: Use add to add 2 and 3. Then use add to add that result and 4. Then + give final answer.\n\nWe need to call add function twice: first add 2 and 3 => + result 5. Then add that result (5) and 4 => 9. Then answer final answer 9.\n\nWe + need to use the functions tool. So first call functions.add with a=2, b=3. Then + call again with a= result, b=4. Then respond.","sequence_number":101} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","output_index":0,"item_id":"rs_tmp_jz24fy2z9lc","content_index":0,"part":{"type":"reasoning_text","text":"The + user wants: Use add to add 2 and 3. Then use add to add that result and 4. Then + give final answer.\n\nWe need to call add function twice: first add 2 and 3 => + result 5. Then add that result (5) and 4 => 9. Then answer final answer 9.\n\nWe + need to use the functions tool. So first call functions.add with a=2, b=3. Then + call again with a= result, b=4. Then respond."},"sequence_number":102} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":0,"item":{"id":"rs_tmp_jz24fy2z9lc","type":"reasoning","status":"completed","content":[{"type":"reasoning_text","text":"The + user wants: Use add to add 2 and 3. Then use add to add that result and 4. Then + give final answer.\n\nWe need to call add function twice: first add 2 and 3 => + result 5. Then add that result (5) and 4 => 9. Then answer final answer 9.\n\nWe + need to use the functions tool. So first call functions.add with a=2, b=3. Then + call again with a= result, b=4. Then respond."}],"summary":[],"format":"unknown"},"sequence_number":103} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":1,"item":{"id":"fc_tmp_yqc49bd84p","type":"function_call","status":"in_progress","call_id":"call-d2207b2b-33a6-4c81-a9ae-92419f3fb3bf","name":"add","arguments":""},"sequence_number":104} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","output_index":1,"item_id":"fc_tmp_yqc49bd84p","delta":"{\n \"a\": + 2,\n \"b\": 3\n}","sequence_number":105} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","output_index":1,"item_id":"fc_tmp_yqc49bd84p","name":"add","arguments":"{\n \"a\": + 2,\n \"b\": 3\n}","sequence_number":106} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":1,"item":{"id":"fc_tmp_yqc49bd84p","type":"function_call","status":"completed","call_id":"call-d2207b2b-33a6-4c81-a9ae-92419f3fb3bf","name":"add","arguments":"{\n \"a\": + 2,\n \"b\": 3\n}"},"sequence_number":107} + + ' + - ' + + ' + - 'data: {"type":"response.completed","response":{"id":"gen-1793761972-ceDTcK3tNCa44UBQ7mYh","object":"response","created_at":1793761972,"model":"nvidia/nemotron-3.5-lightning:free","status":"completed","completed_at":1793761974,"output":[{"id":"rs_tmp_jz24fy2z9lc","type":"reasoning","status":"completed","content":[{"type":"reasoning_text","text":"The + user wants: Use add to add 2 and 3. Then use add to add that result and 4. Then + give final answer.\n\nWe need to call add function twice: first add 2 and 3 => + result 5. Then add that result (5) and 4 => 9. Then answer final answer 9.\n\nWe + need to use the functions tool. So first call functions.add with a=2, b=3. Then + call again with a= result, b=4. Then respond."}],"summary":[],"format":"unknown"},{"id":"fc_tmp_yqc49bd84p","type":"function_call","status":"completed","call_id":"call-d2207b2b-33a6-4c81-a9ae-92419f3fb3bf","name":"add","arguments":"{\n \"a\": + 2,\n \"b\": 3\n}"}],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":{"type":"function","name":"add"},"parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":{"input_tokens":324,"input_tokens_details":{"cached_tokens":0},"output_tokens":126,"output_tokens_details":{"reasoning_tokens":108},"total_tokens":450,"cost":0,"is_byok":false,"cost_details":{"upstream_inference_cost":0,"upstream_inference_input_cost":0,"upstream_inference_output_cost":0}}},"sequence_number":108} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-04T03:12:52.602257+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-01.yaml new file mode 100644 index 0000000..c596e31 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-01.yaml @@ -0,0 +1,245 @@ +filename: 2026-11-04-01a1a48b-9df0-7980-a4b9-23bde9b054f7 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: + - text: 'The user wants: Use add to add 2 and 3. Then use add to add that result + and 4. Then give final answer. + + + We need to call add function twice: first add 2 and 3 => result 5. Then + add that result (5) and 4 => 9. Then answer final answer 9. + + + We need to use the functions tool. So first call functions.add with a=2, + b=3. Then call again with a= result, b=4. Then respond.' + type: reasoning_text + format: unknown + id: rs_tmp_jz24fy2z9lc + status: completed + summary: [] + type: reasoning + - arguments: "{\n \"a\": 2,\n \"b\": 3\n}" + call_id: call-d2207b2b-33a6-4c81-a9ae-92419f3fb3bf + id: fc_tmp_yqc49bd84p + name: add + status: completed + type: function_call + - call_id: call-d2207b2b-33a6-4c81-a9ae-92419f3fb3bf + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: nvidia/nemotron-3.5-lightning:free + parallel_tool_calls: false + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1451' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a48b-9df0-7980-a4b9-23bde9b054f7 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + sse: + - 'data: {"type":"response.created","response":{"id":"gen-1793761975-FlNZ7eszgb5sH5V3O69t","object":"response","created_at":1793761975,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":{"type":"function","name":"add"},"parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":0} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","response":{"id":"gen-1793761975-FlNZ7eszgb5sH5V3O69t","object":"response","created_at":1793761975,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":{"type":"function","name":"add"},"parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":1} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":0,"item":{"id":"rs_tmp_id1ci0csjjo","type":"reasoning","status":"in_progress","summary":[]},"sequence_number":2} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"part":{"type":"reasoning_text","text":""},"sequence_number":3} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":"We + got","sequence_number":4} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":" + result","sequence_number":5} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":" + 5","sequence_number":6} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":".","sequence_number":7} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":" + Now","sequence_number":8} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":" + add","sequence_number":9} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":" + 5","sequence_number":10} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":" + and","sequence_number":11} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":" + 4","sequence_number":12} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"delta":".","sequence_number":13} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.done","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"text":"We + got result 5. Now add 5 and 4.","sequence_number":14} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","output_index":0,"item_id":"rs_tmp_id1ci0csjjo","content_index":0,"part":{"type":"reasoning_text","text":"We + got result 5. Now add 5 and 4."},"sequence_number":15} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":0,"item":{"id":"rs_tmp_id1ci0csjjo","type":"reasoning","status":"completed","content":[{"type":"reasoning_text","text":"We + got result 5. Now add 5 and 4."}],"summary":[],"format":"unknown"},"sequence_number":16} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":1,"item":{"id":"fc_tmp_6gspjedt008","type":"function_call","status":"in_progress","call_id":"call-b0e8c803-f561-4c2a-8bef-ea30c661e3c1","name":"add","arguments":""},"sequence_number":17} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","output_index":1,"item_id":"fc_tmp_6gspjedt008","delta":"{\n \"a\": + 5,\n \"b\": 4\n}","sequence_number":18} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","output_index":1,"item_id":"fc_tmp_6gspjedt008","name":"add","arguments":"{\n \"a\": + 5,\n \"b\": 4\n}","sequence_number":19} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":1,"item":{"id":"fc_tmp_6gspjedt008","type":"function_call","status":"completed","call_id":"call-b0e8c803-f561-4c2a-8bef-ea30c661e3c1","name":"add","arguments":"{\n \"a\": + 5,\n \"b\": 4\n}"},"sequence_number":20} + + ' + - ' + + ' + - 'data: {"type":"response.completed","response":{"id":"gen-1793761975-FlNZ7eszgb5sH5V3O69t","object":"response","created_at":1793761975,"model":"nvidia/nemotron-3.5-lightning:free","status":"completed","completed_at":1793761976,"output":[{"id":"rs_tmp_id1ci0csjjo","type":"reasoning","status":"completed","content":[{"type":"reasoning_text","text":"We + got result 5. Now add 5 and 4."}],"summary":[],"format":"unknown"},{"id":"fc_tmp_6gspjedt008","type":"function_call","status":"completed","call_id":"call-b0e8c803-f561-4c2a-8bef-ea30c661e3c1","name":"add","arguments":"{\n \"a\": + 5,\n \"b\": 4\n}"}],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":{"type":"function","name":"add"},"parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":{"input_tokens":483,"input_tokens_details":{"cached_tokens":0},"output_tokens":32,"output_tokens_details":{"reasoning_tokens":14},"total_tokens":515,"cost":0,"is_byok":false,"cost_details":{"upstream_inference_cost":0,"upstream_inference_input_cost":0,"upstream_inference_output_cost":0}}},"sequence_number":21} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-04T03:12:55.792634+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-02.yaml new file mode 100644 index 0000000..a1ecd80 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning/openrouter-responses-stream-02.yaml @@ -0,0 +1,426 @@ +filename: 2026-11-04-01a1a48b-a0be-7993-81b5-557817530d8b +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: + - text: 'The user wants: Use add to add 2 and 3. Then use add to add that result + and 4. Then give final answer. + + + We need to call add function twice: first add 2 and 3 => result 5. Then + add that result (5) and 4 => 9. Then answer final answer 9. + + + We need to use the functions tool. So first call functions.add with a=2, + b=3. Then call again with a= result, b=4. Then respond.' + type: reasoning_text + format: unknown + id: rs_tmp_jz24fy2z9lc + status: completed + summary: [] + type: reasoning + - arguments: "{\n \"a\": 2,\n \"b\": 3\n}" + call_id: call-d2207b2b-33a6-4c81-a9ae-92419f3fb3bf + id: fc_tmp_yqc49bd84p + name: add + status: completed + type: function_call + - call_id: call-d2207b2b-33a6-4c81-a9ae-92419f3fb3bf + output: '5' + type: function_call_output + - content: + - text: We got result 5. Now add 5 and 4. + type: reasoning_text + format: unknown + id: rs_tmp_id1ci0csjjo + status: completed + summary: [] + type: reasoning + - arguments: "{\n \"a\": 5,\n \"b\": 4\n}" + call_id: call-b0e8c803-f561-4c2a-8bef-ea30c661e3c1 + id: fc_tmp_6gspjedt008 + name: add + status: completed + type: function_call + - call_id: call-b0e8c803-f561-4c2a-8bef-ea30c661e3c1 + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: nvidia/nemotron-3.5-lightning:free + parallel_tool_calls: false + provider: + allow_fallbacks: false + max_price: + completion: 0 + prompt: 0 + request: 0 + reasoning: + effort: low + store: false + stream: true + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1888' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /api/v1/responses + query_params: {} +request_id: 01a1a48b-a0be-7993-81b5-557817530d8b +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + sse: + - 'data: {"type":"response.created","response":{"id":"gen-1793761976-4t7frtBJSVhrYwFWz7he","object":"response","created_at":1793761976,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":"none","parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":0} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","response":{"id":"gen-1793761976-4t7frtBJSVhrYwFWz7he","object":"response","created_at":1793761976,"model":"nvidia/nemotron-3.5-lightning:free","status":"in_progress","completed_at":null,"output":[],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":"none","parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":null},"sequence_number":1} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":0,"item":{"id":"rs_tmp_wr7i22tl0rb","type":"reasoning","status":"in_progress","summary":[]},"sequence_number":2} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"part":{"type":"reasoning_text","text":""},"sequence_number":3} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"delta":"Now","sequence_number":4} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"delta":" + final","sequence_number":5} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"delta":" + answer","sequence_number":6} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"delta":" + 9","sequence_number":7} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.delta","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"delta":".","sequence_number":8} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_text.done","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"text":"Now + final answer 9.","sequence_number":9} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","output_index":0,"item_id":"rs_tmp_wr7i22tl0rb","content_index":0,"part":{"type":"reasoning_text","text":"Now + final answer 9."},"sequence_number":10} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":0,"item":{"id":"rs_tmp_wr7i22tl0rb","type":"reasoning","status":"completed","content":[{"type":"reasoning_text","text":"Now + final answer 9."}],"summary":[],"format":"unknown"},"sequence_number":11} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","output_index":1,"item":{"id":"msg_tmp_7wwbo2awzu","type":"message","status":"in_progress","role":"assistant","content":[]},"sequence_number":12} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"part":{"type":"output_text","text":"","annotations":[],"logprobs":[]},"sequence_number":13} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"The","logprobs":[],"sequence_number":14} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + final","logprobs":[],"sequence_number":15} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + result","logprobs":[],"sequence_number":16} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + after","logprobs":[],"sequence_number":17} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + adding","logprobs":[],"sequence_number":18} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + ","logprobs":[],"sequence_number":19} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"2","logprobs":[],"sequence_number":20} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":21} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"+","logprobs":[],"sequence_number":22} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":23} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"3","logprobs":[],"sequence_number":24} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":25} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"=","logprobs":[],"sequence_number":26} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":27} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"5","logprobs":[],"sequence_number":28} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":",","logprobs":[],"sequence_number":29} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + then","logprobs":[],"sequence_number":30} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + ","logprobs":[],"sequence_number":31} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"5","logprobs":[],"sequence_number":32} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":33} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"+","logprobs":[],"sequence_number":34} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":35} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"4","logprobs":[],"sequence_number":36} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":37} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"=","logprobs":[],"sequence_number":38} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" ","logprobs":[],"sequence_number":39} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"9","logprobs":[],"sequence_number":40} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + is","logprobs":[],"sequence_number":41} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":" + **","logprobs":[],"sequence_number":42} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"9","logprobs":[],"sequence_number":43} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"delta":"**.","logprobs":[],"sequence_number":44} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"text":"The + final result after adding 2 + 3 = 5, then 5 + 4 = 9 is **9**.","logprobs":[],"sequence_number":45} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","output_index":1,"item_id":"msg_tmp_7wwbo2awzu","content_index":0,"part":{"type":"output_text","text":"The + final result after adding 2 + 3 = 5, then 5 + 4 = 9 is **9**.","annotations":[],"logprobs":[]},"sequence_number":46} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","output_index":1,"item":{"id":"msg_tmp_7wwbo2awzu","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"The + final result after adding 2 + 3 = 5, then 5 + 4 = 9 is **9**.","annotations":[],"logprobs":[]}]},"sequence_number":47} + + ' + - ' + + ' + - 'data: {"type":"response.completed","response":{"id":"gen-1793761976-4t7frtBJSVhrYwFWz7he","object":"response","created_at":1793761976,"model":"nvidia/nemotron-3.5-lightning:free","status":"completed","completed_at":1793761977,"output":[{"id":"rs_tmp_wr7i22tl0rb","type":"reasoning","status":"completed","content":[{"type":"reasoning_text","text":"Now + final answer 9."}],"summary":[],"format":"unknown"},{"id":"msg_tmp_7wwbo2awzu","type":"message","role":"assistant","status":"completed","content":[{"type":"output_text","text":"The + final result after adding 2 + 3 = 5, then 5 + 4 = 9 is **9**.","annotations":[],"logprobs":[]}]}],"error":null,"incomplete_details":null,"access_programs":null,"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false},"strict":null}],"tool_choice":"none","parallel_tool_calls":false,"max_output_tokens":2048,"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":"low"},"safety_identifier":null,"prompt_cache_key":null,"prompt_cache_options":null,"usage":{"input_tokens":270,"input_tokens_details":{"cached_tokens":0},"output_tokens":39,"output_tokens_details":{"reasoning_tokens":6},"total_tokens":309,"cost":0,"is_byok":false,"cost_details":{"upstream_inference_cost":0,"upstream_inference_input_cost":0,"upstream_inference_output_cost":0}}},"sequence_number":48} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-04T03:12:56.510408+00:00' +upstream_url: https://openrouter.ai/api/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..6b07694 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-00.yaml @@ -0,0 +1,89 @@ +filename: 2026-11-17-01a1ea64-559a-7dc2-bfb5-9886b1cf860b +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + model: openai.gpt-oss-20b + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '564' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea64-559a-7dc2-bfb5-9886b1cf860b +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + logprobs: null + message: + content: null + reasoning: Need to call add twice. + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: chatcmpl-tool-83c5f09c50ddba50 + type: function + created: 1794933807 + id: chatcmpl-ba2e06e1-672e-4011-8deb-fe8476f24a4e + model: openai.gpt-oss-20b + object: chat.completion + service_tier: default + usage: + completion_tokens: 33 + prompt_tokens: 150 + total_tokens: 183 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoidG9vbF9jYWxscyIsImluZGV4IjowLCJsb2dw + cm9icyI6bnVsbCwibWVzc2FnZSI6eyJjb250ZW50IjpudWxsLCJyZWFzb25pbmciOiJOZWVkIHRv + IGNhbGwgYWRkIHR3aWNlLiIsInJlZnVzYWwiOm51bGwsInJvbGUiOiJhc3Npc3RhbnQiLCJ0b29s + X2NhbGxzIjpbeyJmdW5jdGlvbiI6eyJhcmd1bWVudHMiOiJ7XCJhXCI6MixcImJcIjozfSIsIm5h + bWUiOiJhZGQifSwiaWQiOiJjaGF0Y21wbC10b29sLTgzYzVmMDljNTBkZGJhNTAiLCJ0eXBlIjoi + ZnVuY3Rpb24ifV19fV0sImNyZWF0ZWQiOjE3OTQ5MzM4MDcsImlkIjoiY2hhdGNtcGwtYmEyZTA2 + ZTEtNjcyZS00MDExLThkZWItZmU4NDc2ZjI0YTRlIiwibW9kZWwiOiJvcGVuYWkuZ3B0LW9zcy0y + MGIiLCJvYmplY3QiOiJjaGF0LmNvbXBsZXRpb24iLCJzZXJ2aWNlX3RpZXIiOiJkZWZhdWx0Iiwi + dXNhZ2UiOnsiY29tcGxldGlvbl90b2tlbnMiOjMzLCJwcm9tcHRfdG9rZW5zIjoxNTAsInRvdGFs + X3Rva2VucyI6MTgzfX0= + headers: + connection: keep-alive + content-length: '527' + content-type: application/json + x-request-id: req_kcpg6fylfyfjcnldwnn3adzsl2ppyv7iwovd6ppsszwzanfflamq + status_code: 200 +timestamp: '2026-11-17T16:43:26.490140+00:00' +upstream_url: https://bedrock-mantle.us-west-2.api.aws/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..c68cfa4 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-01.yaml @@ -0,0 +1,100 @@ +filename: 2026-11-17-01a1ea64-5be4-7ab2-9d6a-240b51135e36 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - reasoning: Need to call add twice. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: chatcmpl-tool-83c5f09c50ddba50 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-83c5f09c50ddba50 + model: openai.gpt-oss-20b + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '832' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea64-5be4-7ab2-9d6a-240b51135e36 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + logprobs: null + message: + content: null + reasoning: 'Need second add: 5+4=9.' + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"a":5,"b":4}' + name: add<|channel|>commentary + id: chatcmpl-tool-928bd41255a844e1 + type: function + created: 1794933808 + id: chatcmpl-ed5728e0-4623-4fa1-8c78-61188a9247cf + model: openai.gpt-oss-20b + object: chat.completion + service_tier: default + usage: + completion_tokens: 40 + prompt_tokens: 183 + total_tokens: 223 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoidG9vbF9jYWxscyIsImluZGV4IjowLCJsb2dw + cm9icyI6bnVsbCwibWVzc2FnZSI6eyJjb250ZW50IjpudWxsLCJyZWFzb25pbmciOiJOZWVkIHNl + Y29uZCBhZGQ6IDUrND05LiIsInJlZnVzYWwiOm51bGwsInJvbGUiOiJhc3Npc3RhbnQiLCJ0b29s + X2NhbGxzIjpbeyJmdW5jdGlvbiI6eyJhcmd1bWVudHMiOiJ7XCJhXCI6NSxcImJcIjo0fSIsIm5h + bWUiOiJhZGQ8fGNoYW5uZWx8PmNvbW1lbnRhcnkifSwiaWQiOiJjaGF0Y21wbC10b29sLTkyOGJk + NDEyNTVhODQ0ZTEiLCJ0eXBlIjoiZnVuY3Rpb24ifV19fV0sImNyZWF0ZWQiOjE3OTQ5MzM4MDgs + ImlkIjoiY2hhdGNtcGwtZWQ1NzI4ZTAtNDYyMy00ZmExLThjNzgtNjExODhhOTI0N2NmIiwibW9k + ZWwiOiJvcGVuYWkuZ3B0LW9zcy0yMGIiLCJvYmplY3QiOiJjaGF0LmNvbXBsZXRpb24iLCJzZXJ2 + aWNlX3RpZXIiOiJkZWZhdWx0IiwidXNhZ2UiOnsiY29tcGxldGlvbl90b2tlbnMiOjQwLCJwcm9t + cHRfdG9rZW5zIjoxODMsInRvdGFsX3Rva2VucyI6MjIzfX0= + headers: + connection: keep-alive + content-length: '548' + content-type: application/json + x-request-id: req_arjg6jzxtb4il5nu3qd5lr4f6ao2vjuomreyvje7t3cflk62o5ra + status_code: 200 +timestamp: '2026-11-17T16:43:28.100269+00:00' +upstream_url: https://bedrock-mantle.us-west-2.api.aws/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..4179100 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-non_stream-02.yaml @@ -0,0 +1,100 @@ +filename: 2026-11-17-01a1ea64-5ea1-7890-b5a8-f777c644bcb2 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - reasoning: Need to call add twice. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: chatcmpl-tool-83c5f09c50ddba50 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-83c5f09c50ddba50 + - reasoning: 'Need second add: 5+4=9.' + role: assistant + tool_calls: + - function: + arguments: '{"a":5,"b":4}' + name: add<|channel|>commentary + id: chatcmpl-tool-928bd41255a844e1 + type: function + - content: '9' + role: tool + tool_call_id: chatcmpl-tool-928bd41255a844e1 + model: openai.gpt-oss-20b + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: none + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1082' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea64-5ea1-7890-b5a8-f777c644bcb2 +response: + body: + choices: + - finish_reason: stop + index: 0 + logprobs: null + message: + content: '**Result:** 9' + reasoning: 'We need to respond final answer: 9.' + refusal: null + role: assistant + created: 1794933809 + id: chatcmpl-e3d7cc63-1c85-4a29-9519-d3c1773b458d + model: openai.gpt-oss-20b + object: chat.completion + service_tier: default + usage: + completion_tokens: 25 + prompt_tokens: 230 + total_tokens: 255 + body_bytes: !!binary | + eyJjaG9pY2VzIjpbeyJmaW5pc2hfcmVhc29uIjoic3RvcCIsImluZGV4IjowLCJsb2dwcm9icyI6 + bnVsbCwibWVzc2FnZSI6eyJjb250ZW50IjoiKipSZXN1bHQ6KiogOSIsInJlYXNvbmluZyI6Ildl + IG5lZWQgdG8gcmVzcG9uZCBmaW5hbCBhbnN3ZXI6IDkuIiwicmVmdXNhbCI6bnVsbCwicm9sZSI6 + ImFzc2lzdGFudCJ9fV0sImNyZWF0ZWQiOjE3OTQ5MzM4MDksImlkIjoiY2hhdGNtcGwtZTNkN2Nj + NjMtMWM4NS00YTI5LTk1MTktZDNjMTc3M2I0NThkIiwibW9kZWwiOiJvcGVuYWkuZ3B0LW9zcy0y + MGIiLCJvYmplY3QiOiJjaGF0LmNvbXBsZXRpb24iLCJzZXJ2aWNlX3RpZXIiOiJkZWZhdWx0Iiwi + dXNhZ2UiOnsiY29tcGxldGlvbl90b2tlbnMiOjI1LCJwcm9tcHRfdG9rZW5zIjoyMzAsInRvdGFs + X3Rva2VucyI6MjU1fX0= + headers: + connection: keep-alive + content-length: '413' + content-type: application/json + x-request-id: req_ak6v3ezv7jdddxe5ar7e6myqvvnuiewwzmjjhsv57dsppdp2prsq + status_code: 200 +timestamp: '2026-11-17T16:43:28.801875+00:00' +upstream_url: https://bedrock-mantle.us-west-2.api.aws/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-00.yaml new file mode 100644 index 0000000..6face5e --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-00.yaml @@ -0,0 +1,185 @@ +filename: 2026-11-17-01a1ea64-6128-7e30-b6d6-9d06d170ab3e +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + model: openai.gpt-oss-20b + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '603' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea64-6128-7e30-b6d6-9d06d170ab3e +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: req_xtugqc5awmna4ow3o47hbbfvasdvu7nctzmolhuox55euqavlerq + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"obfuscation":"fiY7h3ZsSZnYfQ5ktbrFkHsb2qgiFvG4fRH0reKjZx5Jkm9"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"YPOuL4GddYgNsSSr09CKW4P6aKVxhlquY","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"3DmYL3yHcRy8tyG1DUNewFEZhZeEIhZpGNTr6nYcB9BINZBXGhPS7jVDN9dteOQWa"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"Qz9pVo70sonRn7sOvyHejj33dG7pgpyZIpnK5eHAsyy5BnqubeV52YOwJki8hGiGhMm5q6LC","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"6Ngz0HsvbatgwU9CWI4I4TIqpArad853IewOc8xSAP65um13ufR4rXSBBfVLa"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"myYwP6ougEiGPRsDi6ISxdM4YX3iLkRaxjAHEubkNimoaas5HkR3T4Pwb2TFDCe0IDZ6B8W9ABXC","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"2jAaaSL486yCfF6qkyhJmfLHHS81YrkB0Q0z6YnG3iJCO9T75Ht7QelmFnkQHTN1J5WJGhnNHPVeijn0CHD"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"SvAeBIzhJV0yUnlvacjT1kHYwbiFI7bc90PN9Hv9SxDWIFNETYwCZTTbKj1J51MMlXaLY2jFeJKrtIi","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"reasoning":"We need to call add twice."},"finish_reason":null,"index":0,"obfuscation":"DKBpbs1Aokfkzwvch8VsbY6DK7MgOL2zIO1GL1HXPCAdkv9UTndJFcbEmuznnvztpnhYFA5yUb34sOHN5R2ShSNlAp34mxwbHzPFHy1vslv9IOIMWP4lEOfxp00o"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"hCphXVviAqDZ1hDy9XOGheQYMLnppEXOuWNnIw16GgZuqKpb5YIvqBfA7ghuEf0stB5NR74xryCHH6mDzYOBSQZ","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"RoDZECAPUrGGAABmmtz1DUz2zTBUffPySsP9CjFbSnsUMELqWXBLRPbjPyMpAZGjKuBygcaHqKjrJNvV7ZrHPwKVAJpU3SqVg5WX8Dxa4UmqohC2hl"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"jMuSlnyb4kY6ZgLPPehVQDRJIqtuZreO8pcs","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"QQXbKY6guUTUHlksp4KaRvMgMaIHzBUgFJx2DimYMW0k"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"RkFLlnAenhthKLNssrd8LcktjLG56j5jPeUcwNr36GTc3eocUR7EPud9eqz1kozX60n4Oe0Qro4mQ0O6ZjDqvgN7tq7FNddFbJ19gZxHEAMS","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"31JisStLHgSiYECCCa5yHgh6nY1xo6jDDSpBE9AeF7nTbqr3O5TLNX0nrQ20HBr6Gc3X3b"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"2YITV6mt0Hqk1LigsFl1zeaGp6nxGenTq6nBuwiEywuaT9uSe4svUdFDaQuo1REEz2EhjACyTSqa2sfbDX","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"1OCyZ2fdx9ymj6wAhrl5FE7lu81sRuXL"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"CPG4RGq3LGIitiWkZkhM2B6NZgA1EXH1sy8Z1l6FZc7EeRVKXyub5XJ","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"rsjHq0vYVbCBcjBL620uXNVSbd3E7s76vwy7cvIO9LfkKMpRu4yhp6DVcmeauERgKEdnpmvohqweauzMWIsT8ebkSlvAypC84qwMNnGxhqLSLMIP0T"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"D19wQYkKopCavs3A5sTErUzLmEKM8Rpy99i0rKZBvaDaosonBtnet0Qul1TZIg3pi5l7GqtTdUvE3tH7EgU","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"wUKrBix1DyY3iYQhswoJHVz1KIHLi6TaKpzrqdPUZDtfU6waSTR7Sc4pHlD9I5C"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"Aq9Qj6EbL0r5Jx8kcaffj2LBr4JzLPtfVkSJFqsd8IoB29YKaX4nArZ4DELhuDZlP6BiwHAHkEdLBQhjEXxOhGoPaOcOkR4p5J0","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"DTNi5Z397Hv5Fhtkap2s6FAg4dnNyizsGPwKu"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"ebztiskcJUzQQvaE8fe64FiCVpw8PIGhPjJSZbHiVPyBicNeQaM19YOaFEQfcqDZhbcaujxM2","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"9y7gSNg1r8OdsO6b1mmMwBkEsTNiJf19XJ5ZmI"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"7uVOCc0NvQMemPmA4fxbXURwWWgdzs5ldj96eAOYUyAfcEH8J7Wm8RQbBBuJOsz4hYPqamNKQlZ7","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"ZPD7TTdsyej6Z6fVZ6TdqTthTXqPhbz4Fy7rGA2mxkEx2tBOaHAzUZkQRxqlu9CZ4mxj3seVbE7UxsMsrXgjvds2PCHEM4EgNTKeGqgour5J571TayqnC"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"Oxa8uDIQCewLCoMNMTpCW4xIYYb1um5ziKEh7D24D20ltwwaGI84uyyQqVgs4hU1PQ6vWH13I3wE9sjsSXPlGrLcc3hnxhVjSaE","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"wNdcmYBwWrbIOmYycd0myhCs8tG6L2gUbmxKo4aopPcbZEbOB6KehWMyZoOU1BjF7GhQz0uMLvUwcyDI7vcOgyBsLnEr10lun"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"C2mtXTjoFeTlVQbyZSEqonIvjwy26gKeUEstXnZ03RYWKuobKkClX0SWgNth1RuzsEU04DfRIjiOi9tDFZDqqGhmGqLkp6NmIo","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"H7wL7NlDXKrHCklP3QbACxCBcrLaoQgE9Rz9SEHHfzaPytyTnO8Mze7IK9g39YW0MAktPxqSlwYfr36iF3hk7WNck2"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"KJGWf3yUmwxPQUc9IX6pZ4MmVniRzULEpUWWhy3BKwZs38tPqnkmMN","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"cM5IxiZyj2dLuDPMy3ie8M2zBNPJIwjqweuCDaKsB67ukqiFN4AMRwilKBBf0e0"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"ZPBjdVn59bxOELjdgHEL9j1eerSGEeGpTcT9TvxrfEtZaDFC7SRhO305olvcP1eYPzFRXxySeJ8gEsU6qpx4S3V6YB8zgQMDPJ4dpTO0QOc","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"PJOcGEDvTBPSAOR0VVkuS4trUtLxwPDkEjWDujMIqCEiwYLKQYKTS0nHNuBg1epiY1ntm176kKgIwg9srzcyzztNFbIJszdHMDfKFrfxSnx1AE7vza6bhOkoTWlBCoHO"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"7o62g0hmOHY4OOFJe6Yg4Lmfk35oki00TqyULL8Wz7D9UBSOEiTEpeQCJoPBOgpGpeG2Q6EqFrSDIQtKhCOGhqFVwHIsp2poji3hxHK7W4Brd6o3DQ3jjb7k1mEJjZ","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"{\"a\":2,\"b\":3}","name":"add"},"id":"chatcmpl-tool-b5b67e0cb5e47465","index":0,"type":"function"}]},"finish_reason":null,"index":0,"obfuscation":"F8OMh0Ltz4FyWw5mz0M4SG41c63ENtvfZtRAaraiX3eJ4HQ4dZa7kb37n0jSQGok5fN3ddcOlvFVuiwJ"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"7X30aY89VJj3dy5rxIm09ukeWztBuSImsOh537Cb0L0fuC44UQiPale6k21F6YItAPQQZVdeZvJkSruX0sGu52WdmbTdk32z0RQc","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"tool_calls","index":0,"obfuscation":"MBsge4BbTFQrhXkKNzvQN4iScuia5a9p4Aqcvu0LZc3brFWnLfB2m9Cy"}],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"KTj4Xe0V4aZHvpTmveyChMHJHBHeRGVfXJuOCp7yz7iJXKUU9u2cpWD3rC4c0LHHkr9xd6YX2Q3CWwfgAg3RkUsSrzu9uHTDPNQ","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1794933809,"id":"chatcmpl-082ae310-599b-4dd9-b5cb-a92d8969dfb8","model":"openai.gpt-oss-20b","obfuscation":"f0oMtVMeV2pExlbegbooOT58zMrHqg3sTXxGrXAKhophpkUHkh3P","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":34,"prompt_tokens":150,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":112},"total_tokens":184}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-17T16:43:29.448659+00:00' +upstream_url: https://bedrock-mantle.us-west-2.api.aws/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-01.yaml new file mode 100644 index 0000000..2950b5e --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-01.yaml @@ -0,0 +1,215 @@ +filename: 2026-11-17-01a1ea64-651f-7061-9a1f-c20bcd939536 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: '' + reasoning: We need to call add twice. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: chatcmpl-tool-b5b67e0cb5e47465 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-b5b67e0cb5e47465 + model: openai.gpt-oss-20b + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '887' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea64-651f-7061-9a1f-c20bcd939536 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: req_zsqt6kqqzfwk7mjm4s3uhsjsnep2vhwr6xgfzpas46phghr6ciaq + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"obfuscation":"Re6eJIvn5FcxFqbGQgoBQNW5R2la4QkWzvH8RIErDimzW1pyKiFAiW1qFrkA2ILcSjY5iVpRfOtrnQwQz"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"sURc3zfI38c92FfHMbYA27ylR0ZMknruEAg5MqygDrSk7nXBV3Ia2CIoANzUL7fmeUQMbiBcwM","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"ykVo2pIVYSxLcXhadhYoOZEkQjWsrBKMi4v17OZkwo0rHZgIAUpa9X3o54k2o3"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"3lPFdVZjrY68tN6HKDUWlYszmCnuXURZyPlVWxB9ebep2yv8AxOhaLS1EKt9ofZGo07Zozxr7","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"q5ZPHifRNMWpVGxCmzu44U8yVaI3ARtvXWXvhOWSsoSeExZ50hNCbIabr2hmmx1fx6Vc4U7NstHpqo1sQgJEdOuXg2QyPybhzB1fKaRvdnwZkdylNoMs60P"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"YTSbDwGrfmQL3aehsDkFP6EKSZ9DEb8FrWPabKI0TdU2qF1ftZmIBb7TfNWwLfKcQgDZ6AQtXeZi3tmFes0v","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"9ezG7hHez0JZlLklqLfYDCyjGUCGGBgj6xkeiQ2SUVkpgdSgyYOKxNqmZgjKytdR5zQNPsVrj0wP4VJBR1j7ourb20sMtjf4w67SaEDwKlTLAhRRVne"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"YfBIWA8tWN7rcy4wbsdpi9c0pkIkYb9jJHeSrCW51W87B3auIsR7E5xR9P93XXU45r6CoRWHpto2E4QnXICYuCufLaZAZNlmNF9dzQ8Qi992Zh5yieHT5rP","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"reasoning":"We have result 5. Next add 5 and "},"finish_reason":null,"index":0,"obfuscation":"MnQQ7QtBmipesf1uAQQZXsRe9EyboF5yFiHZVO8Zy65PEX5x9N0YWMq258aLpsegqXsbtfAj1RRkb4ooV1sogaUBLcPwH4vBR6lnNRnV"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"PrLwRsJlHrXJsmC8B7LVwGG28WtJlXdXo7NXB2F1bSGsJ9zAEd1nAYXy0v6q5GNKgOAzeCpCOLn9xQDB0PB126b6","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"reasoning":"4 => 9. Use add function."},"finish_reason":null,"index":0,"obfuscation":"9F7nZ282u4n8ikwdFjgZH6U38ooipBHpD9NC61gd"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"VegRpPhnTwXJ588kxxk5fDuukKRijy8VNZK9lRTAXvbpWZNf6gWimWW4ds5fVmQ7vU6ceD","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"TkTBtgcKJFLi4ek2zTIZvu7q4S41vB4YnIK0oG7mZIoL2pVsTOL0luYK3gDvcmdkrNzX9VkmMcgnODeWxWRBA9baPXG5MUr8tjiWmjMut1u0VgUNSPW"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"37tbhhTLiJh62fEzaY9cMoFSL5VvMeo0YVA4gZdtkbJ821lZaPltaWy6HItI7v94TlUrJ1iOwroW4LIHDcUWIz","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"Mblo0sh513sspYN76E5TFPJYCe0tFE0mYu3s5wA14"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"KlWOO6wxuZ5WzSGouzBtFubqxHMCJdk1GOhvnfYftCPQ9cGSlWcOdW74jUWrEXNxCyJD2OC3MILWsF7RijC3uVJx5vDfBo1uz4l70DZ","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"aPeBALfvEC3RembZ2f203Q6MElp3HALfwSzCz"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"QEfwJ0KWJCLUEvw5EFTEo9xVpZfzDoDYfz6T33uYNby0kudwaPbOLDtlhPfR32X6y95sa66FbXgMUkaBkU5LVBRyge2JGWlA4NnbNYjcixcfH1jo0vzUmaA","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"4Nkf9nnMzw3G80ylvGHQFeLyttlxim1oicCIhRAjYRNTc7Zu"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"hVeo7jOGVdIhUHp9ZMaZJY8ZriTnBMrMriB97tApTblMmDLZzHCihkquwSovyTeObU","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"n0W5QPn5cQdL8SZwgvx6f8UdOB4GVrLGyaDOrdI9YoaiENTKSNAT18pcjdk"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"ZrCnKc98VKt92m1YUAfHfI37bhwiGUFZXnH8kw9SNBLeDeLfbdmokgcrPk","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"ploQwF19YDhmsUgvDENKT1TVkaDINvnBMgNSyKdYOdk7rJEXgmtkqRxvnjKMMiB9b3RyYz0"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"ej1ALscGE4ypNsyzCXOZVpKZCAOl2xr2mMTto9G7ikv2OpHAaShJQGZtcKQWoHA6vk5g8Y0Ge4pGQ6H5DYWMw46FrHBTWM0eRUCYL6H1FTmBcXs63g27nutG96P","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"NObI4Qo6bisBwoyhMFE8ESxO1OT3SwEws5fF9mMlyqaFJhxVCQln1jJVqlt1V9WgQkMvO6haL3hvcMjbL5CnrxiJ2wh3wyO3y"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"EMDwBIqO8XYV4BsVxZ5wVAue1krayjF5lL","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"kJNqojZjPeKKsSeDC629DkbW7gqluRs00Umjx4zpciWbCO39cjWzINIrto6mEa8jt83W5GhrmcYcKeC8pDoLHHIPzSvyDXEHOGRM4tY2SJ1yNGOFZE9v"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"7Nl6SJ8yn4GAugsMKOMYfmPzgSiAe0CyuQfdnPVhMdQc8qBOIdwnhaqbkY1XysfM47Wn9zvTz4cIgZLVrJ9EUhYUBy8pCCvTnB8QXG8crcOXqVD61bMVZJwKCFF","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"f6RC8HdgZuzSgpwz9LQaEtYw8ifCyZzfRdgG35PN5MMojqn6Sq"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"D5ofojyYYFSSMDx4vRDtgATWPdazSFmt27ur5AmSNTFhrtX3vHZ90esZgny9k2YRDe7zRKCGNxuWeb0LRgGsasjm07k0sEgsWhca0gPEtcHC","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"wiX37qvd7seGQgRCLtFM4vgPbrkUVzxNAGAO6bKdVvwasIUkYQj88EHaqMi3qENYvcsK2INxUkumQ64nTcOM3e1Tr7wrWhEa25NsijXzNBf4fYKxf6"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"Dc4VolnWMn7CeR0vaoBLX2X3GuOlyo1WmcOohHVwkjtJQV0UYYzK3YrtMOENmpuV8aKBOInPzive7Tqc9udJ6I0vmELo9GrnRs2G3","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"5v45ZLClT7zxegl3SnB76SyUpm0VvChSf0i7GxOOes7Pd45dFe6hzOPOQSoYFU8ljAf2znVIDPyX0vk2tSMHOKuFwMjr2rSIL09iMc9mTZsDAr002xcI9O74I"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"W9HifzaLYFUTbTIkCxlYNu0LaXXr5jwR2uB1sCg9gRdisSu6lBwvEaUy39tx3HpeRyb3RvJvnyFOptH9FgLixKaChYjIPyN4Y","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"M0XW6PMWdzm01JJExv2VLvPQQumpc0KMAdijIyJUCujY0aQ2LX8"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"sq27J9ZcSeE3uEp0JQzM5xrH0SQiyqAovLFKeUfYDcluAXXIq5j1yFqskdd9LlwtA63b7Tc2h88NexfENI2d0xTfGQhg1SE0DmZuEh0zu7Pt0xgIYmD0Q110D97","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"AI9Q5pv7DOgKvePcbNrKMjKuJw71y2FIGBrNBbBqqvE2MmTMlSHO4eY5sb0nnV6J67KlYOW0yFd6UlR1Uyi8Fq9"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"f3C7xMFhnZ8iilc6yXU9hs3txlg21rayFLR51PRJX5uXicbfQUkWPwTJLZ4z0SEJ7R5fooZSwKxALg2ZSdin96A6dLHzENpFTDYz7THRDxjodW7Cm0ZlNYsWyxPtck","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"LHMWR3KMYHAhyhFrIRFtHS5k2WFqXDVMsSXmTPV04KKuzlg6WVm56uqtTnhG6cHnDqFlRZzL1gsaAHpBk6ZD182pCUWWY9ECDvldjFCuwMLSeRs"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"wUKA55qo6ZiHSE12vkmlRSRko1MaiLWP76MQuWpQMRyS2excFO0hF7LogjSnSpWKp98cNItAD7yC8wTQBRONmPuMyGRiciaJtUtfd","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"JxcRY0kjz61lug4koZaFyBpt1KjWTx7NzzrFiY9c2tQqwppwLYW7KGfpXaZE124WkYmSTsiw0ESiWg8fbhhtYb9PF88sWBlcmomfZpJspXi8u0GxZxHtN1WwsnNEvW"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"2mWgsG1gQyDS4b5XxYdxkEqXEZ5wBiuZAvsrmr39EQ0WsXeY6a4N4JK2ubt5Fj82vcrHEBgo3PUm","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"{\"a\":5,\"b\":4}","name":"add<|channel|>commentary"},"id":"chatcmpl-tool-905c39a5ba524674","index":0,"type":"function"}]},"finish_reason":null,"index":0,"obfuscation":"Scf3vgUTxnYd9jBULJoLe0XDe86vAyG9Seclq1jqSFoO9kF5T16KZciTgmcSXnh7utryL4gDwTDE6ZOUNaeKR3819Jlq"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"zszLW1IpJqLkjRZACK29S8QiGsCPQkRrTgdZQpqEad1okcZfneNnRfoQ3aWFKE4yZWIjnOPA62ZIqNAsSYnHNKNTJF7hf7e6nQbRaKLtbeSsqez1","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"tool_calls","index":0,"obfuscation":"ySz1CNpElhShdukYEMK254InvLtHjHVudvhcgjtBoNl6qLfsuxhrv61G8wsDNf9MdLcO"}],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"uMeVogNqdVHE2R8p8mCqa3d9pKvNPtjQoa3t4qnGanMvZgqE2X89NvJGcHZWEt4CNqZxcEHPk4ERxEioy7j3TueEKvxJt9v","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1794933810,"id":"chatcmpl-0648dfee-2d70-41b0-97a2-f59dbd3714b9","model":"openai.gpt-oss-20b","obfuscation":"xSpjNDZ7LEFv9lBPjcEEAHPVpiIMh6eFevxL8febWcd9YVjyfxaF1Y3ffPvljZY4kEhHsS9NU6YMpnafrkIobGTNtLYQO7JtrCKCgrrOdkp7q2OZp","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":50,"prompt_tokens":183,"total_tokens":233}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-17T16:43:30.463784+00:00' +upstream_url: https://bedrock-mantle.us-west-2.api.aws/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-02.yaml new file mode 100644 index 0000000..eb71b80 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-chat_completions-stream-02.yaml @@ -0,0 +1,158 @@ +filename: 2026-11-17-01a1ea64-6984-7103-80f2-507f3fa83087 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: '' + reasoning: We need to call add twice. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: chatcmpl-tool-b5b67e0cb5e47465 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-b5b67e0cb5e47465 + - content: '' + reasoning: We have result 5. Next add 5 and 4 => 9. Use add function. + role: assistant + tool_calls: + - function: + arguments: '{"a":5,"b":4}' + name: add<|channel|>commentary + id: chatcmpl-tool-905c39a5ba524674 + type: function + - content: '9' + role: tool + tool_call_id: chatcmpl-tool-905c39a5ba524674 + model: openai.gpt-oss-20b + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: none + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1185' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea64-6984-7103-80f2-507f3fa83087 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: req_rxqnqez5bob4t23ixzvbgw4zw63sxf2patecpfovbttylmlp7rna + sse: + - 'data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"obfuscation":"fWHjdDNtQ4E84qyRpZxzNphXHeObsI6VvgeSfTBf3ba"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"i5bn3g3YKQUNtv3beM9QB5I1ZM4engNXMzuQRW2qgmTYfmZLMQp2qy16D22QDWrPGegnHTysrxJhx5TN1hec7d3muSGr0QW5q6cBn72","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"BSOiAODKlzv8kWL6nUHQ3mJOo6K5m2x4njaBBedeLL"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"ciWzBVFFC6iyMVbKaQxLDDhgd5f4wrDHl3YkYRhoW0Ezn2zIFQt7fmJL3rQeCb5yQwEzOvgh5bTvO7qOuH4tHy6SV0sjAGxb0tSMULVflo8z6EmbyQi2foHS4BeFTMA","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"P0vN68NmLsODdhY3Thdk7edTqqc5qdF34l"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"L8zcVUD7S9x96mtBOaeLLNxzT183H4JgUd606I25opgS2VWoT6NbkG7R4FEHsM2","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"KwW8jjKCfG2Fppnh9Ahj4vwGIFWNsHayC87DlXt57jjPT"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"IXBvCkUPgOt2nyfilh91cm4sxCt0vOeFTY5WIvBuF10kqjfRmrMbsLlF0","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"reasoning":"We need to output final answer: 9."},"finish_reason":null,"index":0,"obfuscation":"DEtpRCx4irSElhu4k9ak8uRtDINKQC6vSSGIwxeqvzSYBnOPOMmKaJZUO74FI4aYwwCV1RRxkRUUIqhr0Gmkg1Nf2VjiTCuj8qAznvPmo"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"5G6JIOkBBA2p0ExcgktpqlnxeRDKnGmsikovfmnikZdTQIQLCd6dEZadPk66UWZFZNmaooJ4lmdZH54uatBiSpTbOAq","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"zxc89JrWTMLtvp8uUTKXxXulycIDt7V99UaQcdk19z3yLsbqY"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"b52KqCZcKD4YzFUg3hYrCmctVfM4BasKs8eq4uaA8F41nThRH6ZNlRUTcNJJF6DMDPEVlyS2OMBELNSn2CQIdbfQE6jLMKrb052mgv3PKSOsMbpH2ggUl7QD","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"pkSlLswfF68MXR3ujHI1iOo6qgva9DGMJaniJK0wo0p5o7Pr5RCHViYNVBUV69melcAgBwDQVVajsGohyqJlo2y"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"L9m3wcBGcGcGPNS5xnISeYWSsY8UrMKMz285IeiQvdmBjSgmzOerz8W01Cs","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"NeT07KbMudUf4eCFfv2pfGX3TY1umspxHcMhc4mGf"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"blQ6EjytquTVxEJMRSps23fyR2ZEx6hjHpJY56kwa9rfuV4jdh8OmXzjmjuiYDVgh8dou9CNqKvGNZi3Zhe9UQnBqmvkmJu4KYLEwA8YVD55iGo7sMIBLv2","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"jWduuT1k8FsjW98R87rV42Sv9SdkIZkdLKSl7lBlW2sM8wdpczzQ3EVC19PGdg7hyEDjDGe66WKTkkTEmraL5RCIZaPT2Bgh2cbSEAfL5Fdfb"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"nDUS5Hb6xge9DZTIepOW0tHZM4N9fgiatt3rDzH2e7jwBlhMdJOoPcntHWsDMF8aoTwQM8c4q6VBsHud4DHDo5TiarFN8XUD23mrpybxPeR9rDZ9GYrM3xFq","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":null,"index":0,"obfuscation":"tBSOUtjAssiBtiDtLzkUNjERCngyP1UMW87R0qPHSVxvYaNpOtRt9hlXPLNguonlJnSJQOMoONcwtperhhg08RdtpZywrVKGxuiFeVOUCd28kjAB64hnHDN2"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"YHbbJWxofX0k7A3aRYrzNhOKrtZueUWFtDyIfYoSiBXLhdlMwg8G7NGMEXn","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{"content":"The final result is: **9**"},"finish_reason":null,"index":0,"obfuscation":"skW5KpAwY8Aci6bs8Fi5cn9SQI6zTEz4Koyfm8gvxhMD7OCzSImOM1ZwfU8iolklyAeg"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"hvQ7fdUbUzj4T6R2eP739NbgA463aWpRYUIRFyGgBSd36aVeeuOHMXrPJrYwtBp955oy5Pzw7mxLVK127RmqisCueZUdb4ZMuDHFwIqJJMSNwG","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[{"delta":{},"finish_reason":"stop","index":0,"obfuscation":"KNo7DEDQw3ftmCzm1EtR8poOEaGoWRyvhyzrHWtECx2xwRAV4USuZ42yq9pgH2klnw1W6cB5X"}],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"WQcF0W7EDBluqQhlnGW4aFjmdL1DYwDwd07SmNwBAnNOv4kiDCC7KJkPDPaROL","object":"chat.completion.chunk","service_tier":"default"} + + ' + - ' + + ' + - 'data: {"choices":[],"created":1794933811,"id":"chatcmpl-376b8f77-01ef-4505-9e02-e1f6c791334d","model":"openai.gpt-oss-20b","obfuscation":"NFReLa4MAH02ySfqsSdm8mcJZfGnALUvN1NoNSWITBXtgovaC8n","object":"chat.completion.chunk","service_tier":"default","usage":{"completion_tokens":28,"prompt_tokens":230,"total_tokens":258}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-17T16:43:31.588959+00:00' +upstream_url: https://bedrock-mantle.us-west-2.api.aws/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-00.yaml new file mode 100644 index 0000000..c3a07b8 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-00.yaml @@ -0,0 +1,93 @@ +filename: 2026-11-17-01a1ea62-ae34-76b1-83d8-f92d77bdf3de +request: + body: + max_tokens: 2048 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + thinking: + budget_tokens: 1024 + type: enabled + tool_choice: + disable_parallel_tool_use: true + type: auto + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '634' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1ea62-ae34-76b1-83d8-f92d77bdf3de +response: + body: + container: null + content: + - signature: EvEDCoQBCBMQARgCKkDo7L08qZbFrNiu52vCs2UNl4RgsBG/vrmh0dNXhas7WhRw/My9farsRizJ14gTdvJZBa4xZZkp8pxntjINohJmMhljbGF1ZGUtaGFpa3UtNC01LTIwMjUxMDAxOABCCHRoaW5raW5nWgwxOTgzMzMzNDQxOTWoAcKH8tcGEgyn/vCIx0Bnf0UihHYaDG0QiDdk5bb+8g2PUiIwGP99SMZXrKnMisXCiHbXhzVfY2zjwOKrJJwIBYP748UDs6+e3Zw2hHThh2i+Sk+KKpkC1p7uALynjvVLFCKFLF31/ah5eZvhJQuC+TbtMbgHRURUMIP+WDGvql4wXraQcUpPuRZXG80qekvJKCTVbHHv59QEYP96umctRXqaX+yOLe+fTaEOujCcWFxhU/Y+VTKiTshl+D8Kt0DiQt1RnNsAHzuxmSB67gRznKQFZeBI8bvk9A1v+QayQfxa2xnAmSHmzM/T6PAVtIaqcU1yAqtnh2dha7YIvXnGGZ4FnDMSk9K2tgViDiir/EcziBSqPcOTobHiAwjWH77WxLrtrw2jTTLILRBUExmAox1FoVvzycRX5N84Y1PhXSBtmhiJ6C3A7nXTiFj1eW5rUopGHk9rQJuTOvJfl84QfTLSpMw0GVcS6ybUc/nxt5EYAQ== + thinking: 'The user wants me to: + + 1. Add 2 and 3 using the add function + + 2. Then add 7 to that result using the add function again + + 3. Make exactly one tool call per turn + + 4. After both results, reply with the final number only + + + So I should make the first call now to add 2 and 3.' + type: thinking + - id: toolu_bdrk_01HEWg5EDvvsR1a4Nh89uFyN + input: + a: 2 + b: 3 + name: add + type: tool_use + id: msg_bdrk_sshmt6hdomzbtzgqmrtzh4ylm5o3hsi7su43rzpfh4l4ngjuk6vq + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: tool_use + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 437 + output_tokens: 145 + output_tokens_details: + thinking_tokens: 83 + service_tier: standard + headers: + connection: keep-alive + content-length: '1603' + content-type: application/json + status_code: 200 +timestamp: '2026-11-17T16:41:38.100233+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-01.yaml new file mode 100644 index 0000000..19b5e27 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-01.yaml @@ -0,0 +1,108 @@ +filename: 2026-11-17-01a1ea62-b252-7cb0-abac-8f227da89e9c +request: + body: + max_tokens: 2048 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - signature: EvEDCoQBCBMQARgCKkDo7L08qZbFrNiu52vCs2UNl4RgsBG/vrmh0dNXhas7WhRw/My9farsRizJ14gTdvJZBa4xZZkp8pxntjINohJmMhljbGF1ZGUtaGFpa3UtNC01LTIwMjUxMDAxOABCCHRoaW5raW5nWgwxOTgzMzMzNDQxOTWoAcKH8tcGEgyn/vCIx0Bnf0UihHYaDG0QiDdk5bb+8g2PUiIwGP99SMZXrKnMisXCiHbXhzVfY2zjwOKrJJwIBYP748UDs6+e3Zw2hHThh2i+Sk+KKpkC1p7uALynjvVLFCKFLF31/ah5eZvhJQuC+TbtMbgHRURUMIP+WDGvql4wXraQcUpPuRZXG80qekvJKCTVbHHv59QEYP96umctRXqaX+yOLe+fTaEOujCcWFxhU/Y+VTKiTshl+D8Kt0DiQt1RnNsAHzuxmSB67gRznKQFZeBI8bvk9A1v+QayQfxa2xnAmSHmzM/T6PAVtIaqcU1yAqtnh2dha7YIvXnGGZ4FnDMSk9K2tgViDiir/EcziBSqPcOTobHiAwjWH77WxLrtrw2jTTLILRBUExmAox1FoVvzycRX5N84Y1PhXSBtmhiJ6C3A7nXTiFj1eW5rUopGHk9rQJuTOvJfl84QfTLSpMw0GVcS6ybUc/nxt5EYAQ== + thinking: 'The user wants me to: + + 1. Add 2 and 3 using the add function + + 2. Then add 7 to that result using the add function again + + 3. Make exactly one tool call per turn + + 4. After both results, reply with the final number only + + + So I should make the first call now to add 2 and 3.' + type: thinking + - id: toolu_bdrk_01HEWg5EDvvsR1a4Nh89uFyN + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01HEWg5EDvvsR1a4Nh89uFyN + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + thinking: + budget_tokens: 1024 + type: enabled + tool_choice: + disable_parallel_tool_use: true + type: auto + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '1874' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1ea62-b252-7cb0-abac-8f227da89e9c +response: + body: + container: null + content: + - text: 'Now I''ll add 7 to that result:' + type: text + - id: toolu_bdrk_01UuV1dMnaRbc7M1wyPvnQ6H + input: + a: 7 + b: 5 + name: add + type: tool_use + id: msg_bdrk_tncp7ffm436h2e4k45amlt72pyyolqyrtzuuxsrckddz5wupraia + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: tool_use + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 604 + output_tokens: 71 + output_tokens_details: + thinking_tokens: 0 + service_tier: standard + headers: + connection: keep-alive + content-length: '665' + content-type: application/json + status_code: 200 +timestamp: '2026-11-17T16:41:39.154027+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-02.yaml new file mode 100644 index 0000000..d08fc16 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-non_stream-02.yaml @@ -0,0 +1,117 @@ +filename: 2026-11-17-01a1ea62-b5a8-72e2-84f9-43479a350566 +request: + body: + max_tokens: 2048 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - signature: EvEDCoQBCBMQARgCKkDo7L08qZbFrNiu52vCs2UNl4RgsBG/vrmh0dNXhas7WhRw/My9farsRizJ14gTdvJZBa4xZZkp8pxntjINohJmMhljbGF1ZGUtaGFpa3UtNC01LTIwMjUxMDAxOABCCHRoaW5raW5nWgwxOTgzMzMzNDQxOTWoAcKH8tcGEgyn/vCIx0Bnf0UihHYaDG0QiDdk5bb+8g2PUiIwGP99SMZXrKnMisXCiHbXhzVfY2zjwOKrJJwIBYP748UDs6+e3Zw2hHThh2i+Sk+KKpkC1p7uALynjvVLFCKFLF31/ah5eZvhJQuC+TbtMbgHRURUMIP+WDGvql4wXraQcUpPuRZXG80qekvJKCTVbHHv59QEYP96umctRXqaX+yOLe+fTaEOujCcWFxhU/Y+VTKiTshl+D8Kt0DiQt1RnNsAHzuxmSB67gRznKQFZeBI8bvk9A1v+QayQfxa2xnAmSHmzM/T6PAVtIaqcU1yAqtnh2dha7YIvXnGGZ4FnDMSk9K2tgViDiir/EcziBSqPcOTobHiAwjWH77WxLrtrw2jTTLILRBUExmAox1FoVvzycRX5N84Y1PhXSBtmhiJ6C3A7nXTiFj1eW5rUopGHk9rQJuTOvJfl84QfTLSpMw0GVcS6ybUc/nxt5EYAQ== + thinking: 'The user wants me to: + + 1. Add 2 and 3 using the add function + + 2. Then add 7 to that result using the add function again + + 3. Make exactly one tool call per turn + + 4. After both results, reply with the final number only + + + So I should make the first call now to add 2 and 3.' + type: thinking + - id: toolu_bdrk_01HEWg5EDvvsR1a4Nh89uFyN + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01HEWg5EDvvsR1a4Nh89uFyN + type: tool_result + role: user + - content: + - text: 'Now I''ll add 7 to that result:' + type: text + - id: toolu_bdrk_01UuV1dMnaRbc7M1wyPvnQ6H + input: + a: 7 + b: 5 + name: add + type: tool_use + role: assistant + - content: + - content: '12' + tool_use_id: toolu_bdrk_01UuV1dMnaRbc7M1wyPvnQ6H + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: false + thinking: + budget_tokens: 1024 + type: enabled + tool_choice: + disable_parallel_tool_use: true + type: auto + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '2179' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1ea62-b5a8-72e2-84f9-43479a350566 +response: + body: + container: null + content: + - text: '12' + type: text + id: msg_bdrk_t5lih4kbq6wis6gs2jjk673n7xw76mxsjkxdtj2t4s52kw6exzca + model: anthropic.claude-haiku-4-5-20251001-v1:0 + role: assistant + stop_details: null + stop_reason: end_turn + stop_sequence: null + type: message + usage: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 0 + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 697 + output_tokens: 4 + output_tokens_details: + thinking_tokens: 0 + service_tier: standard + headers: + connection: keep-alive + content-length: '538' + content-type: application/json + status_code: 200 +timestamp: '2026-11-17T16:41:40.008232+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-00.yaml new file mode 100644 index 0000000..33a3e4a --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-00.yaml @@ -0,0 +1,383 @@ +filename: 2026-11-17-01a1ea62-a33e-7201-86db-2a359c9b0d71 +request: + body: + max_tokens: 2048 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + thinking: + budget_tokens: 1024 + type: enabled + tool_choice: + disable_parallel_tool_use: true + type: auto + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '633' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1ea62-a33e-7201-86db-2a359c9b0d71 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_asc3vlhofaizwgewickkjhfbma54737jqrs4h6jeiyno73zv35sa","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":437,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":8,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"thinking","thinking":"","signature":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":"The + user wants me to:\n1"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":". + First"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":","}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + add 2 and 3 "}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":"using + the"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + add function"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":"\n2. + Then, add 7 "}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":"to + that"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + result using the add function again\n3"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":". + Make exactly one tool call per turn"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":"\n4. + After both results, reply"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + with the final number only\n\nSince"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + I should"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + make exactly one tool call per turn,"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + I''ll"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + start"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + with"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + the"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + first addition"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":":"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":" + "}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":"2 + + 3."}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"signature_delta","signature":"EqQECoQBCBMQARgCKkDmNra/T7rjoPCwfpZdSdYGKJpzkE/Fw2IC/rtE1GJYsJ5v16g4lCV1Pw/+D2uRC5XRR/FAtdOVw35u7u6eMKl5MhljbGF1ZGUtaGFpa3UtNC01LTIwMjUxMDAxOABCCHRoaW5raW5nWgwxOTgzMzMzNDQxOTWoAcCH8tcGEgzW8/mjpQksZv12aNYaDFMapqRfR4yeTAQu1SIwG5eQHOSwFCuc0g1zxHDjhBZ2uw1KK5QyUCIm7qq86Fn2K6DVYwfwL4Prc4AxAcR9KswCx2uDppXFtsPSnT/NnlISqGkd+JL+6J3bmLqEhGQ3pIOrk7gFu2IkSr7Ii7CZcxYc9Zb3orVOU+B125p4m/WFNwBiW7z3tFfKvn5/h6uBOdbZFl05qn1j2/uOxnosREXzHG9snqXJ3SW26on7IXzY/jQh13S3eapXpXaKdJBzI2b2Rn//kXN2ymPpjsBzNCYeeNlydekffFI1V/IaQHFFxwPDPj5kaBJ5H1pAqYw9IYMTaa/qAXfWVg5lFAJNgyJq+50WwDUFDBA3W6ZCcptZZEyYopMCdOl+2safsrWaM8aSDEaAPvpaN1UvLDiKWkC9kdMrYSw7WsA0GBiig/9tuqmwYI0hGSJyZwSPSFxoI4Rpf0hKmy8xdgqnlEY3t9U43bLcZlV0A5p09NW/ed0GlO5A9X5+O6e4sc+2M8wIJvwz8Eo9AntBO61ghaoYAQ=="}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_bdrk_01BEYvCK8kVzRoruaRfYYxRD","name":"add","input":{}}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"a\": + 2"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", + \"b\": "}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"3}"}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":1} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":437,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":157,"output_tokens_details":{"thinking_tokens":95}}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-17T16:41:35.294870+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-01.yaml new file mode 100644 index 0000000..3f832cb --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-01.yaml @@ -0,0 +1,214 @@ +filename: 2026-11-17-01a1ea62-a867-7513-9214-d9f5eda94071 +request: + body: + max_tokens: 2048 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - signature: EqQECoQBCBMQARgCKkDmNra/T7rjoPCwfpZdSdYGKJpzkE/Fw2IC/rtE1GJYsJ5v16g4lCV1Pw/+D2uRC5XRR/FAtdOVw35u7u6eMKl5MhljbGF1ZGUtaGFpa3UtNC01LTIwMjUxMDAxOABCCHRoaW5raW5nWgwxOTgzMzMzNDQxOTWoAcCH8tcGEgzW8/mjpQksZv12aNYaDFMapqRfR4yeTAQu1SIwG5eQHOSwFCuc0g1zxHDjhBZ2uw1KK5QyUCIm7qq86Fn2K6DVYwfwL4Prc4AxAcR9KswCx2uDppXFtsPSnT/NnlISqGkd+JL+6J3bmLqEhGQ3pIOrk7gFu2IkSr7Ii7CZcxYc9Zb3orVOU+B125p4m/WFNwBiW7z3tFfKvn5/h6uBOdbZFl05qn1j2/uOxnosREXzHG9snqXJ3SW26on7IXzY/jQh13S3eapXpXaKdJBzI2b2Rn//kXN2ymPpjsBzNCYeeNlydekffFI1V/IaQHFFxwPDPj5kaBJ5H1pAqYw9IYMTaa/qAXfWVg5lFAJNgyJq+50WwDUFDBA3W6ZCcptZZEyYopMCdOl+2safsrWaM8aSDEaAPvpaN1UvLDiKWkC9kdMrYSw7WsA0GBiig/9tuqmwYI0hGSJyZwSPSFxoI4Rpf0hKmy8xdgqnlEY3t9U43bLcZlV0A5p09NW/ed0GlO5A9X5+O6e4sc+2M8wIJvwz8Eo9AntBO61ghaoYAQ== + thinking: 'The user wants me to: + + 1. First, add 2 and 3 using the add function + + 2. Then, add 7 to that result using the add function again + + 3. Make exactly one tool call per turn + + 4. After both results, reply with the final number only + + + Since I should make exactly one tool call per turn, I''ll start with the + first addition: 2 + 3.' + type: thinking + - caller: null + id: toolu_bdrk_01BEYvCK8kVzRoruaRfYYxRD + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01BEYvCK8kVzRoruaRfYYxRD + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + thinking: + budget_tokens: 1024 + type: enabled + tool_choice: + disable_parallel_tool_use: true + type: auto + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '2006' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1ea62-a867-7513-9214-d9f5eda94071 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_noxkli2rzc42bhjgjle7dqi45ik6uphp6goavufyu7m6eziasx5q","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":616,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Now"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + I''ll add 7 to that"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" + result:"}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_bdrk_013qhsWZjw9r9LgGSrwJpUbL","name":"add","input":{}}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"a\": + 5"}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", + \"b\": "}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"7}"}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":1} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":616,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":71,"output_tokens_details":{"thinking_tokens":0}}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-17T16:41:36.615065+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-02.yaml new file mode 100644 index 0000000..32fdb0b --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/bedrock-messages-stream-02.yaml @@ -0,0 +1,155 @@ +filename: 2026-11-17-01a1ea62-aba2-70f0-ab77-3eeffd03e4ec +request: + body: + max_tokens: 2048 + messages: + - content: + - text: Use add to add 2 and 3. Then use add again to add 7 to that result. + Make exactly one tool call per turn. After both results, reply with the + final number only. + type: text + role: user + - content: + - signature: EqQECoQBCBMQARgCKkDmNra/T7rjoPCwfpZdSdYGKJpzkE/Fw2IC/rtE1GJYsJ5v16g4lCV1Pw/+D2uRC5XRR/FAtdOVw35u7u6eMKl5MhljbGF1ZGUtaGFpa3UtNC01LTIwMjUxMDAxOABCCHRoaW5raW5nWgwxOTgzMzMzNDQxOTWoAcCH8tcGEgzW8/mjpQksZv12aNYaDFMapqRfR4yeTAQu1SIwG5eQHOSwFCuc0g1zxHDjhBZ2uw1KK5QyUCIm7qq86Fn2K6DVYwfwL4Prc4AxAcR9KswCx2uDppXFtsPSnT/NnlISqGkd+JL+6J3bmLqEhGQ3pIOrk7gFu2IkSr7Ii7CZcxYc9Zb3orVOU+B125p4m/WFNwBiW7z3tFfKvn5/h6uBOdbZFl05qn1j2/uOxnosREXzHG9snqXJ3SW26on7IXzY/jQh13S3eapXpXaKdJBzI2b2Rn//kXN2ymPpjsBzNCYeeNlydekffFI1V/IaQHFFxwPDPj5kaBJ5H1pAqYw9IYMTaa/qAXfWVg5lFAJNgyJq+50WwDUFDBA3W6ZCcptZZEyYopMCdOl+2safsrWaM8aSDEaAPvpaN1UvLDiKWkC9kdMrYSw7WsA0GBiig/9tuqmwYI0hGSJyZwSPSFxoI4Rpf0hKmy8xdgqnlEY3t9U43bLcZlV0A5p09NW/ed0GlO5A9X5+O6e4sc+2M8wIJvwz8Eo9AntBO61ghaoYAQ== + thinking: 'The user wants me to: + + 1. First, add 2 and 3 using the add function + + 2. Then, add 7 to that result using the add function again + + 3. Make exactly one tool call per turn + + 4. After both results, reply with the final number only + + + Since I should make exactly one tool call per turn, I''ll start with the + first addition: 2 + 3.' + type: thinking + - caller: null + id: toolu_bdrk_01BEYvCK8kVzRoruaRfYYxRD + input: + a: 2 + b: 3 + name: add + type: tool_use + role: assistant + - content: + - content: '5' + tool_use_id: toolu_bdrk_01BEYvCK8kVzRoruaRfYYxRD + type: tool_result + role: user + - content: + - citations: null + text: 'Now I''ll add 7 to that result:' + type: text + - caller: null + id: toolu_bdrk_013qhsWZjw9r9LgGSrwJpUbL + input: + a: 5 + b: 7 + name: add + type: tool_use + role: assistant + - content: + - content: '12' + tool_use_id: toolu_bdrk_013qhsWZjw9r9LgGSrwJpUbL + type: tool_result + role: user + model: global.anthropic.claude-haiku-4-5-20251001-v1:0 + stream: true + thinking: + budget_tokens: 1024 + type: enabled + tool_choice: + disable_parallel_tool_use: true + type: auto + tools: + - description: Add two integers. + input_schema: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + name: add + headers: + accept: application/json + accept-encoding: gzip, deflate, br + connection: keep-alive + content-length: '2342' + content-type: application/json + user-agent: AsyncAnthropic/Python 0.121.0 + method: POST + path: /anthropic/v1/messages + query_params: {} +request_id: 01a1ea62-aba2-70f0-ab77-3eeffd03e4ec +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream + sse: + - 'event: message_start + + ' + - 'data: {"type":"message_start","message":{"model":"anthropic.claude-haiku-4-5-20251001-v1:0","id":"msg_bdrk_fwvgzwjf75z4mz7j3wuxmvgwzjzct5fe32tq3s4zj4blgugdohyq","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":709,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}} + + ' + - ' + + ' + - 'event: content_block_start + + ' + - 'data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + + ' + - ' + + ' + - 'event: content_block_delta + + ' + - 'data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"12"}} + + ' + - ' + + ' + - 'event: content_block_stop + + ' + - 'data: {"type":"content_block_stop","index":0} + + ' + - ' + + ' + - 'event: message_delta + + ' + - 'data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":709,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":4,"output_tokens_details":{"thinking_tokens":0}}} + + ' + - ' + + ' + - 'event: message_stop + + ' + - 'data: {"type":"message_stop"} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: message_stop +timestamp: '2026-11-17T16:41:37.442329+00:00' +upstream_url: https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic/v1/messages diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..d9a54d5 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-00.yaml @@ -0,0 +1,89 @@ +filename: 2026-11-17-01a1ea38-0b7d-7041-9f8e-a892fd5bc179 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '602' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ea38-0b7d-7041-9f8e-a892fd5bc179 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + content: '' + reasoning_content: 'We need to first add 2 and 3 using the add function, get + result 5. Then add that result (5) and 4 using add, get 9. Then give final + answer. + + + We need to call add twice. Use function calls.' + role: assistant + tool_calls: + - function: + arguments: '{"a": 2, "b": 3}' + name: add + id: chatcmpl-tool-b80b187c20aeff65 + index: 0 + name: null + type: function + tools: null + created: 1794930904 + id: chatcmpl-86c0b6196cdc4e9fb64e69a798952a54 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 85 + completion_tokens_details: + reasoning_tokens: 53 + output_tokens_details: + reasoning_tokens: 53 + prompt_tokens: 325 + prompt_tokens_details: + cached_tokens: 324 + total_tokens: 410 + headers: + connection: keep-alive + content-length: '861' + content-type: application/json + x-request-id: chatcmpl-86c0b6196cdc4e9fb64e69a798952a54 + status_code: 200 +timestamp: '2026-11-17T15:55:03.933102+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..9c96d85 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-01.yaml @@ -0,0 +1,101 @@ +filename: 2026-11-17-01a1ea38-0df7-7723-aa63-9572a996e2b3 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: '' + reasoning_content: 'We need to first add 2 and 3 using the add function, get + result 5. Then add that result (5) and 4 using add, get 9. Then give final + answer. + + + We need to call add twice. Use function calls.' + role: assistant + tool_calls: + - function: + arguments: '{"a": 2, "b": 3}' + name: add + id: chatcmpl-tool-b80b187c20aeff65 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-b80b187c20aeff65 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1060' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ea38-0df7-7723-aa63-9572a996e2b3 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + message: + content: '' + reasoning_content: Now add 5 and 4. + role: assistant + tool_calls: + - function: + arguments: '{"a": 5, "b": 4}' + name: add + id: chatcmpl-tool-a05f9870bd569596 + index: 0 + name: null + type: function + tools: null + created: 1794930905 + id: chatcmpl-6f04d0c3334e43e6a82aada435a270b1 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 40 + completion_tokens_details: + reasoning_tokens: 8 + output_tokens_details: + reasoning_tokens: 8 + prompt_tokens: 429 + prompt_tokens_details: + cached_tokens: 324 + total_tokens: 469 + headers: + connection: keep-alive + content-length: '686' + content-type: application/json + x-request-id: chatcmpl-6f04d0c3334e43e6a82aada435a270b1 + status_code: 200 +timestamp: '2026-11-17T15:55:04.567917+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..b3dfec8 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-non_stream-02.yaml @@ -0,0 +1,102 @@ +filename: 2026-11-17-01a1ea38-1238-7993-9dc5-21c822eb752d +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: '' + reasoning_content: 'We need to first add 2 and 3 using the add function, get + result 5. Then add that result (5) and 4 using add, get 9. Then give final + answer. + + + We need to call add twice. Use function calls.' + role: assistant + tool_calls: + - function: + arguments: '{"a": 2, "b": 3}' + name: add + id: chatcmpl-tool-b80b187c20aeff65 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-b80b187c20aeff65 + - content: '' + reasoning_content: Now add 5 and 4. + role: assistant + tool_calls: + - function: + arguments: '{"a": 5, "b": 4}' + name: add + id: chatcmpl-tool-a05f9870bd569596 + type: function + - content: '9' + role: tool + tool_call_id: chatcmpl-tool-a05f9870bd569596 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: none + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1306' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ea38-1238-7993-9dc5-21c822eb752d +response: + body: + choices: + - finish_reason: stop + index: 0 + message: + content: The final answer is 9. + reasoning_content: Now give final answer. + role: assistant + tools: null + created: 1794930906 + id: chatcmpl-d40117a4efb741f8bf80dc6b5f639153 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: chat.completion + usage: + completion_tokens: 14 + completion_tokens_details: + reasoning_tokens: 5 + output_tokens_details: + reasoning_tokens: 5 + prompt_tokens: 209 + prompt_tokens_details: + cached_tokens: 0 + total_tokens: 223 + headers: + connection: keep-alive + content-length: '550' + content-type: application/json + x-request-id: chatcmpl-d40117a4efb741f8bf80dc6b5f639153 + status_code: 200 +timestamp: '2026-11-17T15:55:05.656567+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-00.yaml new file mode 100644 index 0000000..9e4929e --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-00.yaml @@ -0,0 +1,580 @@ +filename: 2026-11-17-01a1ea38-0411-7d82-bff9-a4f4b5215438 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '641' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ea38-0411-7d82-bff9-a4f4b5215438 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-85d3a5baa44b4af4a7817a7605aff05b + sse: + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"We"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + need"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + use"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + add"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + tool"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + twice"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":":"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + first"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + add"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 2"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 3"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + =>"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + result"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 5"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + Then"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + add"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + that"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + result"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 4"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + =>"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 5"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"+"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"4"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"="},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"9"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + Then"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + give"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + final"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + answer"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 9"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"\n\nWe"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + need"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + to"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + call"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + the"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + function"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + Use"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + tool"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + add"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + with"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"="},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"2"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":",b"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"="},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"3"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + Then"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + call"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + again"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + with"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + a"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"="},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"result"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":",b"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"="},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"4"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + Let"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"''s"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + do"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + first"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + call"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"chatcmpl-tool-b1bb3d37168e9e77","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\": + "}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"2, + \"b\": "}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"3}"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"tool_calls","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-85d3a5baa44b4af4a7817a7605aff05b","object":"chat.completion.chunk","created":1794930902,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":325,"total_tokens":434,"completion_tokens":109,"prompt_tokens_details":{"cached_tokens":324},"completion_tokens_details":{"reasoning_tokens":77},"output_tokens_details":{"reasoning_tokens":77}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-17T15:55:02.033284+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-01.yaml new file mode 100644 index 0000000..d16e79a --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-01.yaml @@ -0,0 +1,184 @@ +filename: 2026-11-17-01a1ea38-06f6-7be2-82fc-258811243011 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - reasoning_content: 'We need to use add tool twice: first add 2 and 3 => result + 5. Then add that result and 4 => 5+4=9. Then give final answer 9. + + + We need to call the function. Use tool add with a=2,b=3. Then call again with + a=result,b=4. Let''s do first call.' + role: assistant + tool_calls: + - function: + arguments: '{"a": 2, "b": 3}' + name: add + id: chatcmpl-tool-b1bb3d37168e9e77 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-b1bb3d37168e9e77 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1137' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ea38-06f6-7be2-82fc-258811243011 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564 + sse: + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"Result"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 5"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + Now"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + add"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 5"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + and"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 4"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"chatcmpl-tool-affd7bb5c12db9df","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\": + "}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5, + \"b\": "}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"4}"}}]},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"tool_calls","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-888d2b7a38264f7ca3c83ae9dcb67564","object":"chat.completion.chunk","created":1794930903,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":453,"total_tokens":497,"completion_tokens":44,"prompt_tokens_details":{"cached_tokens":324},"completion_tokens_details":{"reasoning_tokens":12},"output_tokens_details":{"reasoning_tokens":12}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-17T15:55:02.774895+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-02.yaml new file mode 100644 index 0000000..3ed3432 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-chat_completions-stream-02.yaml @@ -0,0 +1,191 @@ +filename: 2026-11-17-01a1ea38-0972-71c2-bb19-92c1eef03e31 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - reasoning_content: 'We need to use add tool twice: first add 2 and 3 => result + 5. Then add that result and 4 => 5+4=9. Then give final answer 9. + + + We need to call the function. Use tool add with a=2,b=3. Then call again with + a=result,b=4. Let''s do first call.' + role: assistant + tool_calls: + - function: + arguments: '{"a": 2, "b": 3}' + name: add + id: chatcmpl-tool-b1bb3d37168e9e77 + type: function + - content: '5' + role: tool + tool_call_id: chatcmpl-tool-b1bb3d37168e9e77 + - reasoning_content: Result 5. Now add 5 and 4. + role: assistant + tool_calls: + - function: + arguments: '{"a": 5, "b": 4}' + name: add + id: chatcmpl-tool-affd7bb5c12db9df + type: function + - content: '9' + role: tool + tool_call_id: chatcmpl-tool-affd7bb5c12db9df + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: none + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1380' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/chat/completions + query_params: {} +request_id: 01a1ea38-0972-71c2-bb19-92c1eef03e31 +response: + error_event: false + headers: + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0 + sse: + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"Now"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + final"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + answer"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":":"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":" + 9"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"reasoning_content":"."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"The"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + final"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + answer"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + is"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":" + **"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"9"},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{"content":"**."},"finish_reason":null,"raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[{"index":0,"delta":{},"finish_reason":"stop","raw_output":null}],"usage":null} + + ' + - ' + + ' + - 'data: {"id":"chatcmpl-09648e2c1b4f4b52a9c35f5571d625b0","object":"chat.completion.chunk","created":1794930904,"model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","choices":[],"usage":{"prompt_tokens":237,"total_tokens":253,"completion_tokens":16,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":7},"output_tokens_details":{"reasoning_tokens":7}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-17T15:55:03.410155+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-00.yaml new file mode 100644 index 0000000..a0da0d5 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-00.yaml @@ -0,0 +1,145 @@ +filename: 2026-11-17-01a1ea37-fac7-73b1-977e-5aa191dbeef2 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '587' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1ea37-fac7-73b1-977e-5aa191dbeef2 +response: + body: + background: null + created_at: 1794930900 + error: null + id: resp_0efbb53330534761826fa4837d84f510 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - id: rs_704a24b85bb445419610b1e5090edd62 + summary: + - text: We need to compute 2+3 = 5 using add. Then add result (5) and 4 => 9. + Then give final answer. So we need to call function add twice. Let's do + first add. + type: summary_text + type: reasoning + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-87f4a9b204f8b80f + id: fc_dc20d6c680fe4368b4f5b544fcba64dd + name: add + status: completed + type: function_call + parallel_tool_calls: false + previous_response_id: null + reasoning: + effort: low + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 325 + input_tokens_details: + cached_tokens: 324 + output_tokens: 79 + output_tokens_details: + reasoning_tokens: 47 + total_tokens: 404 + user: null + body_bytes: !!binary | + eyJpZCI6InJlc3BfMGVmYmI1MzMzMDUzNDc2MTgyNmZhNDgzN2Q4NGY1MTAiLCJvYmplY3QiOiJy + ZXNwb25zZSIsImNyZWF0ZWRfYXQiOjE3OTQ5MzA5MDAsInN0YXR1cyI6ImNvbXBsZXRlZCIsIm1v + ZGVsIjoiYWNjb3VudHMvZmlyZXdvcmtzL21vZGVscy9uZW1vdHJvbi1saWdodG5pbmctM3A1LTMw + Yi1hM2IiLCJvdXRwdXQiOlt7ImlkIjoicnNfNzA0YTI0Yjg1YmI0NDU0MTk2MTBiMWU1MDkwZWRk + NjIiLCJ0eXBlIjoicmVhc29uaW5nIiwic3VtbWFyeSI6W3sidHlwZSI6InN1bW1hcnlfdGV4dCIs + InRleHQiOiJXZSBuZWVkIHRvIGNvbXB1dGUgMiszID0gNSB1c2luZyBhZGQuIFRoZW4gYWRkIHJl + c3VsdCAoNSkgYW5kIDQgPT4gOS4gVGhlbiBnaXZlIGZpbmFsIGFuc3dlci4gU28gd2UgbmVlZCB0 + byBjYWxsIGZ1bmN0aW9uIGFkZCB0d2ljZS4gTGV0J3MgZG8gZmlyc3QgYWRkLiJ9XX0seyJpZCI6 + ImZjX2RjMjBkNmM2ODBmZTQzNjhiNGY1YjU0NGZjYmE2NGRkIiwidHlwZSI6ImZ1bmN0aW9uX2Nh + bGwiLCJjYWxsX2lkIjoiY2hhdGNtcGwtdG9vbC04N2Y0YTliMjA0ZjhiODBmIiwibmFtZSI6ImFk + ZCIsImFyZ3VtZW50cyI6IntcImFcIjogMiwgXCJiXCI6IDN9Iiwic3RhdHVzIjoiY29tcGxldGVk + In1dLCJwcmV2aW91c19yZXNwb25zZV9pZCI6bnVsbCwidXNhZ2UiOnsiaW5wdXRfdG9rZW5zIjoz + MjUsIm91dHB1dF90b2tlbnMiOjc5LCJ0b3RhbF90b2tlbnMiOjQwNCwiaW5wdXRfdG9rZW5zX2Rl + dGFpbHMiOnsiY2FjaGVkX3Rva2VucyI6MzI0fSwib3V0cHV0X3Rva2Vuc19kZXRhaWxzIjp7InJl + YXNvbmluZ190b2tlbnMiOjQ3fX0sImVycm9yIjpudWxsLCJpbmNvbXBsZXRlX2RldGFpbHMiOm51 + bGwsImluc3RydWN0aW9ucyI6bnVsbCwibWF4X291dHB1dF90b2tlbnMiOjIwNDgsIm1heF90b29s + X2NhbGxzIjpudWxsLCJwYXJhbGxlbF90b29sX2NhbGxzIjpmYWxzZSwicmVhc29uaW5nIjp7ImVm + Zm9ydCI6ImxvdyJ9LCJzdG9yZSI6ZmFsc2UsInRlbXBlcmF0dXJlIjoxLjAsInRleHQiOnsiZm9y + bWF0Ijp7InR5cGUiOiJ0ZXh0In19LCJ0b29sX2Nob2ljZSI6eyJ0eXBlIjoiZnVuY3Rpb24iLCJu + YW1lIjoiYWRkIn0sInRvb2xzIjpbeyJ0eXBlIjoiZnVuY3Rpb24iLCJuYW1lIjoiYWRkIiwiZGVz + Y3JpcHRpb24iOiJBZGQgdHdvIGludGVnZXJzLiIsInBhcmFtZXRlcnMiOnsidHlwZSI6Im9iamVj + dCIsInByb3BlcnRpZXMiOnsiYSI6eyJ0eXBlIjoiaW50ZWdlciJ9LCJiIjp7InR5cGUiOiJpbnRl + Z2VyIn19LCJyZXF1aXJlZCI6WyJhIiwiYiJdLCJhZGRpdGlvbmFsUHJvcGVydGllcyI6ZmFsc2V9 + fV0sInRvcF9wIjowLjk1LCJ0b3BfbG9ncHJvYnMiOm51bGwsInRydW5jYXRpb24iOiJkaXNhYmxl + ZCIsInVzZXIiOm51bGwsImJhY2tncm91bmQiOm51bGwsIm1ldGFkYXRhIjp7fX0= + headers: + connection: keep-alive + content-length: '1415' + content-type: application/json + x-request-id: d8899d31-b258-4014-bff7-aecb972b224a + status_code: 200 +timestamp: '2026-11-17T15:54:59.655926+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-01.yaml new file mode 100644 index 0000000..084d7eb --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-01.yaml @@ -0,0 +1,156 @@ +filename: 2026-11-17-01a1ea37-fe18-7b82-9c77-00130eb66c97 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - id: rs_704a24b85bb445419610b1e5090edd62 + summary: + - text: We need to compute 2+3 = 5 using add. Then add result (5) and 4 => 9. + Then give final answer. So we need to call function add twice. Let's do + first add. + type: summary_text + type: reasoning + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-87f4a9b204f8b80f + id: fc_dc20d6c680fe4368b4f5b544fcba64dd + name: add + type: function_call + - call_id: chatcmpl-tool-87f4a9b204f8b80f + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1096' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1ea37-fe18-7b82-9c77-00130eb66c97 +response: + body: + background: null + created_at: 1794930901 + error: null + id: resp_8334e866d522439d8f0a3995b84e1dd7 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - id: rs_c235d3f2dcd9460bab71cc61421c24b7 + summary: + - text: Now we have result 5. Use add with a=5, b=4. + type: summary_text + type: reasoning + - arguments: '{"a": 5, "b": 4}' + call_id: chatcmpl-tool-879d5d7ec08916b9 + id: fc_5ecc3d5e10194ae387628446f10346f2 + name: add + status: completed + type: function_call + parallel_tool_calls: false + previous_response_id: null + reasoning: + effort: low + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 423 + input_tokens_details: + cached_tokens: 0 + output_tokens: 50 + output_tokens_details: + reasoning_tokens: 18 + total_tokens: 473 + user: null + body_bytes: !!binary | + eyJpZCI6InJlc3BfODMzNGU4NjZkNTIyNDM5ZDhmMGEzOTk1Yjg0ZTFkZDciLCJvYmplY3QiOiJy + ZXNwb25zZSIsImNyZWF0ZWRfYXQiOjE3OTQ5MzA5MDEsInN0YXR1cyI6ImNvbXBsZXRlZCIsIm1v + ZGVsIjoiYWNjb3VudHMvZmlyZXdvcmtzL21vZGVscy9uZW1vdHJvbi1saWdodG5pbmctM3A1LTMw + Yi1hM2IiLCJvdXRwdXQiOlt7ImlkIjoicnNfYzIzNWQzZjJkY2Q5NDYwYmFiNzFjYzYxNDIxYzI0 + YjciLCJ0eXBlIjoicmVhc29uaW5nIiwic3VtbWFyeSI6W3sidHlwZSI6InN1bW1hcnlfdGV4dCIs + InRleHQiOiJOb3cgd2UgaGF2ZSByZXN1bHQgNS4gVXNlIGFkZCB3aXRoIGE9NSwgYj00LiJ9XX0s + eyJpZCI6ImZjXzVlY2MzZDVlMTAxOTRhZTM4NzYyODQ0NmYxMDM0NmYyIiwidHlwZSI6ImZ1bmN0 + aW9uX2NhbGwiLCJjYWxsX2lkIjoiY2hhdGNtcGwtdG9vbC04NzlkNWQ3ZWMwODkxNmI5IiwibmFt + ZSI6ImFkZCIsImFyZ3VtZW50cyI6IntcImFcIjogNSwgXCJiXCI6IDR9Iiwic3RhdHVzIjoiY29t + cGxldGVkIn1dLCJwcmV2aW91c19yZXNwb25zZV9pZCI6bnVsbCwidXNhZ2UiOnsiaW5wdXRfdG9r + ZW5zIjo0MjMsIm91dHB1dF90b2tlbnMiOjUwLCJ0b3RhbF90b2tlbnMiOjQ3MywiaW5wdXRfdG9r + ZW5zX2RldGFpbHMiOnsiY2FjaGVkX3Rva2VucyI6MH0sIm91dHB1dF90b2tlbnNfZGV0YWlscyI6 + eyJyZWFzb25pbmdfdG9rZW5zIjoxOH19LCJlcnJvciI6bnVsbCwiaW5jb21wbGV0ZV9kZXRhaWxz + IjpudWxsLCJpbnN0cnVjdGlvbnMiOm51bGwsIm1heF9vdXRwdXRfdG9rZW5zIjoyMDQ4LCJtYXhf + dG9vbF9jYWxscyI6bnVsbCwicGFyYWxsZWxfdG9vbF9jYWxscyI6ZmFsc2UsInJlYXNvbmluZyI6 + eyJlZmZvcnQiOiJsb3cifSwic3RvcmUiOmZhbHNlLCJ0ZW1wZXJhdHVyZSI6MS4wLCJ0ZXh0Ijp7 + ImZvcm1hdCI6eyJ0eXBlIjoidGV4dCJ9fSwidG9vbF9jaG9pY2UiOnsidHlwZSI6ImZ1bmN0aW9u + IiwibmFtZSI6ImFkZCJ9LCJ0b29scyI6W3sidHlwZSI6ImZ1bmN0aW9uIiwibmFtZSI6ImFkZCIs + ImRlc2NyaXB0aW9uIjoiQWRkIHR3byBpbnRlZ2Vycy4iLCJwYXJhbWV0ZXJzIjp7InR5cGUiOiJv + YmplY3QiLCJwcm9wZXJ0aWVzIjp7ImEiOnsidHlwZSI6ImludGVnZXIifSwiYiI6eyJ0eXBlIjoi + aW50ZWdlciJ9fSwicmVxdWlyZWQiOlsiYSIsImIiXSwiYWRkaXRpb25hbFByb3BlcnRpZXMiOmZh + bHNlfX1dLCJ0b3BfcCI6MC45NSwidG9wX2xvZ3Byb2JzIjpudWxsLCJ0cnVuY2F0aW9uIjoiZGlz + YWJsZWQiLCJ1c2VyIjpudWxsLCJiYWNrZ3JvdW5kIjpudWxsLCJtZXRhZGF0YSI6e319 + headers: + connection: keep-alive + content-length: '1305' + content-type: application/json + x-request-id: bc811b03-005a-482b-bf22-8c9a7f082c45 + status_code: 200 +timestamp: '2026-11-17T15:55:00.504591+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-02.yaml new file mode 100644 index 0000000..4b92dca --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-02.yaml @@ -0,0 +1,167 @@ +filename: 2026-11-17-01a1ea38-013c-7ed2-b05d-f20913ada630 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - id: rs_704a24b85bb445419610b1e5090edd62 + summary: + - text: We need to compute 2+3 = 5 using add. Then add result (5) and 4 => 9. + Then give final answer. So we need to call function add twice. Let's do + first add. + type: summary_text + type: reasoning + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-87f4a9b204f8b80f + id: fc_dc20d6c680fe4368b4f5b544fcba64dd + name: add + type: function_call + - call_id: chatcmpl-tool-87f4a9b204f8b80f + output: '5' + type: function_call_output + - id: rs_c235d3f2dcd9460bab71cc61421c24b7 + summary: + - text: Now we have result 5. Use add with a=5, b=4. + type: summary_text + type: reasoning + - arguments: '{"a": 5, "b": 4}' + call_id: chatcmpl-tool-879d5d7ec08916b9 + id: fc_5ecc3d5e10194ae387628446f10346f2 + name: add + type: function_call + - call_id: chatcmpl-tool-879d5d7ec08916b9 + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: false + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1471' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1ea38-013c-7ed2-b05d-f20913ada630 +response: + body: + background: null + created_at: 1794930901 + error: null + id: resp_ce60a8edf1c043d5bb7546e01c5e2e21 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + object: response + output: + - id: rs_7e0009329f4c4e30aa04b935b5cfd786 + summary: + - text: 'We need to give final answer: 9.' + type: summary_text + type: reasoning + - content: + - annotations: [] + text: The final answer is 9. + type: output_text + id: msg_b3c914f414b047b28e07e5d7d5cbb80a + role: assistant + status: completed + type: message + parallel_tool_calls: false + previous_response_id: null + reasoning: + effort: low + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: null + top_p: 0.95 + truncation: disabled + usage: + input_tokens: 213 + input_tokens_details: + cached_tokens: 0 + output_tokens: 19 + output_tokens_details: + reasoning_tokens: 10 + total_tokens: 232 + user: null + body_bytes: !!binary | + eyJpZCI6InJlc3BfY2U2MGE4ZWRmMWMwNDNkNWJiNzU0NmUwMWM1ZTJlMjEiLCJvYmplY3QiOiJy + ZXNwb25zZSIsImNyZWF0ZWRfYXQiOjE3OTQ5MzA5MDEsInN0YXR1cyI6ImNvbXBsZXRlZCIsIm1v + ZGVsIjoiYWNjb3VudHMvZmlyZXdvcmtzL21vZGVscy9uZW1vdHJvbi1saWdodG5pbmctM3A1LTMw + Yi1hM2IiLCJvdXRwdXQiOlt7ImlkIjoicnNfN2UwMDA5MzI5ZjRjNGUzMGFhMDRiOTM1YjVjZmQ3 + ODYiLCJ0eXBlIjoicmVhc29uaW5nIiwic3VtbWFyeSI6W3sidHlwZSI6InN1bW1hcnlfdGV4dCIs + InRleHQiOiJXZSBuZWVkIHRvIGdpdmUgZmluYWwgYW5zd2VyOiA5LiJ9XX0seyJpZCI6Im1zZ19i + M2M5MTRmNDE0YjA0N2IyOGUwN2U1ZDdkNWNiYjgwYSIsInR5cGUiOiJtZXNzYWdlIiwicm9sZSI6 + ImFzc2lzdGFudCIsImNvbnRlbnQiOlt7InR5cGUiOiJvdXRwdXRfdGV4dCIsInRleHQiOiJUaGUg + ZmluYWwgYW5zd2VyIGlzIDkuIiwiYW5ub3RhdGlvbnMiOltdfV0sInN0YXR1cyI6ImNvbXBsZXRl + ZCJ9XSwicHJldmlvdXNfcmVzcG9uc2VfaWQiOm51bGwsInVzYWdlIjp7ImlucHV0X3Rva2VucyI6 + MjEzLCJvdXRwdXRfdG9rZW5zIjoxOSwidG90YWxfdG9rZW5zIjoyMzIsImlucHV0X3Rva2Vuc19k + ZXRhaWxzIjp7ImNhY2hlZF90b2tlbnMiOjB9LCJvdXRwdXRfdG9rZW5zX2RldGFpbHMiOnsicmVh + c29uaW5nX3Rva2VucyI6MTB9fSwiZXJyb3IiOm51bGwsImluY29tcGxldGVfZGV0YWlscyI6bnVs + bCwiaW5zdHJ1Y3Rpb25zIjpudWxsLCJtYXhfb3V0cHV0X3Rva2VucyI6MjA0OCwibWF4X3Rvb2xf + Y2FsbHMiOm51bGwsInBhcmFsbGVsX3Rvb2xfY2FsbHMiOmZhbHNlLCJyZWFzb25pbmciOnsiZWZm + b3J0IjoibG93In0sInN0b3JlIjpmYWxzZSwidGVtcGVyYXR1cmUiOjEuMCwidGV4dCI6eyJmb3Jt + YXQiOnsidHlwZSI6InRleHQifX0sInRvb2xfY2hvaWNlIjoibm9uZSIsInRvb2xzIjpbeyJ0eXBl + IjoiZnVuY3Rpb24iLCJuYW1lIjoiYWRkIiwiZGVzY3JpcHRpb24iOiJBZGQgdHdvIGludGVnZXJz + LiIsInBhcmFtZXRlcnMiOnsidHlwZSI6Im9iamVjdCIsInByb3BlcnRpZXMiOnsiYSI6eyJ0eXBl + IjoiaW50ZWdlciJ9LCJiIjp7InR5cGUiOiJpbnRlZ2VyIn19LCJyZXF1aXJlZCI6WyJhIiwiYiJd + LCJhZGRpdGlvbmFsUHJvcGVydGllcyI6ZmFsc2V9fV0sInRvcF9wIjowLjk1LCJ0b3BfbG9ncHJv + YnMiOm51bGwsInRydW5jYXRpb24iOiJkaXNhYmxlZCIsInVzZXIiOm51bGwsImJhY2tncm91bmQi + Om51bGwsIm1ldGFkYXRhIjp7fX0= + headers: + connection: keep-alive + content-length: '1274' + content-type: application/json + x-request-id: 4896976e-3ae1-4e25-9480-3e6a4c8409fa + status_code: 200 +timestamp: '2026-11-17T15:55:01.308323+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-00.yaml new file mode 100644 index 0000000..18b4cb0 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-00.yaml @@ -0,0 +1,561 @@ +filename: 2026-11-17-01a1ea37-eb9c-77c2-ab46-fdbbd646ec07 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '586' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1ea37-eb9c-77c2-ab46-fdbbd646ec07 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: fa9663ec-8c83-4d04-8fc8-2eb05c96a12f + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_f854ae308d744c05bd9751e0bd6de846","object":"response","created_at":1794930896,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_f854ae308d744c05bd9751e0bd6de846","object":"response","created_at":1794930896,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"reasoning","id":"rs_41c356bb10094db899af23d02ef569ff","status":"in_progress","summary":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.added","sequence_number":3,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":""}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":4,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"We"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":5,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + need"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":6,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + to"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":7,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + compute"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":8,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + ("} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":9,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"2"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":10,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"+"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":11,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"3"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":12,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":")="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":13,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":14,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":","} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":15,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":16,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":17,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + 5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":18,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"+"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":19,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"4"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":20,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + ="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":21,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"9"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":22,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":23,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + Use"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":24,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + the"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":25,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":26,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + tool"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":27,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + twice"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":28,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":29,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"\n\nWe"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":30,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + must"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":31,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + call"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":32,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + function"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":33,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":34,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + with"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":35,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + a"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":36,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":37,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"2"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":38,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + b"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":39,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":40,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"3"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":41,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":42,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + Then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":43,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + call"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":44,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + again"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":45,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + with"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":46,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + a"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":47,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":48,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"result"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":49,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + b"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":50,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"="} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":51,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"4"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":52,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":53,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + Then"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":54,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + give"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":55,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + final"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":56,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + answer"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":57,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":58,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"\n\nWe"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":59,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"''ll"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":60,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + need"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":61,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + to"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":62,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + output"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":63,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":" + calls"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":64,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":65,"output_index":1,"item":{"type":"function_call","id":"fc_a5b8cb0550f74a028cd6b040ecd59d2b","status":"in_progress","call_id":"chatcmpl-tool-97dd83b08a8858b6","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":66,"item_id":"fc_a5b8cb0550f74a028cd6b040ecd59d2b","output_index":1,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":67,"item_id":"fc_a5b8cb0550f74a028cd6b040ecd59d2b","output_index":1,"delta":"2, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":68,"item_id":"fc_a5b8cb0550f74a028cd6b040ecd59d2b","output_index":1,"delta":"3}"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.done","sequence_number":69,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"text":"We + need to compute (2+3)=5, then add 5+4 =9. Use the add tool twice.\n\nWe must call + function add with a=2 b=3. Then call again with a=result b=4. Then give final + answer.\n\nWe''ll need to output calls."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.done","sequence_number":70,"item_id":"rs_41c356bb10094db899af23d02ef569ff","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":"We + need to compute (2+3)=5, then add 5+4 =9. Use the add tool twice.\n\nWe must call + function add with a=2 b=3. Then call again with a=result b=4. Then give final + answer.\n\nWe''ll need to output calls."}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":71,"output_index":0,"item":{"type":"reasoning","id":"rs_41c356bb10094db899af23d02ef569ff","status":"completed","summary":[{"type":"summary_text","text":"We + need to compute (2+3)=5, then add 5+4 =9. Use the add tool twice.\n\nWe must call + function add with a=2 b=3. Then call again with a=result b=4. Then give final + answer.\n\nWe''ll need to output calls."}]}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":72,"item_id":"fc_a5b8cb0550f74a028cd6b040ecd59d2b","output_index":1,"arguments":"{\"a\": + 2, \"b\": 3}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":73,"output_index":1,"item":{"type":"function_call","id":"fc_a5b8cb0550f74a028cd6b040ecd59d2b","status":"completed","call_id":"chatcmpl-tool-97dd83b08a8858b6","name":"add","arguments":"{\"a\": + 2, \"b\": 3}"}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":74,"response":{"id":"resp_f854ae308d744c05bd9751e0bd6de846","object":"response","created_at":1794930896,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"rs_41c356bb10094db899af23d02ef569ff","type":"reasoning","summary":[{"type":"summary_text","text":"We + need to compute (2+3)=5, then add 5+4 =9. Use the add tool twice.\n\nWe must call + function add with a=2 b=3. Then call again with a=result b=4. Then give final + answer.\n\nWe''ll need to output calls."}]},{"id":"fc_a5b8cb0550f74a028cd6b040ecd59d2b","type":"function_call","call_id":"chatcmpl-tool-97dd83b08a8858b6","name":"add","arguments":"{\"a\": + 2, \"b\": 3}","status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":325,"output_tokens":94,"total_tokens":419,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":62}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-17T15:54:55.772794+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-01.yaml new file mode 100644 index 0000000..54f68fd --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-01.yaml @@ -0,0 +1,247 @@ +filename: 2026-11-17-01a1ea37-f4f7-7863-843b-7529516a454e +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - id: rs_41c356bb10094db899af23d02ef569ff + summary: + - text: 'We need to compute (2+3)=5, then add 5+4 =9. Use the add tool twice. + + + We must call function add with a=2 b=3. Then call again with a=result b=4. + Then give final answer. + + + We''ll need to output calls.' + type: summary_text + type: reasoning + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-97dd83b08a8858b6 + id: fc_a5b8cb0550f74a028cd6b040ecd59d2b + name: add + type: function_call + - call_id: chatcmpl-tool-97dd83b08a8858b6 + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1144' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1ea37-f4f7-7863-843b-7529516a454e +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: 4775bd82-3ed4-4592-9cbf-fd6876784845 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_4e749290bffd462aaebe1c38a8360c6a","object":"response","created_at":1794930898,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_4e749290bffd462aaebe1c38a8360c6a","object":"response","created_at":1794930898,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"reasoning","id":"rs_8b44eb4be0d7479393272d7ed578fd01","status":"in_progress","summary":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.added","sequence_number":3,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":""}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":4,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":"We"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":5,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + got"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":6,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + result"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":7,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + 5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":8,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":9,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + Now"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":10,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + add"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":11,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + 5"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":12,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + and"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":13,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":" + 4"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":14,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":15,"output_index":1,"item":{"type":"function_call","id":"fc_03b10d96cd204c678c9a34b9a35c34e8","status":"in_progress","call_id":"chatcmpl-tool-8b5f27737986ef19","name":"add","arguments":""}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":16,"item_id":"fc_03b10d96cd204c678c9a34b9a35c34e8","output_index":1,"delta":"{\"a\": + "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":17,"item_id":"fc_03b10d96cd204c678c9a34b9a35c34e8","output_index":1,"delta":"5, + \"b\": "} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":18,"item_id":"fc_03b10d96cd204c678c9a34b9a35c34e8","output_index":1,"delta":"4}"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.done","sequence_number":19,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"text":"We + got result 5. Now add 5 and 4."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.done","sequence_number":20,"item_id":"rs_8b44eb4be0d7479393272d7ed578fd01","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":"We + got result 5. Now add 5 and 4."}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":21,"output_index":0,"item":{"type":"reasoning","id":"rs_8b44eb4be0d7479393272d7ed578fd01","status":"completed","summary":[{"type":"summary_text","text":"We + got result 5. Now add 5 and 4."}]}} + + ' + - ' + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":22,"item_id":"fc_03b10d96cd204c678c9a34b9a35c34e8","output_index":1,"arguments":"{\"a\": + 5, \"b\": 4}"} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":23,"output_index":1,"item":{"type":"function_call","id":"fc_03b10d96cd204c678c9a34b9a35c34e8","status":"completed","call_id":"chatcmpl-tool-8b5f27737986ef19","name":"add","arguments":"{\"a\": + 5, \"b\": 4}"}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":24,"response":{"id":"resp_4e749290bffd462aaebe1c38a8360c6a","object":"response","created_at":1794930898,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"rs_8b44eb4be0d7479393272d7ed578fd01","type":"reasoning","summary":[{"type":"summary_text","text":"We + got result 5. Now add 5 and 4."}]},{"id":"fc_03b10d96cd204c678c9a34b9a35c34e8","type":"function_call","call_id":"chatcmpl-tool-8b5f27737986ef19","name":"add","arguments":"{\"a\": + 5, \"b\": 4}","status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":438,"output_tokens":46,"total_tokens":484,"input_tokens_details":{"cached_tokens":324},"output_tokens_details":{"reasoning_tokens":14}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-17T15:54:58.167499+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-02.yaml new file mode 100644 index 0000000..e55ebaa --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-stream-02.yaml @@ -0,0 +1,290 @@ +filename: 2026-11-17-01a1ea37-f827-7da2-97e7-161d911d7340 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - id: rs_41c356bb10094db899af23d02ef569ff + summary: + - text: 'We need to compute (2+3)=5, then add 5+4 =9. Use the add tool twice. + + + We must call function add with a=2 b=3. Then call again with a=result b=4. + Then give final answer. + + + We''ll need to output calls.' + type: summary_text + type: reasoning + - arguments: '{"a": 2, "b": 3}' + call_id: chatcmpl-tool-97dd83b08a8858b6 + id: fc_a5b8cb0550f74a028cd6b040ecd59d2b + name: add + type: function_call + - call_id: chatcmpl-tool-97dd83b08a8858b6 + output: '5' + type: function_call_output + - id: rs_8b44eb4be0d7479393272d7ed578fd01 + summary: + - text: We got result 5. Now add 5 and 4. + type: summary_text + type: reasoning + - arguments: '{"a": 5, "b": 4}' + call_id: chatcmpl-tool-8b5f27737986ef19 + id: fc_03b10d96cd204c678c9a34b9a35c34e8 + name: add + type: function_call + - call_id: chatcmpl-tool-8b5f27737986ef19 + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1508' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /inference/v1/responses + query_params: {} +request_id: 01a1ea37-f827-7da2-97e7-161d911d7340 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream; charset=utf-8 + x-request-id: d81073e7-027c-4fb5-a3ce-498b223c8b66 + sse: + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_51babd1901754d3a8e1067f99e3ed278","object":"response","created_at":1794930899,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_51babd1901754d3a8e1067f99e3ed278","object":"response","created_at":1794930899,"status":"in_progress","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[],"previous_response_id":null,"usage":null,"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":1.0,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"type":"reasoning","id":"rs_ee40dc39a4c642b69815e694a3243f58","status":"in_progress","summary":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.added","sequence_number":3,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":""}} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":4,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":"We"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":5,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":" + have"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":6,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":" + final"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":7,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":" + answer"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":8,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":" + 9"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":9,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":10,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":" + Provide"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":11,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":" + final"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":12,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":" + answer"} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.delta","sequence_number":13,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"delta":"."} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.added","sequence_number":14,"output_index":1,"item":{"type":"message","id":"msg_2011d9b6f32948a081d2fd8b22cb4213","status":"in_progress","role":"assistant","content":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.added","sequence_number":15,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"delta":"The","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"delta":" + final","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"delta":" + answer","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"delta":" + is","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"delta":" + ","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"delta":"9","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"delta":".","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_text.done","sequence_number":23,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"text":"We + have final answer 9. Provide final answer."} + + ' + - ' + + ' + - 'data: {"type":"response.reasoning_summary_part.done","sequence_number":24,"item_id":"rs_ee40dc39a4c642b69815e694a3243f58","output_index":0,"summary_index":0,"part":{"type":"summary_text","text":"We + have final answer 9. Provide final answer."}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":25,"output_index":0,"item":{"type":"reasoning","id":"rs_ee40dc39a4c642b69815e694a3243f58","status":"completed","summary":[{"type":"summary_text","text":"We + have final answer 9. Provide final answer."}]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_text.done","sequence_number":26,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"text":"The + final answer is 9.","logprobs":[]} + + ' + - ' + + ' + - 'data: {"type":"response.content_part.done","sequence_number":27,"item_id":"msg_2011d9b6f32948a081d2fd8b22cb4213","output_index":1,"content_index":0,"part":{"type":"output_text","text":"The + final answer is 9.","annotations":[]}} + + ' + - ' + + ' + - 'data: {"type":"response.output_item.done","sequence_number":28,"output_index":1,"item":{"type":"message","id":"msg_2011d9b6f32948a081d2fd8b22cb4213","status":"completed","role":"assistant","content":[{"type":"output_text","text":"The + final answer is 9.","annotations":[]}]}} + + ' + - ' + + ' + - 'data: {"type":"response.completed","sequence_number":29,"response":{"id":"resp_51babd1901754d3a8e1067f99e3ed278","object":"response","created_at":1794930899,"status":"completed","model":"accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b","output":[{"id":"rs_ee40dc39a4c642b69815e694a3243f58","type":"reasoning","summary":[{"type":"summary_text","text":"We + have final answer 9. Provide final answer."}]},{"id":"msg_2011d9b6f32948a081d2fd8b22cb4213","type":"message","role":"assistant","content":[{"type":"output_text","text":"The + final answer is 9.","annotations":[]}],"status":"completed"}],"previous_response_id":null,"usage":{"input_tokens":224,"output_tokens":20,"total_tokens":244,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":11}},"error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"parallel_tool_calls":false,"reasoning":{"effort":"low"},"store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_p":0.95,"top_logprobs":null,"truncation":"disabled","user":null,"background":null,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: null +timestamp: '2026-11-17T15:54:58.983363+00:00' +upstream_url: https://api.fireworks.ai/inference/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-00.yaml new file mode 100644 index 0000000..02df56f --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-00.yaml @@ -0,0 +1,89 @@ +filename: 2026-11-17-01a1ea5e-7e12-7300-816e-55567495ae07 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '561' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea5e-7e12-7300-816e-55567495ae07 +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + logprobs: null + matched_stop: 154829 + message: + annotations: [] + content: null + reasoning_content: The user wants me to first add 2 and 3, then take that + result and add 4 to it. Let me start with the first addition. + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: call_01a1ea5e7f847760831e114a + type: function + created: 1794933423 + id: 963e7e492efe4931bbebd2167a036ce6-aws_as1 + model: zai-org/GLM-5.2 + object: chat.completion + service_tier: default + system_fingerprint: default + usage: + completion_tokens: 49 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 33 + rejected_prediction_tokens: 0 + prompt_tokens: 198 + prompt_tokens_details: + audio_tokens: 0 + cached_tokens: 192 + total_tokens: 247 + headers: + connection: keep-alive + content-type: application/json + x-request-id: 963e7e492efe4931bbebd2167a036ce6-aws_as1 + status_code: 200 +timestamp: '2026-11-17T16:37:03.634849+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-01.yaml new file mode 100644 index 0000000..b6dc3c9 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-01.yaml @@ -0,0 +1,102 @@ +filename: 2026-11-17-01a1ea5e-8064-7543-9662-ce8cda3ef92d +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - annotations: [] + reasoning_content: The user wants me to first add 2 and 3, then take that result + and add 4 to it. Let me start with the first addition. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: call_01a1ea5e7f847760831e114a + type: function + - content: '5' + role: tool + tool_call_id: call_01a1ea5e7f847760831e114a + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '945' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea5e-8064-7543-9662-ce8cda3ef92d +response: + body: + choices: + - finish_reason: tool_calls + index: 0 + logprobs: null + matched_stop: 154829 + message: + annotations: [] + content: null + reasoning_content: The first result is 5. Now I need to add that result (5) + and 4. + refusal: null + role: assistant + tool_calls: + - function: + arguments: '{"a":5,"b":4}' + name: add + id: call_01a1ea5e811f72b287c3ea9b + type: function + created: 1794933424 + id: f56ff35f9ad74310ae4d1caf2c00025e-aws_as1 + model: zai-org/GLM-5.2 + object: chat.completion + service_tier: default + system_fingerprint: default + usage: + completion_tokens: 38 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 22 + rejected_prediction_tokens: 0 + prompt_tokens: 253 + prompt_tokens_details: + audio_tokens: 0 + cached_tokens: 192 + total_tokens: 291 + headers: + connection: keep-alive + content-type: application/json + x-request-id: f56ff35f9ad74310ae4d1caf2c00025e-aws_as1 + status_code: 200 +timestamp: '2026-11-17T16:37:04.228133+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-02.yaml new file mode 100644 index 0000000..27968e1 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-non_stream-02.yaml @@ -0,0 +1,112 @@ +filename: 2026-11-17-01a1ea5e-81e6-75d0-a6e6-c445b9f29874 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - annotations: [] + reasoning_content: The user wants me to first add 2 and 3, then take that result + and add 4 to it. Let me start with the first addition. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: call_01a1ea5e7f847760831e114a + type: function + - content: '5' + role: tool + tool_call_id: call_01a1ea5e7f847760831e114a + - annotations: [] + reasoning_content: The first result is 5. Now I need to add that result (5) + and 4. + role: assistant + tool_calls: + - function: + arguments: '{"a":5,"b":4}' + name: add + id: call_01a1ea5e811f72b287c3ea9b + type: function + - content: '9' + role: tool + tool_call_id: call_01a1ea5e811f72b287c3ea9b + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning_effort: low + stream: false + tool_choice: none + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1237' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea5e-81e6-75d0-a6e6-c445b9f29874 +response: + body: + choices: + - finish_reason: stop + index: 0 + logprobs: null + matched_stop: 154827 + message: + annotations: [] + content: 'The final answer is **9**. + + + Here''s the step-by-step breakdown: + + 1. 2 + 3 = 5 + + 2. 5 + 4 = 9' + reasoning_content: The second result is 9. So the final answer is 9. + refusal: null + role: assistant + created: 1794933424 + id: f06204d0fb4f4c02bdf69228fd1ef164-aws_as1 + model: zai-org/GLM-5.2 + object: chat.completion + service_tier: default + system_fingerprint: default + usage: + completion_tokens: 54 + completion_tokens_details: + accepted_prediction_tokens: 0 + audio_tokens: 0 + reasoning_tokens: 16 + rejected_prediction_tokens: 0 + prompt_tokens: 141 + prompt_tokens_details: + audio_tokens: 0 + cached_tokens: 0 + total_tokens: 195 + headers: + connection: keep-alive + content-type: application/json + x-request-id: f06204d0fb4f4c02bdf69228fd1ef164-aws_as1 + status_code: 200 +timestamp: '2026-11-17T16:37:04.614674+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-00.yaml new file mode 100644 index 0000000..0cb9a13 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-00.yaml @@ -0,0 +1,183 @@ +filename: 2026-11-17-01a1ea5e-783d-78f0-b766-5b3ba69ba190 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '600' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea5e-783d-78f0-b766-5b3ba69ba190 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1 + sse: + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","content":null,"reasoning_content":""},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":"The"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + user wants me to add "},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":"2 + and 3 first,"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + then take"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + that"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + result and add 4 to"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + it. I"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + need to do these"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + sequentially since the second"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + call depends on the result"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + of the first."},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_01a1ea5e799979a1974ed250","type":"function","function":{"name":"add"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"a\":2"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":",\"b\":3}"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls","matched_stop":154829}]} + + ' + - ' + + ' + - 'data: {"id":"eb248ad8a8ee48ddbe64eeb311b442e0-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":198,"completion_tokens":59,"total_tokens":257,"prompt_tokens_details":{"cached_tokens":192,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":43,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-17T16:37:02.142005+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-01.yaml new file mode 100644 index 0000000..6be26f2 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-01.yaml @@ -0,0 +1,161 @@ +filename: 2026-11-17-01a1ea5e-7ae7-7fd2-b4bf-381ed486841f +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - reasoning_content: The user wants me to add 2 and 3 first, then take that result + and add 4 to it. I need to do these sequentially since the second call depends + on the result of the first. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: call_01a1ea5e799979a1974ed250 + type: function + - content: '5' + role: tool + tool_call_id: call_01a1ea5e799979a1974ed250 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: + function: + name: add + type: function + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1019' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea5e-7ae7-7fd2-b4bf-381ed486841f +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 9039d77f4b7945feaf64aec9451cc17b-aws_as1 + sse: + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","content":null,"reasoning_content":""},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":"The"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + first"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + result is 5"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":". + Now I need to add"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + 5 and"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + 4."},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_01a1ea5e7b8e7462975cc233","type":"function","function":{"name":"add"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\":5"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":",\"b\":4"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls","matched_stop":154829}]} + + ' + - ' + + ' + - 'data: {"id":"9039d77f4b7945feaf64aec9451cc17b-aws_as1","object":"chat.completion.chunk","created":1794933422,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":263,"completion_tokens":35,"total_tokens":298,"prompt_tokens_details":{"cached_tokens":192,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":19,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-17T16:37:02.823569+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-02.yaml new file mode 100644 index 0000000..d380c7e --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-chat_completions-stream-02.yaml @@ -0,0 +1,192 @@ +filename: 2026-11-17-01a1ea5e-7c69-7f31-8e1d-b369358c1a31 +request: + body: + max_completion_tokens: 2048 + messages: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - reasoning_content: The user wants me to add 2 and 3 first, then take that result + and add 4 to it. I need to do these sequentially since the second call depends + on the result of the first. + role: assistant + tool_calls: + - function: + arguments: '{"a":2,"b":3}' + name: add + id: call_01a1ea5e799979a1974ed250 + type: function + - content: '5' + role: tool + tool_call_id: call_01a1ea5e799979a1974ed250 + - reasoning_content: The first result is 5. Now I need to add 5 and 4. + role: assistant + tool_calls: + - function: + arguments: '{"a":5,"b":4}' + name: add + id: call_01a1ea5e7b8e7462975cc233 + type: function + - content: '9' + role: tool + tool_call_id: call_01a1ea5e7b8e7462975cc233 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning_effort: low + stream: true + stream_options: + include_usage: true + tool_choice: none + tools: + - function: + description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1280' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/chat/completions + query_params: {} +request_id: 01a1ea5e-7c69-7f31-8e1d-b369358c1a31 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: bfb25a35557e41939b32ab704f245792-aws_as1 + sse: + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning_content":"","refusal":null},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":"The"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + final result"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"reasoning_content":" + is 9."},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"I"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + first added"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + 2 and 3,"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + which gave"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + 5. Then"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + I added 5 and"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + 4, giving"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + the"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":" + final answer:"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{"content":"\n\n**9**"},"logprobs":null,"finish_reason":null}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop","matched_stop":154827}]} + + ' + - ' + + ' + - 'data: {"id":"bfb25a35557e41939b32ab704f245792-aws_as1","object":"chat.completion.chunk","created":1794933423,"model":"zai-org/GLM-5.2","system_fingerprint":"default","choices":[],"usage":{"prompt_tokens":148,"completion_tokens":40,"total_tokens":188,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":8,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: '[DONE]' +timestamp: '2026-11-17T16:37:03.209870+00:00' +upstream_url: https://api.together.ai/v1/chat/completions diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-00.yaml new file mode 100644 index 0000000..c704bff --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-00.yaml @@ -0,0 +1,137 @@ +filename: 2026-11-17-01a1ea5e-72cb-7b42-99b9-84670ed2ff04 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '546' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1ea5e-72cb-7b42-99b9-84670ed2ff04 +response: + body: + background: false + completed_at: 1794933420 + created_at: 1794933420 + error: null + frequency_penalty: 0.0 + id: resp_01a1ea5e-731b-7dd3-bb71-42af344d8ceb + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - content: + - text: 'The user wants me to: + + 1. Add 2 and 3 + + 2. Then add the result of that with 4 + + 3. Give the final answer + + + Let me start with the first call.' + type: reasoning_text + id: rs_0423dab93ad247b9b1d25b8a75264422-aws_as1-01a1ea5e-731b-7dd3-bb71-42bcc0e7ee65 + status: completed + summary: [] + type: reasoning + - arguments: '{"a":2,"b":3}' + call_id: call_01a1ea5e73ac7001900e935a + id: fc_call_01a1ea5e73ac7001900e935a + name: add + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: low + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 198 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 192 + output_tokens: 59 + output_tokens_details: + reasoning_tokens: 43 + total_tokens: 257 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: 0423dab93ad247b9b1d25b8a75264422-aws_as1 + status_code: 200 +timestamp: '2026-11-17T16:37:00.747784+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-01.yaml new file mode 100644 index 0000000..292826c --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-01.yaml @@ -0,0 +1,151 @@ +filename: 2026-11-17-01a1ea5e-7519-7a90-9037-0bf3a0d9a4ed +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: + - text: 'The user wants me to: + + 1. Add 2 and 3 + + 2. Then add the result of that with 4 + + 3. Give the final answer + + + Let me start with the first call.' + type: reasoning_text + id: rs_0423dab93ad247b9b1d25b8a75264422-aws_as1-01a1ea5e-731b-7dd3-bb71-42bcc0e7ee65 + summary: [] + type: reasoning + - arguments: '{"a":2,"b":3}' + call_id: call_01a1ea5e73ac7001900e935a + id: fc_call_01a1ea5e73ac7001900e935a + name: add + type: function_call + - call_id: call_01a1ea5e73ac7001900e935a + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: false + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1094' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1ea5e-7519-7a90-9037-0bf3a0d9a4ed +response: + body: + background: false + completed_at: 1794933421 + created_at: 1794933421 + error: null + frequency_penalty: 0.0 + id: resp_01a1ea5e-756b-7a02-b7f0-d5a732e15c83 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - content: + - text: The result of adding 2 and 3 is 5. Now I need to add 5 and 4. + type: reasoning_text + id: rs_cc6ffc065fa6461fbe2171ddf175abb9-aws_as1-01a1ea5e-756c-7113-8122-4ca13ae298bf + status: completed + summary: [] + type: reasoning + - arguments: '{"a":5,"b":4}' + call_id: call_01a1ea5e75da7e52ae4c7c2c + id: fc_call_01a1ea5e75da7e52ae4c7c2c + name: add + status: completed + type: function_call + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: low + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 262 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 192 + output_tokens: 41 + output_tokens_details: + reasoning_tokens: 25 + total_tokens: 303 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: cc6ffc065fa6461fbe2171ddf175abb9-aws_as1 + status_code: 200 +timestamp: '2026-11-17T16:37:01.337333+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-02.yaml new file mode 100644 index 0000000..989f4e2 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-non_stream-02.yaml @@ -0,0 +1,170 @@ +filename: 2026-11-17-01a1ea5e-76c4-79d1-bb64-617d94635bac +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: + - text: 'The user wants me to: + + 1. Add 2 and 3 + + 2. Then add the result of that with 4 + + 3. Give the final answer + + + Let me start with the first call.' + type: reasoning_text + id: rs_0423dab93ad247b9b1d25b8a75264422-aws_as1-01a1ea5e-731b-7dd3-bb71-42bcc0e7ee65 + summary: [] + type: reasoning + - arguments: '{"a":2,"b":3}' + call_id: call_01a1ea5e73ac7001900e935a + id: fc_call_01a1ea5e73ac7001900e935a + name: add + type: function_call + - call_id: call_01a1ea5e73ac7001900e935a + output: '5' + type: function_call_output + - content: + - text: The result of adding 2 and 3 is 5. Now I need to add 5 and 4. + type: reasoning_text + id: rs_cc6ffc065fa6461fbe2171ddf175abb9-aws_as1-01a1ea5e-756c-7113-8122-4ca13ae298bf + summary: [] + type: reasoning + - arguments: '{"a":5,"b":4}' + call_id: call_01a1ea5e75da7e52ae4c7c2c + id: fc_call_01a1ea5e75da7e52ae4c7c2c + name: add + type: function_call + - call_id: call_01a1ea5e75da7e52ae4c7c2c + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: false + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1538' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1ea5e-76c4-79d1-bb64-617d94635bac +response: + body: + background: false + completed_at: 1794933421 + created_at: 1794933421 + error: null + frequency_penalty: 0.0 + id: resp_01a1ea5e-770f-77b2-b52a-2e4c297d4854 + incomplete_details: null + instructions: null + max_output_tokens: 2048 + max_tool_calls: null + metadata: {} + model: zai-org/GLM-5.2 + object: response + output: + - content: + - text: The final result is 9. + type: reasoning_text + id: rs_6663cf62e15b4032997d27f8d0da465d-aws_as1-01a1ea5e-770f-77b2-b52a-2e5de95da643 + status: completed + summary: [] + type: reasoning + - content: + - annotations: [] + text: 'The final answer is **9**. + + + Here''s the step-by-step breakdown: + + 1. 2 + 3 = 5 + + 2. 5 + 4 = 9' + type: output_text + id: msg_6663cf62e15b4032997d27f8d0da465d-aws_as1-01a1ea5e-770f-77b2-b52a-2e5de95da643 + role: assistant + status: completed + type: message + parallel_tool_calls: false + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: null + reasoning: + effort: low + summary: null + safety_identifier: null + service_tier: default + status: completed + store: false + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + top_logprobs: 0 + top_p: 1.0 + truncation: disabled + usage: + input_tokens: 152 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 46 + output_tokens_details: + reasoning_tokens: 8 + total_tokens: 198 + user: null + headers: + connection: keep-alive + content-type: application/json + x-request-id: 6663cf62e15b4032997d27f8d0da465d-aws_as1 + status_code: 200 +timestamp: '2026-11-17T16:37:01.764708+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-00.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-00.yaml new file mode 100644 index 0000000..6dedf78 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-00.yaml @@ -0,0 +1,282 @@ +filename: 2026-11-17-01a1ea5e-6435-7f73-a10d-5af0e3c92da9 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + max_output_tokens: 2048 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '545' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1ea5e-6435-7f73-a10d-5af0e3c92da9 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 95049093c1ed46309a63e0b1aa7d374e-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1ea5e-656b-7763-b6a2-50d344c3188e","object":"response","created_at":1794933417,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1ea5e-656b-7763-b6a2-50d344c3188e","object":"response","created_at":1794933417,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","type":"reasoning","summary":[],"content":[],"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"part":{"type":"reasoning_text","text":""}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":"The"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":" + user wants me to first"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":" + add 2 and 3"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":", + then take"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":" + that"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":" + result and add 4 to"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":" + it. Let me start with"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":" + the first addition"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"delta":"."} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":13,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"text":"The + user wants me to first add 2 and 3, then take that result and add 4 to it. Let + me start with the first addition."} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":14,"output_index":0,"item_id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","content_index":0,"part":{"type":"reasoning_text","text":"The + user wants me to first add 2 and 3, then take that result and add 4 to it. Let + me start with the first addition."}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":15,"output_index":0,"item":{"id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","type":"reasoning","summary":[],"content":[{"type":"reasoning_text","text":"The + user wants me to first add 2 and 3, then take that result and add 4 to it. Let + me start with the first addition."}],"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":16,"output_index":1,"item":{"id":"fc_01a1ea5e65e77e03ae6945ae70a59679","type":"function_call","call_id":"call_01a1ea5e65e77e03ae69459e","name":"add","arguments":"","status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":17,"output_index":1,"item_id":"fc_01a1ea5e65e77e03ae6945ae70a59679","delta":"{"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":18,"output_index":1,"item_id":"fc_01a1ea5e65e77e03ae6945ae70a59679","delta":"\"a\":2"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":19,"output_index":1,"item_id":"fc_01a1ea5e65e77e03ae6945ae70a59679","delta":",\"b\":3}"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.done + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":20,"output_index":1,"item_id":"fc_01a1ea5e65e77e03ae6945ae70a59679","arguments":"{\"a\":2,\"b\":3}"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":21,"output_index":1,"item":{"id":"fc_01a1ea5e65e77e03ae6945ae70a59679","type":"function_call","call_id":"call_01a1ea5e65e77e03ae69459e","name":"add","arguments":"{\"a\":2,\"b\":3}","status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":22,"response":{"id":"resp_01a1ea5e-656b-7763-b6a2-50d344c3188e","object":"response","created_at":1794933417,"completed_at":1794933417,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"rs_01a1ea5e659d7ba3967b24943b0f61d4","type":"reasoning","summary":[],"content":[{"type":"reasoning_text","text":"The + user wants me to first add 2 and 3, then take that result and add 4 to it. Let + me start with the first addition."}],"status":"completed"},{"id":"fc_01a1ea5e65e77e03ae6945ae70a59679","type":"function_call","call_id":"call_01a1ea5e65e77e03ae69459e","name":"add","arguments":"{\"a\":2,\"b\":3}","status":"completed"}],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":198,"output_tokens":49,"total_tokens":247,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":33}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-17T16:36:57.013363+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-01.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-01.yaml new file mode 100644 index 0000000..adece4f --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-01.yaml @@ -0,0 +1,274 @@ +filename: 2026-11-17-01a1ea5e-697c-73c1-b60a-d4109ffb2c93 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: + - text: The user wants me to first add 2 and 3, then take that result and add + 4 to it. Let me start with the first addition. + type: reasoning_text + id: rs_01a1ea5e659d7ba3967b24943b0f61d4 + summary: [] + type: reasoning + - arguments: '{"a":2,"b":3}' + call_id: call_01a1ea5e65e77e03ae69459e + id: fc_01a1ea5e65e77e03ae6945ae70a59679 + name: add + type: function_call + - call_id: call_01a1ea5e65e77e03ae69459e + output: '5' + type: function_call_output + max_output_tokens: 2048 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: + name: add + type: function + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1028' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1ea5e-697c-73c1-b60a-d4109ffb2c93 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: c5382797ad47473e8d35b707241ec81e-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1ea5e-6dd6-79f1-9e09-d6864026f99f","object":"response","created_at":1794933419,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1ea5e-6dd6-79f1-9e09-d6864026f99f","object":"response","created_at":1794933419,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","type":"reasoning","summary":[],"content":[],"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"part":{"type":"reasoning_text","text":""}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"delta":"The"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"delta":" + result of"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"delta":" + adding 2 and 3"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"delta":" + is 5"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"delta":". + Now I need to add"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"delta":" + 5 and"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"delta":" + 4."} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":11,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"text":"The + result of adding 2 and 3 is 5. Now I need to add 5 and 4."} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":12,"output_index":0,"item_id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","content_index":0,"part":{"type":"reasoning_text","text":"The + result of adding 2 and 3 is 5. Now I need to add 5 and 4."}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":13,"output_index":0,"item":{"id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","type":"reasoning","summary":[],"content":[{"type":"reasoning_text","text":"The + result of adding 2 and 3 is 5. Now I need to add 5 and 4."}],"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":14,"output_index":1,"item":{"id":"fc_01a1ea5e6e867e01b896e71534e76b17","type":"function_call","call_id":"call_01a1ea5e6e867e01b896e700","name":"add","arguments":"","status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":15,"output_index":1,"item_id":"fc_01a1ea5e6e867e01b896e71534e76b17","delta":"{\"a\":5"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":16,"output_index":1,"item_id":"fc_01a1ea5e6e867e01b896e71534e76b17","delta":",\"b\":4"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.delta + + ' + - 'data: {"type":"response.function_call_arguments.delta","sequence_number":17,"output_index":1,"item_id":"fc_01a1ea5e6e867e01b896e71534e76b17","delta":"}"} + + ' + - ' + + ' + - 'event: response.function_call_arguments.done + + ' + - 'data: {"type":"response.function_call_arguments.done","sequence_number":18,"output_index":1,"item_id":"fc_01a1ea5e6e867e01b896e71534e76b17","arguments":"{\"a\":5,\"b\":4}"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":19,"output_index":1,"item":{"id":"fc_01a1ea5e6e867e01b896e71534e76b17","type":"function_call","call_id":"call_01a1ea5e6e867e01b896e700","name":"add","arguments":"{\"a\":5,\"b\":4}","status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":20,"response":{"id":"resp_01a1ea5e-6dd6-79f1-9e09-d6864026f99f","object":"response","created_at":1794933419,"completed_at":1794933419,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"rs_01a1ea5e6e477671b0c55a626c00b4bd","type":"reasoning","summary":[],"content":[{"type":"reasoning_text","text":"The + result of adding 2 and 3 is 5. Now I need to add 5 and 4."}],"status":"completed"},{"id":"fc_01a1ea5e6e867e01b896e71534e76b17","type":"function_call","call_id":"call_01a1ea5e6e867e01b896e700","name":"add","arguments":"{\"a\":5,\"b\":4}","status":"completed"}],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":{"type":"function","name":"add"},"tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":252,"output_tokens":41,"total_tokens":293,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":25}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-17T16:36:58.364508+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-02.yaml b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-02.yaml new file mode 100644 index 0000000..8d84b13 --- /dev/null +++ b/tests/cassettes/upstream_ir/tool_use_reasoning_low/togetherai-responses-stream-02.yaml @@ -0,0 +1,402 @@ +filename: 2026-11-17-01a1ea5e-6fbd-7d52-81f0-3f798745cb37 +request: + body: + input: + - content: Use add to add 2 and 3. After the result, use add to add that result + and 4. Then give the final answer. + role: user + - content: + - text: The user wants me to first add 2 and 3, then take that result and add + 4 to it. Let me start with the first addition. + type: reasoning_text + id: rs_01a1ea5e659d7ba3967b24943b0f61d4 + summary: [] + type: reasoning + - arguments: '{"a":2,"b":3}' + call_id: call_01a1ea5e65e77e03ae69459e + id: fc_01a1ea5e65e77e03ae6945ae70a59679 + name: add + type: function_call + - call_id: call_01a1ea5e65e77e03ae69459e + output: '5' + type: function_call_output + - content: + - text: The result of adding 2 and 3 is 5. Now I need to add 5 and 4. + type: reasoning_text + id: rs_01a1ea5e6e477671b0c55a626c00b4bd + summary: [] + type: reasoning + - arguments: '{"a":5,"b":4}' + call_id: call_01a1ea5e6e867e01b896e700 + id: fc_01a1ea5e6e867e01b896e71534e76b17 + name: add + type: function_call + - call_id: call_01a1ea5e6e867e01b896e700 + output: '9' + type: function_call_output + max_output_tokens: 2048 + model: zai-org/GLM-5.2 + parallel_tool_calls: false + reasoning: + effort: low + store: false + stream: true + tool_choice: none + tools: + - description: Add two integers. + name: add + parameters: + additionalProperties: false + properties: + a: + type: integer + b: + type: integer + required: + - a + - b + type: object + type: function + headers: + accept: application/json + accept-encoding: gzip, deflate, br + authorization: Bearer *** + connection: keep-alive + content-length: '1430' + content-type: application/json + user-agent: AsyncOpenAI/Python 2.53.0 + method: POST + path: /v1/responses + query_params: {} +request_id: 01a1ea5e-6fbd-7d52-81f0-3f798745cb37 +response: + error_event: false + headers: + cache-control: no-cache + connection: keep-alive + content-type: text/event-stream + x-request-id: 5cd58d734c944d85b4dc3a94d3546287-aws_as1 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a1ea5e-705a-7442-b819-36091a3abdee","object":"response","created_at":1794933420,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a1ea5e-705a-7442-b819-36091a3abdee","object":"response","created_at":1794933420,"completed_at":null,"background":false,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_01a1ea5e70c27d9093919559994b9d00","type":"reasoning","summary":[],"content":[],"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":3,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"part":{"type":"reasoning_text","text":""}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"delta":"So"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"delta":" + the final result"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"delta":" + is 9"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"delta":". + Let me summarize"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"delta":" + the"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"delta":" + process"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"delta":" + for the user."} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":11,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"text":"So + the final result is 9. Let me summarize the process for the user."} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":12,"output_index":0,"item_id":"rs_01a1ea5e70c27d9093919559994b9d00","content_index":0,"part":{"type":"reasoning_text","text":"So + the final result is 9. Let me summarize the process for the user."}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":13,"output_index":0,"item":{"id":"rs_01a1ea5e70c27d9093919559994b9d00","type":"reasoning","summary":[],"content":[{"type":"reasoning_text","text":"So + the final result is 9. Let me summarize the process for the user."}],"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":14,"output_index":1,"item":{"id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","type":"message","role":"assistant","status":"in_progress","content":[]}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":15,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":16,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":"Here","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":17,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":"''s + the step","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":18,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":"-by-step + breakdown","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":19,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":":\n\n1. + **","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":20,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":"First + addition","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":21,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":":** + 2 + 3","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":22,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":" + = 5\n2.","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":23,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":" + **Second addition:** 5","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":24,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":" + + 4 = 9","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":25,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":"\n\n**The","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":26,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":" + final answer is ","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":27,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"delta":"9.**","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":28,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"text":"Here''s + the step-by-step breakdown:\n\n1. **First addition:** 2 + 3 = 5\n2. **Second addition:** + 5 + 4 = 9\n\n**The final answer is 9.**","logprobs":[]} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":29,"output_index":1,"item_id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","content_index":0,"part":{"type":"output_text","text":"Here''s + the step-by-step breakdown:\n\n1. **First addition:** 2 + 3 = 5\n2. **Second addition:** + 5 + 4 = 9\n\n**The final answer is 9.**","annotations":[]}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":30,"output_index":1,"item":{"id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","type":"message","role":"assistant","content":[{"type":"output_text","text":"Here''s + the step-by-step breakdown:\n\n1. **First addition:** 2 + 3 = 5\n2. **Second addition:** + 5 + 4 = 9\n\n**The final answer is 9.**","annotations":[]}],"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":31,"response":{"id":"resp_01a1ea5e-705a-7442-b819-36091a3abdee","object":"response","created_at":1794933420,"completed_at":1794933420,"background":false,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":2048,"max_tool_calls":null,"model":"zai-org/GLM-5.2","output":[{"id":"rs_01a1ea5e70c27d9093919559994b9d00","type":"reasoning","summary":[],"content":[{"type":"reasoning_text","text":"So + the final result is 9. Let me summarize the process for the user."}],"status":"completed"},{"id":"msg_01a1ea5e71017aa2a50b03e3ae92f75a","type":"message","role":"assistant","content":[{"type":"output_text","text":"Here''s + the step-by-step breakdown:\n\n1. **First addition:** 2 + 3 = 5\n2. **Second addition:** + 5 + 4 = 9\n\n**The final answer is 9.**","annotations":[]}],"status":"completed"}],"parallel_tool_calls":false,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":null,"reasoning":{"effort":"low","summary":null},"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"none","tools":[{"type":"function","name":"add","description":"Add + two integers.","parameters":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"additionalProperties":false}}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":142,"output_tokens":66,"total_tokens":208,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens_details":{"reasoning_tokens":18}},"user":null,"safety_identifier":null,"frequency_penalty":0.0,"presence_penalty":0.0,"metadata":{}}} + + ' + - ' + + ' + status_code: 200 + stream_status: complete + terminal_event: response.completed +timestamp: '2026-11-17T16:36:59.965440+00:00' +upstream_url: https://api.together.ai/v1/responses diff --git a/tests/core/test_anthropic_web_search.py b/tests/core/test_anthropic_web_search.py index 7ec5e8a..ad8d5c6 100644 --- a/tests/core/test_anthropic_web_search.py +++ b/tests/core/test_anthropic_web_search.py @@ -378,9 +378,9 @@ async def test_recorded_search_history_preserves_provider_state(stream: bool): ("endpoint", "provider"), [ ("responses", None), - ("responses", "anthropic"), + ("responses", "vllm"), ("chat/completions", None), - ("messages", "openai"), + ("chat/completions", "vllm"), ("messages", "vllm"), ], ) diff --git a/tests/core/test_exceptions.py b/tests/core/test_exceptions.py index ed3eb3a..73d7744 100644 --- a/tests/core/test_exceptions.py +++ b/tests/core/test_exceptions.py @@ -163,21 +163,42 @@ def cassette_handler(request: Request) -> Response: headers=headers, ) body = cassette_response["body"] - if isinstance(body, str): + if isinstance(body, (dict, list)): return Response( cassette_response["status_code"], - content=body.encode(), + json=body, headers=headers, ) return Response( cassette_response["status_code"], - json=body, + content=body, headers=headers, ) return AsyncClient(transport=MockTransport(cassette_handler)), requests +@pytest.mark.parametrize("body", [{"error": "bad request"}, [], "", "bad request\n", b"\xff\x00"]) +async def test_replay_preserves_response_body(body: dict | list | str | bytes) -> None: + """Ensures error replay preserves parsed JSON, empty, text, and binary bodies.""" + cassette = { + "response": { + "status_code": 400, + "headers": {"content-type": "application/json", "x-request-id": "request-1"}, + "body": body, + }, + } + client, _ = _get_http_client(cassette) + async with client: + response = await client.post("https://provider.test/v1/responses", json={"model": "m"}) + if isinstance(body, (dict, list)): + assert response.json() == body + else: + assert response.content == (body.encode() if isinstance(body, str) else body) + assert response.status_code == 400 + assert response.headers["x-request-id"] == "request-1" + + async def _replay_sdk_error( cassette: dict[str, Any], protocol: Protocol, diff --git a/tests/core/test_interface.py b/tests/core/test_interface.py index 823df3b..47539a7 100644 --- a/tests/core/test_interface.py +++ b/tests/core/test_interface.py @@ -921,7 +921,7 @@ def _assert_matched_response( assert expected_usage is not None expected_input_details = expected_usage.input_tokens_details expected_output_details = expected_usage.output_tokens_details - cache_write_tokens = expected_input_details.cache_write_tokens or 0 + cache_write_tokens = expected_input_details.cache_write_tokens cached_tokens = expected_input_details.cached_tokens reasoning_tokens = expected_output_details.reasoning_tokens response_type = { @@ -929,7 +929,7 @@ def _assert_matched_response( "chat/completions": OpenAIChatCompletionsResponse, "messages": AnthropicMessagesResponse, }[downstream] - assert type(response) is response_type + assert isinstance(response, response_type) assert response.id == expected_response.id assert response.model == expected_response.model @@ -960,7 +960,7 @@ def _assert_matched_response( assert response.usage.output_tokens == expected_usage.output_tokens assert response.usage.total_tokens == expected_usage.total_tokens assert response.usage.input_tokens_details.cached_tokens == cached_tokens - assert (response.usage.input_tokens_details.cache_write_tokens or 0) == cache_write_tokens + assert response.usage.input_tokens_details.cache_write_tokens == cache_write_tokens assert response.usage.output_tokens_details.reasoning_tokens == reasoning_tokens elif downstream == "chat/completions": assert isinstance(response, OpenAIChatCompletionsResponse) @@ -990,7 +990,7 @@ def _assert_matched_response( assert response.usage.completion_tokens == expected_usage.output_tokens assert response.usage.total_tokens == expected_usage.total_tokens assert response.usage.prompt_tokens_details.cached_tokens == cached_tokens - assert (response.usage.prompt_tokens_details.cache_write_tokens or 0) == cache_write_tokens + assert response.usage.prompt_tokens_details.cache_write_tokens == cache_write_tokens assert response.usage.completion_tokens_details.reasoning_tokens == reasoning_tokens else: assert isinstance(response, AnthropicMessagesResponse) @@ -1023,7 +1023,7 @@ def _assert_matched_response( assert response.stop_reason == "end_turn" assert response.stop_sequence is None assert response.usage.input_tokens == ( - expected_usage.input_tokens - cache_write_tokens - cached_tokens + expected_usage.input_tokens - (cache_write_tokens or 0) - cached_tokens ) assert response.usage.cache_creation_input_tokens == cache_write_tokens assert response.usage.cache_read_input_tokens == cached_tokens @@ -1416,8 +1416,8 @@ async def _assert_matched_non_stream( history = request_body[key] + _response_history(response, downstream) -async def test_responses_native_stream_normalizes_omitted_cache_write_tokens(): - """Ensures the matched omission parses in the SDK and receives only the documented adjustment.""" +async def test_responses_native_stream_preserves_omitted_cache_write_tokens(): + """Ensures native streaming preserves the same absent cache-write count as the SDK.""" cassette_path = _matched_cassette_path("reasoning_raw", "responses", "stream-00.yaml") cassette = _read_cassette(cassette_path) request_body = deepcopy(cassette["request"]["body"]) @@ -1431,7 +1431,6 @@ async def test_responses_native_stream_normalizes_omitted_cache_write_tokens(): sdk_completed = next(event for event in sdk_events if event.type == "response.completed") assert sdk_completed.response.usage.input_tokens_details.cache_write_tokens is None expected = [event.model_dump(mode="json", exclude_unset=True) for event in sdk_events] - expected[-1]["response"]["usage"]["input_tokens_details"]["cache_write_tokens"] = 0 async with _get_http_client([cassette_path], "responses") as http_client: client = Molto(http_client=http_client) @@ -1446,7 +1445,7 @@ async def test_responses_native_stream_normalizes_omitted_cache_write_tokens(): assert [event.model_dump(mode="json", exclude_unset=True) for event in events] == expected completed = next(event for event in events if event.type == "response.completed") assert completed.response.usage is not None - assert completed.response.usage.input_tokens_details.cache_write_tokens == 0 + assert completed.response.usage.input_tokens_details.cache_write_tokens is None async def _assert_stream_events( @@ -1498,9 +1497,28 @@ async def _assert_stream_events( endpoint=upstream, provider=provider, api_key="test-api-key", + # The recorded vLLM server used the older Chat spelling. + chat_reasoning_field="reasoning_content" if scenario == "reasoning_raw" else None, ) events = [event async for event in response] expected_sse_events = _sse_records(cassette, downstream) + if scenario == "reasoning_raw" and upstream != downstream: + # These matched Messages fixtures report zero writes. Their OpenAI + # counterparts omit the count. Translation preserves the source value. + cache_writes = 0 if upstream == "messages" else None + for index, record in enumerate(expected_sse_events): + event = load_sse(record) + if event.get("type") == "response.completed": + details = event["response"]["usage"]["input_tokens_details"] + details["cache_write_tokens"] = cache_writes + elif event.get("type") == "message_delta": + event["usage"]["cache_creation_input_tokens"] = cache_writes + elif downstream == "chat/completions" and event.get("usage"): + details = event["usage"].setdefault("prompt_tokens_details", {}) + details["cache_write_tokens"] = cache_writes + else: + continue + expected_sse_events[index] = dumps_sse(event) actual_sse_events = [] for event in events: assert isinstance(event, BaseModel) @@ -1749,7 +1767,7 @@ async def test_reasoning_only_history( additions: dict[Protocol, dict[str, Any]] = { "responses": {"input": [responses_item], "reasoning": {"effort": "none"}}, "chat/completions": { - "messages": [{"role": "assistant", "reasoning_content": reasoning}], + "messages": [{"role": "assistant", "reasoning": reasoning}], "reasoning_effort": "none", }, "messages": { @@ -1769,7 +1787,7 @@ async def test_reasoning_only_history( upstream, additions[downstream], additions[upstream], - provider="openai" if signed else "vllm", + provider=DEFAULT_PROVIDER_BY_ENDPOINT[upstream] if signed else "vllm", ) @@ -1825,7 +1843,7 @@ async def test_separate_reasoning_and_text_history_messages( history: dict[Protocol, dict[str, Any]] = { "chat/completions": { "messages": [ - {"role": "assistant", "reasoning_content": "Prior thought"}, + {"role": "assistant", "reasoning": "Prior thought"}, {"role": "assistant", "content": "Prior answer"}, ], "reasoning_effort": "none", @@ -1871,21 +1889,19 @@ async def test_separate_reasoning_and_text_history_messages( @pytest.mark.parametrize("with_text_and_tools", [False, True]) -@pytest.mark.parametrize( - ("reasoning_parts", "expected_reasoning"), - [(["First", "second"], "First\nsecond"), (["First", "", "second"], "First\n\nsecond")], -) -async def test_chat_groups_consecutive_assistant_parts( - with_text_and_tools: bool, reasoning_parts: list[str], expected_reasoning: str +@pytest.mark.parametrize("reasoning_parts", [["First", "second"], ["First", "", "second"]]) +async def test_chat_keeps_consecutive_reasoning_parts_separate( + with_text_and_tools: bool, reasoning_parts: list[str] ) -> None: - """Ensures reasoning joins with newlines while parts stay within their source message.""" + """Ensures independent reasoning parts keep separate entries and the last can own text and tools.""" parts: list[dict[str, Any]] = [ {"type": "thinking", "thinking": text} for text in reasoning_parts ] - expected_message: dict[str, Any] = { - "role": "assistant", - "reasoning_content": expected_reasoning, - } + expected = [ + {"role": "assistant", **({"reasoning": text} if text else {"content": []})} + for text in reasoning_parts + ] + expected_message = expected[-1] if with_text_and_tools: text_parts = [{"type": "text", "text": text} for text in ("Answer ", "continued")] calls = [ @@ -1914,8 +1930,8 @@ async def test_chat_groups_consecutive_assistant_parts( }, { "messages": [ - expected_message, - {"role": "assistant", "reasoning_content": "Separate"}, + *expected, + {"role": "assistant", "reasoning": "Separate"}, ], "reasoning_effort": "none", }, @@ -1923,6 +1939,75 @@ async def test_chat_groups_consecutive_assistant_parts( ) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("order", [(0, 1, 2, 3), (2, 0, 3, 1), (0, 2, 1, 3), (2, 3, 0, 1)]) +async def test_chat_groups_interleaved_text_and_calls(order, stream) -> None: + """Ensures shared Chat grouping preserves per-kind order, markers, boundaries, and results.""" + text_parts = [ + {"type": "text", "text": "First", "cache_control": {"type": "ephemeral"}}, + {"type": "text", "text": "Second"}, + ] + calls = [ + {"type": "tool_use", "id": call_id, "name": "lookup", "input": {}} + for call_id in ("c1", "c2") + ] + parts = [*text_parts, *calls] + additions = { + "messages": [ + {"role": "assistant", "content": [parts[index] for index in order]}, + { + "role": "user", + "content": [ + {"type": "tool_result", "tool_use_id": call["id"], "content": call["id"]} + for call in calls + ], + }, + {"role": "assistant", "content": [{"type": "text", "text": "Separate"}]}, + ], + } + original = deepcopy(additions) + await _assert_request_parity( + "messages", + "chat/completions", + additions, + { + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "First", + "prompt_cache_breakpoint": {"mode": "explicit"}, + }, + {"type": "text", "text": "Second"}, + ], + "tool_calls": [ + { + "type": "function", + "id": call["id"], + "function": {"name": "lookup", "arguments": "{}"}, + } + for call in calls + ], + }, + *[ + { + "role": "tool", + "tool_call_id": call["id"], + "content": [{"type": "text", "text": call["id"]}], + } + for call in calls + ], + {"role": "assistant", "content": "Separate"}, + ], + "prompt_cache_options": {"mode": "explicit"}, + }, + stream=stream, + ) + assert additions == original + + @pytest.mark.parametrize( ("content", "match"), [ @@ -1937,13 +2022,6 @@ async def test_chat_groups_consecutive_assistant_parts( ], "cannot preserve this assistant reasoning order", ), - ( - [ - {"type": "tool_use", "id": "c1", "name": "lookup", "input": {}}, - {"type": "text", "text": "After tool"}, - ], - "cannot preserve assistant text after tool calls", - ), ], ) async def test_chat_rejects_unrepresentable_assistant_part_order(content, match) -> None: @@ -2234,6 +2312,48 @@ async def test_translated_top_level_instructions(upstream: Protocol) -> None: await _assert_request_parity("responses", upstream, additions, expected) +@pytest.mark.parametrize("downstream", ["responses", "chat/completions"]) +@pytest.mark.parametrize("upstream", PROTOCOLS) +@pytest.mark.parametrize("stream", [False, True], ids=["non_stream", "stream"]) +@pytest.mark.parametrize( + "strictness", + [{}, {"strict": None}, {"strict": False}, {"strict": True}], + ids=["omitted", "null", "false", "true"], +) +async def test_function_tool_strictness_defaults( + downstream: Protocol, upstream: Protocol, stream: bool, strictness: dict[str, Any] +) -> None: + """Ensures protocol defaults preserve explicit choices and native SDK request/output parity.""" + parameters = {"type": "object", "properties": {}, "additionalProperties": False} + function = {"name": "lookup", "parameters": parameters, **strictness} + additions = { + "tools": [ + {"type": "function", **function} + if downstream == "responses" + else {"type": "function", "function": function} + ] + } + if downstream == upstream: + expected = additions + else: + strict = strictness.get("strict") + if strict is None: + strict = downstream == "responses" + if upstream == "messages": + tool = {"name": "lookup", "input_schema": parameters} + if strict: + tool["strict"] = True + else: + function = {"name": "lookup", "parameters": parameters, "strict": strict} + tool = ( + {"type": "function", **function} + if upstream == "responses" + else {"type": "function", "function": function} + ) + expected = {"tools": [tool]} + await _assert_request_parity(downstream, upstream, additions, expected, stream=stream) + + @pytest.mark.parametrize(("downstream", "upstream"), ROUTES) @pytest.mark.parametrize("parallel", [False, True]) async def test_required_tool_choice_request( diff --git a/tests/core/test_provider_history_routes.py b/tests/core/test_provider_history_routes.py new file mode 100644 index 0000000..94426a0 --- /dev/null +++ b/tests/core/test_provider_history_routes.py @@ -0,0 +1,1386 @@ +"""Native history transport tests using explicit synthetic Google extension payloads.""" + +import asyncio +from copy import deepcopy + +import httpx +import pytest +from openai import AsyncOpenAI +from openai.lib.streaming.chat import ChatCompletionStreamState + +from molto import Molto +from molto.providers import PROVIDER_CAPABILITIES +from molto.types.exceptions import UnsupportedInput +from molto.types.normalized import ( + AssistantInput, + NormalizedRequest, + PartDeltaEvent, + PartEndEvent, + PartStartEvent, + ResponseStartEvent, + TextOutput, + Thinking, + ToolCall, +) +from molto.upstream.gemini import GeminiChatCompletionsClient +from molto.utils.io import dumps_sse, json_loads +from molto.utils.test import collect_sdk_response + + +def _history(message): + """Remove only SDK parser and stream bookkeeping from actual collected output.""" + history = message.model_dump( + exclude_unset=True, + exclude={ + "parsed": True, + "tool_calls": {"__all__": {"index": True, "function": {"parsed_arguments": True}}}, + }, + ) + for field in ("annotations", "audio", "function_call", "refusal"): + if history.get(field) is None: + history.pop(field, None) + return history + + +async def _consume(result, stream): + if not stream: + return result.choices[0].message, [result.model_dump()] + state = ChatCompletionStreamState() + events = [] + async for event in result: + events.append(event.model_dump()) + state.handle_chunk(event) + return state.get_final_completion().choices[0].message, events + + +@pytest.mark.parametrize("stream", [False, True]) +async def test_google_native_sdk_history_round_trip(stream): + """Ensures all Google attachments survive native SDK parity and exact next-turn transport.""" + + def google(state): + return {"google": {"thought_signature": state}} + + calls = [ + { + "id": f"call_{i}", + "type": "function", + "function": {"name": "lookup", "arguments": f'{{"n":{i}}}'}, + "extra_content": google(f"call-{i}"), + } + for i in range(2) + ] + assistant = { + "role": "assistant", + "content": None, + "tool_calls": calls, + "extra_content": google(" message\n"), + } + chunks = [] + for i, call in enumerate(calls): + first = deepcopy(call) + first["index"] = i + first["function"]["arguments"] = '{"n":' + delta = {"tool_calls": [first]} + if i == 0: + delta.update(role="assistant", content=None, extra_content=assistant["extra_content"]) + chunks.append(delta) + chunks.append({"tool_calls": [{"index": i, "function": {"arguments": f"{i}}}"}}]}) + chunk_base = { + "id": "chatcmpl_1", + "created": 1, + "model": "model", + "object": "chat.completion.chunk", + } + sse = "".join( + dumps_sse({**chunk_base, "choices": [{"index": 0, "delta": delta, "finish_reason": None}]}) + for delta in chunks + ) + sse += dumps_sse( + {**chunk_base, "choices": [{"index": 0, "delta": {}, "finish_reason": "tool_calls"}]} + ) + sse += "data: [DONE]\n\n" + response = { + "id": "chatcmpl_1", + "created": 1, + "model": "model", + "object": "chat.completion", + "choices": [{"index": 0, "message": assistant, "finish_reason": "tool_calls"}], + } + user = { + "role": "user", + "content": [ + {"type": "text", "text": "First", "extra_content": google("part-1")}, + {"type": "text", "text": "Second", "extra_content": google("part-2")}, + ], + "extra_content": google("user"), + } + results = [ + { + "role": "tool", + "tool_call_id": call["id"], + "content": f"file-{i}", + "extra_content": { + "google": { + "parts": [ + { + "file_data": { + "mime_type": "application/pdf", + "display_name": f"file-{i}", + "file_uri": f"gs://example/file-{i}.pdf", + } + } + ] + } + }, + } + for i, call in enumerate(calls) + ] + extra_body = { + "ordinary_extra": True, + "extra_body": {"google": {"thinking_config": {"include_thoughts": True}}}, + } + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + assert str(request.url) == "https://example.test/v1/chat/completions" + assert request.headers["authorization"] == "Bearer test-key" + if stream: + return httpx.Response(200, text=sse, headers={"content-type": "text/event-stream"}) + return httpx.Response(200, json=response) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as sdk_http: + sdk = AsyncOpenAI( + api_key="test-key", + base_url="https://example.test/v1", + http_client=sdk_http, + max_retries=0, + ) + sdk_message, sdk_events = await _consume( + await sdk.chat.completions.create( + model="model", messages=[user], stream=stream, extra_body=extra_body + ), + stream, + ) + assert _history(sdk_message) == assistant + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + actual_message, actual_events = await _consume( + await molto.chat_completions( + {"model": "model", "messages": [user], "stream": stream}, + api_key="test-key", + base_url="https://example.test/v1", + extra_body=extra_body, + ), + stream, + ) + assert actual_events == sdk_events + assert _history(actual_message) == assistant + await _consume( + await molto.chat_completions( + { + "model": "model", + "messages": [user, _history(actual_message), *results], + "stream": stream, + }, + api_key="test-key", + base_url="https://example.test/v1", + extra_body=extra_body, + ), + stream, + ) + expected = {"model": "model", "messages": [user], "stream": stream, **extra_body} + assert requests[:2] == [expected, expected] + assert requests[2] == {**expected, "messages": [user, assistant, *results]} + + +@pytest.mark.parametrize("turn", [1, 2]) +async def test_recorded_native_tool_history_matches_sdk(turn): + """Ensures eagerly validated call history retains recorded request bytes and SDK events.""" + from pathlib import Path + + from molto.utils.io import read_yaml + + cassette = read_yaml( + Path(__file__).parents[1] + / "cassettes" + / "upstream_ir" + / "tool_use" + / f"openai-chat_completions-stream-{turn:02d}.yaml" + ) + body = cassette["request"]["body"] + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + assert request.url.path == cassette["request"]["path"] + return httpx.Response( + cassette["response"]["status_code"], + text="".join(cassette["response"]["sse"]), + headers={"content-type": "text/event-stream"}, + ) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as sdk_http: + sdk = AsyncOpenAI(api_key="test-key", http_client=sdk_http, max_retries=0) + expected_message, expected_events = await _consume( + await sdk.chat.completions.create(**body), True + ) + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + actual_message, actual_events = await _consume( + await molto.chat_completions(body, api_key="test-key"), True + ) + assert requests == [body, body] + assert actual_events == expected_events + assert _history(actual_message) == _history(expected_message) + + +@pytest.mark.parametrize("stream", [False, True]) +async def test_openrouter_native_reasoning_format_history(stream): + """Ensures native Responses output carries exact format into the following SDK request.""" + item = { + "id": "rs_1", + "type": "reasoning", + "summary": [], + "content": [{"type": "reasoning_text", "text": " Think\n"}], + "status": "completed", + "format": "unknown", + } + response = { + "id": "resp_1", + "object": "response", + "created_at": 1, + "model": "model", + "status": "completed", + "output": [item], + } + event = {"type": "response.completed", "sequence_number": 0, "response": response} + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + if stream: + return httpx.Response( + 200, text=dumps_sse(event), headers={"content-type": "text/event-stream"} + ) + return httpx.Response(200, json=response) + + async def collect(result): + if stream: + events = [event async for event in result] + return events[-1].response, [event.model_dump() for event in events] + return result, [result.model_dump()] + + body = {"model": "model", "input": "Think", "stream": stream} + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as sdk_http: + sdk = AsyncOpenAI(api_key="test-key", http_client=sdk_http, max_retries=0) + expected, expected_events = await collect(await sdk.responses.create(**body)) + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + actual, actual_events = await collect(await molto.responses(body, api_key="test-key")) + assert actual_events == expected_events + history = [item.model_dump(exclude_unset=True) for item in actual.output] + assert history == [item] + await collect(await molto.responses({**body, "input": history}, api_key="test-key")) + assert requests == [body, body, {**body, "input": [item]}] + + +@pytest.mark.parametrize( + "item", + [ + { + "summary": [], + "content": [{"type": "reasoning_text", "text": "Think"}], + "format": "named-v1", + }, + { + "summary": [{"type": "summary_text", "text": "Think"}], + "format": "unknown", + }, + {"summary": [], "encrypted_content": "opaque", "format": "unknown"}, + ], + ids=["named", "formatted-summary", "formatted-state"], +) +@pytest.mark.parametrize("endpoint", ["chat/completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_reasoning_format_cannot_be_silently_translated(item, endpoint, stream): + """Ensures a reasoning format describing opaque state is rejected before translated transport.""" + + def handler(request): + raise AssertionError("Unsupported history must fail before transport") + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + with pytest.raises(UnsupportedInput, match="format cannot be translated"): + await molto.responses( + {"model": "model", "stream": stream, "input": [{"type": "reasoning", **item}]}, + endpoint=endpoint, + provider="vllm", + api_key="test-key", + ) + + +def test_unknown_reasoning_format_on_raw_history_is_omitted(): + """Ensures OpenRouter's raw reasoning history can leave its native route without the label.""" + from molto.adapters.openai import OpenAIResponsesAdapter + from molto.types.openai_responses import OpenAIResponsesCreateRequest + + request = OpenAIResponsesCreateRequest( + model="model", + input=[ + { + "id": "rs_1", + "type": "reasoning", + "summary": [], + "content": [{"type": "reasoning_text", "text": " Think\n"}], + "format": "unknown", + } + ], + ) + normalized = OpenAIResponsesAdapter(PROVIDER_CAPABILITIES["vllm"]).normalize_request(request) + assert normalized.input == [Thinking(id="rs_1", content=" Think\n", summary="")] + + +@pytest.mark.parametrize("coordinator", ["chat_completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_reasoning_format_output_rejects_unsupported_translation(coordinator, stream): + """Ensures OpenAI output cannot lose a reasoning format its own API never defines.""" + event = { + "type": "response.output_item.added", + "sequence_number": 0, + "output_index": 0, + "item": { + "id": "rs_1", + "type": "reasoning", + "summary": [], + "content": [{"type": "reasoning_text", "text": "Think"}], + "format": "unknown", + }, + } + created = { + "type": "response.created", + "sequence_number": 0, + "response": { + "id": "resp_1", + "created_at": 1, + "model": "model", + "status": "in_progress", + "output": [], + }, + } + + def handler(request): + return httpx.Response( + 200, + text=dumps_sse(created) + dumps_sse(event), + headers={"content-type": "text/event-stream"}, + ) + + body = {"model": "model", "messages": [{"role": "user", "content": "Think"}], "stream": stream} + if coordinator == "messages": + body["max_tokens"] = 32 + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + with pytest.raises(ValueError, match="format"): + result = await getattr(molto, coordinator)( + body, endpoint="responses", provider="openai", api_key="test-key" + ) + if stream: + [event async for event in result] + + +@pytest.mark.parametrize("coordinator", ["chat_completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_shared_responses_client_ignores_reasoning_format(coordinator, stream): + """Ensures a shared protocol client completes output carrying a format it does not model.""" + item = { + "id": "rs_1", + "type": "reasoning", + "summary": [], + "content": [{"type": "reasoning_text", "text": "Think"}], + "format": "named-v1", + } + response = {"id": "resp_1", "created_at": 1, "model": "model", "output": []} + events = [ + {"type": "response.created", "response": {**response, "status": "in_progress"}}, + {"type": "response.output_item.added", "output_index": 0, "item": item}, + {"type": "response.output_item.done", "output_index": 0, "item": item}, + { + "type": "response.completed", + "response": {**response, "status": "completed", "output": [item]}, + }, + ] + sse = "".join(dumps_sse({**event, "sequence_number": i}) for i, event in enumerate(events)) + body = {"model": "model", "messages": [{"role": "user", "content": "Think"}], "stream": stream} + if coordinator == "messages": + body["max_tokens"] = 32 + async with Molto( + http_client=httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: httpx.Response( + 200, text=sse, headers={"content-type": "text/event-stream"} + ) + ) + ) + ) as molto: + result = await getattr(molto, coordinator)( + body, endpoint="responses", provider="vllm", api_key="test-key" + ) + if stream: + async with result: + result = collect_sdk_response( + "chat/completions" if coordinator == "chat_completions" else coordinator, + [event async for event in result], + ) + if coordinator == "chat_completions": + assert result.choices[0].message.reasoning_content == "Think" + else: + assert [(block.type, block.thinking) for block in result.content] == [ + ("thinking", "Think") + ] + + +def _google_stream(deltas): + """Build synthetic Google chunks, retaining late attachment snapshots.""" + chunk = { + "id": "chatcmpl_google", + "created": 1, + "model": "model", + "object": "chat.completion.chunk", + } + sse = "".join( + dumps_sse({**chunk, "choices": [{"index": 0, "delta": delta}]}) for delta in deltas + ) + sse += dumps_sse( + { + **chunk, + "choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}], + "usage": {"prompt_tokens": 1, "completion_tokens": 2, "total_tokens": 3}, + } + ) + return httpx.Response( + 200, + stream=httpx.ByteStream((sse + "data: [DONE]\n\n").encode()), + headers={"content-type": "text/event-stream"}, + ) + + +@pytest.mark.parametrize("coordinator", ["responses", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("order", ["text-first", "late-message-signature", "tools-first"]) +async def test_google_translated_parallel_signature_history(coordinator, stream, order): + """Ensures signatures prefix their content and retain text/parallel-call attachments on reuse.""" + text_state = {"google": {"thought_signature": " message\n"}} + calls = [ + { + "id": f"call_{i}", + "type": "function", + "function": {"name": "lookup", "arguments": f'{{"n":{i}}}'}, + "extra_content": {"google": {"thought_signature": f"call-{i}"}}, + } + for i in range(2) + ] + text_deltas = [{"content": "Checking both."}] + if order == "text-first": + text_deltas[0]["extra_content"] = text_state + deltas = [] if order == "tools-first" else text_deltas.copy() + for index, call in enumerate(calls): + first = deepcopy(call) + first["index"] = index + first["function"]["arguments"] = '{"n":' + deltas.extend( + [ + {"tool_calls": [first]}, + {"tool_calls": [{"index": index, "function": {"arguments": f"{index}}}"}}]}, + ] + ) + if order == "tools-first": + deltas.extend(text_deltas) + if order != "text-first": + deltas.append({"extra_content": text_state}) + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + return _google_stream(deltas) + + body = {"model": "model", "stream": stream} + if coordinator == "responses": + body["input"] = [{"role": "user", "content": "Check both."}] + else: + body.update(messages=[{"role": "user", "content": "Check both."}], max_tokens=32) + + async def collect(result): + if not stream: + return result + async with result: + return collect_sdk_response(coordinator, [event async for event in result]) + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + create = getattr(molto, coordinator) + result = await collect( + await create(body, endpoint="chat/completions", provider="gemini", api_key="test-key") + ) + if coordinator == "responses": + call_types = ["reasoning", "function_call"] * 2 + expected_types = { + "text-first": ["reasoning", "message", *call_types], + "late-message-signature": ["message", *call_types, "reasoning"], + "tools-first": [*call_types, "message", "reasoning"], + } + assert [item.type for item in result.output] == expected_types[order] + assert [ + item.encrypted_content for item in result.output if item.type == "reasoning" + ] == ( + [" message\n", "call-0", "call-1"] + if order == "text-first" + else ["call-0", "call-1", " message\n"] + ) + history = [item.model_dump(exclude_unset=True) for item in result.output] + body["input"].extend(history) + body["input"].extend( + {"type": "function_call_output", "call_id": call["id"], "output": "ok"} + for call in calls + ) + else: + call_types = ["thinking", "tool_use"] * 2 + expected_types = { + "text-first": ["thinking", "text", *call_types], + "late-message-signature": ["text", *call_types, "thinking"], + "tools-first": [*call_types, "text", "thinking"], + } + assert [item.type for item in result.content] == expected_types[order] + assert [item.signature for item in result.content if item.type == "thinking"] == ( + [" message\n", "call-0", "call-1"] + if order == "text-first" + else ["call-0", "call-1", " message\n"] + ) + body["messages"].extend( + [ + { + "role": "assistant", + "content": [item.model_dump() for item in result.content], + }, + { + "role": "user", + "content": [ + {"type": "tool_result", "tool_use_id": call["id"], "content": "ok"} + for call in calls + ], + }, + ] + ) + await collect( + await create(body, endpoint="chat/completions", provider="gemini", api_key="test-key") + ) + assert len(requests) == 2 + assert requests[1]["messages"] == [ + {"role": "user", "content": [{"type": "text", "text": "Check both."}]}, + { + "role": "assistant", + "content": "Checking both.", + "extra_content": text_state, + "tool_calls": calls, + }, + *[ + { + "role": "tool", + "tool_call_id": call["id"], + "content": [{"type": "text", "text": "ok"}], + } + for call in calls + ], + ] + + +@pytest.mark.parametrize( + "extra_content", + [ + {"google": {"thought_signature": ""}}, + {"google": {"thought_signature": None}}, + {"google": {"thought_signature": 7}}, + {"google": "invalid"}, + "invalid", + ], +) +@pytest.mark.parametrize("placement", ["message", "call"]) +async def test_google_malformed_signature_closes_stream(extra_content, placement): + """Ensures malformed Google state fails explicitly and releases the upstream response.""" + delta = {"content": "Text"} + if placement == "message": + delta["extra_content"] = extra_content + else: + delta["tool_calls"] = [ + { + "index": 0, + "id": "call_1", + "type": "function", + "function": {"name": "lookup", "arguments": "{}"}, + "extra_content": extra_content, + } + ] + responses = [] + + def handler(request): + response = _google_stream([delta]) + responses.append(response) + return response + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + with pytest.raises(ValueError, match="extra_content"): + result = await molto.responses( + {"model": "model", "input": "Hello", "stream": True}, + endpoint="chat/completions", + provider="gemini", + api_key="test-key", + ) + async with result: + [event async for event in result] + assert len(responses) == 1 and responses[0].is_closed + + +@pytest.mark.parametrize( + ("extra_content", "signatures"), + [ + ({"google": {"thought_signature": "state", "unknown": True}, "other": {}}, ["state"]), + ({"google": {"unknown": True}}, []), + ({"other": {}}, []), + ], + ids=["beside-signature", "without-signature", "without-google"], +) +async def test_google_signature_ignores_unmodelled_keys(extra_content, signatures): + """Ensures extra Google keys neither fail the response nor hide its signature.""" + async with Molto( + http_client=httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: _google_stream([{"content": "Text", "extra_content": extra_content}]) + ) + ) + ) as molto: + result = await molto.responses( + {"model": "model", "input": "Hello"}, + endpoint="chat/completions", + provider="gemini", + api_key="test-key", + ) + assert result.output_text == "Text" + assert [ + item.encrypted_content for item in result.output if item.type == "reasoning" + ] == signatures + + +def _google_call(i): + return { + "id": f"call_{i}", + "type": "function", + "function": {"name": "lookup", "arguments": f'{{"n":{i}}}'}, + "extra_content": {"google": {"thought_signature": f"call-{i}"}}, + } + + +@pytest.mark.parametrize("text", [True, False]) +async def test_google_signatures_normalize_to_ordered_parts(text): + """Ensures each signature in one response becomes its own part and restores its attachment.""" + state = {"google": {"thought_signature": " message\n"}} + calls = [_google_call(i) for i in range(2)] + deltas = [{"content": "Checking."}] if text else [] + deltas.append({"role": "assistant", "extra_content": state}) + deltas.extend({"tool_calls": [{**call, "index": i}]} for i, call in enumerate(calls)) + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _google_stream(deltas)) + ) as transport: + client = GeminiChatCompletionsClient( + transport, api_key="test-key", capabilities=PROVIDER_CAPABILITIES["gemini"] + ) + events = [ + event async for event in client.events(NormalizedRequest(model="model", stream=True)) + ] + ends = [event for event in events if isinstance(event, PartEndEvent)] + parts = [event.part for event in ends] + assert [event.index for event in ends] == list(range(len(ends))) + assert parts == [ + *([TextOutput(content="Checking.")] if text else []), + Thinking(content="", summary="", signature=" message\n"), + Thinking(content="", summary="", signature="call-0"), + ToolCall(tool_call_id="call_0", tool_name="lookup", args='{"n":0}'), + Thinking(content="", summary="", signature="call-1"), + ToolCall(tool_call_id="call_1", tool_name="lookup", args='{"n":1}'), + ] + history = NormalizedRequest(model="model", input=[AssistantInput(content=parts)]) + assert GeminiChatCompletionsClient._native_request(history).model_dump()["messages"] == [ + { + "role": "assistant", + **({"content": "Checking."} if text else {}), + "extra_content": state, + "tool_calls": calls, + } + ] + + +def test_google_history_separates_two_independent_signature_parts(): + """Ensures two complete signature parts retain separate assistant entries.""" + parts = [ + Thinking(content="", summary="", signature="first"), + Thinking(content="", summary="", signature="second"), + TextOutput(content="Text"), + ] + messages = GeminiChatCompletionsClient._native_request( + NormalizedRequest(model="model", input=[AssistantInput(content=parts)]) + ).model_dump()["messages"] + assert [message["extra_content"]["google"]["thought_signature"] for message in messages] == [ + "first", + "second", + ] + assert [message["content"] for message in messages] == [[], "Text"] + + +@pytest.mark.parametrize("coordinator", ["responses", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("signed_call", [False, True]) +async def test_google_late_message_signature_without_text_round_trips( + coordinator, stream, signed_call +): + """Ensures a trailing message signature remains attached to the message on continuation.""" + state = {"google": {"thought_signature": " message\n"}} + call = _google_call(0) + if not signed_call: + call.pop("extra_content") + deltas = [ + {"tool_calls": [{**call, "index": 0}]}, + {"role": "assistant", "extra_content": state}, + ] + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + return _google_stream(deltas) + + body = {"model": "model", "stream": stream} + if coordinator == "responses": + body["input"] = [{"role": "user", "content": "Check."}] + else: + body.update(messages=[{"role": "user", "content": "Check."}], max_tokens=32) + + async def collect(result): + if not stream: + return result + async with result: + return collect_sdk_response(coordinator, [event async for event in result]) + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + create = getattr(molto, coordinator) + result = await collect( + await create(body, endpoint="chat/completions", provider="gemini", api_key="test-key") + ) + if coordinator == "responses": + assert [ + (item.type, getattr(item, "encrypted_content", None)) for item in result.output + ] == ( + [("reasoning", "call-0"), ("function_call", None), ("reasoning", " message\n")] + if signed_call + else [("function_call", None), ("reasoning", " message\n")] + ) + body["input"].extend(item.model_dump(exclude_unset=True) for item in result.output) + body["input"].append( + {"type": "function_call_output", "call_id": call["id"], "output": "ok"} + ) + else: + assert [(item.type, getattr(item, "signature", None)) for item in result.content] == ( + [("thinking", "call-0"), ("tool_use", None), ("thinking", " message\n")] + if signed_call + else [("tool_use", None), ("thinking", " message\n")] + ) + body["messages"].extend( + [ + { + "role": "assistant", + "content": [item.model_dump() for item in result.content], + }, + { + "role": "user", + "content": [ + {"type": "tool_result", "tool_use_id": call["id"], "content": "ok"} + ], + }, + ] + ) + await collect( + await create(body, endpoint="chat/completions", provider="gemini", api_key="test-key") + ) + assert requests[1]["messages"] == [ + {"role": "user", "content": [{"type": "text", "text": "Check."}]}, + { + "role": "assistant", + "extra_content": state, + "tool_calls": [call], + }, + {"role": "tool", "tool_call_id": call["id"], "content": [{"type": "text", "text": "ok"}]}, + ] + + +@pytest.mark.parametrize( + ("provider", "omits_nulls"), + [ + ("openai", False), + ("vllm", False), + ("togetherai", False), + ("bedrock", False), + ("fireworks", True), + ("gemini", True), + ], +) +@pytest.mark.parametrize("stream", [False, True]) +async def test_native_history_nulls_reach_only_providers_that_accept_them( + provider, omits_nulls, stream +): + """Ensures echoed null message fields are forwarded faithfully except where a provider rejects them.""" + call = { + "id": "call_1", + "type": "function", + "function": {"name": "lookup", "arguments": "{}"}, + "extra_content": {"google": {"thought_signature": "state", "nested": None}}, + } + assistant = { + "role": "assistant", + "content": None, + "refusal": None, + "audio": None, + "function_call": None, + "tool_calls": [call], + } + body = { + "model": "model", + "stream": stream, + "messages": [ + {"role": "user", "content": "Look it up."}, + assistant, + {"role": "tool", "tool_call_id": "call_1", "content": "ok"}, + ], + } + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + if stream: + return _google_stream([{"content": "Done."}]) + return httpx.Response( + 200, + json={ + "id": "chatcmpl_1", + "object": "chat.completion", + "created": 1, + "model": "model", + "choices": [ + { + "index": 0, + "message": {"role": "assistant", "content": "Done."}, + "finish_reason": "stop", + } + ], + }, + ) + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + result = await molto.chat_completions( + deepcopy(body), + provider=provider, + api_key="test-key", + base_url="https://example.test/v1", + ) + if stream: + async with result: + [event async for event in result] + assert requests[0]["messages"][1] == ( + {"role": "assistant", "tool_calls": [call]} if omits_nulls else assistant + ) + + +async def test_google_cancellation_while_waiting_for_late_signature_closes_response(): + """Ensures translated text streams immediately and cancellation releases the transport.""" + waiting = asyncio.Event() + release = asyncio.Event() + closed = asyncio.Event() + + class DelayedSignatureStream(httpx.AsyncByteStream): + async def __aiter__(self): + yield dumps_sse( + { + "id": "chatcmpl_google", + "created": 1, + "model": "model", + "object": "chat.completion.chunk", + "choices": [{"index": 0, "delta": {"content": "Pending text"}}], + } + ).encode() + waiting.set() + await release.wait() + + async def aclose(self): + closed.set() + + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: httpx.Response( + 200, stream=DelayedSignatureStream(), headers={"content-type": "text/event-stream"} + ) + ) + ) as transport: + client = GeminiChatCompletionsClient( + transport, api_key="test-key", capabilities=PROVIDER_CAPABILITIES["gemini"] + ) + events = client.events(NormalizedRequest(model="model", stream=True)) + assert isinstance(await anext(events), ResponseStartEvent) + assert isinstance(await anext(events), PartStartEvent) + delta = await anext(events) + assert isinstance(delta, PartDeltaEvent) and delta.delta.content_delta == "Pending text" + pending = asyncio.create_task(anext(events)) + try: + await asyncio.wait_for(waiting.wait(), timeout=2) + assert not pending.done() + finally: + pending.cancel() + with pytest.raises(asyncio.CancelledError): + await pending + await events.aclose() + assert closed.is_set() + + +@pytest.mark.parametrize("reasoning", [False, True]) +async def test_google_message_signature_without_text_or_calls(reasoning): + """Ensures standalone message state survives an empty or reasoning-only response.""" + deltas = [{"reasoning_content": "Think"}] if reasoning else [] + deltas.append({"extra_content": {"google": {"thought_signature": "message-state"}}}) + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _google_stream(deltas)) + ) as transport: + client = GeminiChatCompletionsClient( + transport, api_key="test-key", capabilities=PROVIDER_CAPABILITIES["gemini"] + ) + parts = [ + event.part + async for event in client.events(NormalizedRequest(model="model", stream=True)) + if isinstance(event, PartEndEvent) + ] + assert parts == [ + Thinking(content="", summary="Think" if reasoning else "", signature="message-state"), + ] + history = GeminiChatCompletionsClient._native_request( + NormalizedRequest(model="model", input=[AssistantInput(content=parts)]) + ) + assert history.model_dump()["messages"] == [ + { + "role": "assistant", + **({"reasoning_content": "Think"} if reasoning else {"content": []}), + "extra_content": {"google": {"thought_signature": "message-state"}}, + } + ] + + +@pytest.mark.parametrize("endpoint", ["chat/completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_raw_unknown_format_history_translates_with_recorded_sdk_output(endpoint, stream): + """Ensures raw OpenRouter history reaches both protocols and preserves recorded SDK text.""" + from pathlib import Path + + from anthropic import AsyncAnthropic + + from molto.utils.io import read_yaml + + provider = "openai" if endpoint == "chat/completions" else "anthropic" + cassette = read_yaml( + Path(__file__).parents[1] + / "cassettes" + / "upstream_ir" + / "text_chat" + / f"{provider}-{endpoint.replace('/', '_')}-stream-00.yaml" + ) + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + return httpx.Response( + 200, + text="".join(cassette["response"]["sse"]), + headers={"content-type": "text/event-stream"}, + ) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as transport: + sdk = (AsyncOpenAI if endpoint == "chat/completions" else AsyncAnthropic)( + api_key="test-key", http_client=transport, max_retries=0 + ) + create = ( + sdk.chat.completions.create if endpoint == "chat/completions" else sdk.messages.create + ) + async with await create(**cassette["request"]["body"]) as result: + expected = collect_sdk_response(endpoint, [event async for event in result]) + body = { + "model": cassette["request"]["body"]["model"], + "stream": stream, + "max_output_tokens": 32, + "input": [ + { + "type": "reasoning", + "summary": [], + "content": [{"type": "reasoning_text", "text": " Think\n"}], + "format": "unknown", + }, + {"role": "user", "content": "Continue."}, + ], + } + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + actual = await molto.responses( + body, endpoint=endpoint, provider="vllm", api_key="test-key" + ) + if stream: + async with actual: + actual = collect_sdk_response("responses", [event async for event in actual]) + assert requests[1] == { + "model": body["model"], + "stream": True, + "max_completion_tokens" if endpoint == "chat/completions" else "max_tokens": 32, + "messages": [ + { + "role": "assistant", + **( + {"reasoning": " Think\n"} + if endpoint == "chat/completions" + else {"content": [{"type": "thinking", "thinking": " Think\n"}]} + ), + }, + {"role": "user", "content": [{"type": "text", "text": "Continue."}]}, + ], + **( + {"stream_options": {"include_usage": True}} + if endpoint == "chat/completions" + else { + "thinking": {"type": "adaptive", "display": "summarized"}, + "output_config": {"effort": "high"}, + } + ), + } + assert actual.output_text == ( + expected.choices[0].message.content + if endpoint == "chat/completions" + else "".join(block.text for block in expected.content if block.type == "text") + ) + + +@pytest.mark.parametrize("call_placement", [None, "inside", "after"]) +def test_google_prefix_signatures_preserve_explicit_assistant_boundaries(call_placement): + """Ensures pending signatures attach forward without merging separate explicit assistant messages.""" + first_parts = [TextOutput(content="First")] + call = ToolCall(tool_call_id="call_0", tool_name="lookup", args="{}") + if call_placement == "inside": + first_parts.append(call) + request = NormalizedRequest( + model="model", + input=[ + Thinking(content="", summary="", signature="first-state"), + AssistantInput(content=first_parts), + *([call] if call_placement == "after" else []), + Thinking(content="", summary="", signature="second-state"), + AssistantInput(content=[TextOutput(content="Second")]), + ], + ) + before = request.model_copy(deep=True) + actual = GeminiChatCompletionsClient._native_request(request).model_dump()["messages"] + assert request == before + assert actual == [ + { + "role": "assistant", + "content": "First", + "extra_content": {"google": {"thought_signature": "first-state"}}, + **( + { + "tool_calls": [ + { + "id": "call_0", + "type": "function", + "function": {"name": "lookup", "arguments": "{}"}, + } + ] + } + if call_placement + else {} + ), + }, + { + "role": "assistant", + "content": "Second", + "extra_content": {"google": {"thought_signature": "second-state"}}, + }, + ] + + +async def test_google_late_message_signature_prefers_text_over_unsigned_call(): + """Ensures text arriving after an unsigned tool call owns the late message signature.""" + call = _google_call(0) + call.pop("extra_content") + deltas = [ + {"tool_calls": [{**call, "index": 0}]}, + {"content": "Checking."}, + {"extra_content": {"google": {"thought_signature": "message-state"}}}, + ] + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _google_stream(deltas)) + ) as transport: + client = GeminiChatCompletionsClient( + transport, api_key="test-key", capabilities=PROVIDER_CAPABILITIES["gemini"] + ) + parts = [ + event.part + async for event in client.events(NormalizedRequest(model="model", stream=True)) + if isinstance(event, PartEndEvent) + ] + assert parts == [ + ToolCall(tool_call_id="call_0", tool_name="lookup", args='{"n":0}'), + TextOutput(content="Checking."), + Thinking(content="", summary="", signature="message-state"), + ] + assert GeminiChatCompletionsClient._native_request( + NormalizedRequest(model="model", input=[AssistantInput(content=parts)]) + ).model_dump()["messages"] == [ + { + "role": "assistant", + "content": "Checking.", + "extra_content": {"google": {"thought_signature": "message-state"}}, + "tool_calls": [call], + } + ] + + +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize( + ("provider", "override", "field", "expected"), + [ + ("vllm", None, "reasoning", "new spelling"), + ("vllm", "reasoning_content", "reasoning_content", "old spelling"), + ("fireworks", None, "reasoning_content", "old spelling"), + ("openai", "reasoning", "reasoning", "new spelling"), + ], +) +async def test_chat_alias_preference_and_signed_actual_history( + provider, override, field, expected, stream +): + """Ensures the selected spelling wins once and genuine message and tool state survive reuse.""" + namespace = "example" + message_state = {namespace: {"thought_signature": "message token"}} + call_state = {namespace: {"thought_signature": "tool token"}} + call = { + "id": "call1", + "type": "function", + "function": {"name": "lookup", "arguments": "{}"}, + "extra_content": call_state, + } + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + return _google_stream( + [ + { + "reasoning_content": "old spelling", + "reasoning": "new spelling", + "extra_content": message_state, + }, + {"tool_calls": [{**call, "index": 0}]}, + ] + ) + + options = { + "endpoint": "chat/completions", + "provider": provider, + "api_key": "test-key", + "chat_signature_namespace": namespace, + "chat_reasoning_field": override, + } + body = {"model": "model", "input": [{"role": "user", "content": "Check."}], "stream": stream} + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + result = await molto.responses(body, **options) + if stream: + async with result: + result = collect_sdk_response("responses", [event async for event in result]) + reasoning, tool_signature, tool = result.output + assert [part.text for part in reasoning.content or reasoning.summary] == [expected] + assert [reasoning.encrypted_content, tool_signature.encrypted_content] == [ + "message token", + "tool token", + ] + assert tool.call_id == call["id"] + body["input"].extend(item.model_dump(exclude_unset=True) for item in result.output) + body["input"].append( + {"type": "function_call_output", "call_id": call["id"], "output": "done"} + ) + body["stream"] = False + await molto.responses(body, **options) + assert requests[1]["messages"][1] == { + "role": "assistant", + field: expected, + "extra_content": message_state, + "tool_calls": [call], + } + assert requests[1]["messages"][2]["tool_call_id"] == call["id"] + + +@pytest.mark.parametrize("stream", [False, True]) +async def test_google_marker_and_signature_updates_follow_reasoning_runs(stream): + """Ensures markers classify content, empty metadata preserves a run, and its latest token precedes text.""" + + def state(token): + return {"google": {"thought_signature": token}} + + deltas = [ + { + "content": "marked thought", + "extra_content": {"google": {"thought": True, "thought_signature": "A"}}, + }, + {"role": "assistant"}, + {"extra_content": state("B")}, + { + "content": "visible", + "extra_content": {"google": {"thought": False}}, + }, + {"extra_content": state("C")}, + {"extra_content": state("D")}, + ] + async with Molto( + http_client=httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _google_stream(deltas)) + ) + ) as molto: + result = await molto.responses( + {"model": "model", "input": "Check.", "stream": stream}, + endpoint="chat/completions", + provider="gemini", + api_key="test-key", + ) + if stream: + async with result: + result = collect_sdk_response("responses", [event async for event in result]) + first, visible, last = result.output + assert [part.text for part in first.summary] == ["marked thought"] + assert first.encrypted_content == "B" + assert visible.content[0].text == "visible" + assert not last.summary and last.encrypted_content == "D" + + +@pytest.mark.parametrize("boundary", ["text", "tool"]) +async def test_chat_normalization_flushes_each_signature_before_the_next_part(boundary): + """Ensures signature revisions flush once per run before the following text or call.""" + + def signature(token): + return {"extra_content": {"google": {"thought_signature": token}}} + + following = ( + {"content": "answer"} + if boundary == "text" + else {"tool_calls": [{"index": 0, **_google_call(0)}]} + ) + deltas = [ + signature("A"), + {"reasoning": "thinking"}, + signature("B"), + following, + signature("C"), + {}, + signature("D"), + ] + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _google_stream(deltas)) + ) as transport: + client = GeminiChatCompletionsClient( + transport, api_key="test-key", capabilities=PROVIDER_CAPABILITIES["gemini"] + ) + emissions = [] + async for event in client.events(NormalizedRequest(model="model", stream=True)): + if isinstance(event, PartDeltaEvent) and getattr(event.delta, "signature_delta", None): + emissions.append(event.delta.signature_delta) + if isinstance(event, PartStartEvent): + if isinstance(event.part, Thinking) and event.part.signature: + emissions.append(event.part.signature) + if isinstance(event.part, (TextOutput, ToolCall)): + emissions.append(boundary) + assert emissions == ["B", *(["call-0"] if boundary == "tool" else []), boundary, "D"] + + +async def test_marked_chat_history_keeps_message_and_part_signatures_on_continuation(): + """Ensures real returned Chat history can follow independently signed reasoning blocks.""" + from pathlib import Path + + from molto.utils.io import read_yaml + + cassette = read_yaml( + Path(__file__).parents[1] + / "cassettes/upstream_ir/text_chat/openai-responses-stream-00.yaml" + ) + requests = [] + + def handler(request): + requests.append(json_loads(request.content)) + return httpx.Response( + 200, + text="".join(cassette["response"]["sse"]), + headers={"content-type": "text/event-stream"}, + ) + + marked = { + "role": "assistant", + "extra_content": {"google": {"thought": True, "thought_signature": "message token"}}, + "content": [ + { + "type": "text", + "text": "one", + "extra_content": {"google": {"thought_signature": "first token"}}, + }, + { + "type": "text", + "text": "two", + "extra_content": { + "google": {"thought": True, "thought_signature": "second token"} + }, + }, + ], + } + body = {"model": "model", "messages": [marked, {"role": "user", "content": "Continue."}]} + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + for _ in range(2): + reply = await molto.chat_completions( + body, + endpoint="responses", + provider="openai", + api_key="test", + chat_signature_namespace="google", + ) + returned = { + key: value + for key, value in _history(reply.choices[0].message).items() + if value is not None + } + body["messages"].extend([returned, {"role": "user", "content": "Continue."}]) + + for request in requests: + assert [ + (item["encrypted_content"], [p["text"] for p in item["summary"]]) + for item in request["input"] + if item.get("type") == "reasoning" + ] == [("message token", []), ("first token", ["one"]), ("second token", ["two"])] + assert requests[1]["input"][-2]["content"][0]["text"] == reply.choices[0].message.content diff --git a/tests/core/test_reasoning_representation.py b/tests/core/test_reasoning_representation.py new file mode 100644 index 0000000..2f65fc0 --- /dev/null +++ b/tests/core/test_reasoning_representation.py @@ -0,0 +1,312 @@ +"""Coordinator selection checks; synthetic flags do not establish provider support.""" + +from copy import deepcopy +from dataclasses import replace +from pathlib import Path + +import httpx +import pytest +from openai import AsyncOpenAI + +from molto import Molto +from molto.providers import PROVIDER_CAPABILITIES +from molto.types.normalized import AssistantInput, Thinking +from molto.upstream.openai import ChatCompletionsClient +from molto.upstream.registry import CLIENTS +from molto.utils.io import json_loads, read_yaml +from molto.utils.test import assert_stream_lifecycle, collect_sdk_response + + +@pytest.mark.parametrize( + ("provider", "endpoint"), + [ + ("openrouter", "responses"), + ("fireworks", "responses"), + ("fireworks", "chat/completions"), + ("togetherai", "responses"), + ("togetherai", "chat/completions"), + ("vllm", "responses"), + ("vllm", "chat/completions"), + ("bedrock", "chat/completions"), + ], +) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("thinking", ["", "Prior thought"]) +async def test_raw_history_preserves_signatures_on_the_wire( + provider, endpoint, stream, thinking, monkeypatch +): + """Ensures signed raw history survives fixed and caller-selected profiles on both wires.""" + if provider == "bedrock": + monkeypatch.setattr(CLIENTS[provider, endpoint], "REQUIRES_REASONING_REPRESENTATION", True) + body = { + "model": "synthetic", + "max_tokens": 32, + "stream": stream, + "messages": [ + { + "role": "assistant", + "content": [ + {"type": "thinking", "thinking": thinking, "signature": "synthetic-state"} + ], + } + ], + } + before = deepcopy(body) + cassette_protocol = endpoint.replace("/", "_") + recording = read_yaml( + Path(__file__).parents[1] + / f"cassettes/matched/simple_text/openai-{cassette_protocol}-stream-00.yaml" + ) + requests = [] + + def handle(request): + requests.append(json_loads(request.content)) + return httpx.Response( + 200, + content="".join(recording["response"]["sse"]), + headers={"content-type": "text/event-stream"}, + ) + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handle)) + ) as client: + result = await client.messages( + body, + provider=provider, + endpoint=endpoint, + reasoning_representation="raw", + chat_signature_namespace="issuer", + api_key="test-key", + base_url="https://example.test", + ) + if stream: + events = [event async for event in result] + result = collect_sdk_response("messages", events) + assert result.content + if endpoint == "responses": + (item,) = requests[0]["input"] + assert item["encrypted_content"] == "synthetic-state" + assert [part["text"] for part in item.get("content", [])] == ( + [thinking] if thinking else [] + ) + assert item["summary"] == [] + else: + (item,) = requests[0]["messages"] + assert item["extra_content"] == {"issuer": {"thought_signature": "synthetic-state"}} + assert (item.get("reasoning_content") or item.get("reasoning") or "") == thinking + assert body == before + + +@pytest.mark.parametrize( + ("downstream", "upstream"), + [ + ("responses", "chat/completions"), + ("messages", "chat/completions"), + ("chat_completions", "responses"), + ], +) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("selection", [None, "invalid"]) +async def test_flagged_translation_requires_selection_before_normalization( + downstream, upstream, stream, selection, monkeypatch +): + """Ensures every translation boundary requires a valid selection before validation or HTTP.""" + monkeypatch.setattr(CLIENTS["vllm", upstream], "REQUIRES_REASONING_REPRESENTATION", True) + async with Molto( + http_client=httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: pytest.fail("Missing selection reached HTTP")) + ) + ) as client: + with pytest.raises(ValueError, match="reasoning_representation='raw' or 'summary'"): + await getattr(client, downstream)( + {"stream": stream}, + endpoint=upstream, + provider="vllm", + reasoning_representation=selection, + ) + + +@pytest.mark.parametrize("downstream", ["responses", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_selected_profile_controls_history_and_sdk_backed_projection( + downstream, stream, monkeypatch +): + """Ensures successive selections reach adapters and clients without leaking into HTTP or globals.""" + recording = read_yaml( + Path(__file__).parents[1] + / "cassettes/matched/reasoning_raw/vllm-chat_completions-stream-00.yaml" + ) + profiles = [] + histories = [] + + class AmbiguousChatClient(ChatCompletionsClient): + REQUIRES_REASONING_REPRESENTATION = True + + @classmethod + def resolve_capabilities(cls, capabilities): + return replace(capabilities, thinking="summary") + + async def _events(self, request): + profiles.append(self._capabilities) + histories.append(request.input) + async for event in super()._events(request): + yield event + + monkeypatch.setitem(CLIENTS, ("vllm", "chat/completions"), AmbiguousChatClient) + original_profile = PROVIDER_CAPABILITIES["vllm"] + requests = [] + + def response(): + return httpx.Response( + 200, + content="".join(recording["response"]["sse"]), + headers={"content-type": "text/event-stream"}, + ) + + def handle(request): + requests.append(json_loads(request.content)) + return response() + + async with httpx.AsyncClient(transport=httpx.MockTransport(lambda _: response())) as transport: + sdk = AsyncOpenAI(api_key="test-key", http_client=transport) + async with await sdk.chat.completions.create(**recording["request"]["body"]) as events: + expected = collect_sdk_response("chat/completions", [event async for event in events]) + sdk_message = expected.choices[0].message + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handle)) + ) as client: + for selection in ("raw", "summary", "raw"): + body = {"model": recording["request"]["body"]["model"], "stream": stream} + if downstream == "responses": + body["input"] = [ + { + "type": "reasoning", + "summary": [{"type": "summary_text", "text": "Prior thought"}] + if selection == "summary" + else [], + "content": [{"type": "reasoning_text", "text": "Prior thought"}] + if selection == "raw" + else [], + } + ] + else: + body.update( + max_tokens=2048, + messages=[ + { + "role": "assistant", + "content": [{"type": "thinking", "thinking": "Prior thought"}], + } + ], + thinking={"type": "disabled"}, + ) + before = deepcopy(body) + result = await getattr(client, downstream)( + body, + provider="vllm", + endpoint="chat/completions", + base_url="https://example.test/v1", + reasoning_representation=selection, + ) + if stream: + events = [event async for event in result] + assert_stream_lifecycle(downstream, events) + result = collect_sdk_response(downstream, events) + if downstream == "responses": + reasoning = next(item for item in result.output if item.type == "reasoning") + parts = reasoning.content if selection == "raw" else reasoning.summary + assert "".join(part.text for part in parts) == sdk_message.reasoning_content + assert not (reasoning.summary if selection == "raw" else reasoning.content) + assert result.output_text == sdk_message.content + else: + reasoning = next(block for block in result.content if block.type == "thinking") + assert reasoning.thinking == sdk_message.reasoning_content + assert ( + "".join(block.text for block in result.content if block.type == "text") + == sdk_message.content + ) + assert body == before + assert profiles[-1] == replace(original_profile, thinking=selection) + history = histories[-1][0] + thought = history.content[0] if isinstance(history, AssistantInput) else history + assert isinstance(thought, Thinking) + assert thought.content == ("Prior thought" if selection == "raw" else "") + assert thought.summary == ("Prior thought" if selection == "summary" else "") + assert "reasoning_representation" not in requests[-1] + assert requests[-1]["messages"] == [ + {"role": "assistant", "reasoning_content": "Prior thought"} + ] + assert PROVIDER_CAPABILITIES["vllm"] is original_profile + + +@pytest.mark.parametrize( + "provider_endpoint", + [ + pair + for pair, client_type in CLIENTS.items() + if not client_type.REQUIRES_REASONING_REPRESENTATION + ], +) +async def test_unflagged_clients_keep_fixed_profiles(provider_endpoint): + """Ensures the public option cannot override any currently fixed client profile.""" + provider, endpoint = provider_endpoint + client_type = CLIENTS[provider_endpoint] + expected = client_type.resolve_capabilities(PROVIDER_CAPABILITIES[provider]) + async with Molto() as client: + for selection in ("raw", "summary"): + upstream, capabilities = client._upstream_client( + endpoint, + provider, + downstream="messages" if endpoint != "messages" else "responses", + reasoning_representation=selection, + api_key="test-key", + base_url="https://example.test", + extra_body=None, + extra_headers=None, + ) + assert capabilities == upstream._capabilities == expected + + +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("selection", [None, "raw", "summary"]) +async def test_native_flagged_client_preserves_sdk_parity(stream, selection, monkeypatch): + """Ensures native Chat bypasses reasoning selection and preserves parsed SDK output and body.""" + mode = "stream" if stream else "non_stream" + recording = read_yaml( + Path(__file__).parents[1] + / f"cassettes/matched/simple_text/openai-chat_completions-{mode}-00.yaml" + ) + monkeypatch.setattr( + CLIENTS["openai", "chat/completions"], "REQUIRES_REASONING_REPRESENTATION", True + ) + body = recording["request"]["body"] + requests = [] + + def handle(request): + requests.append(json_loads(request.content)) + if stream: + return httpx.Response( + 200, + content="".join(recording["response"]["sse"]), + headers={"content-type": "text/event-stream"}, + ) + return httpx.Response(200, json=recording["response"]["body"]) + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handle)) + ) as client: + actual = await client.chat_completions( + body, api_key="test-key", reasoning_representation=selection + ) + actual = [event.model_dump() async for event in actual] if stream else actual.model_dump() + async with httpx.AsyncClient(transport=httpx.MockTransport(handle)) as transport: + sdk = AsyncOpenAI(api_key="test-key", http_client=transport) + expected = await sdk.chat.completions.create(**body) + if stream: + async with expected: + expected = [event.model_dump() async for event in expected] + else: + expected = expected.model_dump() + assert actual == expected + assert requests == [body, body] diff --git a/tests/core/test_request_validation.py b/tests/core/test_request_validation.py index 9cb05de..fe550ad 100644 --- a/tests/core/test_request_validation.py +++ b/tests/core/test_request_validation.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ValidationError, create_model from molto import Molto +from molto.providers import Provider from molto.types.anthropic_messages import AnthropicMessagesCreateRequest from molto.types.openai_chat_completions import OpenAIChatCompletionsCreateRequest from molto.types.openai_responses import OpenAIResponsesCreateRequest @@ -77,12 +78,21 @@ async def _assert_text_response_parity(result, protocol: Protocol, mode: str) -> _assert_matched_response(result, protocol, reference) -@pytest.mark.parametrize("protocol", PROTOCOLS) +@pytest.mark.parametrize( + ("protocol", "provider"), + [ + ("responses", None), + ("chat/completions", None), + ("messages", None), + ("chat/completions", "gemini"), + ("chat/completions", "fireworks"), + ], +) @pytest.mark.parametrize("stream", [False, True], ids=["non-stream", "stream"]) async def test_native_requests_preserve_provider_fields_and_sdk_parity( - protocol: Protocol, stream: bool + protocol: Protocol, provider: Provider | None, stream: bool ) -> None: - """Ensures native input reaches the SDK unchanged while extensions stay body fields.""" + """Ensures native extensions survive transport alongside provider-specific omissions.""" mode = "stream" if stream else "non_stream" path = _matched_cassette_path("simple_text", protocol, f"{mode}-00.yaml") sdk_body = deepcopy(_read_cassette(path)["request"]["body"]) @@ -91,8 +101,11 @@ async def test_native_requests_preserve_provider_fields_and_sdk_parity( sdk_body["service_tier"] = "provider-specific-tier" message = _first_message(sdk_body, protocol) message["provider_message"] = {"value": None} + message["provider_message_null"] = None message["content"][0]["provider_part"] = True message["content"].append({"type": "provider-specific-part", "payload": {"value": None}}) + if protocol == "chat/completions": + sdk_body["stream_options"] = {"include_usage": True, "include_obfuscation": False} extensions = { "provider_option": {"value": "body-value"}, "provider_null": None, @@ -101,14 +114,18 @@ async def test_native_requests_preserve_provider_fields_and_sdk_parity( "timeout": "body-only-timeout", "extra_body": {"body_only": "must-not-be-merged"}, } - body = {**sdk_body, **extensions} + body = deepcopy({**sdk_body, **extensions}) overrides = {"provider_option": {"value": "override"}, "top_p": 0.75} original_body = deepcopy(body) original_overrides = deepcopy(overrides) - expected = {**body, **overrides} + if provider in ("gemini", "fireworks"): + del sdk_body["messages"][0]["provider_message_null"] + sdk_body["stream_options"] = {"include_usage": True} + expected = {**sdk_body, **extensions, **overrides} requests: list[Request] = [] - # Synthetic request extensions exercise forwarding, not live provider acceptance. + # Synthetic requests replay OpenAI/Anthropic responses to test forwarding, + # not live provider acceptance. Hosted Chat clients use the cassette URL. async with _get_http_client([path], protocol, expected_body=expected) as http_client: reference = await _sdk_result( http_client, protocol, sdk_body, extra_body={**extensions, **overrides} @@ -119,7 +136,9 @@ async def test_native_requests_preserve_provider_fields_and_sdk_parity( result = await _coordinator(Molto(http_client=http_client), protocol)( body=body, endpoint=protocol, + provider=provider, api_key="test-api-key", + base_url="https://api.openai.com/v1" if provider is not None else None, extra_body=overrides, ) if stream: diff --git a/tests/core/test_unsigned_reasoning.py b/tests/core/test_unsigned_reasoning.py index aac5cf6..236b1b8 100644 --- a/tests/core/test_unsigned_reasoning.py +++ b/tests/core/test_unsigned_reasoning.py @@ -96,18 +96,23 @@ def _reasoning_and_text(protocol: Protocol, response) -> tuple[str, str]: @pytest.mark.parametrize( - ("downstream", "upstream", "ciphertext"), + ("downstream", "upstream", "ciphertext", "provider"), [ - (downstream, upstream, ciphertext) + (downstream, upstream, ciphertext, provider) for downstream, upstream in permutations(PROTOCOLS, 2) for ciphertext in ((None, "") if upstream == "responses" else (None,)) + for provider in { + "responses": ("openai",), + "messages": ("anthropic",), + "chat/completions": ("openai",), + }[upstream] ], ) @pytest.mark.parametrize("stream", [True, False]) async def test_unsigned_reasoning_output_and_history_match_sdk( - downstream: Protocol, upstream: Protocol, ciphertext: str | None, stream: bool + downstream: Protocol, upstream: Protocol, ciphertext: str | None, provider: str, stream: bool ): - """Ensures unsigned output matches the SDK and history is validated by its destination.""" + """Ensures unsigned reasoning survives SDK collection and the exact next-turn request.""" events = _unsigned_events(upstream, ciphertext) payload = "".join(dumps_sse(event, event.get("type", "")) for event in events) expected_request = _expected_request(downstream, upstream) @@ -134,7 +139,7 @@ def handler(request: Request) -> Response: result = await _coordinator(client, downstream)( body=_body(downstream, stream), endpoint=upstream, - provider="openai", + provider=provider, api_key="test-api-key", ) if stream: @@ -169,31 +174,57 @@ def handler(request: Request) -> Response: ) history_body["messages"].extend([assistant, {"role": "user", "content": "Follow up"}]) - if upstream != "chat/completions": - with pytest.raises(UnsupportedInput, match="summary requires a signature"): - await _coordinator(client, downstream)( - body=history_body, - endpoint=upstream, - provider="openai", - api_key="test-api-key", - ) - assert len(requests) == 2 - return - - expected_request["messages"].extend( - [ - { + if upstream == "responses": + expected_request["input"].extend( + [ + { + "type": "reasoning", + "content": [], + "summary": [{"type": "summary_text", "text": expected[0]}], + }, + { + "type": "message", + "role": "assistant", + "status": "completed", + "content": [ + { + "type": "output_text", + "text": expected[1], + "annotations": [], + "logprobs": [], + } + ], + }, + {"role": "user", "content": [{"type": "input_text", "text": "Follow up"}]}, + ] + ) + else: + if upstream == "messages": + assistant_history = { + "role": "assistant", + "content": [ + {"type": "thinking", "thinking": expected[0]}, + {"type": "text", "text": expected[1]}, + ], + } + expected_request["thinking"] = {"type": "adaptive", "display": "summarized"} + expected_request["output_config"] = {"effort": "high"} + else: + assistant_history = { "role": "assistant", "reasoning_content": expected[0], "content": expected[1], - }, - {"role": "user", "content": [{"type": "text", "text": "Follow up"}]}, - ] - ) + } + expected_request["messages"].extend( + [ + assistant_history, + {"role": "user", "content": [{"type": "text", "text": "Follow up"}]}, + ] + ) async with await create(**expected_request) as sdk_stream: reference = collect_sdk_response(upstream, [event async for event in sdk_stream]) followup = await _coordinator(client, downstream)( - body=history_body, endpoint=upstream, provider="openai", api_key="test-api-key" + body=history_body, endpoint=upstream, provider=provider, api_key="test-api-key" ) if stream: projected = [event async for event in followup] @@ -204,7 +235,10 @@ def handler(request: Request) -> Response: ) assert len(requests) == 4 - # Chat can replay summary text, but must not silently discard opaque state. + if upstream != "chat/completions": + return + + # An unconfigured Chat endpoint has no destination for opaque state. if downstream == "responses": thinking = next( item for item in history_body["input"] if item.get("type") == "reasoning" @@ -215,6 +249,46 @@ def handler(request: Request) -> Response: thinking["signature"] = "opaque-state" with pytest.raises(UnsupportedInput, match="cannot represent thinking signatures"): await _coordinator(client, downstream)( - body=history_body, endpoint=upstream, provider="openai", api_key="test-api-key" + body=history_body, endpoint=upstream, provider=provider, api_key="test-api-key" ) assert len(requests) == 4 + + +@pytest.mark.parametrize("downstream", ["chat/completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("populated_start", [False, True]) +async def test_openrouter_summary_projects_downstream(downstream, stream, populated_start): + """Ensures OpenRouter summary snapshots and deltas reach Chat and Messages despite its raw profile.""" + # This fixture-derived stream tests a wire shape independently of live OpenRouter output. + events = _unsigned_events("responses") + if populated_start: + added = next( + event["item"] for event in events if event["type"] == "response.output_item.added" + ) + first = next( + event for event in events if event["type"] == "response.reasoning_summary_text.delta" + ) + added["summary"] = [{"type": "summary_text", "text": first["delta"]}] + first["delta"] = "" + payload = "".join(dumps_sse(event, event["type"]) for event in events) + + def handler(request): + return Response(200, text=payload, headers={"content-type": "text/event-stream"}) + + async with AsyncClient(transport=MockTransport(handler)) as transport: + sdk = AsyncOpenAI(api_key="test-key", http_client=transport) + async with await sdk.responses.create( + input="Question", model="test-model", stream=True + ) as source: + expected = collect_sdk_response("responses", [event async for event in source]) + result = await _coordinator(Molto(http_client=transport), downstream)( + _body(downstream, stream), + provider="openrouter", + endpoint="responses", + api_key="test-key", + ) + if stream: + projected = [event async for event in result] + assert_stream_lifecycle(downstream, projected) + result = collect_sdk_response(downstream, projected) + assert _reasoning_and_text(downstream, result) == _reasoning_and_text("responses", expected) diff --git a/tests/core/test_web_search.py b/tests/core/test_web_search.py index a3f6563..8f618e1 100644 --- a/tests/core/test_web_search.py +++ b/tests/core/test_web_search.py @@ -952,7 +952,7 @@ def _history(protocol: Protocol, search: bool) -> list[dict[str, Any]]: async def test_fixed_route_followup_history( downstream: Protocol, upstream: Protocol, stream: bool, search: bool ): - """Ensures native and compatible-provider followups preserve reduced history and placeholders.""" + """Ensures followups preserve history or reject missing Anthropic continuation state.""" body, expected = _request_pair(downstream, upstream, stream) body_key = "input" if downstream == "responses" else "messages" expected_key = "input" if upstream == "responses" else "messages" @@ -966,12 +966,20 @@ async def test_fixed_route_followup_history( ] body[body_key].extend(_history(downstream, search)) expected[expected_key].extend(_history(upstream, search)) + requests = [] async with _get_http_client( [_path(upstream, stream if downstream == upstream else True)], upstream, expected_body=expected, + requests=requests, ) as http_client: - if downstream == "chat/completions": + if downstream == "responses" and upstream == "messages" and search: + with pytest.raises(UnsupportedInput, match="original encrypted_content"): + await Molto(http_client=http_client).responses( + body=body, endpoint=upstream, api_key="test-api-key" + ) + assert requests == [] + elif downstream == "chat/completions": with pytest.raises( ValueError, match="Chat Completions cannot preserve reasoning signatures" ): @@ -987,9 +995,6 @@ async def test_fixed_route_followup_history( body=body, endpoint=upstream, api_key="test-api-key", - provider="openai" - if downstream == "responses" and upstream == "messages" and search - else None, ) if stream: _ = [event async for event in result] @@ -1504,7 +1509,7 @@ async def test_synthetic_pause_has_no_invented_result(stream: bool, downstream: async def test_synthetic_citation_boundaries_match_sdk_and_history( stream: bool, timing: str, text, ranges, expected_text, associations ): - """Ensures SDK attribution and exact text survive output and compatible-provider history projection.""" + """Ensures citation boundaries survive output and history with required Anthropic state.""" citations = [ { "type": "url_citation", @@ -1593,9 +1598,29 @@ async def test_synthetic_citation_boundaries_match_sdk_and_history( expected_body=expected_request, requests=requests, ) as http_client: - followup = await Molto(http_client=http_client).responses( - body=body, endpoint="messages", provider="openai", api_key="test-api-key" - ) + molto = Molto(http_client=http_client) + with pytest.raises(UnsupportedInput, match="original encrypted_index"): + await molto.responses(body=body, endpoint="messages", api_key="test-api-key") + assert requests == [] + # Synthetic opaque state exercises history projection, not provider acceptance. + for index, citation in enumerate(history["content"][0]["annotations"]): + projected = next( + item + for block in expected_request["messages"][-2]["content"] + for item in block.get("citations", []) + if item["url"] == citation["url"] + ) + citation["extra_content"] = { + "anthropic": { + "encrypted_index": f"synthetic-index-{index}", + "cited_text": projected["cited_text"], + } + } + for block in expected_request["messages"][-2]["content"]: + for item in block.get("citations", []): + if item["url"] == citation["url"]: + item["encrypted_index"] = f"synthetic-index-{index}" + followup = await molto.responses(body=body, endpoint="messages", api_key="test-api-key") if stream: _ = [event async for event in followup] assert len(requests) == 1 @@ -2019,7 +2044,7 @@ async def test_synthetic_multiple_responses_text_parts_have_local_offsets( async def test_search_history_reaches_sdk_error_boundary( downstream: Protocol, upstream: Protocol, stream: bool ): - """Ensures native and compatible-provider reduced history retains recorded SDK error parity.""" + """Ensures representable search history reaches the recorded SDK error boundary.""" body, expected = _request_pair(downstream, upstream, stream) for request, protocol in ((body, downstream), (expected, upstream)): key = "input" if protocol == "responses" else "messages" @@ -2028,6 +2053,22 @@ async def test_search_history_reaches_sdk_error_boundary( {"role": "user", "content": [{"type": "input_text", "text": request[key]}]} ] request[key].extend(_history(protocol, True)) + if downstream == "responses" and upstream == "messages": + # These synthetic values satisfy local continuation requirements; the + # recorded invalid-request response remains the SDK error reference. + body["input"][-3]["action"]["sources"][0]["extra_content"] = { + "anthropic": {"encrypted_content": "synthetic-content"} + } + citation = body["input"][-2]["content"][0]["annotations"][0] + citation["extra_content"] = { + "anthropic": { + "encrypted_index": "synthetic-index", + "cited_text": body["input"][-2]["content"][0]["text"], + } + } + blocks = expected["messages"][-2]["content"] + blocks[1]["content"][0]["encrypted_content"] = "synthetic-content" + blocks[2]["citations"][0]["encrypted_index"] = "synthetic-index" error_path = _matched_cassette_path("error-invalid_request_error", upstream, "stream-00.yaml") error_type = AnthropicBadRequestError if upstream == "messages" else OpenAIBadRequestError async with _get_http_client([error_path], upstream, expected_body=expected) as http_client: @@ -2048,9 +2089,6 @@ async def test_search_history_reaches_sdk_error_boundary( body=body, endpoint=upstream, api_key="test-api-key", - provider="openai" - if downstream == "responses" and upstream == "messages" - else None, ) if stream: _ = [event async for event in result] diff --git a/tests/test_hosted_providers.py b/tests/test_hosted_providers.py new file mode 100644 index 0000000..0a4963f --- /dev/null +++ b/tests/test_hosted_providers.py @@ -0,0 +1,677 @@ +"""Offline destination/authentication probes; these do not certify hosted models.""" + +from copy import deepcopy +from pathlib import Path + +import httpx +import pytest +from anthropic import AsyncAnthropic, omit +from openai import AsyncOpenAI, OpenAIError +from openai.lib.streaming.chat import ChatCompletionStreamState +from pydantic import SecretStr + +from molto import Molto +from molto.configs import ENV_CONFIG, EnvConfig +from molto.providers import PROVIDER_CAPABILITIES +from molto.types.exceptions import AuthenticationError +from molto.upstream.registry import CLIENTS +from molto.utils.io import dumps_sse, json_loads, read_yaml +from molto.utils.test import ( + assert_stream_lifecycle, + collect_sdk_response, + reconstructable_chat_completions_chunks, + reconstructable_responses_event, +) + +DESTINATIONS = [ + ("fireworks", "responses", "https://api.fireworks.ai/inference/v1", "/responses"), + ("openrouter", "responses", "https://openrouter.ai/api/v1", "/responses"), + ("togetherai", "responses", "https://api.together.ai/v1", "/responses"), + ( + "fireworks", + "chat/completions", + "https://api.fireworks.ai/inference/v1", + "/chat/completions", + ), + ("togetherai", "chat/completions", "https://api.together.ai/v1", "/chat/completions"), + ( + "bedrock", + "chat/completions", + "https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1", + "/chat/completions", + ), + ( + "gemini", + "chat/completions", + "https://generativelanguage.googleapis.com/v1beta/openai", + "/chat/completions", + ), + ( + "bedrock", + "responses", + "https://bedrock-runtime.ap-southeast-1.amazonaws.com/openai/v1", + "/responses", + ), + ( + "bedrock", + "messages", + "https://bedrock-runtime.ap-southeast-1.amazonaws.com/anthropic", + "/v1/messages", + ), + ( + "bedrock", + "messages", + "https://bedrock-mantle.us-east-1.api.aws/anthropic", + "/v1/messages", + ), +] + + +@pytest.mark.parametrize("source", ["environment", "dotenv"]) +@pytest.mark.parametrize( + "names", + [ + ["AWS_BEARER_TOKEN_BEDROCK"], + ["BEDROCK_API_KEY"], + ["AWS_BEARER_TOKEN_BEDROCK", "BEDROCK_API_KEY"], + ], +) +def test_bedrock_credential_alias_preserves_secret_and_name_precedence( + source, names, monkeypatch, tmp_path +): + """Ensures both names load one secret field, preferring the AWS name within each source.""" + for name in ("AWS_BEARER_TOKEN_BEDROCK", "BEDROCK_API_KEY"): + monkeypatch.delenv(name, raising=False) + values = {name: f"synthetic-{index}" for index, name in enumerate(names)} + env_file = None + if source == "environment": + for name, value in values.items(): + monkeypatch.setenv(name, value) + else: + env_file = tmp_path / ".env" + env_file.write_text("\n".join(f"{name}={value}" for name, value in values.items())) + config = EnvConfig(_env_file=env_file) + credential = config.aws_bearer_token_bedrock + assert isinstance(credential, SecretStr) + assert credential.get_secret_value() == "synthetic-0" + assert str(credential) == "**********" + assert config.model_dump()["aws_bearer_token_bedrock"] is credential + + +@pytest.mark.parametrize("field", ["aws_bearer_token_bedrock", "BEDROCK_API_KEY"]) +def test_bedrock_constructor_credential_overrides_environment(field, monkeypatch): + """Ensures explicit settings construction keeps precedence over either environment name.""" + monkeypatch.setenv("AWS_BEARER_TOKEN_BEDROCK", "synthetic-aws") + monkeypatch.setenv("BEDROCK_API_KEY", "synthetic-alias") + config = EnvConfig(_env_file=None, **{field: "synthetic-explicit"}) + assert config.aws_bearer_token_bedrock.get_secret_value() == "synthetic-explicit" + + +@pytest.mark.parametrize( + ("environment_name", "dotenv_name", "expected"), + [ + ("AWS_BEARER_TOKEN_BEDROCK", "AWS_BEARER_TOKEN_BEDROCK", "synthetic-environment"), + ("BEDROCK_API_KEY", "BEDROCK_API_KEY", "synthetic-environment"), + ("AWS_BEARER_TOKEN_BEDROCK", "BEDROCK_API_KEY", "synthetic-environment"), + ("BEDROCK_API_KEY", "AWS_BEARER_TOKEN_BEDROCK", "synthetic-file"), + ], +) +def test_bedrock_alias_and_source_precedence( + environment_name, dotenv_name, expected, monkeypatch, tmp_path +): + """Ensures the AWS name takes priority while same-name environment values override dotenv.""" + for name in ("AWS_BEARER_TOKEN_BEDROCK", "BEDROCK_API_KEY"): + monkeypatch.delenv(name, raising=False) + monkeypatch.setenv(environment_name, "synthetic-environment") + env_file = tmp_path / ".env" + env_file.write_text(f"{dotenv_name}=synthetic-file\n") + config = EnvConfig(_env_file=env_file) + assert config.aws_bearer_token_bedrock.get_secret_value() == expected + + +def cassette(protocol, stream): + mode = "stream" if stream else "non_stream" + path = Path(__file__).parent / "cassettes/matched/simple_text" + provider = "anthropic" if protocol == "messages" else "openai" + return read_yaml(path / f"{provider}-{protocol.replace('/', '_')}-{mode}-00.yaml") + + +def response(recording): + recorded = recording["response"] + if "sse" in recorded: + return httpx.Response( + 200, content="".join(recorded["sse"]), headers={"content-type": "text/event-stream"} + ) + return httpx.Response(200, json=recorded["body"]) + + +@pytest.mark.parametrize(("provider", "endpoint", "base", "path"), DESTINATIONS) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("override", [False, True]) +async def test_hosted_native_destination_auth_and_sdk_parity( + provider, endpoint, base, path, stream, override, monkeypatch +): + """Ensures configured keys/default URLs and explicit overrides retain native SDK fidelity.""" + monkeypatch.setattr( + ENV_CONFIG, + CLIENTS[provider, endpoint].REQUIRED_API_KEY.lower(), + SecretStr("configured-key"), + ) + monkeypatch.setenv("OPENAI_API_KEY", "unrelated") + monkeypatch.setenv("OPENAI_ORG_ID", "unrelated") + monkeypatch.setenv("OPENAI_PROJECT_ID", "unrelated") + monkeypatch.setenv("ANTHROPIC_API_KEY", "unrelated") + monkeypatch.setenv("ANTHROPIC_AUTH_TOKEN", "unrelated") + base = "https://custom.example/prefix" if override else base + key = "override-key" if override else "configured-key" + recording = cassette(endpoint, stream) + body = deepcopy(recording["request"]["body"]) + body["stream"] = stream + expected_body = deepcopy(body) + if provider in {"gemini", "fireworks"} and endpoint == "chat/completions": + expected_body.get("stream_options", {}).pop("include_obfuscation", None) + requests = [] + + def handler(request): + requests.append(request) + assert str(request.url) == base + path + assert request.method == "POST" + assert json_loads(request.content) == expected_body + if endpoint == "messages": + assert request.headers["x-api-key"] == key + assert "authorization" not in request.headers + else: + assert request.headers["authorization"] == f"Bearer {key}" + assert "x-api-key" not in request.headers + assert "openai-organization" not in request.headers + assert "openai-project" not in request.headers + return response(recording) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as transport: + async with Molto(http_client=transport) as molto: + actual = await getattr(molto, endpoint.replace("/", "_"))( + body, + endpoint=endpoint, + provider=provider, + base_url=base if override or provider == "bedrock" else None, + api_key=key if override else None, + extra_headers={"Authorization": "inbound", "x-api-key": "inbound"}, + ) + if stream: + actual = [event.model_dump() async for event in actual] + else: + actual = actual.model_dump() + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: response(recording)) + ) as transport: + sdk = ( + AsyncAnthropic(api_key="sdk-key", http_client=transport) + if endpoint == "messages" + else AsyncOpenAI(api_key="sdk-key", http_client=transport) + ) + create = ( + sdk.messages.create + if endpoint == "messages" + else sdk.responses.create + if endpoint == "responses" + else sdk.chat.completions.create + ) + expected = await create(**expected_body) + if stream: + async with expected: + expected = [event.model_dump() async for event in expected] + else: + expected = expected.model_dump() + assert actual == expected + assert len(requests) == 1 + + +@pytest.mark.parametrize("downstream", ["responses", "chat/completions"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_bedrock_messages_translation_matches_openai_sdk(downstream, stream, monkeypatch): + """Ensures Bedrock routing preserves matched Messages-to-OpenAI output in both modes.""" + # These matched protocol fixtures establish offline translation parity, not + # live Bedrock acceptance of their synthetic model or response values. + upstream = cassette("messages", True) + reference = cassette(downstream, True) + body = deepcopy(reference["request"]["body"]) + body["stream"] = stream + if not stream: + body.pop("stream_options", None) + monkeypatch.setenv("ANTHROPIC_API_KEY", "unrelated-key") + monkeypatch.setenv("ANTHROPIC_AUTH_TOKEN", "unrelated-token") + requests = [] + + def handler(request): + requests.append(request) + assert str(request.url) == "https://bedrock.example/anthropic/v1/messages" + assert json_loads(request.content) == upstream["request"]["body"] + assert request.headers["x-api-key"] == "selected-key" + assert "authorization" not in request.headers + return response(upstream) + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as molto: + actual = await getattr(molto, downstream.replace("/", "_"))( + body, + endpoint="messages", + provider="bedrock", + base_url="https://bedrock.example/anthropic", + api_key="selected-key", + ) + if stream: + actual = [event async for event in actual] + assert_stream_lifecycle(downstream, actual) + + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: response(reference)) + ) as transport: + sdk = AsyncOpenAI(api_key="sdk-key", http_client=transport) + create = sdk.responses.create if downstream == "responses" else sdk.chat.completions.create + expected = await create(**reference["request"]["body"]) + async with expected: + expected = [event async for event in expected] + + if stream: + if downstream == "responses": + actual = [reconstructable_responses_event(dumps_sse(e), body=body) for e in actual] + expected = [reconstructable_responses_event(dumps_sse(e), body=body) for e in expected] + else: + actual = [ + chunk + for event in actual + for chunk in reconstructable_chat_completions_chunks(dumps_sse(event), body=body) + ] + expected = [ + chunk + for event in expected + for chunk in reconstructable_chat_completions_chunks(dumps_sse(event), body=body) + ] + # Messages has no source timestamp to project onto Chat chunks. + for chunk in actual + expected: + chunk.pop("created", None) + assert actual == expected + else: + expected = collect_sdk_response(downstream, expected) + assert actual.id == expected.id + assert actual.model == expected.model + if downstream == "responses": + assert actual.status == expected.status + assert actual.incomplete_details == expected.incomplete_details + actual_output = [item.model_dump(exclude={"id", "phase"}) for item in actual.output] + expected_output = [ + item.model_dump(exclude={"id", "phase"}) for item in expected.output + ] + assert actual_output == expected_output + assert actual.usage.model_dump() == expected.usage.model_dump() + else: + assert len(actual.choices) == len(expected.choices) == 1 + assert actual.choices[0].index == expected.choices[0].index + assert actual.choices[0].finish_reason == expected.choices[0].finish_reason + actual_message = actual.choices[0].message.model_dump(exclude={"parsed"}) + expected_message = expected.choices[0].message.model_dump(exclude={"parsed"}) + assert actual_message == expected_message + assert actual.usage.prompt_tokens == expected.usage.prompt_tokens + assert actual.usage.completion_tokens == expected.usage.completion_tokens + assert actual.usage.total_tokens == expected.usage.total_tokens + assert actual.usage.prompt_tokens_details.cached_tokens == ( + expected.usage.prompt_tokens_details.cached_tokens + ) + assert actual.usage.completion_tokens_details.reasoning_tokens == ( + expected.usage.completion_tokens_details.reasoning_tokens + ) + assert len(requests) == 1 + + +@pytest.mark.parametrize(("provider", "endpoint", "base", "path"), DESTINATIONS) +@pytest.mark.parametrize("downstream", ["responses", "chat_completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_missing_provider_credentials_never_use_other_accounts( + provider, endpoint, base, path, downstream, stream, monkeypatch +): + """Ensures unrelated environment keys cannot authorize any hosted route or result mode.""" + monkeypatch.setattr( + ENV_CONFIG, CLIENTS[provider, endpoint].REQUIRED_API_KEY.lower(), SecretStr("") + ) + for name in ( + "OPENAI_API_KEY", + "OPENAI_ADMIN_KEY", + "ANTHROPIC_API_KEY", + "ANTHROPIC_AUTH_TOKEN", + ): + monkeypatch.setenv(name, "unrelated-key") + body = { + "model": "example", + "stream": stream, + "max_tokens": 20, + "messages": [{"role": "user", "content": "Hi"}], + } + if downstream == "responses": + body = {"model": "example", "stream": stream, "input": "Hi", "max_output_tokens": 20} + + def unexpected(request): + pytest.fail("Missing provider credential reached HTTP") + + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(unexpected)) + ) as molto: + with pytest.raises(Exception, match=CLIENTS[provider, endpoint].REQUIRED_API_KEY) as error: + await getattr(molto, downstream)( + body, endpoint=endpoint, provider=provider, base_url=base + ) + assert type(error.value).__name__ == "AuthenticationError" + assert str(error.value.request.url) == base + path + + +@pytest.mark.parametrize(("provider", "endpoint", "base", "path"), DESTINATIONS) +async def test_direct_hosted_client_defaults_and_missing_credentials( + provider, endpoint, base, path, monkeypatch +): + """Ensures direct clients own their URL and reject unrelated SDK credentials without the facade.""" + monkeypatch.setenv("OPENAI_API_KEY", "unrelated-key") + async with httpx.AsyncClient() as transport: + kwargs = {"capabilities": PROVIDER_CAPABILITIES[provider]} + if provider == "bedrock": + with pytest.raises(ValueError, match="explicit"): + CLIENTS[provider, endpoint](transport, **kwargs) + kwargs["base_url"] = base + client = CLIENTS[provider, endpoint](transport, **kwargs) + factory = "_make_anthropic_client" if endpoint == "messages" else "_make_sdk_client" + error_type = AuthenticationError if endpoint == "messages" else OpenAIError + with pytest.raises(error_type, match=CLIENTS[provider, endpoint].REQUIRED_API_KEY): + getattr(client, factory)() + selected = CLIENTS[provider, endpoint](transport, api_key="selected-key", **kwargs) + sdk = getattr(selected, factory)() + assert str(sdk.base_url).rstrip("/") == base + if endpoint == "messages": + assert sdk.default_headers["X-Api-Key"] == "selected-key" + assert sdk.default_headers.get("Authorization", omit) is omit + else: + assert sdk.default_headers["Authorization"] == "Bearer selected-key" + + +@pytest.mark.parametrize( + ("provider", "endpoint"), + [ + (provider, endpoint) + for provider in PROVIDER_CAPABILITIES + for endpoint in ("responses", "chat/completions", "messages") + if (provider, endpoint) not in CLIENTS + ], +) +@pytest.mark.parametrize("downstream", ["responses", "chat_completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize("base_url", [None, "https://custom.example/prefix"]) +async def test_unregistered_routes_rejected_before_http( + provider, endpoint, downstream, stream, base_url +): + """Ensures native and translated routes require registration even with an explicit URL.""" + body = {"model": "example", "stream": stream} + if downstream == "responses": + body["input"] = "Hi" + else: + body["messages"] = [{"role": "user", "content": "Hi"}] + if downstream == "messages": + body["max_tokens"] = 20 + before = deepcopy(body) + async with Molto( + http_client=httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: pytest.fail("Unregistered provider protocol reached HTTP") + ) + ) + ) as client: + with pytest.raises(ValueError, match="Unsupported upstream endpoint") as error: + await getattr(client, downstream)( + body, + provider=provider, + endpoint=endpoint, + api_key="selected-key", + base_url=base_url, + ) + assert repr(provider) in str(error.value) + assert repr(endpoint) in str(error.value) + assert body == before + + +async def test_native_bedrock_messages_requires_explicit_destination(): + """Ensures Bedrock Messages cannot send its credential to a default Anthropic URL.""" + async with Molto( + http_client=httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: pytest.fail("Missing Bedrock destination reached HTTP") + ) + ) + ) as client: + with pytest.raises(ValueError, match="explicit base_url"): + await client.messages( + {"model": "test", "messages": [], "max_tokens": 20}, + provider="bedrock", + api_key="selected-key", + ) + + +def tool_chunk(calls, finish=None): + return { + "id": "chat-1", + "model": "example", + "created": 1, + "object": "chat.completion.chunk", + "choices": [{"index": 0, "delta": {"tool_calls": calls}, "finish_reason": finish}], + } + + +def gemini_http(events): + data = "".join(dumps_sse(event) for event in events) + "data: [DONE]\n\n" + return httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: httpx.Response(200, text=data, headers={"content-type": "text/event-stream"}) + ) + ) + + +def call_start(call_id, arguments="{", **fields): + return { + "id": call_id, + "type": "function", + "function": {"name": "add", "arguments": arguments}, + **fields, + } + + +@pytest.mark.parametrize( + ("downstream", "stream"), + [("chat_completions", True), ("responses", True), ("responses", False)], +) +@pytest.mark.parametrize("parallel", [False, True]) +async def test_gemini_missing_indices_preserve_distinct_calls(downstream, stream, parallel): + """Ensures repaired single and contiguous parallel calls finish with stable IDs and arguments.""" + events = [ + tool_chunk([call_start("call-a", index=None)]), + tool_chunk([{"id": "call-a", "function": {"arguments": '"a":1}'}}]), + ] + if parallel: + events.extend( + [ + tool_chunk([call_start("call-b")]), + tool_chunk([{"id": "call-b", "function": {"arguments": '"a":2}'}}]), + ] + ) + events.append(tool_chunk([], "tool_calls")) + async with Molto(http_client=gemini_http(events)) as molto: + body = {"model": "example", "stream": stream} + body.update( + {"input": "Hi"} + if downstream == "responses" + else {"messages": [{"role": "user", "content": "Hi"}]} + ) + result = await getattr(molto, downstream)( + body, endpoint="chat/completions", provider="gemini", api_key="key" + ) + if stream: + output = [event async for event in result] + if downstream == "chat_completions": + state = ChatCompletionStreamState() + for event in output: + state.handle_chunk(event) + calls = state.get_final_completion().choices[0].message.tool_calls + actual = [(c.id, c.function.arguments) for c in calls] + else: + response = output[-1].response if stream else result + actual = [(item.call_id, item.arguments) for item in response.output] + if stream: + added = [ + event.item.call_id + for event in output + if event.type == "response.output_item.added" + ] + done = [ + event.item.call_id + for event in output + if event.type == "response.output_item.done" + ] + assert added == done == [call_id for call_id, _ in actual] + assert actual == [("call-a", '{"a":1}')] + ([("call-b", '{"a":2}')] if parallel else []) + + +async def test_gemini_native_interleaved_calls_use_ids_not_array_positions(): + """Ensures native accumulation preserves parallel identities when fragment order changes.""" + first = [call_start("call-a"), call_start("call-b")] + for call in first: + call["extra_content"] = {"google": {"thought_signature": f"state-{call['id']}"}} + events = [ + tool_chunk(first), + tool_chunk( + [ + {"id": "call-b", "function": {"arguments": '"a":2}'}}, + {"id": "call-a", "function": {"arguments": '"a":1}'}}, + ] + ), + tool_chunk([], "tool_calls"), + ] + original = deepcopy(events) + async with Molto(http_client=gemini_http(events)) as molto: + output = await molto.chat_completions( + {"model": "example", "stream": True, "messages": [{"role": "user", "content": "Hi"}]}, + provider="gemini", + api_key="key", + ) + state = ChatCompletionStreamState() + async for event in output: + state.handle_chunk(event) + calls = state.get_final_completion().choices[0].message.tool_calls + assert [(c.id, c.function.name, c.function.arguments) for c in calls] == [ + ("call-a", "add", '{"a":1}'), + ("call-b", "add", '{"a":2}'), + ] + assert [c.extra_content for c in calls] == [ + {"google": {"thought_signature": "state-call-a"}}, + {"google": {"thought_signature": "state-call-b"}}, + ] + assert events == original + + +@pytest.mark.parametrize("stream", [False, True]) +async def test_gemini_translated_noncontiguous_calls_reject(stream): + """Ensures inferred indices do not bypass the translated stream's contiguous-call contract.""" + events = [ + tool_chunk([call_start("call-a"), call_start("call-b")]), + tool_chunk([{"id": "call-a", "function": {"arguments": "}"}}]), + ] + async with Molto(http_client=gemini_http(events)) as molto: + with pytest.raises(ValueError, match="contiguous"): + result = await molto.responses( + {"model": "example", "input": "Hi", "stream": stream}, + endpoint="chat/completions", + provider="gemini", + api_key="key", + ) + if stream: + [event async for event in result] + + +async def test_gemini_unidentified_call_rejects(): + """Ensures a call lacking both an index and identity cannot be repaired.""" + calls = [{"index": None, "function": {"arguments": "{}"}}] + async with Molto(http_client=gemini_http([tool_chunk(calls)])) as molto: + with pytest.raises(ValueError, match="unambiguous"): + result = await molto.responses( + {"model": "example", "input": "Hi", "stream": True}, + endpoint="chat/completions", + provider="gemini", + api_key="key", + ) + [event async for event in result] + + +async def test_gemini_anonymous_fragment_after_parallel_calls_rejects(): + """Ensures a fragment with several possible owners never defaults to the latest or zero index.""" + events = [ + tool_chunk([call_start("call-a"), call_start("call-b")]), + tool_chunk([{"function": {"arguments": "}"}}]), + ] + async with Molto(http_client=gemini_http(events)) as molto: + with pytest.raises(ValueError, match="unambiguous"): + result = await molto.chat_completions( + { + "model": "example", + "messages": [{"role": "user", "content": "Hi"}], + "stream": True, + }, + provider="gemini", + api_key="key", + ) + [event async for event in result] + + +async def test_gemini_anonymous_single_call_continuation_is_unambiguous(): + """Ensures an anonymous argument-only fragment can continue the sole established call.""" + events = [ + tool_chunk([call_start("call-a")]), + tool_chunk([{"function": {"arguments": '"a":1}'}}]), + tool_chunk([], "tool_calls"), + ] + async with Molto(http_client=gemini_http(events)) as molto: + result = await molto.responses( + {"model": "example", "input": "Hi", "stream": False}, + endpoint="chat/completions", + provider="gemini", + api_key="key", + ) + assert [(item.call_id, item.arguments) for item in result.output] == [("call-a", '{"a":1}')] + + +@pytest.mark.parametrize( + "calls", + [ + [call_start("call-a", index=0)], + [call_start("call-a", index=-1)], + [call_start("call-a", index="invalid")], + [call_start("call-a", index=0), call_start("call-b", index=0)], + [call_start("call-a", index=0), call_start("call-a", index=1)], + ], +) +async def test_gemini_indexed_chunks_retain_native_fidelity(calls): + """Ensures already indexed output retains SDK parity without Molto identity validation.""" + events = [ + tool_chunk(calls), + tool_chunk([{"id": "call-a", "index": 0, "function": {"arguments": "}"}}]), + tool_chunk([], "tool_calls"), + ] + async with Molto(http_client=gemini_http(events)) as molto: + result = await molto.chat_completions( + {"model": "example", "messages": [{"role": "user", "content": "Hi"}], "stream": True}, + provider="gemini", + api_key="key", + ) + actual = [event.model_dump() async for event in result] + async with AsyncOpenAI( + api_key="key", base_url="https://example.test", http_client=gemini_http(events) + ) as sdk: + reference = await sdk.chat.completions.create( + model="example", messages=[{"role": "user", "content": "Hi"}], stream=True + ) + async with reference: + expected = [event.model_dump() async for event in reference] + assert actual == expected diff --git a/tests/test_match_anthropic_cassette_events.py b/tests/test_match_anthropic_cassette_events.py index 382a240..4e2776b 100644 --- a/tests/test_match_anthropic_cassette_events.py +++ b/tests/test_match_anthropic_cassette_events.py @@ -1691,10 +1691,12 @@ def test_opaque_reasoning_history_uses_prior_done_snapshot(cassette_dir: Path) - def test_request_only_matching_preserves_recorded_error(tmp_path: Path) -> None: + """Ensures request alignment preserves recorded error bodies, status, and headers.""" cassette_dir = Path(__file__).parent / "cassettes" / "errors" / "context_length_exceeded" expected = read_yaml(str(cassette_dir / "anthropic-messages-stream-00.yaml")) responses_path = cassette_dir / "openai-responses-stream-00.yaml" original_responses = responses_path.read_bytes() + expected["response"]["body"] = b'{ "error": "original bytes" }\n' unmatched = deepcopy(expected) unmatched["request"]["body"]["model"] = "unmatched-model" unmatched["request"]["body"]["messages"] = [{"role": "user", "content": "Unmatched input"}] diff --git a/tests/test_match_anthropic_cassette_responses.py b/tests/test_match_anthropic_cassette_responses.py index 97e7748..d126c04 100644 --- a/tests/test_match_anthropic_cassette_responses.py +++ b/tests/test_match_anthropic_cassette_responses.py @@ -32,6 +32,7 @@ def test_matches_real_non_streaming_cassette_and_is_idempotent( """Ensures every discovered conversation turn matches valid native output idempotently.""" messages = read_yaml(messages_path) responses = read_yaml(responses_path) + original_responses = deepcopy(responses) transport = deepcopy(messages["response"]["headers"]) match_messages_response(messages, responses) @@ -64,6 +65,7 @@ def test_matches_real_non_streaming_cassette_and_is_idempotent( matched = deepcopy(messages) match_messages_response(messages, responses) assert messages == matched + assert responses == original_responses def test_matches_ordered_content_usage_and_tool_stop() -> None: @@ -195,6 +197,16 @@ def test_matches_positive_cache_writes_by_effective_lifetime( assert messages == matched +def test_missing_cache_write_count_remains_unknown(): + """Ensures a missing aggregate cannot produce a cache write count or lifetime breakdown.""" + messages, responses = _cassettes() + responses["response"]["body"]["usage"]["input_tokens_details"].pop("cache_write_tokens", None) + match_messages_response(messages, responses) + usage = messages["response"]["body"]["usage"] + assert usage["cache_creation_input_tokens"] is None + assert usage.get("cache_creation") is None + + @pytest.mark.parametrize("cache_write_tokens", [0, 3, 4]) def test_mixed_cache_lifetimes_preserve_only_observed_distribution( cache_write_tokens: int, diff --git a/tests/test_match_openai_cassette_events.py b/tests/test_match_openai_cassette_events.py index d2f4c3c..24e9e1b 100644 --- a/tests/test_match_openai_cassette_events.py +++ b/tests/test_match_openai_cassette_events.py @@ -999,10 +999,12 @@ def test_uses_default_service_tier_for_translated_chat_completions() -> None: def test_request_only_matching_preserves_recorded_error(tmp_path: Path) -> None: + """Ensures request alignment preserves recorded error bodies, status, and headers.""" cassette_dir = Path(__file__).parent / "cassettes" / "errors" / "context_length_exceeded" expected = read_yaml(str(cassette_dir / "openai-chat_completions-stream-00.yaml")) responses_path = cassette_dir / "openai-responses-stream-00.yaml" original_responses = responses_path.read_bytes() + expected["response"]["body"] = b'{ "error": "original bytes" }\n' unmatched = deepcopy(expected) unmatched["request"]["body"]["model"] = "unmatched-model" unmatched["request"]["body"]["messages"] = [{"role": "user", "content": "Unmatched input"}] diff --git a/tests/test_match_openai_cassette_responses.py b/tests/test_match_openai_cassette_responses.py index e973ee8..aaa6d23 100644 --- a/tests/test_match_openai_cassette_responses.py +++ b/tests/test_match_openai_cassette_responses.py @@ -37,6 +37,7 @@ def test_matches_real_non_streaming_cassette_and_is_idempotent( """Ensures every discovered conversation turn matches valid native output idempotently.""" chat = read_yaml(chat_path) responses = read_yaml(responses_path) + original_responses = deepcopy(responses) transport = deepcopy(chat["response"]["headers"]) match_chat_completions_response(chat, responses) @@ -65,6 +66,7 @@ def test_matches_real_non_streaming_cassette_and_is_idempotent( matched = deepcopy(chat) match_chat_completions_response(chat, responses) assert chat == matched + assert responses == original_responses @pytest.mark.parametrize("details_state", ["missing", "null"]) diff --git a/tests/test_providers.py b/tests/test_providers.py index 877fab2..f6de54c 100644 --- a/tests/test_providers.py +++ b/tests/test_providers.py @@ -18,7 +18,12 @@ def test_provider_capabilities_are_explicit_and_immutable() -> None: """Ensures provider-specific requirements are explicit and cannot be mutated.""" assert PROVIDER_CAPABILITIES == { "anthropic": ProviderCapabilities(thinking="summary", requires_search_history_state=True), + "bedrock": ProviderCapabilities(thinking="summary"), + "fireworks": ProviderCapabilities(thinking="raw"), "openai": ProviderCapabilities(thinking="summary"), + "gemini": ProviderCapabilities(thinking="summary"), + "openrouter": ProviderCapabilities(thinking="raw"), + "togetherai": ProviderCapabilities(thinking="raw"), "vllm": ProviderCapabilities(thinking="raw"), } with pytest.raises(FrozenInstanceError): @@ -36,7 +41,7 @@ def test_default_provider_is_separate_from_endpoint_selection() -> None: @pytest.mark.parametrize( ("provider", "base_url"), [ - ("openai", "https://vllm.example"), + ("anthropic", "https://vllm.example"), ("vllm", "https://api.anthropic.com"), ], ) @@ -45,6 +50,7 @@ async def test_provider_selects_capabilities_independently_of_endpoint_and_base_ provider: str, base_url: str, ) -> None: + """Ensures a supported provider selects capabilities independently of the destination.""" captured: dict[str, object] = {} def stub_events( diff --git a/tests/test_recorder_proxy.py b/tests/test_recorder_proxy.py new file mode 100644 index 0000000..25e04b6 --- /dev/null +++ b/tests/test_recorder_proxy.py @@ -0,0 +1,330 @@ +"""Offline regressions for the standalone provider evidence recorder.""" + +import json +from pathlib import Path + +import httpx +import pytest +from starlette.requests import Request +from yaml import safe_load + +from scripts import recorder_proxy + + +@pytest.fixture +def recording_dir(monkeypatch, tmp_path): + """Ensure recorder tests write temporary artifacts, never committed cassettes.""" + monkeypatch.setattr(recorder_proxy, "OUTPUT_DIR", tmp_path) + monkeypatch.setattr(recorder_proxy, "TARGET_HOST", "https://provider.test/prefix") + return tmp_path + + +def read_recording(path: Path) -> dict: + files = list(path.glob("*.yaml")) + assert len(files) == 1 + return safe_load(files[0].read_text()) + + +@pytest.mark.parametrize("stream", [False, True]) +@pytest.mark.parametrize( + ("status", "content_type", "body", "recorded_body"), + [ + (400, "application/json", b"", ""), + (502, "text/html", b"Bad gateway\n", "Bad gateway\n"), + ( + 429, + "application/json; charset=utf-8", + b'{ "error": "slow down" }\n', + {"error": "slow down"}, + ), + (400, "application/problem+json", b'{"detail":"bad request"}', {"detail": "bad request"}), + (503, "application/json", b"not json", "not json"), + (400, "application/octet-stream", b"\xff\x00", b"\xff\x00"), + (200, "application/json", b'{ "id": "result" }\n', {"id": "result"}), + ], +) +async def test_response_bytes_and_errors_survive_proxy( + monkeypatch, recording_dir, stream, status, content_type, body, recorded_body +): + """Ensures exact proxy forwarding and one recorded body for JSON, text, and binary errors.""" + requests = [] + + def handler(request): + requests.append(request) + assert str(request.url) == "https://provider.test/prefix/v1/responses" + return httpx.Response( + status, + content=body, + headers={ + "content-type": content_type, + "x-request-id": "request-1", + "retry-after": "1", + }, + ) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as upstream: + monkeypatch.setattr(recorder_proxy, "HTTP_CLIENT", upstream) + async with httpx.AsyncClient( + transport=httpx.ASGITransport(app=recorder_proxy.app), base_url="http://proxy.test" + ) as client: + response = await client.post("/v1/responses", json={"model": "m", "stream": stream}) + + assert len(requests) == 1 + assert response.status_code == status + assert response.content == body + assert response.headers["content-type"] == content_type + assert response.headers["x-request-id"] == "request-1" + captured = read_recording(recording_dir)["response"] + assert captured["body"] == recorded_body + assert "body_bytes" not in captured + assert captured["status_code"] == status + assert captured["headers"]["retry-after"] == "1" + + +class ProviderStream(httpx.AsyncByteStream): + def __init__(self, chunks, fail=False): + self.chunks = chunks + self.fail = fail + self.closed = False + + async def __aiter__(self): + for chunk in self.chunks: + yield chunk + if self.fail: + raise httpx.ReadError("URL may contain credentials") + + async def aclose(self): + self.closed = True + + +def proxy_request(): + async def receive(): + return {"type": "http.request", "body": b'{"stream":true}', "more_body": False} + + return Request( + { + "type": "http", + "method": "POST", + "path": "/v1/responses", + "headers": [(b"content-type", b"application/json")], + "query_string": b"", + }, + receive, + ) + + +@pytest.mark.parametrize( + ("chunks", "terminal", "error"), + [ + ([b'data: {"choices":[]}\n\ndata: [DONE]\n\n'], "[DONE]", False), + ( + [b'event: response.incomplete\ndata: {"type":"response.incomplete"}\n\n'], + "response.incomplete", + False, + ), + ([b'event: message_stop\ndata: {"type":"message_stop"}\n\n'], "message_stop", False), + ([b'data: {"error":{"message":"invalid request"}}\n\n'], None, True), + ([b'data: {"choices":[]}\n\n'], None, False), + ], +) +async def test_stream_capture_reports_eof_and_terminal_evidence( + monkeypatch, recording_dir, chunks, terminal, error +): + """Ensures EOF, protocol termination, and HTTP 200 stream errors remain distinct evidence.""" + source = ProviderStream(chunks) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: httpx.Response( + 200, stream=source, headers={"content-type": "text/event-stream; charset=utf-8"} + ) + ) + ) as upstream: + monkeypatch.setattr(recorder_proxy, "HTTP_CLIENT", upstream) + response = await recorder_proxy.proxy_request(proxy_request(), "v1/responses") + messages = [] + + async def send(message): + messages.append(message) + + await response.stream_response(send) + + captured = read_recording(recording_dir)["response"] + assert captured["status_code"] == 200 + assert captured["stream_status"] == "complete" + assert captured["terminal_event"] == terminal + assert captured["error_event"] == error + assert "".join(captured["sse"]).encode() == b"".join(chunks) + assert b"".join(item.get("body", b"") for item in messages) == b"".join(chunks) + assert source.closed + + +@pytest.mark.parametrize("disconnect_at", ["http.response.start", "http.response.body"]) +async def test_disconnected_stream_is_saved_and_closed(monkeypatch, recording_dir, disconnect_at): + """Ensures disconnects during headers or body save partial evidence and close transport.""" + source = ProviderStream([b'data: {"choices":[]}\n\n', b"data: [DONE]\n\n"]) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: httpx.Response( + 200, stream=source, headers={"content-type": "text/event-stream"} + ) + ) + ) as upstream: + monkeypatch.setattr(recorder_proxy, "HTTP_CLIENT", upstream) + response = await recorder_proxy.proxy_request(proxy_request(), "v1/responses") + + async def send(message): + if message["type"] == disconnect_at: + raise OSError("client disconnected") + + with pytest.raises(OSError, match="client disconnected"): + await response.stream_response(send) + + captured = read_recording(recording_dir)["response"] + assert captured["stream_status"] == "disconnected" + assert captured["terminal_event"] is None + assert not any("[DONE]" in line for line in captured["sse"]) + assert source.closed + + +async def test_failed_stream_propagates_and_retains_partial_evidence(monkeypatch, recording_dir): + """Ensures an upstream read failure is not swallowed or reported as successful completion.""" + source = ProviderStream([b'data: {"choices":[]}\n\n'], fail=True) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: httpx.Response( + 200, stream=source, headers={"content-type": "text/event-stream"} + ) + ) + ) as upstream: + monkeypatch.setattr(recorder_proxy, "HTTP_CLIENT", upstream) + response = await recorder_proxy.proxy_request(proxy_request(), "v1/responses") + + async def send(message): + pass + + with pytest.raises(httpx.ReadError): + await response.stream_response(send) + + captured = read_recording(recording_dir)["response"] + assert captured["stream_status"] == "transport_error" + assert captured["transport_error"] == "ReadError" + assert captured["terminal_event"] is None + assert captured["sse"] == ['data: {"choices":[]}\n', "\n"] + assert source.closed + + +@pytest.mark.parametrize( + ("header_secret", "api_secret", "query_secret"), + [("header-secret", "api-secret", "query-secret"), ("hdrK", "apiK", "qryK")], +) +async def test_credentials_are_masked_in_recordings_only( + monkeypatch, recording_dir, header_secret, api_secret, query_secret +): + """Ensures echoed credentials are masked while continuation state and actual traffic survive.""" + payload = { + "extra_content": {"google": {"thought_signature": "opaque-state"}}, + "key": "semantic-key", + } + + def handler(request): + assert request.headers["authorization"] == f"Bearer {header_secret}" + assert request.headers["x-api-key"] == api_secret + assert request.url.params["key"] == query_secret + assert json.loads(request.content) == payload + return httpx.Response( + 400, text=f"{header_secret} {api_secret} {query_secret} opaque-state" + ) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as upstream: + monkeypatch.setattr(recorder_proxy, "HTTP_CLIENT", upstream) + async with httpx.AsyncClient( + transport=httpx.ASGITransport(app=recorder_proxy.app), base_url="http://proxy.test" + ) as client: + response = await client.post( + f"/v1/responses?key={query_secret}", + json=payload, + headers={"authorization": f"Bearer {header_secret}", "x-api-key": api_secret}, + ) + + assert response.text == f"{header_secret} {api_secret} {query_secret} opaque-state" + captured = read_recording(recording_dir) + assert captured["request"]["body"] == payload + assert captured["request"]["query_params"]["key"] == "***" + assert captured["request"]["headers"]["authorization"] == "Bearer ***" + assert captured["response"]["body"] == "*** *** *** opaque-state" + recorded = next(recording_dir.glob("*.yaml")).read_text() + assert all(secret not in recorded for secret in (header_secret, api_secret, query_secret)) + + +@pytest.mark.parametrize("stream", [False, True]) +async def test_placeholder_credentials_do_not_rewrite_recorded_content( + monkeypatch, recording_dir, stream +): + """Ensures the known dummy key is masked in credential fields without altering content.""" + payload = {"input": "Reply EMPTY or Bearer EMPTY when the list is EMPTY.", "stream": stream} + response_text = "The list is EMPTY. Bearer EMPTY is a placeholder." + response_body = ( + f'data: {{"text": "{response_text}"}}\n\ndata: [DONE]\n\n' if stream else response_text + ) + + def handler(request): + assert request.headers["authorization"] == "Bearer EMPTY" + return httpx.Response( + 200, + text=response_body, + headers={"content-type": "text/event-stream" if stream else "text/plain"}, + ) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as upstream: + monkeypatch.setattr(recorder_proxy, "HTTP_CLIENT", upstream) + async with httpx.AsyncClient( + transport=httpx.ASGITransport(app=recorder_proxy.app), base_url="http://proxy.test" + ) as client: + response = await client.post( + "/v1/responses?key=EMPTY", + json=payload, + headers={"authorization": "Bearer EMPTY"}, + ) + + assert response.text == response_body + captured = read_recording(recording_dir) + assert captured["request"]["body"] == payload + assert captured["request"]["query_params"]["key"] == "***" + assert captured["request"]["headers"]["authorization"] == "Bearer ***" + if stream: + assert "".join(captured["response"]["sse"]) == response_body + else: + assert captured["response"]["body"] == response_body + + +@pytest.mark.parametrize("content_type", ["application/json", "text/html"]) +async def test_partial_non_streaming_error_retains_received_bytes( + monkeypatch, recording_dir, content_type +): + """Ensures truncated error bodies retain observed bytes and failure status without fabrication.""" + body = b'{"error":"truncated' if content_type == "application/json" else b"truncated" + source = ProviderStream([body], fail=True) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: httpx.Response(502, stream=source, headers={"content-type": content_type}) + ) + ) as upstream: + monkeypatch.setattr(recorder_proxy, "HTTP_CLIENT", upstream) + with pytest.raises(httpx.ReadError): + await recorder_proxy.proxy_request(proxy_request(), "v1/responses") + captured = read_recording(recording_dir)["response"] + assert captured["status_code"] == 502 + assert captured["body"] == body.decode() + assert captured["transport_error"] == "ReadError" + assert source.closed + + +def test_standalone_proxy_disables_credential_bearing_access_logs(monkeypatch, recording_dir): + """Ensures standalone startup cannot expose query credentials through Uvicorn access logs.""" + captured = {} + monkeypatch.setattr("sys.argv", ["recorder_proxy.py"]) + monkeypatch.setattr( + recorder_proxy.uvicorn, "run", lambda app, **options: captured.update(options) + ) + recorder_proxy.main() + assert captured["access_log"] is False diff --git a/tests/test_smoke_provider.py b/tests/test_smoke_provider.py new file mode 100644 index 0000000..4772472 --- /dev/null +++ b/tests/test_smoke_provider.py @@ -0,0 +1,152 @@ +"""Offline checks for the explicitly invoked live smoke runner.""" + +from types import SimpleNamespace + +import httpx +import pytest + +from molto.utils.io import dumps_sse, json_loads +from scripts import smoke_provider + + +def options(**overrides): + return SimpleNamespace( + **{ + "provider": "vllm", + "upstream": "chat/completions", + "downstream": None, + "model": "test-model", + "mode": "both", + "base_url": "https://provider.test/v1", + "extra_body": None, + "max_tokens": 128, + "max_requests": 18, + "timeout": 2, + "deadline": 10, + **overrides, + } + ) + + +def chat_response(request, *, tool_finish="tool_calls"): + body = json_loads(request.content) + tool_turn = isinstance(body.get("tool_choice"), dict) + message = {"role": "assistant", "content": None if tool_turn else "5"} + if tool_turn: + message["tool_calls"] = [ + { + "id": "call-add", + "type": "function", + "function": {"name": "add", "arguments": '{"a":2,"b":3}'}, + } + ] + finish = tool_finish if tool_turn else "stop" + common = {"id": "chat-smoke", "model": "test-model", "created": 1} + usage = {"prompt_tokens": 8, "completion_tokens": 4, "total_tokens": 12} + if body.get("stream"): + if tool_turn: + message["tool_calls"][0]["index"] = 0 + chunk = {**common, "object": "chat.completion.chunk"} + events = [ + {**chunk, "choices": [{"index": 0, "delta": message, "finish_reason": None}]}, + {**chunk, "choices": [{"index": 0, "delta": {}, "finish_reason": finish}]}, + {**chunk, "choices": [], "usage": usage}, + ] + return httpx.Response( + 200, + text="".join(dumps_sse(event) for event in events) + "data: [DONE]\n\n", + headers={"content-type": "text/event-stream"}, + ) + return httpx.Response( + 200, + json={ + **common, + "object": "chat.completion", + "choices": [{"index": 0, "message": message, "finish_reason": finish}], + "usage": usage, + }, + ) + + +def mock_http(monkeypatch, handler): + original = httpx.AsyncClient + + class MockClient(original): + def __init__(self, **kwargs): + super().__init__(transport=httpx.MockTransport(handler), **kwargs) + + monkeypatch.setattr(smoke_provider.httpx, "AsyncClient", MockClient) + + +async def test_smoke_runs_native_and_translated_tool_continuations(monkeypatch, capsys): + """Ensures the runner exercises all protocols/modes and reuses actual calls in tool history.""" + requests = [] + + def handle(request): + body = json_loads(request.content) + requests.append(body) + if body.get("tool_choice") == "none": + result = body["messages"][-1] + assert result["role"] == "tool" and result["tool_call_id"] == "call-add" + assert result["content"] in ("5", [{"type": "text", "text": "5"}]) + assert body["messages"][-2]["tool_calls"][0]["id"] == "call-add" + return chat_response(request) + + mock_http(monkeypatch, handle) + assert await smoke_provider.run(options()) == 0 + assert len(requests) == 18 + assert sum(body.get("tool_choice") == "none" for body in requests) == 6 + assert capsys.readouterr().out.count("PASS ") == 12 + + +async def test_smoke_bounds_requests_and_does_not_print_provider_errors(monkeypatch, capsys): + """Ensures bounded failed runs cannot disclose a provider's credential-bearing error text.""" + requests = [] + + def handle(request): + requests.append(request) + return httpx.Response(401, json={"error": {"message": "LEAK-SENTINEL", "type": "auth"}}) + + mock_http(monkeypatch, handle) + assert await smoke_provider.run(options(max_requests=1)) == 1 + assert len(requests) == 1 + output = capsys.readouterr().out + assert "LEAK-SENTINEL" not in output + assert "status=401" in output + assert "HTTP attempts: 1/1" in output + + +async def test_smoke_detects_incorrect_messages_tool_termination(monkeypatch, capsys): + """Ensures an end_turn response containing a tool call fails the translated smoke check.""" + mock_http(monkeypatch, lambda request: chat_response(request, tool_finish="stop")) + assert await smoke_provider.run(options(downstream=["messages"], mode="non-stream")) == 1 + assert "FAIL messages non-stream tool: AssertionError" in capsys.readouterr().out + + +@pytest.mark.parametrize("extra_body", ["{", "[]", '{"max_tokens":100000}']) +def test_smoke_rejects_invalid_extra_body_before_live_execution(extra_body): + """Ensures malformed provider options fail at argument parsing without starting live work.""" + with pytest.raises(SystemExit) as error: + smoke_provider.main( + [ + "--provider", + "vllm", + "--model", + "test", + "--upstream", + "responses", + "--extra-body", + extra_body, + ] + ) + assert error.value.code == 2 + + +@pytest.mark.parametrize("limit", ["--max-tokens", "--max-requests", "--timeout", "--deadline"]) +def test_smoke_rejects_nonpositive_limits(limit): + """Ensures invalid bounds fail before any provider traffic starts.""" + with pytest.raises(SystemExit) as error: + smoke_provider.main( + ["--provider", "vllm", "--model", "test", "--upstream", "responses", limit, "0"] + ) + assert error.value.code == 2 diff --git a/tests/types/test_normalized.py b/tests/types/test_normalized.py index 19ab576..5bc4e8f 100644 --- a/tests/types/test_normalized.py +++ b/tests/types/test_normalized.py @@ -442,28 +442,18 @@ def test_user_input_preserves_ordered_text_and_image_parts(): assert message.content[2].content == "after" -@pytest.mark.parametrize( - "values", - [ - {"content": "raw", "summary": "summary"}, - {"content": "raw", "summary": "", "signature": "opaque-state"}, - ], -) -def test_thinking_rejects_contradictory_representations(values: dict) -> None: - with pytest.raises(ValidationError): - Thinking(**values) - - -@pytest.mark.parametrize( - "values", - [ - {"content_delta": "raw", "summary_delta": "summary"}, - {"content_delta": "raw", "signature_delta": "opaque-state"}, - ], -) -def test_thinking_delta_rejects_contradictory_representations(values: dict) -> None: - with pytest.raises(ValidationError): - ThinkingDelta(**values) +def test_thinking_preserves_independent_representations_and_signature() -> None: + """Ensures a part and its delta can carry raw text, a summary, and opaque state together.""" + part = Thinking(content="raw", summary="summary", signature="opaque-state") + delta = ThinkingDelta( + content_delta="raw", summary_delta="summary", signature_delta="opaque-state" + ) + assert (part.content, part.summary, part.signature) == ("raw", "summary", "opaque-state") + assert (delta.content_delta, delta.summary_delta, delta.signature_delta) == ( + "raw", + "summary", + "opaque-state", + ) def test_thinking_keeps_protocol_specific_valid_states() -> None: diff --git a/tests/types/test_openai_responses.py b/tests/types/test_openai_responses.py index 706e933..5d874ac 100644 --- a/tests/types/test_openai_responses.py +++ b/tests/types/test_openai_responses.py @@ -1,5 +1,6 @@ import inspect from copy import deepcopy +from pathlib import Path from typing import get_args import pytest @@ -17,6 +18,7 @@ from pydantic import TypeAdapter, ValidationError, create_model from molto.types.openai_responses import ( + OpenAICompatibleResponsesResponse, OpenAIResponsesCreateRequest, OpenAIResponsesInputItemParam, OpenAIResponsesResponse, @@ -28,6 +30,26 @@ ResponseOutputMessageOptionalIDParam, ResponseReasoningItemOptionalIDParam, ) +from molto.utils.io import read_yaml + + +@pytest.mark.parametrize("strictness", [{}, {"strict": False}, {"strict": True}, {"strict": None}]) +def test_function_tool_preserves_optional_strictness(strictness): + """Ensures omitted strictness stays omitted and explicit values retain existing serialization.""" + tool = {"type": "function", "name": "add", "parameters": {}, **strictness} + request = OpenAIResponsesCreateRequest(model="m", tools=[tool]) + expected = {key: value for key, value in tool.items() if value is not None} + assert request.model_dump()["tools"] == [expected] + assert request.model_dump()["tools"] == [expected] + + +@pytest.mark.parametrize("field", ["type", "name", "parameters"]) +def test_function_tool_still_requires_sdk_identity_and_schema(field): + """Ensures optional strictness does not loosen other required function definition fields.""" + tool = {"type": "function", "name": "add", "parameters": {}} + del tool[field] + with pytest.raises(ValidationError): + OpenAIResponsesCreateRequest(model="m", tools=[tool]) def test_request_fields_match_responses_create_body_parameters(): @@ -439,6 +461,31 @@ def test_non_streaming_response_uses_sdk_model(): assert response.model_dump()["object"] == "response" +@pytest.mark.parametrize("writes", [{}, {"cache_write_tokens": None}, {"cache_write_tokens": 0}]) +def test_compatible_response_preserves_reported_cache_writes(writes): + """Ensures only the optional cache-write count differs from the pinned SDK schema.""" + path = ( + Path(__file__).parents[1] + / "cassettes/upstream_ir/tool_use_reasoning_low/fireworks-responses-non_stream-00.yaml" + ) + body = read_yaml(path)["response"]["body"] + details = body["usage"]["input_tokens_details"] + assert "cache_write_tokens" not in details + details.update(writes) + response = OpenAICompatibleResponsesResponse.model_validate(body) + assert response.usage.input_tokens_details.cache_write_tokens == writes.get( + "cache_write_tokens" + ) + for kind in ("completed", "created", "failed", "in_progress", "incomplete", "queued"): + event = OpenAIResponsesStreamEventAdapter.validate_python( + {"type": f"response.{kind}", "sequence_number": 0, "response": body} + ) + assert event.response.usage.input_tokens_details == response.usage.input_tokens_details + del details["cached_tokens"] + with pytest.raises(ValidationError, match="cached_tokens"): + OpenAICompatibleResponsesResponse.model_validate(body) + + def test_stream_event_union_wraps_every_sdk_event_and_field(): molto_events = get_args(get_args(OpenAIResponsesStreamEvent)[0]) sdk_events = get_args(get_args(ResponseStreamEvent)[0]) diff --git a/tests/types/test_provider_history.py b/tests/types/test_provider_history.py new file mode 100644 index 0000000..1aae029 --- /dev/null +++ b/tests/types/test_provider_history.py @@ -0,0 +1,138 @@ +"""Synthetic provider history boundaries; these cases do not certify live models.""" + +from copy import deepcopy + +import pytest +from openai.types.chat import ChatCompletionMessage +from openai.types.responses import ResponseReasoningItem +from pydantic import ValidationError + +from molto.types.openai_chat_completions import OpenAIChatCompletionsCreateRequest +from molto.types.openai_responses import OpenAIResponsesCreateRequest + + +@pytest.mark.parametrize( + "call", + [ + {"id": "call_1", "type": "function", "function": {"name": "add", "arguments": '{"a":2}'}}, + {"id": "call_2", "type": "custom", "custom": {"name": "code", "input": " x\n"}}, + ], +) +def test_tool_history_is_eager_and_repeatable(call): + """Ensures function and custom calls survive repeated serialization without lazy iterators.""" + message = {"role": "assistant", "content": None, "tool_calls": [call]} + request = OpenAIChatCompletionsCreateRequest(model="model", messages=[message]) + expected = {"model": "model", "messages": [message]} + assert request.model_dump(warnings="error") == expected + assert request.model_dump(warnings="error") == expected + + +@pytest.mark.parametrize("kind", ["function", "custom"]) +@pytest.mark.parametrize( + "corruption", + ["index", "missing_id", "missing_name", "missing_payload", "extra", "nested_extra"], +) +def test_tool_history_rejects_corruption_at_construction(kind, corruption): + """Ensures malformed call history fails before transport instead of disappearing on dump.""" + payload = "arguments" if kind == "function" else "input" + call = {"id": "call_1", "type": kind, kind: {"name": "tool", payload: "{}"}} + if corruption == "index": + call["index"] = 0 + elif corruption == "missing_id": + del call["id"] + elif corruption == "missing_name": + del call[kind]["name"] + elif corruption == "missing_payload": + del call[kind][payload] + elif corruption == "extra": + call["unexpected"] = True + else: + call[kind]["unexpected"] = True + with pytest.raises(ValidationError): + OpenAIChatCompletionsCreateRequest( + model="model", messages=[{"role": "assistant", "tool_calls": [call]}] + ) + + +def google_state(value): + return {"google": {"thought_signature": value}} + + +@pytest.mark.parametrize("role", ["user", "system", "developer", "assistant", "tool"]) +@pytest.mark.parametrize("parts", [False, True]) +def test_google_message_and_part_attachments_remain_independent(role, parts): + """Ensures opaque message and individual part values remain at their original attachments.""" + message = {"role": role, "content": "Text", "extra_content": google_state(" message\n")} + if parts: + message["content"] = [ + {"type": "text", "text": "First", "extra_content": google_state("part-1")}, + {"type": "text", "text": "Second", "extra_content": google_state("part-2")}, + ] + if role == "tool": + message["tool_call_id"] = "call_1" + message["extra_content"]["google"]["parts"] = [ + { + "file_data": { + "mime_type": "application/pdf", + "display_name": "report", + "file_uri": "gs://example/report.pdf", + } + } + ] + original = deepcopy(message) + request = OpenAIChatCompletionsCreateRequest(model="model", messages=[message]) + assert request.model_dump()["messages"] == [original] + assert request.model_dump()["messages"] == [original] + assert message == original + + +def test_google_parallel_calls_preserve_distinct_opaque_state(): + """Ensures each parallel call retains its own signature, identity and argument bytes.""" + message = ChatCompletionMessage.model_validate( + { + "role": "assistant", + "content": None, + "extra_content": google_state("message"), + "tool_calls": [ + { + "id": f"call_{i}", + "type": "function", + "function": {"name": "add", "arguments": f'{{"a":{i}}}'}, + "extra_content": google_state(f"call-{i}"), + } + for i in range(2) + ], + } + ).model_dump(exclude_unset=True) + request = OpenAIChatCompletionsCreateRequest(model="model", messages=[message]) + assert request.model_dump(warnings="error")["messages"] == [message] + assert request.model_dump(warnings="error")["messages"] == [message] + + +@pytest.mark.parametrize( + "extension", [{"other": {}}, {"google": {}, "other": {}}, {"google": "bad"}, None] +) +def test_google_extension_rejects_unknown_namespaces(extension): + """Ensures the extension is a narrow Google envelope rather than arbitrary request extras.""" + with pytest.raises(ValidationError): + OpenAIChatCompletionsCreateRequest( + model="model", + messages=[{"role": "user", "content": "Text", "extra_content": extension}], + ) + + +def test_openrouter_reasoning_format_round_trips_sdk_history(): + """Ensures SDK-retained reasoning format survives repeated native history serialization.""" + item = ResponseReasoningItem.model_validate( + { + "id": "rs_1", + "type": "reasoning", + "summary": [], + "content": [{"type": "reasoning_text", "text": " Think\n"}], + "status": "completed", + "format": "unknown", + } + ).model_dump(exclude_unset=True) + request = OpenAIResponsesCreateRequest(model="model", input=[item]) + assert request.model_dump()["input"] == [item] + assert request.model_dump()["input"] == [item] diff --git a/tests/upstream/test_anthropic.py b/tests/upstream/test_anthropic.py index f9e1d41..2c90fa3 100644 --- a/tests/upstream/test_anthropic.py +++ b/tests/upstream/test_anthropic.py @@ -215,19 +215,17 @@ async def stub_native_events( @pytest.mark.parametrize( - ("capabilities", "thinking_delta", "thinking", "preserves_signature"), + ("capabilities", "thinking_delta", "thinking"), [ ( VLLM_CAPABILITIES, ThinkingDelta(content_delta="Thought"), - Thinking(content="Thought", summary=""), - False, + Thinking(content="Thought", summary="", signature="replacement-state"), ), ( PROVIDER_CAPABILITIES["anthropic"], ThinkingDelta(summary_delta="Thought"), Thinking(content="", summary="Thought", signature="replacement-state"), - True, ), ], ) @@ -236,8 +234,8 @@ async def test_client_maps_streamed_signatures_to_ir( capabilities: ProviderCapabilities, thinking_delta: ThinkingDelta, thinking: Thinking, - preserves_signature: bool, ): + """Ensures both raw and summarized thinking retain the latest signature.""" native_events = [ { "type": "message_start", @@ -318,11 +316,9 @@ async def stub_native_events( ] part_end = next(event for event in events if isinstance(event, PartEndEvent)) assert isinstance(part_start.part, Thinking) - assert part_start.part.signature == ("initial-state" if preserves_signature else None) + assert part_start.part.signature == "initial-state" assert text_delta.delta == thinking_delta - assert [event.delta.signature_delta for event in signature_deltas] == ( - ["replacement-state"] if preserves_signature else [] - ) + assert [event.delta.signature_delta for event in signature_deltas] == ["replacement-state"] assert isinstance(part_end.part, Thinking) assert part_end.part == thinking @@ -627,8 +623,7 @@ async def test_client_preserves_unsigned_summary_completion( async def test_client_completes_thinking_block_without_deltas( monkeypatch: pytest.MonkeyPatch, ) -> None: - # A thinking block whose text is complete at block start still gets a - # balanced part lifecycle: the deferred start is flushed at block stop. + """Ensures a raw block complete at start retains its text and signature through block stop.""" native_events = [ _MESSAGE_START, { @@ -652,8 +647,12 @@ async def test_client_completes_thinking_block_without_deltas( if isinstance(event, (PartStartEvent, PartDeltaEvent, PartEndEvent)) ] assert part_events == [ - PartStartEvent(index=0, part=Thinking(content="Settled thought", summary="")), - PartEndEvent(index=0, part=Thinking(content="Settled thought", summary="")), + PartStartEvent( + index=0, part=Thinking(content="Settled thought", summary="", signature="sig-1") + ), + PartEndEvent( + index=0, part=Thinking(content="Settled thought", summary="", signature="sig-1") + ), ] @@ -762,15 +761,36 @@ def test_adapter_maps_thinking_configuration_to_reasoning_effort( {"type": "enabled", "budget_tokens": 10_000, "display": "summarized"}, None, ), + ( + "anthropic.claude-sonnet-4-5-20250929-v1:0", + "medium", + {"type": "enabled", "budget_tokens": 10_000, "display": "summarized"}, + None, + ), + ( + "us.anthropic.claude-haiku-4-5-20251001-v1:0", + "medium", + {"type": "enabled", "budget_tokens": 10_000, "display": "summarized"}, + None, + ), + ( + "global.anthropic.claude-sonnet-5", + "xhigh", + {"type": "adaptive", "display": "summarized"}, + {"effort": "xhigh"}, + ), ], ) +@pytest.mark.parametrize("prefix", ["", "vendor/", "custom.route."]) def test_client_selects_model_supported_thinking_configuration( model: str, effort: str, thinking: dict, output_config: dict | None, + prefix: str, ): - """Ensures thinking mode and effort follow the target model capabilities.""" + """Ensures thinking follows Claude capabilities regardless of provider/model prefixes.""" + model = prefix + model body = AnthropicMessagesClient._native_request( NormalizedRequest( input=[UserInput(content=[TextInput(content="Hello")])], @@ -783,6 +803,7 @@ def test_client_selects_model_supported_thinking_configuration( assert body["thinking"] == thinking assert body.get("output_config") == output_config + assert body["model"] == model def test_client_projects_user_text_as_content_block_list(): @@ -1115,17 +1136,21 @@ def test_client_uses_summary_when_reasoning_history_omits_raw_content(): } -def test_client_rejects_reasoning_history_outside_capability() -> None: - """Ensures reasoning history respects the selected provider capability.""" +def test_client_prefers_content_for_complete_history() -> None: + """Ensures complete Messages history prefers raw text and preserves its signature.""" request = NormalizedRequest( - input=[Thinking(content="", summary="Summary", signature="opaque-state")], + input=[Thinking(content="Raw", summary="Summary", signature="opaque-state")], max_output_tokens=100, model="model", stream=True, ) - with pytest.raises(UnsupportedInput, match="does not match the provider"): - AnthropicMessagesClient._native_request(request, capabilities=VLLM_CAPABILITIES) + body = AnthropicMessagesClient._native_request( + request, capabilities=PROVIDER_CAPABILITIES["anthropic"] + ).model_dump() + assert body["messages"][0]["content"] == [ + {"type": "thinking", "thinking": "Raw", "signature": "opaque-state"} + ] def test_client_disables_thinking_without_output_effort(): diff --git a/tests/upstream/test_fireworks.py b/tests/upstream/test_fireworks.py new file mode 100644 index 0000000..cf41f8a --- /dev/null +++ b/tests/upstream/test_fireworks.py @@ -0,0 +1,77 @@ +"""Fireworks reasoning semantics retain native wire labels for continuation.""" + +import httpx +import pytest + +from molto.providers import ProviderCapabilities +from molto.types.normalized import ( + NormalizedRequest, + PartDeltaEvent, + PartEndEvent, + PartStartEvent, + Thinking, + ThinkingDelta, +) +from molto.types.openai_responses import OpenAIResponsesStreamEventAdapter +from molto.upstream.fireworks import FireworksChatCompletionsClient, FireworksResponsesClient + + +@pytest.mark.parametrize("client_type", [FireworksChatCompletionsClient, FireworksResponsesClient]) +def test_fireworks_resolves_raw_profile_without_mutating_input(client_type): + """Ensures both Fireworks clients retain raw policy even with a supplied summary profile.""" + profile = ProviderCapabilities(thinking="summary") + assert client_type.resolve_capabilities(profile).thinking == "raw" + assert profile.thinking == "summary" + + +async def test_summary_labeled_lifecycle_retains_wire_labels(monkeypatch): + """Ensures Fireworks summary labels survive every part of the Responses lifecycle.""" + items = [ + { + "type": "response.output_item.added", + "item": { + "type": "reasoning", + "id": "rs_1", + "summary": [{"type": "summary_text", "text": "A"}], + }, + }, + { + "type": "response.reasoning_summary_part.added", + "item_id": "rs_1", + "summary_index": 0, + "part": {"type": "summary_text", "text": "B"}, + }, + { + "type": "response.reasoning_summary_text.delta", + "item_id": "rs_1", + "summary_index": 0, + "delta": "C", + }, + { + "type": "response.output_item.done", + "item": { + "type": "reasoning", + "id": "rs_1", + "summary": [{"type": "summary_text", "text": "ABC"}], + }, + }, + ] + + async def native_events(request): + for index, item in enumerate(items): + yield OpenAIResponsesStreamEventAdapter.validate_python( + {"output_index": 0, "sequence_number": index, **item} + ) + + async with httpx.AsyncClient() as transport: + client = FireworksResponsesClient( + transport, capabilities=ProviderCapabilities(thinking="raw") + ) + monkeypatch.setattr(client, "native_events", native_events) + events = [event async for event in client.events(NormalizedRequest(model="m"))] + assert events == [ + PartStartEvent(index=0, part=Thinking(id="rs_1", content="", summary="A")), + PartDeltaEvent(index=0, delta=ThinkingDelta(summary_delta="B")), + PartDeltaEvent(index=0, delta=ThinkingDelta(summary_delta="C")), + PartEndEvent(index=0, part=Thinking(id="rs_1", content="", summary="ABC")), + ] diff --git a/tests/upstream/test_gemini.py b/tests/upstream/test_gemini.py new file mode 100644 index 0000000..37b868a --- /dev/null +++ b/tests/upstream/test_gemini.py @@ -0,0 +1,115 @@ +"""Supplementary synthetic Gemini history cases; provider validation is separate.""" + +import pytest + +from molto.types.exceptions import UnsupportedInput +from molto.types.normalized import ( + AssistantInput, + NormalizedRequest, + TextOutput, + Thinking, + ToolCall, +) +from molto.upstream.gemini import GeminiChatCompletionsClient + + +@pytest.mark.parametrize("tool", [False, True]) +@pytest.mark.parametrize("explicit_reasoning", [False, True]) +def test_signature_prefix_does_not_split_pending_reasoning(tool, explicit_reasoning): + """Ensures signature-only prefixes join pending reasoning while explicit messages stay separate.""" + reasoning = Thinking(content="", summary="Consider this") + content = ( + ToolCall(tool_call_id="call_1", tool_name="lookup", args="{}") + if tool + else TextOutput(content="Answer") + ) + request = NormalizedRequest( + model="synthetic", + input=[ + AssistantInput(content=[reasoning]) if explicit_reasoning else reasoning, + Thinking(content="", summary="", signature="opaque"), + AssistantInput(content=[content]), + AssistantInput(content=[TextOutput(content="Separate")]), + ], + ) + original = request.model_copy(deep=True) + extension = {"extra_content": {"google": {"thought_signature": "opaque"}}} + message = { + "role": "assistant", + **( + { + "tool_calls": [ + { + "id": "call_1", + "type": "function", + "function": {"name": "lookup", "arguments": "{}"}, + **extension, + } + ] + } + if tool + else {"content": "Answer", **extension} + ), + } + expected = [message, {"role": "assistant", "content": "Separate"}] + if explicit_reasoning: + expected.insert(0, {"role": "assistant", "reasoning_content": "Consider this"}) + else: + message["reasoning_content"] = "Consider this" + assert ( + GeminiChatCompletionsClient._native_request(request).model_dump()["messages"] == expected + ) + assert request == original + + +@pytest.mark.parametrize("tool", [False, True]) +def test_signature_filtering_preserves_reasoning_order_validation(tool): + """Ensures removing signature-only parts never admits reasoning after text or calls.""" + content = ( + ToolCall(tool_call_id="call_1", tool_name="lookup", args="{}") + if tool + else TextOutput(content="Answer") + ) + request = NormalizedRequest( + model="synthetic", + input=[ + AssistantInput( + content=[ + Thinking(content="", summary="", signature="opaque"), + content, + Thinking(content="", summary="Too late"), + ] + ) + ], + ) + with pytest.raises(UnsupportedInput, match="reasoning order"): + GeminiChatCompletionsClient._native_request(request) + + +def test_signed_reasoning_parts_stay_in_separate_chat_history_entries(): + """Ensures each text-bearing reasoning part keeps its own signature and tools retain their IDs.""" + parts = [ + Thinking(content="first", summary="discarded summary", signature="s1"), + Thinking(content="", summary="second", signature="s2"), + TextOutput(content="answer"), + Thinking(content="", summary="", signature="tool"), + ToolCall(tool_call_id="call_1", tool_name="lookup", args="{}"), + ] + request = NormalizedRequest(model="model", input=[AssistantInput(content=parts)]) + first, second = GeminiChatCompletionsClient._native_request(request).model_dump()["messages"] + assert first == { + "role": "assistant", + "reasoning_content": "first", + "extra_content": {"google": {"thought_signature": "s1"}}, + } + assert second["reasoning_content"] == "second" + assert second["content"] == "answer" + assert second["extra_content"] == {"google": {"thought_signature": "s2"}} + assert second["tool_calls"] == [ + { + "id": "call_1", + "type": "function", + "function": {"name": "lookup", "arguments": "{}"}, + "extra_content": {"google": {"thought_signature": "tool"}}, + } + ] diff --git a/tests/upstream/test_multi_turn.py b/tests/upstream/test_multi_turn.py index 54f6575..6e314ac 100644 --- a/tests/upstream/test_multi_turn.py +++ b/tests/upstream/test_multi_turn.py @@ -1,13 +1,21 @@ from contextlib import asynccontextmanager +from copy import deepcopy from pathlib import Path import httpx import pytest +from anthropic import AsyncAnthropic, omit +from anthropic.lib.streaming._messages import accumulate_event +from openai import AsyncOpenAI +from openai.lib.streaming.chat import ChatCompletionStreamState +from molto import Molto +from molto.adapters.openai import OpenAIChatCompletionsAdapter from molto.providers import PROVIDER_CAPABILITIES from molto.types.normalized import ( AssistantInput, FunctionTool, + FunctionToolChoice, ImageUrlInput, ModelResponseStreamEvent, NormalizedRequest, @@ -27,25 +35,50 @@ ToolReturn, UserInput, ) +from molto.types.openai_chat_completions import OpenAIChatCompletionsCreateRequest from molto.upstream.anthropic import AnthropicMessagesClient +from molto.upstream.bedrock import ( + BedrockChatCompletionsClient, + BedrockMessagesClient, + BedrockResponsesClient, +) +from molto.upstream.fireworks import FireworksChatCompletionsClient, FireworksResponsesClient +from molto.upstream.gemini import GeminiChatCompletionsClient from molto.upstream.openai import OpenAIChatCompletionsClient, OpenAIResponsesClient -from molto.utils.io import json_loads, read_yaml +from molto.upstream.openrouter import OpenRouterResponsesClient +from molto.upstream.together import TogetherAIChatCompletionsClient, TogetherAIResponsesClient +from molto.utils.io import json_dumps, json_loads, read_yaml -CLIENTS = [OpenAIResponsesClient, OpenAIChatCompletionsClient, AnthropicMessagesClient] -REASONING_CLIENTS = [OpenAIResponsesClient, AnthropicMessagesClient] -CASSETTE_DIR = Path(__file__).parents[1] / "cassettes" / "upstream_ir" -CLIENT_SETTINGS = { +CLIENTS = { OpenAIResponsesClient: ("openai", "responses"), OpenAIChatCompletionsClient: ("openai", "chat_completions"), AnthropicMessagesClient: ("anthropic", "messages"), + BedrockResponsesClient: ("bedrock", "responses"), + BedrockChatCompletionsClient: ("bedrock", "chat_completions"), + BedrockMessagesClient: ("bedrock", "messages"), + FireworksResponsesClient: ("fireworks", "responses"), + FireworksChatCompletionsClient: ("fireworks", "chat_completions"), + GeminiChatCompletionsClient: ("gemini", "chat_completions"), + OpenRouterResponsesClient: ("openrouter", "responses"), + TogetherAIResponsesClient: ("togetherai", "responses"), + TogetherAIChatCompletionsClient: ("togetherai", "chat_completions"), } +# The original scenario prompts belong to these providers' own recordings. +# Hosted captures below use their recorded prompts and available scenarios. +CANONICAL_CLIENTS = [ + client for client, (provider, _) in CLIENTS.items() if provider in {"openai", "anthropic"} +] +REASONING_CLIENTS = [ + client for client in CANONICAL_CLIENTS if CLIENTS[client][1] != "chat_completions" +] +CASSETTE_DIR = Path(__file__).parents[1] / "cassettes" / "upstream_ir" @asynccontextmanager async def _replay_client( client_type, scenario: str, turns: int, *, requests: list[httpx.Request] | None = None ): - provider, endpoint = CLIENT_SETTINGS[client_type] + provider, endpoint = CLIENTS[client_type] cassettes = [ read_yaml(CASSETTE_DIR / scenario / f"{provider}-{endpoint}-stream-{turn:02}.yaml") for turn in range(turns) @@ -86,14 +119,24 @@ def handle(request: httpx.Request) -> httpx.Response: assert consumed == turns, "Not all conversation turns were replayed" -def _assert_ir(events: list[ModelResponseStreamEvent]) -> list[TextOutput | ToolCall | Thinking]: +def _assert_ir( + events: list[ModelResponseStreamEvent], + *, + tool_name="read_file", + source_timestamps=None, + raw_reasoning=False, + termination_reason=None, +) -> list[TextOutput | ToolCall | Thinking]: """Check lifecycle balance and reconstruct each completed part from its deltas.""" start, end = events[0], events[-1] assert isinstance(start, ResponseStartEvent) assert isinstance(end, ResponseEndEvent) assert start.id == end.id and start.id assert start.model == end.model and start.model - assert start.created_at == end.created_at + if source_timestamps is None: + assert start.created_at == end.created_at + else: + assert (start.created_at, end.created_at) == source_timestamps assert end.stop_sequence is None usage = end.usage assert usage is not None @@ -101,18 +144,21 @@ def _assert_ir(events: list[ModelResponseStreamEvent]) -> list[TextOutput | Tool assert usage.output_tokens > 0 assert usage.total_tokens == usage.input_tokens + usage.output_tokens assert 0 <= usage.input_tokens_details.cached_tokens <= usage.input_tokens - assert 0 <= usage.input_tokens_details.cache_write_tokens <= usage.input_tokens + if usage.input_tokens_details.cache_write_tokens is not None: + assert 0 <= usage.input_tokens_details.cache_write_tokens <= usage.input_tokens assert 0 <= usage.output_tokens_details.reasoning_tokens <= usage.output_tokens - parts = [] - active = None + parts = {} + active_parts = {} for event in events[1:-1]: assert isinstance(event, (PartStartEvent, PartDeltaEvent, PartEndEvent)) - assert event.index == len(parts) if isinstance(event, PartStartEvent): - assert active is None - active = event.part.model_copy(deep=True) - elif isinstance(event, PartDeltaEvent): + assert event.index == len(parts) + len(active_parts) + active_parts[event.index] = event.part.model_copy(deep=True) + continue + assert event.index in active_parts + active = active_parts[event.index] + if isinstance(event, PartDeltaEvent): delta = event.delta if isinstance(delta, TextDelta): assert isinstance(active, TextOutput) @@ -126,8 +172,12 @@ def _assert_ir(events: list[ModelResponseStreamEvent]) -> list[TextOutput | Tool else: assert isinstance(delta, ThinkingDelta) assert isinstance(active, Thinking) - assert not delta.content_delta - active.summary += delta.summary_delta or "" + if raw_reasoning: + assert not delta.summary_delta and not delta.signature_delta + active.content += delta.content_delta or "" + else: + assert not delta.content_delta + active.summary += delta.summary_delta or "" if delta.signature_delta is not None: # Opaque state is a replacement snapshot, never a text fragment. active.signature = delta.signature_delta @@ -137,25 +187,32 @@ def _assert_ir(events: list[ModelResponseStreamEvent]) -> list[TextOutput | Tool assert active.content.strip() elif isinstance(active, ToolCall): assert active.tool_call_id - assert active.tool_name == "read_file" + assert active.tool_name == tool_name args = json_loads(active.args) - assert isinstance(args, dict) and set(args) == {"path"} - assert isinstance(args["path"], str) and args["path"] + assert isinstance(args, dict) + if tool_name == "read_file": + assert set(args) == {"path"} + assert isinstance(args["path"], str) and args["path"] else: assert isinstance(active, Thinking) - assert active.content == "" - assert active.signature - parts.append(event.part) - active = None - assert active is None + if raw_reasoning: + assert active.content and not active.summary and not active.signature + else: + assert active.content == "" + assert active.summary or active.signature + parts[event.index] = event.part + del active_parts[event.index] + assert not active_parts assert parts + parts = [parts[index] for index in range(len(parts))] assert end.termination_reason == ( - "tool_call" if any(isinstance(part, ToolCall) for part in parts) else "stop" + termination_reason + or ("tool_call" if any(isinstance(part, ToolCall) for part in parts) else "stop") ) return parts -@pytest.mark.parametrize("client_type", CLIENTS, ids=lambda cls: cls.__name__) +@pytest.mark.parametrize("client_type", CANONICAL_CLIENTS, ids=lambda cls: cls.__name__) async def test_multi_turn_text_chat(client_type) -> None: """Ensures all clients emit coherent text IR and preserve assistant history.""" async with _replay_client(client_type, "text_chat", turns=2) as (client, model): @@ -181,7 +238,7 @@ async def test_multi_turn_text_chat(client_type) -> None: ) -@pytest.mark.parametrize("client_type", CLIENTS, ids=lambda cls: cls.__name__) +@pytest.mark.parametrize("client_type", CANONICAL_CLIENTS, ids=lambda cls: cls.__name__) async def test_multi_turn_text_and_image_chat(client_type) -> None: """Ensures mixed text/image parts stay in one user message across conversation turns.""" requests = [] @@ -240,7 +297,7 @@ async def test_multi_turn_text_and_image_chat(client_type) -> None: request.input.append(AssistantInput(content=parts)) -@pytest.mark.parametrize("client_type", CLIENTS, ids=lambda cls: cls.__name__) +@pytest.mark.parametrize("client_type", CANONICAL_CLIENTS, ids=lambda cls: cls.__name__) async def test_multi_turn_consecutive_user_text_inputs(client_type) -> None: """Ensures adjacent user messages and text parts retain their boundaries across turns.""" requests = [] @@ -376,7 +433,7 @@ async def _assert_tool_conversation(client_type, *, reasoning: bool) -> None: assert continued_thinking is reasoning -@pytest.mark.parametrize("client_type", CLIENTS, ids=lambda cls: cls.__name__) +@pytest.mark.parametrize("client_type", CANONICAL_CLIENTS, ids=lambda cls: cls.__name__) async def test_multi_turn_tool_use(client_type) -> None: """Ensures tool IR preserves JSON arguments, call identity, results, and final text.""" await _assert_tool_conversation(client_type, reasoning=False) @@ -386,3 +443,1543 @@ async def test_multi_turn_tool_use(client_type) -> None: async def test_multi_turn_tool_use_with_reasoning(client_type) -> None: """Ensures reasoning summaries and opaque state survive a complete tool conversation.""" await _assert_tool_conversation(client_type, reasoning=True) + + +# Only provider-owned recordings belong in this matrix. Missing scenarios are +# absent coverage, never canonical fixtures relabeled as another provider. +PROVIDER_CLIENTS = { + (provider, endpoint): client + for client, (provider, endpoint) in CLIENTS.items() + if client not in CANONICAL_CLIENTS +} +GEMINI_COMBINED_SCENARIOS = ("reasoning_combined_control", "reasoning_combined") +PROVIDER_NATIVE_CONVERSATIONS = [ + pytest.param( + provider, endpoint, scenario.name, mode, id=f"{provider}-{endpoint}-{scenario.name}-{mode}" + ) + for provider, endpoint in PROVIDER_CLIENTS + for scenario in sorted(CASSETTE_DIR.iterdir()) + if scenario.is_dir() + for mode in ("stream", "non_stream", "mixed") + if (scenario / f"{provider}-{endpoint}-{mode}-00.yaml").exists() +] + [ + # These probes share previously recorded first turns. Only turn 01 is new. + pytest.param("gemini", "chat_completions", scenario, mode, id=f"gemini-{scenario}-{mode}") + for scenario in GEMINI_COMBINED_SCENARIOS + for mode in ("stream", "non_stream") +] + +PROVIDER_RESPONSES_CONVERSATIONS = [ + pytest.param(case.values[0], case.values[2], case.values[3], id=case.id) + for case in PROVIDER_NATIVE_CONVERSATIONS + if case.values[1] == "responses" +] + + +def _provider_turns(provider, scenario, mode, endpoint="responses"): + return [ + read_yaml(path) + for path in sorted((CASSETTE_DIR / scenario).glob(f"{provider}-{endpoint}-{mode}-*.yaml")) + ] + + +def _sdk_body(body): + """Keep provider extensions separate from the SDK's native arguments.""" + body = deepcopy(body) + extension_keys = ("provider",) if "input" in body else ("provider", "reasoning", "extra_body") + extras = {key: body.pop(key) for key in extension_keys if key in body} + return body, extras + + +def _recorded_response(cassette): + response = cassette["response"] + if "sse" in response: + return httpx.Response( + response["status_code"], + text="".join(response["sse"]), + headers={"content-type": "text/event-stream"}, + ) + body = response["body"] + if isinstance(body, (dict, list)): + return httpx.Response(response["status_code"], json=body) + return httpx.Response( + response["status_code"], + content=body, + headers={"content-type": "application/json"}, + ) + + +def _with_unmodelled_output_extensions(cassette): + """Add synthetic extension fields to an in-memory copy of recorded stream evidence.""" + cassette = deepcopy(cassette) + for index, line in enumerate(cassette["response"]["sse"]): + if not line.startswith("data: ") or line.strip() == "data: [DONE]": + continue + event = json_loads(line[6:]) + for choice in event.get("choices", []): + delta = choice["delta"] + delta["extra_content"] = {"vendor": {"extension": True}} + for call in delta.get("tool_calls") or []: + call["extra_content"] = {"vendor": {"extension": True}} + items = [event.get("item", {}), *event.get("response", {}).get("output", [])] + for item in items: + if item.get("type") == "reasoning": + item["format"] = "vendor-format" + cassette["response"]["sse"][index] = f"data: {json_dumps(event)}\n" + return cassette + + +async def _collect_responses(result, stream): + if not stream: + return result, None + async with result: + events = [event async for event in result] + completed = [event.response for event in events if event.type == "response.completed"] + assert len(completed) == 1 + return completed[0], [event.model_dump() for event in events] + + +async def _collect_chat(result, stream, *, repair_single_call_index=False): + if not stream: + return result, None + state = ChatCompletionStreamState() + async with result: + events = [event async for event in result] + if repair_single_call_index: + # The Gemini recordings contain one complete, unindexed call per response. + # Repair SDK reference copies only; Molto output must already carry indices. + events = [event.model_copy(deep=True) for event in events] + tools = [ + tool + for event in events + for choice in event.choices + for tool in choice.delta.tool_calls or [] + ] + assert len(tools) <= 1 + for tool in tools: + assert tool.index is None and tool.id + tool.index = 0 + for event in events: + state.handle_chunk(event) + return state.get_final_completion(), [event.model_dump() for event in events] + + +async def _collect_messages(result, stream): + if not stream: + return result, None + snapshot = None + async with result: + events = [event async for event in result] + for event in events: + snapshot = accumulate_event(event=event, current_snapshot=snapshot) + assert snapshot is not None + return snapshot, [event.model_dump() for event in events] + + +def _messages_history(message): + """Carry actual SDK content into history exactly as the Messages recording driver does.""" + return { + "role": message.role, + "content": [block.model_dump(exclude_unset=True) for block in message.content], + } + + +def _chat_history(message, provider, *, omit_output_fields=False): + """Reproduce the recording driver's actual SDK-output history.""" + # Fireworks rejects null output-only fields in assistant input. + history = message.model_dump( + exclude_unset=True, exclude_none=provider == "fireworks" or omit_output_fields + ) + if provider == "gemini": + # Gemini rejects null optional message fields; opaque nested nulls stay intact. + history = {name: value for name, value in history.items() if value is not None} + assert history.pop("annotations", None) in (None, []) + history.pop("parsed", None) + for call in history.get("tool_calls") or []: + if provider in {"togetherai", "gemini"} or omit_output_fields: + call.pop("index", None) + call["function"].pop("parsed_arguments", None) + # These providers repeat delta.role; the SDK accumulator concatenates those strings. + if provider in {"togetherai", "gemini"}: + assert history["role"] and history["role"].replace("assistant", "") == "" + history["role"] = "assistant" + else: + assert history["role"] == "assistant" + return history + + +def _gemini_marked_history(reply): + """Normalize the thought marker on the native complete reply used for continuation.""" + profile = GeminiChatCompletionsClient.resolve_capabilities(PROVIDER_CAPABILITIES["gemini"]) + message = reply.choices[0].message.model_dump(exclude_unset=True, exclude_none=True) + assert message["extra_content"]["google"]["thought"] is True + request = OpenAIChatCompletionsCreateRequest(model=reply.model, messages=[message]) + normalized = OpenAIChatCompletionsAdapter(profile).normalize_request(request) + (assistant,) = normalized.input + assert isinstance(assistant, AssistantInput) + assert not any(isinstance(part, TextOutput) for part in assistant.content) + assert assistant.content[0].summary == message["content"] + return normalized + + +async def _gemini_combined_history(scenario, recorded): + """Rebuild the probe from two independent SDK replies to the same prompt.""" + + async def seed(mode): + first, second = _provider_turns("gemini", "reasoning_text", mode, "chat_completions") + body, extras = _sdk_body(first["request"]["body"]) + async with AsyncOpenAI( + api_key="test-key", + http_client=httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _recorded_response(first)) + ), + ) as sdk: + reply, _ = await _collect_chat( + await sdk.chat.completions.create(**body, extra_body=extras), body["stream"] + ) + return reply.choices[0].message, deepcopy(second["request"]["body"]) + + visible, request = await seed("stream") + signed = _chat_history(visible, "gemini") + assert request["messages"][1] == signed + assert visible.content and "reasoning_content" not in signed + (signature,) = _google_signatures(visible) + parts = [] + if scenario == "reasoning_combined": + marked, prior = await seed("non_stream") + assert marked.extra_content["google"]["thought"] is True + assert marked.content == prior["messages"][1]["reasoning_content"] + assert request["messages"][0] == prior["messages"][0] + signed["reasoning_content"] = marked.content + parts.append(Thinking(content="", summary=marked.content)) + parts.extend( + [ + Thinking(content="", summary="", signature=signature), + TextOutput(content=visible.content), + ] + ) + request["messages"][1] = signed + request["stream"] = recorded["stream"] + assert request == recorded + return request["messages"], NormalizedRequest(input=[AssistantInput(content=parts)]) + + +def _chat_input_body(recorded): + """Omit empty output-only SDK fields from input copies, preserving source cassettes.""" + body = deepcopy(recorded) + for message in body["messages"]: + if message["role"] != "assistant": + continue + assert message.pop("annotations", None) in (None, []) + for field in ("reasoning_content", "tool_calls"): + if field in message and message[field] is None: + del message[field] + for call in message.get("tool_calls", []): + call.pop("index", None) + return body + + +@pytest.mark.parametrize( + ("provider", "endpoint", "scenario", "mode"), PROVIDER_NATIVE_CONVERSATIONS +) +async def test_provider_native_conversation(provider, endpoint, scenario, mode): + """Ensures native SDK parity and exact actual-output continuation for recorded provider conversations.""" + cassettes = _provider_turns(provider, scenario, mode, endpoint) + responses = endpoint == "responses" + messages = endpoint == "messages" + history_key = "input" if responses else "messages" + path = { + "responses": "/responses", + "chat_completions": "/chat/completions", + "messages": "/v1/messages", + }[endpoint] + collect = { + "responses": _collect_responses, + "chat_completions": _collect_chat, + "messages": _collect_messages, + }[endpoint] + history = deepcopy(cassettes[0]["request"]["body"][history_key]) + if scenario in GEMINI_COMBINED_SCENARIOS: + history, _ = await _gemini_combined_history(scenario, cassettes[0]["request"]["body"]) + for turn, cassette in enumerate(cassettes): + recorded = cassette["request"]["body"] + base_url = cassette["upstream_url"].removesuffix(path) + stream = recorded["stream"] + assert history == recorded[history_key] + wire = {**recorded, history_key: history} + if endpoint == "chat_completions": + wire = _chat_input_body(wire) + body, extras = _sdk_body(wire) + calls = [] + + def handle(request, cassette=cassette, recorded=wire, calls=calls): + calls.append(request) + assert str(request.url) == cassette["upstream_url"] + if messages: + assert request.headers["x-api-key"] == "test-key" + assert "authorization" not in request.headers + else: + assert request.headers["authorization"] == "Bearer test-key" + assert json_loads(request.content) == recorded + return _recorded_response(cassette) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handle)) as transport: + sdk = (AsyncAnthropic if messages else AsyncOpenAI)( + api_key="test-key", + base_url=base_url, + http_client=transport, + max_retries=0, + **( + {"auth_token": "", "default_headers": {"Authorization": omit}} + if messages + else {} + ), + ) + create = ( + sdk.messages.create + if messages + else (sdk.responses.create if responses else sdk.chat.completions.create) + ) + sdk_result = await create(**body, extra_body=extras) + expected, expected_events = await ( + _collect_chat(sdk_result, stream, repair_single_call_index=True) + if provider == "gemini" + else collect(sdk_result, stream) + ) + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handle)) + ) as molto: + molto_body = deepcopy(body) + if not responses and provider in {"gemini", "fireworks"}: + # These providers reject SDK-shaped null history and OpenAI's + # padding option. Compare the adjusted wire and output to the SDK. + for message in molto_body["messages"]: + if message["role"] == "assistant": + for field in ("audio", "function_call", "refusal"): + message[field] = None + message.setdefault("content", None) + if stream and "stream_options" in recorded: + molto_body.setdefault("stream_options", {})["include_obfuscation"] = False + before = deepcopy(molto_body) + actual, actual_events = await collect( + await getattr(molto, endpoint)( + molto_body, + provider=provider, + api_key="test-key", + base_url=base_url, + extra_body=extras, + ), + stream, + ) + assert molto_body == before + assert actual_events == expected_events + assert actual.model_dump() == expected.model_dump() + if scenario in GEMINI_COMBINED_SCENARIOS: + assert "36" in actual.choices[0].message.content + assert len(calls) == 2 + if responses: + # The reasoning recorder omits output lifecycle status on history. + history.extend( + item.model_dump( + exclude_unset=True, + exclude={"status"} if scenario == "tool_use_reasoning_low" else set(), + ) + for item in actual.output + ) + elif provider == "gemini" and not stream and "reasoning" in scenario: + # The recorder projected genuine marked content into reasoning_content + # for continuation. Reconstruct those requests from the returned SDK object. + normalized = _gemini_marked_history(actual) + profile = GeminiChatCompletionsClient.resolve_capabilities( + PROVIDER_CAPABILITIES["gemini"] + ) + wire = GeminiChatCompletionsClient._native_request(normalized, capabilities=profile) + history.extend(wire.model_dump(exclude_none=True)["messages"]) + elif messages: + history.append(_messages_history(actual)) + else: + history.append( + _chat_history( + actual.choices[0].message, + provider, + omit_output_fields=scenario == "tool_use_reasoning_low", + ) + ) + if turn + 1 < len(cassettes): + next_history = cassettes[turn + 1]["request"]["body"][history_key] + assert history == next_history[: len(history)] + suffix = next_history[len(history) :] + assert suffix and all( + item.get("role") in {"user", "tool"} or item.get("type") == "function_call_output" + for item in suffix + ) + history.extend(deepcopy(suffix)) + + +def _caller_input(items): + """Read recorded caller data; assistant history must come from actual emitted IR.""" + result = [] + for item in items: + if item.get("type") == "function_call_output" or item.get("role") == "tool": + responses = item.get("type") == "function_call_output" + content = item["output"] if responses else item["content"] + if isinstance(content, str): + content = [{"type": "input_text", "text": content}] + result.append( + ToolReturn( + tool_call_id=item["call_id"] if responses else item["tool_call_id"], + content=[TextInput(content=part["text"]) for part in content], + ) + ) + else: + assert item["role"] == "user" + content = item["content"] + if isinstance(content, str): + content = [{"type": "input_text", "text": content}] + assert all(part["type"] in {"input_text", "text"} for part in content) + result.append(UserInput(content=[TextInput(content=part["text"]) for part in content])) + return result + + +def _expected_responses_wire(recorded): + """Adjust source copies only for documented normalized representations, never model output.""" + body = deepcopy(recorded) + for item in body["input"]: + if item.get("role") == "user" and isinstance(item["content"], str): + item["content"] = [{"type": "input_text", "text": item["content"]}] + if item.get("role") == "assistant": + item.setdefault("status", "completed") + # IR text parts do not carry their enclosing source message's ID. + item.pop("id", None) + # Reconstructed Responses history intentionally omits native phase; + # the SDK parity path above still preserves the provider's value. + assert item.get("phase") in (None, "commentary", "final_answer") + item.pop("phase", None) + for part in item["content"]: + part.setdefault("annotations", []) + part.setdefault("logprobs", []) + if item.get("type") == "reasoning": + item.setdefault("content", []) + assert item.pop("format", None) in (None, "unknown") + item.pop("status", None) + if item.get("type") == "function_call": + item.setdefault("status", "completed") + if item.get("type") == "function_call_output" and isinstance(item["output"], str): + item["output"] = [{"type": "input_text", "text": item["output"]}] + for tool in body.get("tools", []): + assert tool["type"] == "function" + tool.setdefault("strict", False) + return body + + +@pytest.mark.parametrize( + ("provider", "scenario", "mode"), + [case for case in PROVIDER_RESPONSES_CONVERSATIONS if case.values[2] == "stream"], +) +async def test_provider_normalized_responses_conversation(provider, scenario, mode): + """Ensures SDK-visible text, reasoning, calls and usage survive real normalized continuations.""" + cassettes = _provider_turns(provider, scenario, mode) + first = cassettes[0]["request"]["body"] + request = NormalizedRequest( + model=first["model"], + stream=True, + max_output_tokens=first["max_output_tokens"], + input=_caller_input(first["input"]), + ) + if first.get("tools"): + request.tools = [ + FunctionTool(**{key: value for key, value in tool.items() if key != "type"}) + for tool in first["tools"] + ] + for turn, cassette in enumerate(cassettes): + recorded = cassette["request"]["body"] + base_url = cassette["upstream_url"].removesuffix("/responses") + body, extras = _sdk_body(recorded) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _, cassette=cassette: _recorded_response(cassette) + ) + ) as transport: + sdk = AsyncOpenAI( + api_key="test-key", base_url=base_url, http_client=transport, max_retries=0 + ) + reference, source_events = await _collect_responses( + await sdk.responses.create(**body, extra_body=extras), True + ) + expected = _expected_responses_wire(recorded) + calls = [] + + def handle(http_request, expected=expected, cassette=cassette, calls=calls): + calls.append(http_request) + assert str(http_request.url) == cassette["upstream_url"] + assert json_loads(http_request.content) == expected + return _recorded_response(cassette) + + # Keep captured execution controls; these tests target content and history. + controls = { + key: recorded[key] + for key in ( + "reasoning", + "tool_choice", + "parallel_tool_calls", + "store", + "provider", + "include", + ) + if key in recorded + } + client_type = PROVIDER_CLIENTS[provider, "responses"] + async with httpx.AsyncClient(transport=httpx.MockTransport(handle)) as transport: + client = client_type( + transport, + api_key="test-key", + capabilities=client_type.resolve_capabilities(PROVIDER_CAPABILITIES[provider]), + base_url=base_url, + extra_body=controls, + ) + before = request.model_copy(deep=True) + events = [event async for event in client.events(request)] + assert request == before + assert len(calls) == 1 + raw = any(item.type == "reasoning" and item.content for item in reference.output) + parts = _assert_ir( + events, + tool_name=request.tools[0].name if request.tools else "read_file", + source_timestamps=( + int(source_events[0]["response"]["created_at"]), + int(reference.created_at), + ), + raw_reasoning=raw, + ) + assert (events[0].id, events[0].model) == (reference.id, reference.model) + assert ( + "".join(part.content for part in parts if isinstance(part, TextOutput)) + == reference.output_text + ) + assert [ + (part.tool_call_id, part.tool_name, json_loads(part.args)) + for part in parts + if isinstance(part, ToolCall) + ] == [ + (item.call_id, item.name, json_loads(item.arguments)) + for item in reference.output + if item.type == "function_call" + ] + assert [ + (part.content, part.summary, part.signature) + for part in parts + if isinstance(part, Thinking) + ] == [ + ( + "".join(part.text for part in item.content or []), + "".join(part.text for part in item.summary), + item.encrypted_content, + ) + for item in reference.output + if item.type == "reasoning" + ] + assert ( + events[-1].usage.input_tokens, + events[-1].usage.output_tokens, + events[-1].usage.total_tokens, + ) == ( + reference.usage.input_tokens, + reference.usage.output_tokens, + reference.usage.total_tokens, + ) + if turn + 1 < len(cassettes): + request.input.append(AssistantInput(content=parts)) + suffix = cassettes[turn + 1]["request"]["body"]["input"][ + len(recorded["input"]) + len(reference.output) : + ] + assert suffix + request.input.extend(_caller_input(suffix)) + + +def _responses_caller_input(messages): + """Read only caller messages; translated assistant history comes from Molto output.""" + result = [] + for message in messages: + if message["role"] == "tool": + result.append( + { + "type": "function_call_output", + "call_id": message["tool_call_id"], + "output": message["content"], + } + ) + else: + assert message["role"] == "user" + content = message["content"] + if isinstance(content, str): + content = [{"type": "text", "text": content}] + assert all(part["type"] == "text" for part in content) + result.append( + { + "role": "user", + "content": [{"type": "input_text", "text": part["text"]} for part in content], + } + ) + return result + + +def _expected_chat_wire(recorded): + """Account for normalized text parts and omitted empty assistant metadata on copies.""" + body = _chat_input_body(recorded) + for message in body["messages"]: + if message["role"] in {"user", "tool"} and isinstance(message["content"], str): + message["content"] = [{"type": "text", "text": message["content"]}] + if message["role"] == "assistant": + for field in ("audio", "function_call", "refusal", "content"): + if field in message and message[field] is None: + del message[field] + if message.get("tool_calls") and message.get("content") == "": + del message["content"] + return body + + +def _messages_caller_input(messages): + """Express recorded caller input in Messages without copying assistant history.""" + result = [] + for message in messages: + if message["role"] == "tool": + result.append( + { + "role": "user", + "content": [ + { + "type": "tool_result", + "tool_use_id": message["tool_call_id"], + "content": message["content"], + } + ], + } + ) + else: + assert message["role"] == "user" + result.append(deepcopy(message)) + return result + + +def _google_signatures(message): + """Read opaque signatures from independently parsed SDK message and tool attachments.""" + return [ + signature + for attachment in (message, *(message.tool_calls or [])) + if ( + signature := (getattr(attachment, "extra_content", {}) or {}) + .get("google", {}) + .get("thought_signature") + ) + ] + + +def _google_stream_parts(message): + """Reconstruct the recorded trailing message and same-chunk tool signatures.""" + parts = [] + message_signature = ( + getattr(message, "extra_content", {}).get("google", {}).get("thought_signature") + ) + if message.content: + parts.append(TextOutput(content=message.content)) + for index, call in enumerate(message.tool_calls or []): + signature = getattr(call, "extra_content", {}).get("google", {}).get("thought_signature") + if not message.content and index == 0 and not signature: + signature, message_signature = message_signature, None + if signature: + parts.append(Thinking(content="", summary="", signature=signature)) + parts.append( + ToolCall( + tool_call_id=call.id, tool_name=call.function.name, args=call.function.arguments + ) + ) + if message_signature: + parts.append(Thinking(content="", summary="", signature=message_signature)) + return parts + + +@pytest.mark.parametrize( + ("provider", "endpoint", "scenario", "mode", "downstream", "unknown_extensions"), + [ + pytest.param(*case.values, downstream, False, id=f"{case.id}-{downstream}") + for case in PROVIDER_NATIVE_CONVERSATIONS + if case.values[1] == "chat_completions" and case.values[3] in {"stream", "mixed"} + for downstream in ( + ("responses", "messages") + if case.values[0] in {"gemini", "fireworks", "togetherai"} + or "reasoning" in case.values[2] + else ("responses",) + ) + ] + + [ + pytest.param( + "fireworks", + "chat_completions", + "tool_use", + "stream", + downstream, + True, + id=f"fireworks-unknown-extensions-{downstream}", + ) + for downstream in ("responses", "messages") + ], +) +@pytest.mark.parametrize("stream", [False, True]) +async def test_provider_chat_translated_conversation( + provider, endpoint, scenario, mode, downstream, unknown_extensions, stream +): + """Ensures text, reasoning, calls and Gemini signatures survive SDK-backed continuation.""" + cassettes = _provider_turns(provider, scenario, mode, endpoint) + if unknown_extensions: + cassettes = [_with_unmodelled_output_extensions(cassette) for cassette in cassettes] + first = cassettes[0]["request"]["body"] + responses = downstream == "responses" + capabilities = PROVIDER_CLIENTS[provider, endpoint].resolve_capabilities( + PROVIDER_CAPABILITIES[provider] + ) + history_key = "input" if responses else "messages" + caller_input = _responses_caller_input if responses else _messages_caller_input + if scenario in GEMINI_COMBINED_SCENARIOS: + messages, normalized = await _gemini_combined_history(scenario, first) + prior = ( + OpenAIResponsesClient._process_input(normalized) + if responses + else AnthropicMessagesClient._request_parts(normalized)[1] + ) + history = [*caller_input(messages[:1]), *prior, *caller_input(messages[2:])] + else: + history = caller_input(first["messages"]) + body = { + "model": first["model"], + "stream": stream, + "max_output_tokens" if responses else "max_tokens": first["max_completion_tokens"], + history_key: history, + } + if first.get("tools"): + body["tools"] = ( + [{"type": "function", **tool["function"]} for tool in first["tools"]] + if responses + else [ + { + "name": tool["function"]["name"], + "description": tool["function"]["description"], + "input_schema": tool["function"]["parameters"], + } + for tool in first["tools"] + ] + ) + for turn, cassette in enumerate(cassettes): + recorded = cassette["request"]["body"] + base_url = cassette["upstream_url"].removesuffix("/chat/completions") + sdk_body, extras = _sdk_body(recorded) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _, cassette=cassette: _recorded_response(cassette) + ) + ) as transport: + sdk = AsyncOpenAI( + api_key="test-key", base_url=base_url, http_client=transport, max_retries=0 + ) + reference, reference_events = await _collect_chat( + await sdk.chat.completions.create(**sdk_body, extra_body=extras), + recorded["stream"], + repair_single_call_index=provider == "gemini", + ) + if not recorded["stream"]: + async with Molto(http_client=transport) as molto: + first_reply = await molto.chat_completions( + sdk_body, + provider=provider, + api_key="test-key", + base_url=base_url, + extra_body=extras, + ) + assert first_reply.model_dump() == reference.model_dump() + if not recorded["stream"]: + # Mixed-mode captures start with a genuine complete, thought-marked reply. + # Translate its actual history before requesting the recorded follow-up stream. + assert mode == "mixed" and turn == 0 + normalized = _gemini_marked_history(first_reply) + history = ( + OpenAIResponsesClient._process_input(normalized) + if responses + else AnthropicMessagesClient._request_parts(normalized)[1] + ) + body[history_key].extend(history) + suffix = cassettes[turn + 1]["request"]["body"]["messages"][ + len(recorded["messages"]) + 1 : + ] + assert suffix + body[history_key].extend(caller_input(suffix)) + continue + if unknown_extensions: + assert any( + choice["delta"].get("extra_content") + for event in reference_events + for choice in event["choices"] + ) + expected = _expected_chat_wire(recorded) + expected.setdefault("stream_options", {})["include_usage"] = True + for tool in expected.get("tools", []): + # Translated tools make the downstream protocol's default explicit. + tool["function"].setdefault("strict", responses) + if not responses: + if not PROVIDER_CLIENTS[provider, endpoint].OMIT_INCLUDE_OBFUSCATION: + expected.setdefault("stream_options", {})["include_obfuscation"] = False + # Messages returns object-valued tool input, so continuation cannot + # retain the original JSON argument whitespace. + for message in expected["messages"]: + for call in message.get("tool_calls", []): + function = call["function"] + function["arguments"] = json_dumps(json_loads(function["arguments"])) + calls = [] + + def handle(request, cassette=cassette, expected=expected, calls=calls): + calls.append(request) + assert str(request.url) == cassette["upstream_url"] + assert json_loads(request.content) == expected + return _recorded_response(cassette) + + controls = { + key: recorded[key] + for key in ( + "reasoning", + "reasoning_effort", + "tool_choice", + "parallel_tool_calls", + "extra_body", + ) + if key in recorded + } + before = deepcopy(body) + message = reference.choices[0].message + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handle)) + ) as molto: + result = await getattr(molto, downstream)( + body, + provider=provider, + endpoint="chat/completions", + api_key="test-key", + base_url=base_url, + extra_body=controls, + ) + if responses: + actual, _ = await _collect_responses(result, stream) + elif stream: + actual = None + async with result: + async for event in result: + actual = accumulate_event(event=event, current_snapshot=actual) + else: + actual = result + assert body == before + assert len(calls) == 1 + assert (actual.id, actual.model) == (reference.id, reference.model) + if responses: + assert actual.status == "completed" + assert actual.created_at == reference.created + if reference.usage is None: + assert actual.usage is None + else: + assert actual.usage.total_tokens == reference.usage.total_tokens + text = actual.output_text + tool_calls = [ + (item.call_id, item.name, json_loads(item.arguments)) + for item in actual.output + if item.type == "function_call" + ] + thoughts = [item for item in actual.output if item.type == "reasoning"] + signatures = [item.encrypted_content for item in thoughts if item.encrypted_content] + reasoning = "".join( + part.text for item in thoughts for part in (item.content or item.summary) + ) + if capabilities.thinking == "raw": + assert all(not item.summary for item in thoughts) + else: + assert all(not item.content for item in thoughts) + assert all( + item.type in {"message", "function_call", "reasoning"} for item in actual.output + ) + usage = ( + (actual.usage.input_tokens, actual.usage.output_tokens) if actual.usage else None + ) + else: + assert actual.stop_reason == ("tool_use" if message.tool_calls else "end_turn") + text = "".join(block.text for block in actual.content if block.type == "text") + tool_calls = [ + (block.id, block.name, block.input) + for block in actual.content + if block.type == "tool_use" + ] + thoughts = [block for block in actual.content if block.type == "thinking"] + signatures = [block.signature for block in thoughts if block.signature] + reasoning = "".join(block.thinking for block in thoughts) + assert all(block.type in {"text", "tool_use", "thinking"} for block in actual.content) + usage = ( + actual.usage.input_tokens + + (actual.usage.cache_read_input_tokens or 0) + + (actual.usage.cache_creation_input_tokens or 0), + actual.usage.output_tokens, + ) + assert text == (message.content or "") + assert tool_calls == [ + (call.id, call.function.name, json_loads(call.function.arguments)) + for call in message.tool_calls or [] + ] + assert reasoning == ( + getattr(message, "reasoning_content", None) + or getattr(message, "reasoning", None) + or "" + ) + assert signatures == (_google_signatures(message) if provider == "gemini" else []) + if provider == "gemini": + types = ( + {Thinking: "reasoning", TextOutput: "message", ToolCall: "function_call"} + if responses + else {Thinking: "thinking", TextOutput: "text", ToolCall: "tool_use"} + ) + assert [item.type for item in (actual.output if responses else actual.content)] == [ + types[type(part)] for part in _google_stream_parts(message) + ] + if reference.usage is not None: + assert usage == (reference.usage.prompt_tokens, reference.usage.completion_tokens) + else: + assert usage == (None if responses else (0, 0)) + if turn + 1 < len(cassettes): + if responses: + body[history_key].extend( + item.model_dump(exclude_unset=True) for item in actual.output + ) + else: + body[history_key].append( + { + "role": "assistant", + "content": [block.model_dump() for block in actual.content], + } + ) + suffix = cassettes[turn + 1]["request"]["body"]["messages"][ + len(recorded["messages"]) + 1 : + ] + assert suffix + body[history_key].extend(caller_input(suffix)) + + +@pytest.mark.parametrize("scenario", ["text_chat", "tool_use"]) +async def test_gemini_normalized_signature_conversation(scenario): + """Ensures Gemini signatures enter IR unchanged and restore their original attachments.""" + cassettes = _provider_turns("gemini", scenario, "stream", "chat_completions") + first = cassettes[0]["request"]["body"] + request = NormalizedRequest( + model=first["model"], + stream=True, + max_output_tokens=first["max_completion_tokens"], + input=_caller_input(_responses_caller_input(first["messages"])), + tools=[FunctionTool(**tool["function"]) for tool in first.get("tools", [])] or None, + ) + for turn, cassette in enumerate(cassettes): + recorded = cassette["request"]["body"] + base_url = cassette["upstream_url"].removesuffix("/chat/completions") + sdk_body, extras = _sdk_body(recorded) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _, cassette=cassette: _recorded_response(cassette) + ) + ) as transport: + sdk = AsyncOpenAI( + api_key="test-key", base_url=base_url, http_client=transport, max_retries=0 + ) + reference, _ = await _collect_chat( + await sdk.chat.completions.create(**sdk_body, extra_body=extras), + True, + repair_single_call_index=True, + ) + calls = [] + expected = _expected_chat_wire(recorded) + + def handle(http_request, cassette=cassette, expected=expected, calls=calls): + calls.append(http_request) + assert str(http_request.url) == cassette["upstream_url"] + assert json_loads(http_request.content) == expected + return _recorded_response(cassette) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handle)) as transport: + client = GeminiChatCompletionsClient( + transport, + api_key="test-key", + base_url=base_url, + capabilities=PROVIDER_CAPABILITIES["gemini"], + extra_body={ + key: recorded[key] + for key in ("reasoning_effort", "tool_choice", "parallel_tool_calls") + if key in recorded + }, + ) + before = request.model_copy(deep=True) + events = [event async for event in client.events(request)] + assert request == before + assert len(calls) == 1 + assert reference.choices[0].finish_reason == "stop" + parts = _assert_ir( + events, + tool_name=request.tools[0].name if request.tools else "read_file", + ) + message = reference.choices[0].message + assert (events[0].id, events[0].model, events[0].created_at) == ( + reference.id, + reference.model, + reference.created, + ) + assert ( + events[-1].usage.input_tokens, + events[-1].usage.output_tokens, + events[-1].usage.total_tokens, + ) == ( + reference.usage.prompt_tokens, + reference.usage.completion_tokens, + reference.usage.total_tokens, + ) + assert parts == _google_stream_parts(message) + if turn + 1 < len(cassettes): + request.input.append(AssistantInput(content=parts)) + suffix = cassettes[turn + 1]["request"]["body"]["messages"][ + len(recorded["messages"]) + 1 : + ] + assert suffix + request.input.extend(_caller_input(_responses_caller_input(suffix))) + + +@pytest.mark.parametrize( + ("provider", "scenario", "unknown_extensions"), + [ + pytest.param(case.values[0], case.values[1], False, id=case.id) + for case in PROVIDER_RESPONSES_CONVERSATIONS + if case.values[0] in {"openrouter", "fireworks", "togetherai"} + and case.values[1].startswith("tool_use_reasoning") + and case.values[2] == "stream" + ] + + [("fireworks", "tool_use_reasoning", True)], +) +@pytest.mark.parametrize("downstream", ["chat_completions", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_provider_reasoning_public_projection( + provider, scenario, unknown_extensions, downstream, stream +): + """Ensures actual returned raw reasoning completes tool conversations with SDK parity.""" + cassettes = _provider_turns(provider, scenario, "stream") + first = cassettes[0]["request"]["body"] + body = { + "model": first["model"], + "messages": [], + "max_tokens": first["max_output_tokens"], + "stream": stream, + } + if downstream == "chat_completions": + body["tools"] = [ + { + "type": "function", + "function": {key: value for key, value in tool.items() if key != "type"}, + } + for tool in first["tools"] + ] + else: + body["tools"] = [ + { + "name": tool["name"], + "description": tool["description"], + "input_schema": tool["parameters"], + } + for tool in first["tools"] + ] + caller_input = first["input"] + carried_reasoning = [] + for turn, cassette in enumerate(cassettes): + for item in caller_input: + if item.get("type") == "function_call_output": + if downstream == "chat_completions": + body["messages"].append( + { + "role": "tool", + "tool_call_id": item["call_id"], + "content": item["output"], + } + ) + else: + body["messages"].append( + { + "role": "user", + "content": [ + { + "type": "tool_result", + "tool_use_id": item["call_id"], + "content": item["output"], + } + ], + } + ) + else: + message = deepcopy(item) + assert message["role"] == "user" + if isinstance(message["content"], list): + for part in message["content"]: + assert part["type"] == "input_text" + part["type"] = "text" + body["messages"].append(message) + if unknown_extensions: + cassette = _with_unmodelled_output_extensions(cassette) + recorded = cassette["request"]["body"] + base_url = cassette["upstream_url"].removesuffix("/responses") + sdk_body, extras = _sdk_body(recorded) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _, cassette=cassette: _recorded_response(cassette) + ) + ) as transport: + sdk = AsyncOpenAI( + api_key="test-key", base_url=base_url, http_client=transport, max_retries=0 + ) + reference, _ = await _collect_responses( + await sdk.responses.create(**sdk_body, extra_body=extras), True + ) + expected = _expected_responses_wire(recorded) + for item in expected["input"]: + if item.get("type") in {"reasoning", "function_call"}: + # Chat and Messages retain call IDs but have no Responses item IDs. + item.pop("id", None) + if item.get("type") == "reasoning" and item["summary"]: + # The downstream protocols return unlabeled text. The raw input + # profile restores that text as reasoning_text on continuation. + item["content"] = [ + {"type": "reasoning_text", "text": part["text"]} for part in item["summary"] + ] + item["summary"] = [] + if downstream == "messages" and item.get("type") == "function_call": + # Messages carries parsed arguments, so JSON whitespace is not retained. + item["arguments"] = json_dumps(json_loads(item["arguments"])) + if downstream == "messages": + expected["stream_options"] = {"include_obfuscation": False} + controls = { + key: recorded[key] + for key in ("reasoning", "tool_choice", "parallel_tool_calls", "store", "provider") + if key in recorded + } + requests = [] + + def handle(request, cassette=cassette, expected=expected, requests=requests): + requests.append(request) + assert str(request.url) == cassette["upstream_url"] + assert json_loads(request.content) == expected + return _recorded_response(cassette) + + before = deepcopy(body) + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handle)) + ) as molto: + result = await getattr(molto, downstream)( + body, + provider=provider, + endpoint="responses", + base_url=base_url, + api_key="test-key", + extra_body=controls, + ) + if downstream == "chat_completions": + actual, _ = await _collect_chat(result, stream) + else: + actual, _ = await _collect_messages(result, stream) + assert body == before + assert len(requests) == 1 + assert (actual.id, actual.model) == (reference.id, reference.model) + if downstream == "chat_completions": + message = actual.choices[0].message + text = message.content or "" + reasoning = getattr(message, "reasoning_content", "") or "" + calls = [ + (call.id, call.function.name, json_loads(call.function.arguments)) + for call in message.tool_calls or [] + ] + usage = (actual.usage.prompt_tokens, actual.usage.completion_tokens) + assert actual.choices[0].finish_reason == ("tool_calls" if calls else "stop") + body["messages"].append( + { + "role": "assistant", + "content": message.content, + "reasoning_content": reasoning, + "tool_calls": [ + { + "id": call.id, + "type": "function", + "function": { + "name": call.function.name, + "arguments": call.function.arguments, + }, + } + for call in message.tool_calls or [] + ], + } + ) + else: + text = "".join(block.text for block in actual.content if block.type == "text") + reasoning = "".join( + block.thinking for block in actual.content if block.type == "thinking" + ) + assert all(not block.signature for block in actual.content if block.type == "thinking") + calls = [ + (block.id, block.name, block.input) + for block in actual.content + if block.type == "tool_use" + ] + usage = ( + actual.usage.input_tokens + + (actual.usage.cache_read_input_tokens or 0) + + (actual.usage.cache_creation_input_tokens or 0), + actual.usage.output_tokens, + ) + assert actual.stop_reason == ("tool_use" if calls else "end_turn") + body["messages"].append(_messages_history(actual)) + cache_writes = ( + actual.usage.prompt_tokens_details.cache_write_tokens + if downstream == "chat_completions" + else actual.usage.cache_creation_input_tokens + ) + assert cache_writes == reference.usage.input_tokens_details.cache_write_tokens + assert text == reference.output_text + assert reasoning == "".join( + part.text + for item in reference.output + if item.type == "reasoning" + for part in (item.content or item.summary) + ) + assert calls == [ + (item.call_id, item.name, json_loads(item.arguments)) + for item in reference.output + if item.type == "function_call" + ] + assert usage == (reference.usage.input_tokens, reference.usage.output_tokens) + carried_reasoning.append(reasoning) + if turn + 1 < len(cassettes): + caller_input = cassettes[turn + 1]["request"]["body"]["input"][ + len(recorded["input"]) + len(reference.output) : + ] + assert caller_input + assert len(cassettes) >= 2 + assert any(carried_reasoning[:-1]) + assert text + assert not calls + + +def _chat_caller_from_messages(messages): + """Express only recorded caller input as Chat text or tool results, never assistant history.""" + result = [] + for message in messages: + assert message["role"] == "user" + content = message["content"] + if all(block["type"] == "tool_result" for block in content): + result.extend( + { + "role": "tool", + "tool_call_id": block["tool_use_id"], + "content": deepcopy(block["content"]), + } + for block in content + ) + else: + assert all(block["type"] == "text" for block in content) + result.append(deepcopy(message)) + return result + + +def _expected_messages_wire(recorded): + """Account for normalized text content and empty output metadata without changing recordings.""" + body = deepcopy(recorded) + if body.get("thinking", {}).get("type") == "enabled": + # Molto makes Claude's summarized display default explicit. + body["thinking"]["display"] = "summarized" + for message in body["messages"]: + for block in message["content"]: + if block["type"] == "text": + assert block.pop("citations", None) in (None, []) + elif block["type"] == "tool_use": + assert block.pop("caller", None) in (None, {"type": "direct"}) + elif block["type"] == "tool_result" and isinstance(block["content"], str): + block["content"] = [{"type": "text", "text": block["content"]}] + return body + + +async def _messages_sdk_reference(cassette): + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _recorded_response(cassette)) + ) as transport: + sdk = AsyncAnthropic( + api_key="test-key", + auth_token="", + default_headers={"Authorization": omit}, + http_client=transport, + max_retries=0, + base_url=cassette["upstream_url"].removesuffix("/v1/messages"), + ) + reference, _ = await _collect_messages( + await sdk.messages.create(**cassette["request"]["body"]), True + ) + return reference + + +def _messages_semantics(message): + """Read portable content and semantic token usage from the independent SDK response.""" + assert all(block.type in {"thinking", "text", "tool_use"} for block in message.content) + return ( + "".join(block.text for block in message.content if block.type == "text"), + [ + (block.id, block.name, block.input) + for block in message.content + if block.type == "tool_use" + ], + ( + message.usage.input_tokens + + (message.usage.cache_creation_input_tokens or 0) + + (message.usage.cache_read_input_tokens or 0), + message.usage.output_tokens, + ), + ) + + +PROVIDER_MESSAGES_CONVERSATIONS = [ + pytest.param(case.values[0], case.values[2], id=case.id) + for case in PROVIDER_NATIVE_CONVERSATIONS + if case.values[1] == "messages" and case.values[3] == "stream" +] + + +@pytest.mark.parametrize(("provider", "scenario"), PROVIDER_MESSAGES_CONVERSATIONS) +async def test_provider_normalized_messages_conversation(provider, scenario): + """Ensures recorded Messages content, calls, usage, and actual IR history survive continuation.""" + cassettes = _provider_turns(provider, scenario, "stream", "messages") + first = cassettes[0]["request"]["body"] + request = NormalizedRequest( + model=first["model"], + stream=True, + max_output_tokens=first["max_tokens"], + reasoning=Reasoning(effort="minimal") if first.get("thinking") else None, + input=_caller_input(_chat_caller_from_messages(first["messages"])), + tools=[ + FunctionTool( + name=tool["name"], description=tool["description"], parameters=tool["input_schema"] + ) + for tool in first.get("tools", []) + ] + or None, + ) + for turn, cassette in enumerate(cassettes): + recorded = cassette["request"]["body"] + reference = await _messages_sdk_reference(cassette) + expected = _expected_messages_wire(recorded) + choice = recorded.get("tool_choice", {}) + request.tool_choice = ( + FunctionToolChoice(name=choice["name"]) + if choice.get("type") == "tool" + else choice.get("type") + ) + request.parallel_tool_calls = ( + not choice["disable_parallel_tool_use"] + if "disable_parallel_tool_use" in choice + else None + ) + calls = [] + + def handle(http_request, cassette=cassette, expected=expected, calls=calls): + calls.append(http_request) + assert str(http_request.url) == cassette["upstream_url"] + assert http_request.headers["x-api-key"] == "test-key" + assert "authorization" not in http_request.headers + assert json_loads(http_request.content) == expected + return _recorded_response(cassette) + + async with httpx.AsyncClient(transport=httpx.MockTransport(handle)) as transport: + client = PROVIDER_CLIENTS[provider, "messages"]( + transport, + api_key="test-key", + capabilities=PROVIDER_CAPABILITIES[provider], + base_url=cassette["upstream_url"].removesuffix("/v1/messages"), + ) + before = request.model_copy(deep=True) + events = [event async for event in client.events(request)] + assert request == before + assert len(calls) == 1 + parts = _assert_ir( + events, tool_name=request.tools[0].name if request.tools else "read_file" + ) + expected_text, expected_calls, expected_usage = _messages_semantics(reference) + assert (events[0].id, events[0].model) == (reference.id, reference.model) + assert ( + "".join(part.content for part in parts if isinstance(part, TextOutput)) + == expected_text + ) + assert [ + (part.tool_call_id, part.tool_name, json_loads(part.args)) + for part in parts + if isinstance(part, ToolCall) + ] == expected_calls + assert [ + (part.summary, part.signature) for part in parts if isinstance(part, Thinking) + ] == [ + (block.thinking, block.signature) + for block in reference.content + if block.type == "thinking" + ] + assert all(not part.content for part in parts if isinstance(part, Thinking)) + assert (events[-1].usage.input_tokens, events[-1].usage.output_tokens) == expected_usage + if turn + 1 < len(cassettes): + request.input.append(AssistantInput(content=parts)) + suffix = cassettes[turn + 1]["request"]["body"]["messages"][ + len(recorded["messages"]) + 1 : + ] + assert suffix + request.input.extend(_caller_input(_chat_caller_from_messages(suffix))) + + +@pytest.mark.parametrize( + ("provider", "scenario", "downstream"), + [ + pytest.param(*case.values, downstream, id=f"{case.id}-{downstream}") + for case in PROVIDER_MESSAGES_CONVERSATIONS + for downstream in ("responses", "chat_completions") + ], +) +@pytest.mark.parametrize("stream", [False, True]) +async def test_provider_messages_translated_conversation(provider, scenario, downstream, stream): + """Ensures Messages recordings project with SDK semantic parity and actual-output continuation.""" + cassettes = _provider_turns(provider, scenario, "stream", "messages") + first = cassettes[0]["request"]["body"] + responses = downstream == "responses" + history_key = "input" if responses else "messages" + caller = _chat_caller_from_messages(first["messages"]) + body = { + "model": first["model"], + "stream": stream, + "max_output_tokens" if responses else "max_completion_tokens": first["max_tokens"], + history_key: _responses_caller_input(caller) if responses else caller, + } + if first.get("thinking"): + if responses: + body["reasoning"] = {"effort": "minimal"} + else: + body["reasoning_effort"] = "minimal" + if first.get("tools"): + functions = [ + { + "name": tool["name"], + "description": tool["description"], + "parameters": tool["input_schema"], + "strict": False, + } + for tool in first["tools"] + ] + body["tools"] = [ + {"type": "function", **function} + if responses + else {"type": "function", "function": function} + for function in functions + ] + for turn, cassette in enumerate(cassettes): + recorded = cassette["request"]["body"] + reference = await _messages_sdk_reference(cassette) + expected = _expected_messages_wire(recorded) + choice = recorded.get("tool_choice") + if choice: + body["tool_choice"] = ( + ( + {"type": "function", "name": choice["name"]} + if responses + else {"type": "function", "function": {"name": choice["name"]}} + ) + if choice["type"] == "tool" + else choice["type"] + ) + if "disable_parallel_tool_use" in choice: + body["parallel_tool_calls"] = not choice["disable_parallel_tool_use"] + else: + body.pop("parallel_tool_calls", None) + calls = [] + + def handle(request, cassette=cassette, expected=expected, calls=calls): + calls.append(request) + assert str(request.url) == cassette["upstream_url"] + assert request.headers["x-api-key"] == "test-key" + assert "authorization" not in request.headers + assert json_loads(request.content) == expected + return _recorded_response(cassette) + + before = deepcopy(body) + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handle)) + ) as molto: + result = await getattr(molto, downstream)( + body if responses else _chat_input_body(body), + provider=provider, + endpoint="messages", + chat_signature_namespace="anthropic", + api_key="test-key", + base_url=cassette["upstream_url"].removesuffix("/v1/messages"), + ) + actual, _ = await (_collect_responses if responses else _collect_chat)(result, stream) + assert body == before + assert len(calls) == 1 + assert (actual.id, actual.model) == (reference.id, reference.model) + expected_text, expected_calls, expected_usage = _messages_semantics(reference) + assert reference.stop_reason == ("tool_use" if expected_calls else "end_turn") + if responses: + assert actual.status == "completed" + assert actual.output_text == expected_text + actual_calls = [ + (item.call_id, item.name, json_loads(item.arguments)) + for item in actual.output + if item.type == "function_call" + ] + assert all( + item.type in {"reasoning", "message", "function_call"} for item in actual.output + ) + assert [ + ("".join(part.text for part in item.summary), item.encrypted_content) + for item in actual.output + if item.type == "reasoning" + ] == [ + (block.thinking, block.signature) + for block in reference.content + if block.type == "thinking" + ] + assert all(not item.content for item in actual.output if item.type == "reasoning") + usage = (actual.usage.input_tokens, actual.usage.output_tokens) + else: + message = actual.choices[0].message + assert (message.content or "") == expected_text + thinking = [block for block in reference.content if block.type == "thinking"] + assert (getattr(message, "reasoning_content", "") or "") == "".join( + block.thinking for block in thinking + ) + signature = ( + (getattr(message, "extra_content", {}) or {}) + .get("anthropic", {}) + .get("thought_signature") + ) + assert ([signature] if signature else []) == [block.signature for block in thinking] + assert actual.choices[0].finish_reason == ("tool_calls" if expected_calls else "stop") + actual_calls = [ + (call.id, call.function.name, json_loads(call.function.arguments)) + for call in message.tool_calls or [] + ] + usage = (actual.usage.prompt_tokens, actual.usage.completion_tokens) + assert actual_calls == expected_calls + assert usage == expected_usage + if turn + 1 < len(cassettes): + if responses: + body[history_key].extend( + item.model_dump(exclude_unset=True) for item in actual.output + ) + else: + body[history_key].append(_chat_history(message, "bedrock")) + suffix = cassettes[turn + 1]["request"]["body"]["messages"][ + len(recorded["messages"]) + 1 : + ] + assert suffix + caller = _chat_caller_from_messages(suffix) + body[history_key].extend(_responses_caller_input(caller) if responses else caller) diff --git a/tests/upstream/test_openai.py b/tests/upstream/test_openai.py index a7f17ce..01ee3d0 100644 --- a/tests/upstream/test_openai.py +++ b/tests/upstream/test_openai.py @@ -1,4 +1,5 @@ from collections.abc import AsyncIterator +from copy import deepcopy from json import dumps import httpx @@ -57,6 +58,7 @@ OpenAIResponsesStreamEventAdapter, ) from molto.upstream.openai import OpenAIChatCompletionsClient, OpenAIResponsesClient +from molto.utils.test import collect_sdk_response OPENAI_CAPABILITIES = PROVIDER_CAPABILITIES["openai"] VLLM_CAPABILITIES = PROVIDER_CAPABILITIES["vllm"] @@ -427,14 +429,10 @@ def test_openai_clients_preserve_assistant_message_and_text_part_boundaries(empt ToolCall(tool_name="lookup", tool_call_id="call_1", args="{}"), Thinking(content="Later", summary=""), ], - [ - ToolCall(tool_name="lookup", tool_call_id="call_1", args="{}"), - TextOutput(content="Later"), - ], ], ) def test_chat_client_rejects_unrepresentable_order_within_assistant_message(content): - """Ensures Chat never reorders or overwrites parts from one explicit assistant message.""" + """Ensures Chat rejects reasoning after text or calls within one assistant message.""" request = NormalizedRequest(model="m", input=[AssistantInput(content=content)]) with pytest.raises(UnsupportedInput): @@ -516,7 +514,7 @@ def test_chat_completions_client_remaps_parallel_image_result_after_tool_message request = NormalizedRequest( input=[ UserInput(content=[TextInput(content="Call all tools.")]), - Thinking(content="", summary="I should call all tools in parallel."), + Thinking(content="I should call all tools in parallel.", summary=""), ToolCall( tool_call_id="call_a", tool_name="read_image", @@ -708,7 +706,7 @@ def test_chat_completions_client_flushes_image_results_before_later_assistant_hi request = NormalizedRequest( input=[ UserInput(content=[TextInput(content="Call both tools.")]), - Thinking(content="", summary="I should call both tools in parallel."), + Thinking(content="I should call both tools in parallel.", summary=""), ToolCall( tool_call_id="call_a", tool_name="read_image", @@ -727,7 +725,7 @@ def test_chat_completions_client_flushes_image_results_before_later_assistant_hi tool_call_id="call_b", content=[TextInput(content="Text from b.txt")], ), - Thinking(content="", summary="Let me try again."), + Thinking(content="Let me try again.", summary=""), ToolCall( tool_call_id="call_c", tool_name="read_image", @@ -2057,14 +2055,11 @@ def _message_item_events( @pytest.mark.parametrize( "signature_fields", [{}, {"encrypted_content": None}, {"encrypted_content": ""}] ) -async def test_responses_events_omit_completely_empty_reasoning_part( +async def test_responses_events_preserve_completely_empty_reasoning_part( monkeypatch: pytest.MonkeyPatch, signature_fields: dict[str, str | None], ) -> None: - """Ensures absent or empty ciphertext cannot materialize an empty reasoning lifecycle.""" - # A reasoning item with no content, summary, signature, or deltas carries - # nothing to translate, so its part lifecycle is omitted from the IR and the - # surviving parts are reindexed to stay dense. + """Ensures empty Responses items retain their IDs and position without invented ciphertext.""" empty_reasoning_item = { "id": "rs_123", "type": "reasoning", @@ -2108,9 +2103,11 @@ async def stub_native_events( PartStartEvent(index=0, part=TextOutput(content="", id="msg_a")), PartDeltaEvent(index=0, delta=TextDelta(content_delta="Hi")), PartEndEvent(index=0, part=TextOutput(content="Hi", id="msg_a")), - PartStartEvent(index=1, part=TextOutput(content="", id="msg_b")), - PartDeltaEvent(index=1, delta=TextDelta(content_delta="Bye")), - PartEndEvent(index=1, part=TextOutput(content="Bye", id="msg_b")), + PartStartEvent(index=1, part=Thinking(content="", summary="", id="rs_123")), + PartEndEvent(index=1, part=Thinking(content="", summary="", id="rs_123")), + PartStartEvent(index=2, part=TextOutput(content="", id="msg_b")), + PartDeltaEvent(index=2, delta=TextDelta(content_delta="Bye")), + PartEndEvent(index=2, part=TextOutput(content="Bye", id="msg_b")), ] @@ -2263,42 +2260,31 @@ async def stub_native_events( assert first == PartStartEvent(index=0, part=expected_part) -async def test_responses_events_reject_reasoning_outside_capability( - monkeypatch: pytest.MonkeyPatch, -) -> None: - async def stub_native_events( - native_request: OpenAIResponsesCreateRequest, - ) -> AsyncIterator[OpenAIResponsesStreamEvent]: - yield _response_event( - { - "type": "response.output_item.added", - "item": { - "id": "rs_123", - "type": "reasoning", - "content": [{"type": "reasoning_text", "text": "raw"}], - "summary": [], - }, - "output_index": 0, - "sequence_number": 0, - } - ) - - async with httpx.AsyncClient(transport=httpx.MockTransport(_unexpected_http)) as http_client: - client = OpenAIResponsesClient(http_client, capabilities=OPENAI_CAPABILITIES) - monkeypatch.setattr(client, "native_events", stub_native_events) - with pytest.raises(ValueError, match="cannot contain raw text"): - await anext(client.events(NormalizedRequest(model="m"))) - - -def test_responses_client_rejects_unsigned_summary_history() -> None: - """Ensures Responses rejects summaries without required opaque state.""" - request = NormalizedRequest( - input=[Thinking(content="", summary="Summary")], - model="m", +@pytest.mark.parametrize( + ("content", "summary", "signature"), + [ + ("Raw", "", None), + ("", "Summary", None), + ("Raw", "Summary", "opaque"), + ("Raw", "", "opaque"), + ("", "", "opaque"), + ("", "", None), + ], +) +def test_responses_reasoning_history_round_trip(content, summary, signature) -> None: + """Ensures Responses normalizes and restores each reasoning field independently.""" + item = { + "type": "reasoning", + "content": [{"type": "reasoning_text", "text": content}] if content else [], + "summary": [{"type": "summary_text", "text": summary}] if summary else [], + } + if signature is not None: + item["encrypted_content"] = signature + normalized = OpenAIResponsesAdapter(OPENAI_CAPABILITIES).normalize_request( + OpenAIResponsesCreateRequest(model="m", input=[item]) ) - - with pytest.raises(ValueError, match="summary requires a signature"): - OpenAIResponsesClient._native_request(request) + assert normalized.input == [Thinking(content=content, summary=summary, signature=signature)] + assert OpenAIResponsesClient._native_request(normalized).model_dump()["input"] == [item] @pytest.mark.parametrize( @@ -2427,11 +2413,11 @@ async def stub_native_events( ] -async def test_responses_events_defer_completely_empty_reasoning_part_start( +async def test_responses_events_start_empty_reasoning_immediately( monkeypatch: pytest.MonkeyPatch, ) -> None: - # Only a completely empty reasoning item is deferred; with no further events - # it produces nothing at all. + """Ensures an empty start preserves the reasoning item identity as soon as it arrives.""" + async def stub_native_events( native_request: OpenAIResponsesCreateRequest, ) -> AsyncIterator[OpenAIResponsesStreamEvent]: @@ -2448,15 +2434,16 @@ async def stub_native_events( client = OpenAIResponsesClient(http_client, capabilities=VLLM_CAPABILITIES) monkeypatch.setattr(client, "native_events", stub_native_events) stream = client.events(NormalizedRequest(model="m")) - with pytest.raises(StopAsyncIteration): - await anext(stream) + assert await anext(stream) == PartStartEvent( + index=0, part=Thinking(content="", summary="", id="rs_123") + ) + await stream.aclose() async def test_responses_events_complete_reasoning_part_without_deltas( monkeypatch: pytest.MonkeyPatch, ) -> None: - # A reasoning item whose text only appears in the completed item still gets a - # balanced part lifecycle: the deferred start is flushed at completion. + """Ensures text present only at completion survives in the final part snapshot.""" native_events = [ _response_event( { @@ -2624,11 +2611,7 @@ async def normalized_events() -> AsyncIterator[ModelResponseStreamEvent]: async def test_responses_events_translate_non_empty_part_added_snapshots( monkeypatch: pytest.MonkeyPatch, ) -> None: - # Part-added snapshots can carry initial text; translate them as deltas so - # the streamed text stays consistent with the completed snapshots. Raw - # reasoning and summaries use separate reasoning items, as required by the - # Responses lifecycle. Empty part-added echoes remain ignored (see - # test_responses_events_ignore_...). + """Ensures raw, summary, and answer text present in part-added snapshots reach the IR.""" native_events = [ _response_event( { @@ -2792,11 +2775,10 @@ async def stub_native_events( ] -async def test_responses_events_ignore_empty_deltas_on_deferred_reasoning_part( +async def test_responses_events_ignore_empty_reasoning_deltas( monkeypatch: pytest.MonkeyPatch, ) -> None: - # Empty deltas are lifecycle echoes: they must not materialize a deferred - # reasoning part, so the part is still omitted at completion. + """Ensures an empty item survives empty delta echoes without creating reasoning text.""" empty_item = {"id": "rs_123", "type": "reasoning", "content": [], "summary": []} native_events = [ _response_event( @@ -2848,7 +2830,8 @@ async def stub_native_events( monkeypatch.setattr(client, "native_events", stub_native_events) events = [event async for event in client.events(NormalizedRequest(model="m"))] - assert events == [] + part = Thinking(id="rs_123", content="", summary="") + assert events == [PartStartEvent(index=0, part=part), PartEndEvent(index=0, part=part)] async def test_responses_events_forward_same_provider_opaque_reasoning_state( @@ -3927,3 +3910,277 @@ def handler(request: httpx.Request) -> httpx.Response: error = exc_info.value assert error.response.status_code == 404 assert isinstance(error.__cause__, APIStatusError) + + +def _provider_chunk(delta, finish_reason=None): + return { + "id": "chatcmpl_synthetic", + "object": "chat.completion.chunk", + "created": 1, + "model": "synthetic", + "choices": [{"index": 0, "delta": delta, "finish_reason": finish_reason}], + } + + +def _provider_stream(*chunks): + return httpx.Response( + 200, + text="".join(f"data: {dumps(chunk)}\n\n" for chunk in chunks) + "data: [DONE]\n\n", + headers={"content-type": "text/event-stream"}, + ) + + +@pytest.mark.parametrize("following", [{"content": "\n\n"}, {"reasoning_content": " think "}]) +async def test_tool_lifecycle_closes_before_following_content(following): + """Ensures actual nonempty content finishes the preceding call before starting a new part.""" + first = { + "index": 0, + "id": "call_1", + "type": "function", + "function": {"name": "lookup", "arguments": "{"}, + } + chunks = [ + _provider_chunk({"tool_calls": [first]}), + _provider_chunk( + { + "content": "", + "reasoning_content": "", + "tool_calls": [{"index": 0, "function": {"arguments": "}"}}], + } + ), + _provider_chunk(following), + _provider_chunk({}, "tool_calls"), + ] + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _provider_stream(*chunks)) + ) as transport: + client = OpenAIChatCompletionsClient( + transport, capabilities=PROVIDER_CAPABILITIES["vllm"], api_key="test" + ) + events = [ + event + async for event in client.events(NormalizedRequest(model="synthetic", stream=True)) + ] + starts = [event for event in events if isinstance(event, PartStartEvent)] + ends = [event for event in events if isinstance(event, PartEndEvent)] + assert [event.index for event in starts] == [0, 1] + assert [event.index for event in ends] == [0, 1] + assert ends[0].part == ToolCall(tool_call_id="call_1", tool_name="lookup", args="{}") + assert events.index(ends[0]) < events.index(starts[1]) + assert ends[1].part == ( + TextOutput(content="\n\n") + if "content" in following + else Thinking(content=" think ", summary="") + ) + + +@pytest.mark.parametrize( + "following", + [ + {"content": "text"}, + {"reasoning_content": "think"}, + { + "tool_calls": [ + {"index": 1, "id": "call_2", "function": {"name": "second", "arguments": "{}"}} + ] + }, + ], +) +async def test_closed_tool_call_cannot_resume(following): + """Ensures intervening text, reasoning, or another call makes later fragments fail explicitly.""" + chunks = [ + _provider_chunk( + { + "tool_calls": [ + {"index": 0, "id": "call_1", "function": {"name": "first", "arguments": "{"}} + ] + } + ), + _provider_chunk(following), + _provider_chunk({"tool_calls": [{"index": 0, "function": {"arguments": "}"}}]}), + _provider_chunk({}, "stop"), + ] + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _provider_stream(*chunks)) + ) as transport: + client = OpenAIChatCompletionsClient( + transport, capabilities=PROVIDER_CAPABILITIES["vllm"], api_key="test" + ) + with pytest.raises(ValueError, match="contiguous"): + [ + event + async for event in client.events(NormalizedRequest(model="synthetic", stream=True)) + ] + + +@pytest.mark.parametrize("placement", ["message", "part", "call"]) +def test_translated_history_rejects_google_state(placement): + """Ensures opaque native continuation state is rejected instead of dropped in translation.""" + message = { + "role": "assistant", + "content": [{"type": "text", "text": "hello"}], + "tool_calls": [ + {"id": "call_1", "type": "function", "function": {"name": "lookup", "arguments": "{}"}} + ], + } + extension = {"google": {"thought_signature": "opaque"}} + target = ( + message + if placement == "message" + else message["content"][0] + if placement == "part" + else message["tool_calls"][0] + ) + target["extra_content"] = extension + original = deepcopy(message) + request = OpenAIChatCompletionsCreateRequest(model="synthetic", messages=[message]) + with pytest.raises(UnsupportedInput, match="extra_content"): + OpenAIChatCompletionsAdapter(PROVIDER_CAPABILITIES["vllm"]).normalize_request(request) + assert message == original + + +@pytest.mark.parametrize("placement", ["message", "call"]) +@pytest.mark.parametrize("coordinator", ["responses", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_shared_chat_client_ignores_unknown_extra_content(placement, coordinator, stream): + """Ensures a shared protocol client completes output carrying an extension it does not model.""" + delta = { + "tool_calls": [ + {"index": 0, "id": "call_1", "function": {"name": "lookup", "arguments": "{}"}} + ] + } + target = delta if placement == "message" else delta["tool_calls"][0] + target["extra_content"] = {"google": {"thought_signature": "opaque"}} + body = {"model": "synthetic", "stream": stream} + if coordinator == "responses": + body["input"] = "Hello" + else: + body.update(messages=[{"role": "user", "content": "Hello"}], max_tokens=32) + async with Molto( + http_client=httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: _provider_stream( + _provider_chunk(delta), _provider_chunk({}, "tool_calls") + ) + ) + ) + ) as client: + result = await getattr(client, coordinator)( + body=body, endpoint="chat/completions", provider="vllm", api_key="test" + ) + if stream: + async with result: + result = collect_sdk_response(coordinator, [event async for event in result]) + items = result.output if coordinator == "responses" else result.content + assert [item.type for item in items] == [ + "function_call" if coordinator == "responses" else "tool_use" + ] + + +@pytest.mark.parametrize("placement", ["message", "call"]) +@pytest.mark.parametrize("coordinator", ["responses", "messages"]) +@pytest.mark.parametrize("stream", [False, True]) +async def test_translated_output_rejects_google_state_and_closes(placement, coordinator, stream): + """Ensures OpenAI output state it cannot translate fails explicitly and releases the stream.""" + provider = "openai" + delta = { + "tool_calls": [ + {"index": 0, "id": "call_1", "function": {"name": "lookup", "arguments": "{}"}} + ] + } + target = delta if placement == "message" else delta["tool_calls"][0] + target["extra_content"] = {"google": {"thought_signature": "opaque"}} + responses = [] + + def handler(request): + response = _provider_stream(_provider_chunk(delta), _provider_chunk({}, "tool_calls")) + responses.append(response) + return response + + body = {"model": "synthetic", "stream": stream} + if coordinator == "responses": + body["input"] = "Hello" + else: + body.update(messages=[{"role": "user", "content": "Hello"}], max_tokens=32) + async with Molto( + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)) + ) as client: + with pytest.raises(ValueError, match="extra_content|associated text"): + result = await getattr(client, coordinator)( + body=body, endpoint="chat/completions", provider=provider, api_key="test" + ) + if stream: + async with result: + [event async for event in result] + assert responses[0].is_closed + + +def test_chat_projection_rejects_reasoning_signatures(): + """Ensures Chat history rejects opaque state that its protocol cannot represent.""" + request = NormalizedRequest( + model="synthetic", + input=[AssistantInput(content=[Thinking(content="", summary="", signature="opaque")])], + ) + with pytest.raises(UnsupportedInput, match="cannot represent"): + OpenAIChatCompletionsClient._native_request(request) + + +async def test_generic_chat_missing_index_fails_instead_of_losing_call(): + """Ensures unsupported missing indices cannot produce a successful empty translated response.""" + chunk = _provider_chunk( + { + "tool_calls": [ + {"index": None, "id": "call_1", "function": {"name": "lookup", "arguments": "{}"}} + ] + } + ) + async with httpx.AsyncClient( + transport=httpx.MockTransport( + lambda _: _provider_stream(chunk, _provider_chunk({}, "tool_calls")) + ) + ) as transport: + client = OpenAIChatCompletionsClient( + transport, capabilities=PROVIDER_CAPABILITIES["vllm"], api_key="test" + ) + with pytest.raises(ValueError, match="require an index"): + [ + event + async for event in client.events(NormalizedRequest(model="synthetic", stream=True)) + ] + + +@pytest.mark.parametrize("usage_only", [True, False]) +async def test_chat_translation_selects_choice_zero_by_index(usage_only): + """Ensures alternative completions stay native and their chunks can still report shared usage.""" + chunks = [_provider_chunk({"content": "first"}), _provider_chunk({"content": "alternative"})] + chunks[1]["choices"][0]["index"] = 1 + mixed = _provider_chunk({"reasoning": "wrong"}) + mixed["choices"][0]["index"] = 1 + mixed["choices"].append({"index": 0, "delta": {"content": " choice"}}) + alternate_end = _provider_chunk({}, "length") + alternate_end["choices"][0]["index"] = 1 + chunks.extend([mixed, _provider_chunk({}, "stop"), alternate_end]) + if usage_only: + chunks.append({**_provider_chunk({}), "choices": []}) + chunks[-1]["usage"] = {"prompt_tokens": 1, "completion_tokens": 2, "total_tokens": 3} + async with httpx.AsyncClient( + transport=httpx.MockTransport(lambda _: _provider_stream(*chunks)) + ) as transport: + client = OpenAIChatCompletionsClient( + transport, capabilities=OPENAI_CAPABILITIES, api_key="test" + ) + events = [ + event async for event in client.events(NormalizedRequest(model="m", stream=True)) + ] + native = [ + event + async for event in client.native_events({"model": "m", "messages": [], "stream": True}) + ] + assert [event.part for event in events if isinstance(event, PartEndEvent)] == [ + TextOutput(content="first choice") + ] + assert events[-1].termination_reason == "stop" + assert events[-1].usage.total_tokens == 3 + assert [[choice.index for choice in chunk.choices] for chunk in native] == [ + [choice["index"] for choice in chunk["choices"]] for chunk in chunks + ] diff --git a/tests/upstream/test_openai_search.py b/tests/upstream/test_openai_search.py index fe97b78..febc159 100644 --- a/tests/upstream/test_openai_search.py +++ b/tests/upstream/test_openai_search.py @@ -358,7 +358,7 @@ async def typed_events(client, request): response = _response( usage={ "input_tokens": 1, - "input_tokens_details": {"cached_tokens": 0}, + "input_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0}, "output_tokens": 2, "output_tokens_details": {"reasoning_tokens": 0}, "total_tokens": 3, diff --git a/tests/upstream/test_openrouter.py b/tests/upstream/test_openrouter.py new file mode 100644 index 0000000..cdf4692 --- /dev/null +++ b/tests/upstream/test_openrouter.py @@ -0,0 +1,131 @@ +"""OpenRouter Responses interprets explicit wire reasoning without changing other protocols.""" + +import httpx +import pytest + +from molto.providers import PROVIDER_CAPABILITIES, ProviderCapabilities +from molto.types.normalized import ( + NormalizedRequest, + PartDeltaEvent, + PartEndEvent, + Thinking, + ThinkingDelta, +) +from molto.upstream.openrouter import OpenRouterResponsesClient +from tests.upstream.test_openai import _response_event, _unexpected_http + + +def test_openrouter_uses_raw_history_profile_with_explicit_response_labels(): + """Ensures ambiguous history is raw while Responses keeps explicit wire labels.""" + profile = ProviderCapabilities(thinking="summary") + resolved = OpenRouterResponsesClient.resolve_capabilities(profile) + assert resolved == ProviderCapabilities(thinking="raw") + assert profile.thinking == "summary" + + +async def normalized_events(monkeypatch, items): + async def native_events(request): + for item in items: + yield _response_event(item) + + async with httpx.AsyncClient(transport=httpx.MockTransport(_unexpected_http)) as transport: + client = OpenRouterResponsesClient( + transport, capabilities=PROVIDER_CAPABILITIES["openrouter"] + ) + monkeypatch.setattr(client, "native_events", native_events) + return [event async for event in client.events(NormalizedRequest(model="m"))] + + +def reasoning_item(**fields): + return {"id": "rs_1", "type": "reasoning", "summary": [], **fields} + + +def item_event(item, *, done=False): + return { + "type": "response.output_item.done" if done else "response.output_item.added", + "output_index": 0, + "sequence_number": 0, + "item": item, + } + + +@pytest.mark.parametrize(("raw", "signature"), [(True, None), (False, None), (False, "opaque")]) +async def test_wire_reasoning_preserves_raw_or_summary(monkeypatch, raw, signature): + """Ensures explicit raw text and summaries preserve their representation and observed state.""" + item = reasoning_item( + **( + {"content": [{"type": "reasoning_text", "text": "Thought"}], "format": "unknown"} + if raw + else { + "summary": [{"type": "summary_text", "text": "Thought"}], + "encrypted_content": signature, + } + ) + ) + events = await normalized_events(monkeypatch, [item_event(item), item_event(item, done=True)]) + assert events[-1] == PartEndEvent( + index=0, + part=Thinking( + id="rs_1", + content="Thought" if raw else "", + summary="" if raw else "Thought", + signature=signature, + ), + ) + + +@pytest.mark.parametrize( + ("fields", "error"), + [ + ( + { + "summary": [{"type": "summary_text", "text": "Summary"}], + "encrypted_content": "opaque", + "format": "unknown", + }, + "format cannot be translated", + ), + ( + {"content": [{"type": "reasoning_text", "text": "Raw"}], "format": "named-v1"}, + "format cannot be translated", + ), + ], +) +async def test_wire_reasoning_rejects_unsupported_formats(monkeypatch, fields, error): + """Ensures wire interpretation rejects unsupported opaque formats.""" + with pytest.raises(ValueError, match=error): + await normalized_events(monkeypatch, [item_event(reasoning_item(**fields), done=True)]) + + +@pytest.mark.parametrize("first_raw", [False, True]) +async def test_wire_reasoning_preserves_both_delta_labels(monkeypatch, first_raw): + """Ensures both delta labels survive in a single item in either arrival order.""" + deltas = [ + { + "type": "response.reasoning_text.delta" + if raw + else "response.reasoning_summary_text.delta", + "content_index" if raw else "summary_index": 0, + "item_id": "rs_1", + "output_index": 0, + "sequence_number": index, + "delta": "Thought", + } + for index, raw in enumerate((first_raw, not first_raw)) + ] + item = reasoning_item( + content=[{"type": "reasoning_text", "text": "Thought"}], + summary=[{"type": "summary_text", "text": "Thought"}], + encrypted_content="opaque", + ) + events = await normalized_events( + monkeypatch, [item_event(reasoning_item()), *deltas, item_event(item, done=True)] + ) + expected = [ThinkingDelta(content_delta="Thought"), ThinkingDelta(summary_delta="Thought")] + assert [event.delta for event in events if isinstance(event, PartDeltaEvent)] == [ + *(expected if first_raw else reversed(expected)), + ThinkingDelta(signature_delta="opaque"), + ] + assert events[-1] == PartEndEvent( + index=0, part=Thinking(id="rs_1", content="Thought", summary="Thought", signature="opaque") + ) diff --git a/tests/utils/test_test_utils.py b/tests/utils/test_test_utils.py index 793d96f..2c32557 100644 --- a/tests/utils/test_test_utils.py +++ b/tests/utils/test_test_utils.py @@ -326,14 +326,14 @@ def test_reconstructable_responses_event_preserves_incomplete_result( assert response["usage"] == expected["usage"] -def test_reconstructable_responses_event_requires_recorded_cache_write_count( +def test_reconstructable_responses_event_preserves_missing_cache_write_count( incomplete_responses_event: tuple[dict[str, Any], dict[str, Any]], ) -> None: """Ensure comparison validation cannot invent a missing incomplete cache-write count.""" event, body = deepcopy(incomplete_responses_event) event["response"]["usage"]["input_tokens_details"].pop("cache_write_tokens", None) - with pytest.raises(ValidationError, match="cache_write_tokens"): - reconstructable_responses_event(dumps_sse(event), body) + actual = reconstructable_responses_event(dumps_sse(event), body) + assert "cache_write_tokens" not in actual["response"]["usage"]["input_tokens_details"] @pytest.mark.parametrize(