{"record":{"id":"874fa668484d5a97","repo":"BerriAI/litellm","slug":"chat-provider-invalid-text-delta-parsed-chunk","errorCode":null,"errorMessage":"Chat provider: Invalid text delta {parsed_chunk}","messagePattern":"Chat provider: Invalid text delta (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/completion_extras/litellm_responses_transformation/transformation.py","lineNumber":1383,"sourceCode":"                        )\n                    ]\n                )\n\n        elif event_type == \"response.output_text.delta\":\n            # Content part added to output\n            content_part = parsed_chunk.get(\"delta\", None)\n            if content_part is not None:\n                return ModelResponseStream(\n                    choices=[\n                        StreamingChoices(\n                            index=0,\n                            delta=Delta(content=content_part),\n                            finish_reason=None,\n                        )\n                    ]\n                )\n            else:\n                raise ValueError(f\"Chat provider: Invalid text delta {parsed_chunk}\")\n        elif event_type == \"response.reasoning_summary_text.delta\":\n            content_part = parsed_chunk.get(\"delta\", None)\n            if content_part:\n                return ModelResponseStream(\n                    choices=[\n                        StreamingChoices(\n                            index=cast(int, parsed_chunk.get(\"summary_index\")),\n                            delta=Delta(reasoning_content=content_part),\n                        )\n                    ]\n                )\n        elif event_type == \"response.completed\":\n            # Response is fully complete - now we can signal is_finished=True\n            # This ensures we don't prematurely end the stream before tool_calls arrive\n\n            # Check if response contains function_call items in output\n            # to determine correct finish_reason\n            response_data: Final = parsed_chunk.get(\"response\", {})","sourceCodeStart":1365,"sourceCodeEnd":1401,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/completion_extras/litellm_responses_transformation/transformation.py#L1365-L1401","documentation":"While translating Responses-API stream events into chat-completion chunks, a 'response.output_text.delta' event carried a delta the parser could not turn into a ModelResponseStream — the parsed chunk is echoed so the malformed payload can be identified.","triggerScenarios":"Thrown at litellm/completion_extras/litellm_responses_transformation/transformation.py:1383 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the logged chunk; the provider emitted a text delta in an unexpected format.","Update litellm; if the issue persists, report the chunk shape so the transformation can handle it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}