Skip to content
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

Add auto chunking for text stream writer #361

Merged
merged 5 commits into from
Feb 15, 2025
Merged

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Feb 14, 2025

  • removes mid-stream chunk overrides
  • this allows for writer.write(text) to perform auto chunking, mirroring the same behaviour as on byte streams
  • also allows for send_text to be a thin auto-closing wrapper over stream_text
  • allows for text_reader to be a simple async iterable of type str instead of the TextStreamUpdate data class (again improved consistency with how byte stream reader works)

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

lgtm

@lukasIO lukasIO merged commit a766014 into main Feb 15, 2025
12 checks passed
@lukasIO lukasIO deleted the lukas/auto-text-chunking branch February 15, 2025 18:54
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