-
Notifications
You must be signed in to change notification settings - Fork 21
Add support for Anthropic Model from AWS Bedrock #23
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 8000 account
base: main
Are you sure you want to change the base?
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.
Hey @subhamX, sorry for the time it took to get to your PR.
Thanks for the awesome contribution! Solid work :)
Just some minor remarks before we are able to merge it.
There were some changes to main
in the meantime, so we need to resolve some conflicts first. I think easiest would be to rebase. Let me know if you need help or I should take this over.
@@ -11,6 +11,7 @@ dependencies = [ | |||
"pillow>=11.0.0", | |||
"pydantic>=2.9.2", | |||
"anthropic>=0.37.1", |
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.
Rm as the new anthropic[bedrock]
takes precedence
else: | ||
raise ValueError("ANTHROPIC_API_KEY or ANTHROPIC_BEDROCK_PROFILE must be set") |
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.
It is fine if they are not set as there might be other models available. So either a debug or info log is fine from my perspective.
self.authenticated = True | ||
if os.getenv("ANTHROPIC_API_KEY") is None: | ||
self.authenticated = False |
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.
authenticated
property cannot be removed as the ModelRouter
logic depends on it. Instead would extend it to account for the new env variable to "authenticate" (maybe you can use a property or method exposed by api client to check if it is really authenticated but also fine to just check the env variable but would also encapsulate that in the provider similar to client and model name)
Closes #18
The following pull request add support for AWS bedrock provider. Clients can now either set
ANTHROPIC_BEDROCK_PROFILE
orANTHROPIC_API_KEY
.