Skip to content

Adding bedrock chat completion for anthropic models #6170

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

Merged
merged 12 commits into from
Apr 28, 2025

Conversation

HariniNarasimhan
Copy link
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
Contributor Author

@microsoft-github-policy-service agree

Copy link
Collaborator

@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

Copy link

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
Collaborator

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 <[email protected]>
Co-authored-by: Eric Zhu <[email protected]>
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