Skip to content
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

Python: Move to a thinner wrap for Bedrock Agent in Python #10740

Merged

Conversation

TaoChenOSU
Copy link
Contributor

@TaoChenOSU TaoChenOSU commented Feb 28, 2025

Motivation and Context

Though the current Bedrock agent implementation uses a "thin wrap" approach, it still has some abstractions that we don't want to maintain. Just like what we have done for the other agents, we remove those abstractions.

Description

  1. Update the Bedrock agent abstraction to be thinner.
  2. Update samples and tests.

Note: The .Net implementation doesn't need to be updated as it was already using a thinner wrap.
Note: This breaks the current usage pattern for Bedrock agents in Python.

Contribution Checklist

@TaoChenOSU TaoChenOSU added python Pull requests for the Python Semantic Kernel agents labels Feb 28, 2025
@TaoChenOSU TaoChenOSU self-assigned this Feb 28, 2025
@TaoChenOSU TaoChenOSU requested a review from a team as a code owner February 28, 2025 22:51
@github-actions github-actions bot changed the title Move to a thinner wrap for Bedrock Agent in Python Python: Move to a thinner wrap for Bedrock Agent in Python Feb 28, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 28, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/agents/bedrock
   bedrock_agent.py2023483%101, 210, 242, 261, 277–280, 286, 288, 291, 295, 327, 357–366, 377, 409, 426–427, 429–430, 472, 483–484, 496, 532–543, 554, 571–584
   bedrock_agent_base.py1414171%101, 119–120, 145, 158–160, 187, 206–208, 213, 232–234, 239, 243–244, 264–266, 275, 294–298, 303, 322–326, 331, 343–345, 357–376
semantic_kernel/connectors/ai/bedrock/services
   bedrock_chat_completion.py1361490%117, 139, 164, 168–171, 229, 247–266, 325
   bedrock_text_completion.py57296%95, 118
   bedrock_text_embedding.py45198%94
semantic_kernel/connectors/ai/bedrock/services/model_provider
   utils.py742073%63, 66, 97, 101–112, 129–147, 168–171
TOTAL18981240687% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3172 5 💤 0 ❌ 0 🔥 1m 44s ⏱️

@TaoChenOSU TaoChenOSU enabled auto-merge March 3, 2025 19:56
@TaoChenOSU TaoChenOSU added this pull request to the merge queue Mar 3, 2025
Merged via the queue into microsoft:main with commit 75453a1 Mar 3, 2025
28 checks passed
@TaoChenOSU TaoChenOSU deleted the taochen/python-fix-bedrock-agent branch March 3, 2025 22:14
rracanicci pushed a commit to rracanicci/semantic-kernel that referenced this pull request Mar 5, 2025
…#10740)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Though the current Bedrock agent implementation uses a "thin wrap"
approach, it still has some abstractions that we don't want to maintain.
Just like what we have done for the other agents, we remove those
abstractions.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Update the Bedrock agent abstraction to be thinner.
2. Update samples and tests.

Note: The .Net implementation doesn't need to be updated as it was
already using a thinner wrap.
Note: This breaks the current usage pattern for Bedrock agents in
Python.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents documentation python Pull requests for the Python Semantic Kernel
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

5 participants