diff --git a/crates/lingua/src/processing/transform.rs b/crates/lingua/src/processing/transform.rs index 3ce3cb4d..7d09912e 100644 --- a/crates/lingua/src/processing/transform.rs +++ b/crates/lingua/src/processing/transform.rs @@ -22,9 +22,10 @@ use crate::providers::openai::model_needs_transforms; use crate::serde_json; use crate::serde_json::Value; use crate::universal::{ - AssistantContent, AssistantContentPart, Message, UniversalReasoningDelta, UniversalRequest, - UniversalResponse, UniversalStreamChoice, UniversalStreamChunk, UniversalStreamDelta, - UniversalToolCallDelta, UniversalToolFunctionDelta, UserContent, UserContentPart, + AssistantContent, AssistantContentPart, Message, TextContentPart, UniversalReasoningDelta, + UniversalRequest, UniversalResponse, UniversalStreamChoice, UniversalStreamChunk, + UniversalStreamDelta, UniversalToolCallDelta, UniversalToolFunctionDelta, UserContent, + UserContentPart, }; use serde::de::DeserializeOwned; use thiserror::Error; @@ -465,6 +466,83 @@ pub fn request_to_universal(input: Bytes) -> Result bool { + match msg { + Message::Assistant { + content: AssistantContent::Array(parts), + .. + } => { + !parts.is_empty() + && parts + .iter() + .all(|part| matches!(part, AssistantContentPart::Reasoning { .. })) + } + _ => false, + } +} + +fn merge_responses_output_parts_for_chat_completions(messages: Vec) -> Vec { + let mut merged = Vec::with_capacity(messages.len()); + + for message in messages { + let should_merge = matches!(merged.last(), Some(prev) if is_reasoning_only_response_message(prev)) + && matches!(message, Message::Assistant { .. }); + + if !should_merge { + merged.push(message); + continue; + } + + let Some(previous) = merged.pop() else { + merged.push(message); + continue; + }; + + let Message::Assistant { + content: AssistantContent::Array(reasoning_parts), + id: reasoning_id, + } = previous + else { + merged.push(previous); + merged.push(message); + continue; + }; + + let Message::Assistant { + content: next_content, + id: next_id, + } = message + else { + merged.push(Message::Assistant { + content: AssistantContent::Array(reasoning_parts), + id: reasoning_id, + }); + merged.push(message); + continue; + }; + + let mut combined_parts = reasoning_parts; + match next_content { + AssistantContent::Array(parts) => combined_parts.extend(parts), + AssistantContent::String(text) => { + combined_parts.push(AssistantContentPart::Text(TextContentPart { + text, + encrypted_content: None, + cache_control: None, + provider_options: None, + })); + } + } + + merged.push(Message::Assistant { + content: AssistantContent::Array(combined_parts), + id: next_id.or(reasoning_id), + }); + } + + merged +} + /// Transform a response payload from one format to another. /// /// # Arguments @@ -495,7 +573,16 @@ pub fn transform_response( let target_adapter = adapter_for_format(target_format) .ok_or(TransformError::UnsupportedTargetFormat(target_format))?; - let universal_resp = source_adapter.response_to_universal(response)?; + let mut universal_resp = source_adapter.response_to_universal(response)?; + if source_format == ProviderFormat::Responses + && matches!( + target_format, + ProviderFormat::ChatCompletions | ProviderFormat::Google + ) + { + universal_resp.messages = + merge_responses_output_parts_for_chat_completions(universal_resp.messages); + } let transformed = target_adapter.response_from_universal(&universal_resp)?; let bytes = crate::serde_json::to_vec(&transformed) diff --git a/crates/lingua/src/providers/openai/responses_adapter.rs b/crates/lingua/src/providers/openai/responses_adapter.rs index ec1e5564..7792ed8a 100644 --- a/crates/lingua/src/providers/openai/responses_adapter.rs +++ b/crates/lingua/src/providers/openai/responses_adapter.rs @@ -1558,6 +1558,154 @@ mod tests { ); } + #[test] + fn responses_reasoning_then_message_transforms_to_chat_content() { + let payload = json!({ + "id": "resp_123", + "object": "response", + "model": "gpt-5.5", + "status": "completed", + "output": [ + { + "type": "reasoning", + "id": "rs_123", + "summary": [], + "encrypted_content": "encrypted-reasoning" + }, + { + "type": "message", + "id": "msg_123", + "status": "completed", + "role": "assistant", + "content": [{ + "type": "output_text", + "text": "visible answer", + "annotations": [] + }] + } + ], + "usage": { + "input_tokens": 10, + "output_tokens": 12, + "output_tokens_details": { + "reasoning_tokens": 4 + }, + "total_tokens": 22 + } + }); + + let transformed = transform_response( + Bytes::from(payload.to_string()), + ProviderFormat::ChatCompletions, + ) + .expect("Responses response should transform to Chat Completions") + .into_bytes(); + + #[derive(serde::Deserialize)] + struct ChatResponse { + choices: Vec, + } + + #[derive(serde::Deserialize)] + struct ChatChoice { + message: ChatMessage, + } + + #[derive(serde::Deserialize)] + struct ChatMessage { + content: Option, + reasoning: Option, + reasoning_signature: Option, + } + + let chat: ChatResponse = serde_json::from_slice(&transformed).unwrap(); + + assert_eq!(chat.choices.len(), 1); + assert_eq!( + chat.choices[0].message.content.as_deref(), + Some("visible answer") + ); + assert_eq!(chat.choices[0].message.reasoning.as_deref(), Some("")); + assert_eq!( + chat.choices[0].message.reasoning_signature.as_deref(), + Some("encrypted-reasoning") + ); + } + + #[test] + fn responses_reasoning_then_message_preserves_output_item_ids_in_universal() { + let adapter = ResponsesAdapter; + let payload = json!({ + "id": "resp_123", + "object": "response", + "model": "gpt-5.5", + "status": "completed", + "output": [ + { + "type": "reasoning", + "id": "rs_123", + "summary": [], + "encrypted_content": "encrypted-reasoning" + }, + { + "type": "message", + "id": "msg_123", + "status": "completed", + "role": "assistant", + "content": [{ + "type": "output_text", + "text": "visible answer", + "annotations": [] + }] + } + ] + }); + + let universal = adapter + .response_to_universal(payload) + .expect("Responses output should convert to universal"); + + assert_eq!(universal.messages.len(), 2); + assert!(matches!( + &universal.messages[0], + Message::Assistant { + id: Some(id), + content: AssistantContent::Array(parts), + } if id == "rs_123" && matches!(parts.as_slice(), [AssistantContentPart::Reasoning { .. }]) + )); + assert!(matches!( + &universal.messages[1], + Message::Assistant { + id: Some(id), + content: AssistantContent::Array(parts), + } if id == "msg_123" && matches!(parts.as_slice(), [AssistantContentPart::Text(_)]) + )); + + #[derive(serde::Deserialize)] + struct ResponsesOutput { + output: Vec, + } + + #[derive(serde::Deserialize)] + struct ResponsesOutputItem { + id: String, + } + + let serialized = adapter + .response_from_universal(&universal) + .expect("Universal response should convert back to Responses"); + let responses: ResponsesOutput = serde_json::from_value(serialized).unwrap(); + + assert_eq!( + responses + .output + .iter() + .map(|item| item.id.clone()) + .collect::>(), + vec!["rs_123".to_string(), "msg_123".to_string()] + ); + } + #[test] fn test_responses_preserves_deferred_namespace_tool_search_tools() { let adapter = ResponsesAdapter; diff --git a/payloads/scripts/transforms/__snapshots__/transforms.test.ts.snap b/payloads/scripts/transforms/__snapshots__/transforms.test.ts.snap index 280d141f..99587962 100644 --- a/payloads/scripts/transforms/__snapshots__/transforms.test.ts.snap +++ b/payloads/scripts/transforms/__snapshots__/transforms.test.ts.snap @@ -17581,15 +17581,6 @@ exports[`chat-completions → responses > chatCompletionsAnthropicCacheControlPa { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "I don’t see the reference text yet. Please paste the stable reference text you want summarized. If it’s long, feel free to send it in chunks. @@ -17618,6 +17609,7 @@ Cacheable context card template (you can copy this to store and reuse): - Keywords: Once you provide the text, I’ll generate the summary in your chosen format and treat it as the cacheable context for this session.", + "reasoning": "", "role": "assistant", }, }, @@ -17672,15 +17664,6 @@ exports[`chat-completions → responses > chatCompletionsAssistantCacheControlPa { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "I can’t directly pull a cached prefill from elsewhere in this chat. If you want me to use a prefill, paste its content here or tell me the style you want, and I’ll apply it to my responses. I can also provide you with a reusable prefill you can store and reuse. @@ -17698,6 +17681,7 @@ Prefill (system-like): How to use: - Use this as the initial context before your prompt (e.g., as a system message in an API or as a header in your workflow), then ask your question. - If you want a domain-specific prefill (coding, legal, medical, etc.), tell me and I’ll tailor it.", + "reasoning": "", "role": "assistant", }, }, @@ -17740,15 +17724,6 @@ exports[`chat-completions → responses > complexReasoningRequest > response 1`] { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Answer (no colon counted, only digits in HHMM): @@ -17772,6 +17747,7 @@ Most common digits: 0 and 1 (tie), each appearing 1164 times ≈ 20.21% of all d Rarest digits: 6, 7, 8, and 9 (tie), each appearing 264 times ≈ 4.58% of all digits. Brief note on method: counted digit occurrences separately for hour tens (H1), hour units (H2), minute tens (M1), and minute units (M2), then summed.", + "reasoning": "", "role": "assistant", }, }, @@ -17834,15 +17810,6 @@ exports[`chat-completions → responses > exclusiveMinimumToolParam > response 1 { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Sure. I can configure the LLM, but I need a max_tokens value to apply. @@ -17854,6 +17821,7 @@ Options (balanced defaults): - 4096 – longer responses If you’d like, I can apply 2048 tokens right now as a balanced default. Would you like me to set max_tokens to 2048 (or choose another value)? Also, note that this configuration step only covers max_tokens; tell me if you want me to note any other preferences, and I can track them for you.", + "reasoning": "", "role": "assistant", }, }, @@ -17895,18 +17863,10 @@ exports[`chat-completions → responses > fableTemperatureParam > response 1`] = { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Hi there! How can I help you today?", + "reasoning": "", "role": "assistant", }, }, @@ -17948,18 +17908,10 @@ exports[`chat-completions → responses > frequencyPenaltyParam > response 1`] = { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Ok.", + "reasoning": "", "role": "assistant", }, }, @@ -18028,14 +17980,6 @@ exports[`chat-completions → responses > functionToolsWithReasoningEffortParam "annotations": [], "reasoning": "", "role": "assistant", - }, - }, - { - "finish_reason": "tool_calls", - "index": 1, - "message": { - "annotations": [], - "role": "assistant", "tool_calls": [ { "function": { @@ -18117,15 +18061,6 @@ exports[`chat-completions → responses > googleToolCallThoughtSignatureReplayPa { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "The collections in the mydb database are: @@ -18133,6 +18068,7 @@ exports[`chat-completions → responses > googleToolCallThoughtSignatureReplayPa - users Would you like to see document counts or sample documents from any of these?", + "reasoning": "", "role": "assistant", }, }, @@ -18183,18 +18119,10 @@ exports[`chat-completions → responses > imageUrlMimeTypeFallbackParam > respon { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "A cute tabby cat with striped fur is lying on a warm wooden surface, front paws crossed and head tilted, looking directly at the camera with big amber eyes. Its ears are perked and whiskers are prominent, giving a curious, relaxed expression. The background is softly blurred, suggesting an indoor setting with furniture.", + "reasoning": "", "role": "assistant", }, }, @@ -18241,18 +18169,10 @@ exports[`chat-completions → responses > instructionsParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "ok", + "reasoning": "", "role": "assistant", }, }, @@ -18314,18 +18234,10 @@ exports[`chat-completions → responses > jsonSchemaFormatParam > response 1`] = { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"created_at":"2026-04-14T00:00:00Z"}", + "reasoning": "", "role": "assistant", }, }, @@ -18391,18 +18303,10 @@ exports[`chat-completions → responses > jsonSchemaMinMaxItemsParam > response { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"tags":["json","api","tags"]}", + "reasoning": "", "role": "assistant", }, }, @@ -18465,18 +18369,10 @@ exports[`chat-completions → responses > jsonSchemaMinimumMaximumParam > respon { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"score":0}", + "reasoning": "", "role": "assistant", }, }, @@ -18557,18 +18453,10 @@ exports[`chat-completions → responses > jsonSchemaPrefixItemsParam > response { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"tuple": ["gateway", 7]}", + "reasoning": "", "role": "assistant", }, }, @@ -18610,18 +18498,10 @@ exports[`chat-completions → responses > logitBiasParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Hello! How can I help you today?", + "reasoning": "", "role": "assistant", }, }, @@ -18678,18 +18558,10 @@ exports[`chat-completions → responses > maxCompletionTokensParam > response 1` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "ok", + "reasoning": "", "role": "assistant", }, }, @@ -18737,18 +18609,10 @@ exports[`chat-completions → responses > metadataParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "ok.", + "reasoning": "", "role": "assistant", }, }, @@ -18844,18 +18708,10 @@ exports[`chat-completions → responses > nMultipleCompletionsParam > response 1 { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Hello.", + "reasoning": "", "role": "assistant", }, }, @@ -18898,15 +18754,6 @@ exports[`chat-completions → responses > openaiPromptCacheKeyParam > response 1 { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "I don’t have access to a specific “cached policy” in this chat. If you share the policy text (or a link/document), I’ll summarize it right away. @@ -18926,6 +18773,7 @@ If you paste the policy text, I can provide: - A brief section-by-section summary (if the document is long). Would you like to share the policy now, or tell me your preferred length and audience for the summary?", + "reasoning": "", "role": "assistant", }, }, @@ -18971,18 +18819,10 @@ exports[`chat-completions → responses > opus47AdaptiveThinkingReasoningEffortP { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "4", + "reasoning": "", "role": "assistant", }, }, @@ -19049,14 +18889,6 @@ exports[`chat-completions → responses > parallelToolCallsDisabledParam > respo "annotations": [], "reasoning": "", "role": "assistant", - }, - }, - { - "finish_reason": "tool_calls", - "index": 1, - "message": { - "annotations": [], - "role": "assistant", "tool_calls": [ { "function": { @@ -19150,15 +18982,6 @@ exports[`chat-completions → responses > parallelToolCallsRequest > response 1` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Here’s the current weather: @@ -19167,6 +18990,7 @@ exports[`chat-completions → responses > parallelToolCallsRequest > response 1` - New York, NY: 45°F and cloudy Want an hourly forecast or precipitation chance for either city?", + "reasoning": "", "role": "assistant", }, }, @@ -19212,15 +19036,6 @@ exports[`chat-completions → responses > predictionParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Here’s an updated version that adds basic error handling by validating inputs and guarding against division by zero. It throws descriptive errors so callers can handle them with try/catch. @@ -19256,6 +19071,7 @@ try { } If you prefer a non-throwing variant that returns an error object instead of throwing, tell me and I’ll adapt it.", + "reasoning": "", "role": "assistant", }, }, @@ -19297,18 +19113,10 @@ exports[`chat-completions → responses > presencePenaltyParam > response 1`] = { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Ok.", + "reasoning": "", "role": "assistant", }, }, @@ -19351,18 +19159,10 @@ exports[`chat-completions → responses > promptCacheKeyParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "ok.", + "reasoning": "", "role": "assistant", }, }, @@ -19407,18 +19207,10 @@ exports[`chat-completions → responses > reasoningEffortLowParam > response 1`] { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "4", + "reasoning": "", "role": "assistant", }, }, @@ -19460,18 +19252,10 @@ exports[`chat-completions → responses > reasoningEffortMinimalParam > response { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "2 + 2 = 4", + "reasoning": "", "role": "assistant", }, }, @@ -19554,15 +19338,6 @@ exports[`chat-completions → responses > reasoningRequest > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Step 1: Distance of each part @@ -19577,6 +19352,7 @@ Step 3: Average speed - Average speed = total distance / total time = 200 miles / 3 hours = 66 2/3 mph ≈ 66.67 mph Answer: 66 2/3 mph.", + "reasoning": "", "role": "assistant", }, }, @@ -19666,18 +19442,10 @@ exports[`chat-completions → responses > reasoningSummaryParam > response 1`] = { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "4", + "reasoning": "", "role": "assistant", }, }, @@ -19719,18 +19487,10 @@ exports[`chat-completions → responses > reasoningWithOutput > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Typically blue during a clear day. It can be red/orange/pink at sunrise or sunset, gray when it’s cloudy, and black at night. The blue color comes from the way sunlight scatters in the Earth's atmosphere. Want to know the current sky color for your location and time?", + "reasoning": "", "role": "assistant", }, }, @@ -19775,18 +19535,10 @@ exports[`chat-completions → responses > safetyIdentifierParam > response 1`] = { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Ok.", + "reasoning": "", "role": "assistant", }, }, @@ -19828,20 +19580,12 @@ exports[`chat-completions → responses > seedParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "7 Want a different range or another number?", + "reasoning": "", "role": "assistant", }, }, @@ -19884,18 +19628,10 @@ exports[`chat-completions → responses > serviceTierParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "ok.", + "reasoning": "", "role": "assistant", }, }, @@ -19940,18 +19676,10 @@ exports[`chat-completions → responses > simpleRequest > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Paris", + "reasoning": "", "role": "assistant", }, }, @@ -20032,18 +19760,10 @@ exports[`chat-completions → responses > stopSequencesParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20", + "reasoning": "", "role": "assistant", }, }, @@ -20086,18 +19806,10 @@ exports[`chat-completions → responses > storeDisabledParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Okay.", + "reasoning": "", "role": "assistant", }, }, @@ -20212,18 +19924,10 @@ exports[`chat-completions → responses > textFormatJsonObjectParam > response 1 { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"status": "ok"}", + "reasoning": "", "role": "assistant", }, }, @@ -20359,18 +20063,10 @@ exports[`chat-completions → responses > textFormatJsonSchemaNullableUnionTypeG { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"explanation":"This is a meta-request: the user asks the assistant to classify the current query and respond with JSON. It falls under meta/annotation and instruction-type content.","filter":null,"match":true}", + "reasoning": "", "role": "assistant", }, }, @@ -20435,18 +20131,10 @@ exports[`chat-completions → responses > textFormatJsonSchemaParam > response 1 { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"age":25,"name":"John"}", + "reasoning": "", "role": "assistant", }, }, @@ -20512,18 +20200,10 @@ exports[`chat-completions → responses > textFormatJsonSchemaWithDescriptionPar { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "{"age":25,"name":"John"}", + "reasoning": "", "role": "assistant", }, }, @@ -20570,18 +20250,10 @@ exports[`chat-completions → responses > textFormatTextParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Hello! 👋 How can I help you today?", + "reasoning": "", "role": "assistant", }, }, @@ -20647,14 +20319,6 @@ exports[`chat-completions → responses > toolCallRequest > response 1`] = ` "annotations": [], "reasoning": "", "role": "assistant", - }, - }, - { - "finish_reason": "tool_calls", - "index": 1, - "message": { - "annotations": [], - "role": "assistant", "tool_calls": [ { "function": { @@ -20733,14 +20397,6 @@ exports[`chat-completions → responses > toolChoiceRequiredParam > response 1`] "annotations": [], "reasoning": "", "role": "assistant", - }, - }, - { - "finish_reason": "tool_calls", - "index": 1, - "message": { - "annotations": [], - "role": "assistant", "tool_calls": [ { "function": { @@ -20822,14 +20478,6 @@ exports[`chat-completions → responses > toolChoiceRequiredWithReasoningParam > "annotations": [], "reasoning": "", "role": "assistant", - }, - }, - { - "finish_reason": "tool_calls", - "index": 1, - "message": { - "annotations": [], - "role": "assistant", "tool_calls": [ { "function": { @@ -20880,18 +20528,10 @@ exports[`chat-completions → responses > topPParam > response 1`] = ` { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Hi there! How can I help you today?", + "reasoning": "", "role": "assistant", }, }, @@ -20933,18 +20573,10 @@ exports[`chat-completions → responses > topPReasoningModelParam > response 1`] { "finish_reason": "stop", "index": 0, - "message": { - "annotations": [], - "reasoning": "", - "role": "assistant", - }, - }, - { - "finish_reason": "stop", - "index": 1, "message": { "annotations": [], "content": "Hi there! How can I help today?", + "reasoning": "", "role": "assistant", }, }, @@ -26209,15 +25841,6 @@ exports[`google → responses > complexReasoningRequest > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Total digits shown over a full day (00:00 to 23:59) are 24 hours × 60 minutes × 4 digits = 5,760 digits. @@ -26251,7 +25874,7 @@ So: "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26307,15 +25930,6 @@ exports[`google → responses > exclusiveMinimumToolParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -26328,7 +25942,7 @@ exports[`google → responses > exclusiveMinimumToolParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26366,15 +25980,6 @@ exports[`google → responses > googleOpenAIModelTopKParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "An API gateway acts as a single entry point that handles authentication, rate limiting, and routing for backend services.", }, @@ -26382,7 +25987,7 @@ exports[`google → responses > googleOpenAIModelTopKParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26515,15 +26120,6 @@ exports[`google → responses > googleThinkingJsonSchemaParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "{"confidence":0.0,"recommendation":"Highlight price‑performance tradeoffs between the mics and invite viewers to share their own outdoor setups to boost engagement.","topic":"Mic setup comparison and outdoor performance with audience engagement"}", }, @@ -26531,7 +26127,7 @@ exports[`google → responses > googleThinkingJsonSchemaParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26599,15 +26195,6 @@ exports[`google → responses > googleToolCallThoughtSignatureReplayParam > resp "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "The collections in mydb are: - movies @@ -26619,7 +26206,7 @@ Would you like any details from these collections (e.g., document counts or samp "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26685,15 +26272,6 @@ exports[`google → responses > googleToolSchemaNumericInt64Param > response 1`] "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Here are the bounds the tool schema enforces: @@ -26717,7 +26295,7 @@ Please provide values for index_name and tags (an array of strings), and I’ll "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26754,15 +26332,6 @@ exports[`google → responses > imageConfigParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Here are a couple of simple ways to render a tiny red dot. @@ -26778,7 +26347,7 @@ If you had a different size or format in mind (PNG, data URL, etc.), tell me and "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26824,15 +26393,6 @@ exports[`google → responses > imageUrlMimeTypeFallbackParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "A cute tabby cat lies stretched out on a wooden surface, facing the camera. It has striped brown-gray fur, large amber eyes, and long white whiskers. Its front paws are extended forward, and its head is slightly tilted to the side, with a soft, indoor background blurred behind it.", }, @@ -26840,7 +26400,7 @@ exports[`google → responses > imageUrlMimeTypeFallbackParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -26877,15 +26437,6 @@ exports[`google → responses > instructionsParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Hi there! How can I help today? I can answer questions, explain concepts, draft or edit text, brainstorm ideas, help with code, translate, summarize, plan things, or analyze images. Tell me what you’d like to do or what you’re curious about.", }, @@ -26893,7 +26444,7 @@ exports[`google → responses > instructionsParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27199,15 +26750,6 @@ exports[`google → responses > maxCompletionTokensParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Ok.", }, @@ -27215,7 +26757,7 @@ exports[`google → responses > maxCompletionTokensParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27252,15 +26794,6 @@ exports[`google → responses > mediaResolutionParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "I can’t see an image attached. Please upload the image or share a link, and I’ll give a brief description (1–2 sentences) focusing on the main subject, setting, and mood.", }, @@ -27268,7 +26801,7 @@ exports[`google → responses > mediaResolutionParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27401,15 +26934,6 @@ exports[`google → responses > parallelToolCallsRequest > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Here’s the current weather: @@ -27422,7 +26946,7 @@ Want a 7-day forecast or a weather alert for either city?", "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27462,15 +26986,6 @@ exports[`google → responses > reasoningEffortLowParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "4 (in base-10 arithmetic).", }, @@ -27478,7 +26993,7 @@ exports[`google → responses > reasoningEffortLowParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27515,15 +27030,6 @@ exports[`google → responses > reasoningRequest > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Step-by-step: @@ -27539,7 +27045,7 @@ Answer: 200/3 mph (about 66.67 mph)", "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27621,15 +27127,6 @@ exports[`google → responses > reasoningSummaryParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "4", }, @@ -27637,7 +27134,7 @@ exports[`google → responses > reasoningSummaryParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27674,15 +27171,6 @@ exports[`google → responses > reasoningWithOutput > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "On a clear day, the sky usually looks blue. This is because sunlight is scattered by the Earth's atmosphere, and blue light scatters more than other colors. @@ -27696,7 +27184,7 @@ The color can change: "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27733,15 +27221,6 @@ exports[`google → responses > responseModalitiesAudioParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Hello! It’s wonderful to meet you.", }, @@ -27749,7 +27228,7 @@ exports[`google → responses > responseModalitiesAudioParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27786,15 +27265,6 @@ exports[`google → responses > seedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "7", }, @@ -27802,7 +27272,7 @@ exports[`google → responses > seedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27839,15 +27309,6 @@ exports[`google → responses > simpleRequest > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Paris.", }, @@ -27855,7 +27316,7 @@ exports[`google → responses > simpleRequest > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27933,15 +27394,6 @@ exports[`google → responses > speechConfigParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Hello! It’s wonderful to meet you.", }, @@ -27949,7 +27401,7 @@ exports[`google → responses > speechConfigParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -27986,15 +27438,6 @@ exports[`google → responses > stopSequencesParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20", }, @@ -28002,7 +27445,7 @@ exports[`google → responses > stopSequencesParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28081,15 +27524,6 @@ exports[`google → responses > temperatureParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Hi there! 👋 How can I help today?", }, @@ -28097,7 +27531,7 @@ exports[`google → responses > temperatureParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28139,15 +27573,6 @@ exports[`google → responses > textFormatJsonObjectParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "{"status": "ok"}", }, @@ -28155,7 +27580,7 @@ exports[`google → responses > textFormatJsonObjectParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28214,15 +27639,6 @@ exports[`google → responses > textFormatJsonSchemaParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "{"age":25,"name":"John"}", }, @@ -28230,7 +27646,7 @@ exports[`google → responses > textFormatJsonSchemaParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28289,15 +27705,6 @@ exports[`google → responses > textFormatJsonSchemaWithDescriptionParam > respo "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "{"age":25,"name":"John"}", }, @@ -28305,7 +27712,7 @@ exports[`google → responses > textFormatJsonSchemaWithDescriptionParam > respo "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28345,15 +27752,6 @@ exports[`google → responses > thinkingLevelParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "I’m ready to help, but I don’t see the problem statement yet. Please share one of the following: @@ -28377,7 +27775,7 @@ If you can’t share the problem statement, you can still describe it (in your o "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28434,15 +27832,6 @@ exports[`google → responses > toolCallRequest > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -28455,7 +27844,7 @@ exports[`google → responses > toolCallRequest > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28511,15 +27900,6 @@ exports[`google → responses > toolChoiceAnyParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -28532,7 +27912,7 @@ exports[`google → responses > toolChoiceAnyParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28588,15 +27968,6 @@ exports[`google → responses > toolChoiceAutoParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Sure—what location would you like the weather for? Please specify a city (and country if needed) or a ZIP/postal code. @@ -28610,7 +27981,7 @@ If you just want the current weather for your area, share your location and I’ "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28666,15 +28037,6 @@ exports[`google → responses > toolChoiceNoneParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "I can’t access live weather data right now. Tell me: @@ -28688,7 +28050,7 @@ If you’d like, I can guide you to check it quickly on your phone or computer u "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28747,15 +28109,6 @@ exports[`google → responses > toolChoiceRequiredParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -28768,7 +28121,7 @@ exports[`google → responses > toolChoiceRequiredParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28830,15 +28183,6 @@ exports[`google → responses > toolChoiceRequiredWithReasoningParam > response "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -28851,7 +28195,7 @@ exports[`google → responses > toolChoiceRequiredWithReasoningParam > response "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28907,15 +28251,6 @@ exports[`google → responses > toolModeValidatedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -28928,7 +28263,7 @@ exports[`google → responses > toolModeValidatedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -28965,15 +28300,6 @@ exports[`google → responses > topKParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Hi there! How can I help you today?", }, @@ -28981,7 +28307,7 @@ exports[`google → responses > topKParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -29018,15 +28344,6 @@ exports[`google → responses > topPParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "text": "Hi there! 👋 How can I help you today?", }, @@ -29034,7 +28351,7 @@ exports[`google → responses > topPParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -29076,15 +28393,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29109,7 +28417,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, { "content": { @@ -29118,15 +28426,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 2, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29145,7 +28444,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 3, + "index": 1, }, { "content": { @@ -29154,15 +28453,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 4, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29187,7 +28477,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 5, + "index": 2, }, { "content": { @@ -29196,15 +28486,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 6, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29223,7 +28504,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 7, + "index": 3, }, { "content": { @@ -29232,15 +28513,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 8, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29259,7 +28531,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 9, + "index": 4, }, { "content": { @@ -29268,15 +28540,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 10, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29299,7 +28562,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 11, + "index": 5, }, { "content": { @@ -29308,15 +28571,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 12, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29335,7 +28589,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 13, + "index": 6, }, { "content": { @@ -29344,15 +28598,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 14, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29375,7 +28620,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 15, + "index": 7, }, { "content": { @@ -29384,15 +28629,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 16, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29411,7 +28647,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 17, + "index": 8, }, { "content": { @@ -29420,15 +28656,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 18, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29447,7 +28674,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 19, + "index": 9, }, { "content": { @@ -29456,15 +28683,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 20, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29483,7 +28701,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 21, + "index": 10, }, { "content": { @@ -29492,15 +28710,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 22, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29519,7 +28728,7 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 23, + "index": 11, }, { "content": { @@ -29528,15 +28737,6 @@ exports[`google → responses > webSearchToolAdvancedParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 24, - }, - { - "content": { - "parts": [ { "text": "Here are some notable AI news items in early 2026 (with exact dates for clarity). Want deeper details on any item? @@ -29577,7 +28777,7 @@ If you’d like, I can: "role": "model", }, "finishReason": "STOP", - "index": 25, + "index": 12, }, ], "modelVersion": "gpt-5-nano-2025-08-07", @@ -29619,15 +28819,6 @@ exports[`google → responses > webSearchToolParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 0, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29652,7 +28843,7 @@ exports[`google → responses > webSearchToolParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 1, + "index": 0, }, { "content": { @@ -29661,15 +28852,6 @@ exports[`google → responses > webSearchToolParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 2, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29692,7 +28874,7 @@ exports[`google → responses > webSearchToolParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 3, + "index": 1, }, { "content": { @@ -29701,15 +28883,6 @@ exports[`google → responses > webSearchToolParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 4, - }, - { - "content": { - "parts": [ { "functionCall": { "args": { @@ -29732,7 +28905,7 @@ exports[`google → responses > webSearchToolParam > response 1`] = ` "role": "model", }, "finishReason": "STOP", - "index": 5, + "index": 2, }, { "content": { @@ -29741,15 +28914,6 @@ exports[`google → responses > webSearchToolParam > response 1`] = ` "text": "", "thought": true, }, - ], - "role": "model", - }, - "finishReason": "STOP", - "index": 6, - }, - { - "content": { - "parts": [ { "text": "Here are the latest OpenAI news highlights as of today, April 7, 2026. If you want deeper details on any item, I can pull up the full article or official post. @@ -29770,7 +28934,7 @@ If you’d like, I can pull the exact blog posts or press releases for any of th "role": "model", }, "finishReason": "STOP", - "index": 7, + "index": 3, }, ], "modelVersion": "gpt-5-nano-2025-08-07", diff --git a/payloads/scripts/transforms/capture-transforms.ts b/payloads/scripts/transforms/capture-transforms.ts index b73af721..4060ffe3 100644 --- a/payloads/scripts/transforms/capture-transforms.ts +++ b/payloads/scripts/transforms/capture-transforms.ts @@ -342,9 +342,13 @@ export async function captureTransforms( targetModel ) as Record; - const streamResponse = await callProvider(captureProvider, streamRequest, { - stream: true, - }); + const streamResponse = await callProvider( + captureProvider, + streamRequest, + { + stream: true, + } + ); const chunks = await collectStreamChunks(streamResponse); writeFileSync(streamingPath, JSON.stringify(chunks, null, 2));