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

Non-oai usage meta + non-oai client types #182

Merged
merged 3 commits into from
Jun 13, 2024
Merged

Non-oai usage meta + non-oai client types #182

merged 3 commits into from
Jun 13, 2024

Conversation

roodboi
Copy link
Collaborator

@roodboi roodboi commented Jun 11, 2024

fix client inference for non oai + check for usage for non-oai and non-readable

We were not passing through usage into meta for llm-polyglot/anthropic clients because the existing logic to do it checked explicitly for OAI clients + dependent on the response being a stream that could be .tee'd

This update does a similar "tee" for the iterable so we can read in parallel but doesn't have the same stream_options check so it will always run for any non-oai clients - if they don't provide usage it will just ignore.

Additionally, client inference has been updated slightly to get rid of the annoying non oai client type errors

Copy link

changeset-bot bot commented Jun 11, 2024

🦋 Changeset detected

Latest commit: 5a12fbd

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 roodboi linked an issue Jun 11, 2024 that may be closed by this pull request
Copy link

cloudflare-workers-and-pages bot commented Jun 11, 2024

Deploying instructor-js with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5a12fbd
Status: ✅  Deploy successful!
Preview URL: https://37374d28.instructor-js.pages.dev
Branch Preview URL: https://non-oai-usage.instructor-js.pages.dev

View logs

jxnl
jxnl previously approved these changes Jun 12, 2024
Copy link
Collaborator

@jxnl jxnl left a comment

Choose a reason for hiding this comment

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

should we make a usage.dm page? :O

@roodboi
Copy link
Collaborator Author

roodboi commented Jun 12, 2024

we should probably do a page on the _meta obj - the completed paths property, usage, etc.. ps this pr depends on me pushing up new polyglot v to use the non-beta tools - just have to test and cleanup a few things hack-dance/island-ai#60

@roodboi roodboi merged commit 0a5bbd8 into main Jun 13, 2024
3 checks passed
@roodboi roodboi deleted the non-oai-usage branch June 13, 2024 03:39
@roodboi roodboi mentioned this pull request Jun 13, 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.

Type Issue using anthropic through llm-polyglot
2 participants