Skip to content

Standardize streaming tool call & tool result format across LLM providers #9430

Open
@vblagoje

Description

@vblagoje

Is your feature request related to a problem? Please describe.
When using streamed responses across various LLM providers, there is no standardized output format for tool calls and tool call results. This inconsistency makes it difficult to format and display results uniformly in user interfaces. Yet many user facing UI tools e.g. Claude Desktop, Cursor etc nicely format these streamed tool calls and responses. Cursor is perhaps the best examples because it standardizes tool call/result UI widgets for tool calls/results regardless of LLM provider.

A clear, structured format for tools is essential for a good user experience. Currently OpenWebUI/Cursor may be using their own adaptation layer to standardize format across LLM outputs so that their UI can nicely render these tool calls/results regardless of the LLM provider. We should do something similar.

Describe the solution you'd like
I would like to see a standardized output format for tool calls and tool call results across all supported LLMs in Haystack, first and foremost for streamed responses. This format should be well-documented and easy to adapt in various UIs, ensuring that tool interactions are consistently represented regardless of the underlying LLM provider.

We should handle multiple tool calls/results per response as well. This is becoming more common nowadays.

Describe alternatives you've considered

  • None

Additional context

  • Screenshots from Cursor and Claude Desktop are attached to illustrate the desired output format and user experience.
  • Before implementing this feature, we should research how different UI applications handle tool call formatting and results, and gather best practices to inform our design.
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority, leave it in the backlog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions