Skip to content

chore: Feature/bedrock agent function resolver #894

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 56 commits into from
Jun 3, 2025

Conversation

hjgraca
Copy link
Contributor

@hjgraca hjgraca commented May 26, 2025

Please provide the issue number

Issue number: #887

Summary

Changes

This pull request introduces a new utility, BedrockAgentFunctionResolver, to simplify the development of AWS Lambda functions interacting with Amazon Bedrock Agents. It includes documentation, project setup, core implementation, and dependency injection support. Below is a summary of the most important changes:

Documentation and Usage Guide

  • Added a comprehensive markdown file bedrock_agent_function.md documenting the BedrockAgentFunctionResolver utility. It includes an overview, features, installation instructions, basic and advanced usage examples, and benefits.

Project Setup

  • Added a new project AWS.Lambda.Powertools.EventHandler.BedrockAgentFunctionResolver to the solution file AWS.Lambda.Powertools.sln. This includes configuration for build settings and solution hierarchy. [1] [2] [3]
  • Created a new .csproj file with dependencies on Amazon.Lambda.Core, AWSSDK.BedrockAgentRuntime, and Microsoft.Extensions.DependencyInjection.

Core Implementation

  • Introduced the ParameterAccessor class for strongly-typed parameter extraction in Bedrock Agent function calls, supporting various data types like string, int, bool, and more.
  • Added InternalsVisibleTo attribute to allow internal access for unit testing.

Dependency Injection Support

  • Added DiBedrockAgentFunctionResolver and extension methods in BedrockAgentFunctionResolverExtensions.cs to enable seamless integration with .NET's dependency injection system.

User experience

Please share what the user experience looks like before and after this change

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation tests labels May 26, 2025
@pull-request-size pull-request-size bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 26, 2025
@github-actions github-actions bot added the internal Maintenance changes label May 26, 2025
Copy link

codecov bot commented May 26, 2025

Codecov Report

Attention: Patch coverage is 82.85229% with 101 lines in your changes missing coverage. Please review.

Project coverage is 76.95%. Comparing base (dd8d262) to head (1aa7b27).
Report is 73 commits behind head on develop.

Files with missing lines Patch % Lines
...rs.BedrockAgentFunction/Helpers/ParameterMapper.cs 68.33% 26 Missing and 12 partials ⚠️
...drockAgentFunction/BedrockAgentFunctionResolver.cs 84.81% 17 Missing and 7 partials ⚠️
....BedrockAgentFunction/Helpers/ParameterAccessor.cs 78.66% 10 Missing and 6 partials ⚠️
...rs.BedrockAgentFunction/Helpers/ResultConverter.cs 90.22% 6 Missing and 7 partials ⚠️
...Function/BedrockAgentFunctionResolverExtensions.cs 86.20% 1 Missing and 3 partials ⚠️
...ler.Resolvers.BedrockAgentFunction/Models/Agent.cs 0.00% 4 Missing ⚠️
...rockAgentFunction/Models/BedrockFunctionRequest.cs 88.88% 1 Missing ⚠️
...ockAgentFunction/Models/BedrockFunctionResponse.cs 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #894      +/-   ##
===========================================
+ Coverage    76.53%   76.95%   +0.41%     
===========================================
  Files          248      264      +16     
  Lines         9703    10292     +589     
  Branches      1071     1164      +93     
===========================================
+ Hits          7426     7920     +494     
- Misses        1938     1998      +60     
- Partials       339      374      +35     

☔ 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.

hjgraca added 17 commits May 27, 2025 12:18
…it and add attribute-based tool registration support
… fluent API for function registration and automatic request processing
…d result processing with dedicated helper classes
…alidator, ResultConverter, and BedrockAgentFunctionResolver
…ParameterMapper, ParameterTypeValidator, and ResultConverter; enhance error handling in ParameterAccessor
Signed-off-by: Henrique Graca <[email protected]>
Signed-off-by: Henrique Graca <[email protected]>
Signed-off-by: Henrique Graca <[email protected]>
…ce error handling and session attributes management
@hjgraca hjgraca requested a review from leandrodamascena May 29, 2025 14:25
…ODO for CDK integration and remove redundant resource requirements
hjgraca added 25 commits June 2, 2025 18:08
…tailed XML documentation and support for various handler signatures
…it and add attribute-based tool registration support
… fluent API for function registration and automatic request processing
…d result processing with dedicated helper classes
…alidator, ResultConverter, and BedrockAgentFunctionResolver
…ParameterMapper, ParameterTypeValidator, and ResultConverter; enhance error handling in ParameterAccessor
…ce error handling and session attributes management
Signed-off-by: Henrique Graca <[email protected]>
…ODO for CDK integration and remove redundant resource requirements
…esolver' into feature/bedrock-agent-function-resolver

# Conflicts:
#	libraries/src/AWS.Lambda.Powertools.EventHandler.Resolvers.BedrockAgentFunction/BedrockAgentFunctionResolver.cs
Signed-off-by: Henrique Graca <[email protected]>
@hjgraca hjgraca merged commit 4145acc into develop Jun 3, 2025
5 checks passed
@hjgraca hjgraca deleted the feature/bedrock-agent-function-resolver branch June 3, 2025 12:17
Copy link

sonarqubecloud bot commented Jun 3, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation internal Maintenance changes size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants