Skip to content

Reasoning support in StreamingChunk #9728

@anakin87

Description

@anakin87

When working on deepset-ai/haystack-core-integrations#2200, I realized that support for streaming reasoning text in Haystack is currently limited.
In that PR, reasoning chunks are only accumulated in StreamingChunk.meta for later reconstruction, but they are not actually streamed.

What needs to be done

  • introduce reasoning field in StreamingChunk to store reasoning chunks
    • this might be a str.
    • investigate if a more complex object is needed by looking at how providers stream reasoning chunks (Anthropic)
  • update print_streaming_chunk utility function to also print reasoning

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority, add to the next sprint if no P1 available

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions