You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried asking for help in the community on discord or discussions and have not received a response.
I have tried searching the documentation and have not found an answer.
What Model are you using?
gpt-3.5-turbo
gpt-4-turbo
gpt-4
Other (please specify): us.anthropic.claude-3-5-sonnet-20241022-v2:0
Describe the bug
The usage object for Anthropic’s Bedrock client does not contain certain fields (cache_creation_input_tokens, cache_read_input_tokens), which causes an AttributeError in instructor.utils.update_total_usage() when attempting to sum usage stats.
To Reproduce
Instantiate an AnthropicBedrock client (e.g., anthropic.AnthropicBedrock(...)).
Use instructor.from_anthropic to wrap the client.
Run test_client_anthropic_bedrock_response
Get error: AttributeError: 'Usage' object has no attribute 'cache_creation_input_tokens'.
Expected behavior instructor should gracefully handle Anthropic usage objects that don’t have those fields, rather than raising an AttributeError.
Screenshots
N/A
The text was updated successfully, but these errors were encountered:
What Model are you using?
us.anthropic.claude-3-5-sonnet-20241022-v2:0
Describe the bug
The usage object for Anthropic’s Bedrock client does not contain certain fields (
cache_creation_input_tokens
,cache_read_input_tokens
), which causes anAttributeError
ininstructor.utils.update_total_usage()
when attempting to sum usage stats.To Reproduce
AnthropicBedrock
client (e.g.,anthropic.AnthropicBedrock(...)
).instructor.from_anthropic
to wrap the client.test_client_anthropic_bedrock_response
AttributeError: 'Usage' object has no attribute 'cache_creation_input_tokens'
.Expected behavior
instructor
should gracefully handle Anthropic usage objects that don’t have those fields, rather than raising anAttributeError
.Screenshots
N/A
The text was updated successfully, but these errors were encountered: