BerriAI/litellm · error · ValueError

Error updating current delta chunks

Error message

Error updating current delta chunks: {e}, got transformed_message: {transformed_message}

What it means

Error "Error updating current delta chunks: {e}, got transformed_message: {transformed_message}" thrown in BerriAI/litellm.

Solutions

  1. The realtime stream sent a part type this litellm version does not map; upgrade litellm to handle newer Gemini Live event shapes.

When it happens

Trigger: Thrown at litellm/llms/gemini/realtime/transformation.py:936 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/f41f8777666df0d5. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/gemini/realtime/transformation.py:936

                any_delta_chunk = False
                for event in transformed_message:
                    if event["type"] == "response.output_text.delta":
                        current_delta_chunks.append(cast(OpenAIRealtimeResponseDelta, event))
                        any_delta_chunk = True
                if not any_delta_chunk:
                    current_delta_chunks = None
            else:
                if (
                    transformed_message["type"] == "response.output_text.delta"
                ):  # audio deltas are not accumulated (memory)
                    if current_delta_chunks is None:
                        current_delta_chunks = []
                    current_delta_chunks.append(cast(OpenAIRealtimeResponseDelta, transformed_message))
                else:
                    current_delta_chunks = None
            return current_delta_chunks
        except Exception as e:
            raise ValueError(
                f"Error updating current delta chunks: {e}, got transformed_message: {transformed_message}"
            )

    def update_current_item_chunks(
        self,
        transformed_message: OpenAIRealtimeEvents | list[OpenAIRealtimeEvents],
        current_item_chunks: list[OpenAIRealtimeOutputItemDone] | None,
    ) -> list[OpenAIRealtimeOutputItemDone] | None:
        try:
            if isinstance(transformed_message, list):
                current_item_chunks = []
                any_item_chunk = False
                for event in transformed_message:
                    if event["type"] == "response.output_item.done":
                        current_item_chunks.append(cast(OpenAIRealtimeOutputItemDone, event))
                        any_item_chunk = True
                if not any_item_chunk:
                    current_item_chunks = None

View on GitHub (pinned to 77b7c6c40c)