-
Notifications
You must be signed in to change notification settings - Fork 314
feat(bedrock): automatically infer AWS Region in Bedrock clients #918
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the commit message here should be fix(bedrock): ...
or feat(bedrock): ...
src/anthropic/lib/bedrock/_client.py
Outdated
try: | ||
import boto3 | ||
|
||
session = boto3.Session() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also create a session in _auth.py so ideally we'd reuse it as they can be expensive
tests seem to be failing which is pretty suspicious, changes here seem reasonable though. I suspect we're missing something but it is not clear to me what... |
moved to #974 |
Instead of only relying on the client param or
AWS_REGION
env variable, we can also read this in from the existing AWS config (just like we do already for other Session tokens). This adds support for pulling in the region from the standard AWS config (using boto3).Resolves both of these issues: