Repository navigation
.Net: Add Amazon's AWS Bedrock Connector - #7627
Merged
Merged
Conversation
### 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. --> There has been a strong demand from developers in the community to be able to utilize Bedrock with the Semantic Kernel. With the wide variety of foundation models offered including specialized models tailored for various domains and use cases, Bedrock's AI capabilities can now be leveraged within the Semantic Kernel's unified ecosystem with this connector. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> This pull request implements a connector for Amazon Bedrock, allowing developers to leverage Bedrock's foundation models within the Semantic Kernel framework. Key features of this implementation include: - Core Services: Implementation of `IChatCompletionService` and `ITextGenerationService` from the Semantic Kernel. - Authentication and Security: Secure client authentication and API communication with the Amazon Bedrock Runtime. - Modular Design: A directory organization and namespace structure similar to other connectors in the Semantic Kernel, including folders for core, services, models, and extensions. - Testing: Inclusion of unit tests and integration tests for available Bedrock models to demonstrate successful communication with Bedrock API, request/response mapping, and output generation. The implementation leverages the following Amazon Bedrock Runtime actions: - `InvokeModelAsync` and `InvokeModelWithResponseStreamAsync` for `GetTextContentsAsync` and `GetStreamingTextContentsAsync`, respectively. - `ConverseAsync` and `ConverseStreamAsync` for `GetChatMessageContentsAsync` and `GetStreamingChatMessageContentsAsync`, respectively. The following base models from various providers are currently connected and available for use under Bedrock: - AI21 Labs Jamba - AI21 Labs Jurassic-2 series - Amazon Titan - Anthropic Claude - Cohere Command - Meta Llama 3 - Mistral AI Mistral The kernel builder extension methods support two authentication scenarios: - User-provided `IAmazonBedrockRuntime` object: Developers can provide a pre-configured `IAmazonBedrockRuntime` object, allowing for customized configurations such as specifying custom credentials, endpoints, or other settings. - Automatic `IAmazonBedrockRuntime` creation: If developers do not provide an `IAmazonBedrockRuntime` object, an instance is automatically created and registered in the dependency injection (DI) container using the `AWSSDK.Extensions.NETCore.Setup` package. In this case, the `IAmazonBedrockRuntime` object will be configured with default settings, such as credentials obtained from environment variables, AWS credentials files, or instance profile credentials. Resolve #3094 Resolve #4335 - #3094 - #4335 ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] 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 - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Co-authored-by: Charlize Yeh <[email protected]> Co-authored-by: Roger Barreto <[email protected]> Co-authored-by: Roger Barreto <[email protected]>
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
September 13, 2024 10:36 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
September 16, 2024 10:41 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
October 3, 2024 12:15 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
marked this pull request as ready for review
October 3, 2024 12:16
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
October 8, 2024 15:29 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
October 21, 2024 10:28 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
had a problem deploying
to
integration
October 22, 2024 00:53 — with
GitHub Actions
Failure
Roger Barreto (rogerbarreto)
had a problem deploying
to
integration
October 23, 2024 16:58 — with
GitHub Actions
Error
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
October 23, 2024 17:00 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
October 23, 2024 19:15 — with
GitHub Actions
Inactive
Dmytro Struk (dmytrostruk)
approved these changes
Oct 24, 2024
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
October 29, 2024 09:46 — with
GitHub Actions
Inactive
Roger Barreto (rogerbarreto)
temporarily deployed
to
integration
October 30, 2024 14:10 — with
GitHub Actions
Inactive
SergeyMenshykh
approved these changes
Oct 30, 2024
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Amazon's AWS Bedrock Connector
Adding support for Amazon AWS Connector to the Semantic Kernel.