Skip to content

feat: forward id, streaming start, streaming end of content blocks #6812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 91 commits into from
Jun 22, 2025

Conversation

lgrammel
Copy link
Collaborator

@lgrammel lgrammel commented Jun 20, 2025

Background

When streaming, it was not possible to distinguish different content of the same type (e.g. 2 text content parts) sent from Anthropic and OpenAI APIs. This prevents building UIs where e.g. multiple reasoning blocks stream at the same time, or where a text part is followed by sources and then by further text parts.

Summary

  • text and reasoning parts have ids, and start/delta/end events when streaming

Verification

Source streaming with anthropic server side tool call in UI.

Tasks

  • change spec
  • streamText
  • streamObject
  • smooth stream transformation
  • extract reasoning middleware
  • simulate streaming middleware
  • ui message stream parts text
  • ui message stream parts reasoning
  • ui message streaming
  • anthropic provider
  • openai responses provider
  • openai chat provider
  • openai completion provider
  • perplexity provider
  • cohere provider
  • openai compatible chat provider
  • groq provider
  • openai compatible completion provider
  • xai provider
  • mistral provider
  • bedrock provider
  • google provider
  • langchain
  • llamaindex
  • ui test updates react
  • ui test updates vue
  • ui test updates svelte
  • rsc
  • examples fixes

Future Work

  • add state field to ui message reasoning and text parts

@lgrammel lgrammel changed the title 1 feat: forward block id, streaming start, streaming end Jun 22, 2025
@lgrammel lgrammel changed the title feat: forward block id, streaming start, streaming end feat: forward id, streaming start, streaming end for content blocks Jun 22, 2025
@lgrammel lgrammel changed the title feat: forward id, streaming start, streaming end for content blocks feat: forward id, streaming start, streaming end of content blocks Jun 22, 2025
@lgrammel lgrammel marked this pull request as ready for review June 22, 2025 10:49
@lgrammel lgrammel merged commit 742b7be into v5 Jun 22, 2025
8 checks passed
@lgrammel lgrammel deleted the lg/lGSreJg branch June 22, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants