diff --git a/libs/partners/openai/langchain_openai/chat_models/base.py b/libs/partners/openai/langchain_openai/chat_models/base.py index 2c9143f7cae..71109d9b4d8 100644 --- a/libs/partners/openai/langchain_openai/chat_models/base.py +++ b/libs/partners/openai/langchain_openai/chat_models/base.py @@ -4446,7 +4446,15 @@ def _convert_responses_chunk_to_generation_chunk( } ) elif chunk.type == "response.output_text.done": - content.append({"type": "text", "id": chunk.item_id, "index": current_index}) + _advance(chunk.output_index, chunk.content_index) + content.append( + { + "type": "text", + "text": "", + "id": chunk.item_id, + "index": current_index, + } + ) elif chunk.type == "response.created": id = chunk.response.id response_metadata["id"] = chunk.response.id # Backwards compatibility