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

updating to tee the primary stream if stream usage is enabled - so we can extract usage and include in _meta #176

Merged
merged 3 commits into from
May 17, 2024

Conversation

roodboi
Copy link
Collaborator

@roodboi roodboi commented May 17, 2024

I tried a few different approaches here - There is an update included to zod-stream which adds a bit more defense to how we read the delta - since we get a specialized message for usage towards the end now that causes an undefined read error - I attempted to find a way to include usage for the stream using a flag in there but couldn't really find a good way to do so without slowing down the stream parser - instead this approach just tees the stream and reads usage when the option is set.

Copy link

changeset-bot bot commented May 17, 2024

🦋 Changeset detected

Latest commit: 5683b58

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

This PR includes changesets to release 1 package
Name Type
@instructor-ai/instructor Minor

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

@roodboi
Copy link
Collaborator Author

roodboi commented May 17, 2024

also updating to news oai model in most tests for speed and cost

Copy link

cloudflare-workers-and-pages bot commented May 17, 2024

Deploying instructor-js with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5683b58
Status:⚡️  Build in progress...

View logs

@roodboi roodboi requested a review from jxnl May 17, 2024 16:31
@roodboi roodboi merged commit 6dd4255 into main May 17, 2024
1 of 3 checks passed
@roodboi roodboi deleted the stream-usage-flow branch May 17, 2024 16:36
@roodboi roodboi mentioned this pull request May 17, 2024
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