run-llama/llama_index · error · ValueError

stream_call is only supported for LLMs.

Error message

stream_call is only supported for LLMs.

What it means

Error "stream_call is only supported for LLMs." thrown in run-llama/llama_index.

Source

Thrown at llama-index-core/llama_index/core/program/function_program.py:327

                    "Multiple outputs found, returning first one. "
                    "If you want to return all outputs, set output_multiple=True."
                )
            return new_cur_objects[0]

    def stream_call(
        self, *args: Any, llm_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any
    ) -> Generator[
        Union[Model, List[Model], FlexibleModel, List[FlexibleModel]], None, None
    ]:
        """
        Stream object.

        Returns a generator returning partials of the same object
        or a list of objects until it returns.
        """
        # TODO: we can extend this to non-function calling LLMs as well, coming soon
        if not isinstance(self._llm, FunctionCallingLLM):
            raise ValueError("stream_call is only supported for LLMs.")

        # avoid passing in duplicate kwargs
        llm_kwargs = llm_kwargs or {}
        llm_kwargs.pop("tool_required", None)
        llm_kwargs.pop("tool_choice", None)
        llm_kwargs.pop("allow_parallel_tool_calls", None)

        tool = get_function_tool(self._output_cls)

        messages = self._prompt.format_messages(llm=self._llm, **kwargs)
        messages = self._llm._extend_messages(messages)

        chat_response_gen = self._llm.stream_chat_with_tools(
            [tool],
            chat_history=messages,
            verbose=self._verbose,
            allow_parallel_tool_calls=self._allow_parallel_tool_calls,
            tool_choice=self._tool_choice,

View on GitHub (pinned to afd0fef371)

Solutions

  1. Call stream_call only with an LLM-based program.
  2. Use the non-streaming call path for non-LLM programs.

When it happens

Trigger: Thrown at llama-index-core/llama_index/core/program/function_program.py:327 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15). Data as JSON: /api/errors/d318a89f09c070d3. Report an issue: GitHub.