Skip to content

Adding bedrock chat completion for anthropic models#6170

Merged
ekzhu merged 12 commits into
microsoft:mainfrom
HariniNarasimhan:feature-anthropic-bedrock
Apr 28, 2025
Merged

Adding bedrock chat completion for anthropic models#6170
ekzhu merged 12 commits into
microsoft:mainfrom
HariniNarasimhan:feature-anthropic-bedrock

Conversation

@HariniNarasimhan
Copy link
Copy Markdown
Contributor

Why are these changes needed?

Anthropic models are supported by AWS bedrock. ChatCompletionClient can be created for anthropic bedrock models using this changes. This enables the user to do the following

  • Add any anthropic models and version from AWS bedrock
  • Can use ChatCompletionClient for bedrock anthropic models

Related issue number

Closes #5226

@HariniNarasimhan
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Comment thread python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py Outdated
Comment thread python/packages/autogen-ext/src/autogen_ext/models/anthropic/config/__init__.py Outdated
Copy link
Copy Markdown
Contributor

@ekzhu ekzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use secrete str for keys and tokens

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2025

Codecov Report

Attention: Patch coverage is 44.06780% with 33 lines in your changes missing coverage. Please review.

Project coverage is 78.26%. Comparing base (99d853a) to head (c6c1b66).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../autogen_ext/models/anthropic/_anthropic_client.py 26.66% 33 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6170      +/-   ##
==========================================
- Coverage   78.39%   78.26%   -0.13%     
==========================================
  Files         221      221              
  Lines       16102    16158      +56     
==========================================
+ Hits        12623    12646      +23     
- Misses       3479     3512      +33     
Flag Coverage Δ
unittests 78.26% <44.06%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ekzhu
Copy link
Copy Markdown
Contributor

ekzhu commented Apr 22, 2025

@HariniNarasimhan checkout python/README.md for how to run auto checks locally.

@ekzhu ekzhu merged commit a91006c into microsoft:main Apr 28, 2025
61 of 62 checks passed
abhinav-aegis pushed a commit to abhinav-aegis/autogen that referenced this pull request Apr 28, 2025
## Why are these changes needed?

Anthropic models are supported by AWS bedrock. ChatCompletionClient can
be created for anthropic bedrock models using this changes. This enables
the user to do the following
- Add any anthropic models and version from AWS bedrock
- Can use ChatCompletionClient for bedrock anthropic models

## Related issue number
Closes microsoft#5226

---------

Co-authored-by: harini.narasimhan <harini.narasimhan@eagleview.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for AWS Bedrock integration

4 participants