Skip to content

Conversation

tkattkat
Copy link
Collaborator

why

  • Currently we have no way to utilize streamtext, only generateObject, and generateText

what changed

  • Streamtext can now be utilized through createChatCompletion by passing stream:true

test plan

  • tested locally

Copy link

changeset-bot bot commented Aug 19, 2025

⚠️ No Changeset found

Latest commit: a8fdc92

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

greptile-apps[bot]

This comment was marked as outdated.

@tkattkat tkattkat marked this pull request as draft August 19, 2025 01:20
@tkattkat tkattkat marked this pull request as ready for review August 19, 2025 01:30
greptile-apps[bot]

This comment was marked as outdated.

@tkattkat tkattkat marked this pull request as draft August 19, 2025 01:35
@browserbase browserbase deleted a comment from greptile-apps bot Aug 19, 2025
@tkattkat tkattkat marked this pull request as ready for review August 19, 2025 01:49
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This review covers only the changes made since the last review (commit 111ec3b), not the entire PR.

The most recent changes focus on implementing streaming text functionality in the AI SDK LLM client. The developer added three new optional properties to the ChatCompletionOptions interface: aiSDKTools (of type ToolSet), maxSteps (number), and stream (boolean). In the AISdkClient implementation, a new conditional branch was added that checks for options.stream and uses the streamText function from the AI SDK when streaming is enabled.

When stream: true is passed, the client now calls streamText with the formatted messages, temperature, AI SDK tools, and max steps parameters, then returns the stream directly cast as T. The implementation also updates tool parameter references from options.tools to options.aiSDKTools throughout the client to maintain consistency with the interface changes.

This change enables real-time text generation through the existing createChatCompletion interface, allowing users to receive partial responses as they're generated rather than waiting for complete responses. The streaming functionality bypasses the existing caching mechanism entirely, which is necessary since streams cannot be cached or processed synchronously like regular responses.

Confidence score: 3/5

  • This PR introduces useful streaming functionality but has some implementation concerns that could cause issues in production
  • Score reflects the type safety concerns with the stream casting and the fact that streaming bypasses caching mechanisms
  • Pay close attention to the type casting in the streaming path and ensure consumers can handle the stream response appropriately

2 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

@tkattkat tkattkat closed this Aug 19, 2025
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