Skip to content

Conversation

@okisdev
Copy link
Contributor

@okisdev okisdev commented Dec 17, 2025

This PR adds timing, chunks and tokens support for assistant-stream and @assistant-ui/react-ai-sdk, an timing example with Grok.

Preview:

ScreenShot 2025-12-17 at 20 49 28@2x

Important

Adds timing support to assistant-stream and @assistant-ui/react-ai-sdk, including tracking and displaying message processing metrics.

  • Behavior:
    • Adds timing support to assistant-stream and @assistant-ui/react-ai-sdk.
    • Displays timing metrics such as timeToFirstChunk, timeToFirstToken, totalStreamTime, tokensPerSecond, and totalChunks in Grok.tsx.
  • Core Changes:
    • Introduces TimingTracker class in assistant-message-accumulator.ts to track timing metrics.
    • Updates AssistantStreamChunk type to include timing type.
    • Modifies AssistantMessageAccumulator to handle timing chunks and update message metadata.
  • UI Components:
    • Adds MessageTimingDisplay component in Grok.tsx to show timing information.
    • Integrates Grok example in example-showcase.tsx.
  • Utilities:
    • Implements useStreamingTiming hook in useStreamingTiming.ts to manage timing state.
    • Updates convertMessage.ts to handle timing metadata in message conversion.
  • Misc:
    • Updates types in types.ts and AssistantTypes.ts to include MessageTiming.

This description was created by Ellipsis for 765d2ca. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2025

🦋 Changeset detected

Latest commit: 2c6cf46

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
assistant-stream Patch
@assistant-ui/react-ai-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 16 files

@promptless
Copy link
Contributor

promptless bot commented Dec 17, 2025

📝 Documentation updates detected!

New suggestion: Document message timing metrics for performance monitoring (PR #2946)

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.

1 participant