BerriAI/litellm · error · OCIError

OCI returned image content in a streaming response — not sup

Error message

OCI returned image content in a streaming response — not supported

What it means

Error "OCI returned image content in a streaming response — not supported" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/oci/chat/generic.py:390

        raise OCIError(
            status_code=500,
            message=f"Chunk cannot be parsed as OCIStreamChunk: {e}",
        )

    if typed_chunk.index is None:
        typed_chunk.index = 0

    # Emit ``content=None`` rather than ``content=""`` on chunks with no text
    # parts (e.g. tool-call-only or keep-alive chunks) so downstream
    # stream-mergers that distinguish "no text in this delta" from "an
    # explicitly empty text delta" behave correctly.
    text: str | None = None
    if typed_chunk.message and typed_chunk.message.content:
        for item in typed_chunk.message.content:
            if isinstance(item, OCITextContentPart):
                text = (text or "") + item.text
            elif isinstance(item, OCIImageContentPart):
                raise OCIError(
                    status_code=500,
                    message="OCI returned image content in a streaming response — not supported",
                )
            else:
                raise OCIError(
                    status_code=500,
                    message=f"Unsupported content type in OCI streaming response: {item.type}",
                )

    # Build plain tool-call dicts inline (matching the shape produced by
    # ``handle_cohere_stream_chunk``) rather than calling
    # ``adapt_tools_to_openai_standard`` and ``model_dump``-ing the typed
    # objects. Both code paths feed ``Delta.tool_calls``, so emitting the
    # same minimal ``{"id", "type", "function": {"name", "arguments"}}``
    # shape keeps downstream stream-mergers behaving identically across
    # GENERIC and Cohere chunks.
    tool_calls: list[dict[str, Any]] | None = None
    if typed_chunk.message and typed_chunk.message.toolCalls:

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. OCI streaming does not support image content; use a non-streaming call.

When it happens

Trigger: Thrown at litellm/llms/oci/chat/generic.py:390 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/9d5cfcb7788c3918. Report an issue: GitHub.