-
Notifications
You must be signed in to change notification settings - Fork 16
Update usage on failed json.Unmarshal or validate.Struct #28
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
Comments
Also in |
@ericvanlare Now the usage PR is merged, would you be able to add a separate PR to add a section in the README on how to view the usage, noting how the it sums the retries and you can still view the usage even if instructor fails in the end? |
@ericvanlare Merged - thanks! |
Response usage for input tokens and output tokens is only counted when it comes from a chat with successful json hydration, usage counts for failures at
json.Unmarshal()
orvalidate.Struct()
inchat.go
are ignored as of now.Here's a reference I found in instructor-py
I propose instructor-go should count usage from all LLM calls in the retry, successes and failures, and update the successful call's usage counts before returning it.
The text was updated successfully, but these errors were encountered: