screenshot-to-code icon indicating copy to clipboard operation
screenshot-to-code copied to clipboard

feat: claude models usage, but from bedrock

Open marcelovicentegc opened this issue 1 year ago • 3 comments

Hey, folks! @abi I've noticed that other people have opened PRs integrating this project with Bedrock (#322, #357 and #367) and I'm opening this PR either way to collect your feedback and whether or not its of your interest to have it merged and be one of the available integrations. Let me know! I'm willing to treat this PR carefully to match the expected standards.

Amazing project by the way. Great work putting this up :pray:

marcelovicentegc avatar Feb 03 '25 17:02 marcelovicentegc

Thanks!

I am interested in supporting bedrock. How are AWS credentials set with this PR? I also noticed a lot of copied code between the bedrock function and the regular Anthropic function. It would be nice to introduce less duplicated code.

abi avatar Feb 03 '25 21:02 abi

How are AWS credentials set with this PR?

They're supported through AWS's Python SDK (boto3). boto3 accepts credentials in many different ways. On this initial implementation, boto looks for the credentials implicitly on:

  1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and/or AWS_SESSION_TOKEN
  2. Shared credential file (~/.aws/credentials)
  3. AWS config file (~/.aws/config)
  4. Container credential provider (if deployed on AWS)
  5. Instance metadata service on an Amazon EC2 instance that has an IAM role configured (if deployed on AWS)

We can make that explicit too by passing the credentials directly into the SDK's initialization method. Let me know what works the best for you :hugs:

I also noticed a lot of copied code between the bedrock function and the regular Anthropic function. It would be nice to introduce less duplicated code.

Agreed! Will patch this PR with an abstraction to handle this :pray: (PS: Done!)

marcelovicentegc avatar Feb 03 '25 22:02 marcelovicentegc

Thanks! I'll take a look soon.

abi avatar Feb 04 '25 16:02 abi