-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
.Net: Add connector for AWS Bedrock #4335
Comments
After reading #3094, I was wondering if there is still hope for the Bedrock connector to make it into the main repo? That would be soooo sweet 🙏 |
This issue is stale because it has been open for 90 days with no activity. |
Hi @stephentoub do you need help with this one? I'd love to give it a hand. I've authored this library https://github.com/fbouteruche/rockhead-extensions and I know how to work with AWS Bedrock. |
@stephentoub @markwallace-microsoft We are planning to work on this. Could you please update the status regarding this issue. |
Awesome. @markwallace-microsoft ? |
@stephentoub Should we plan to fork this repo and open a PR adding the Bedrock connectors here? https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/Connectors |
@Beau-Gosse-dev we'd be delighted to have this contribution. I'm adding @RogerBarreto as he has been working with contributors on some of the new connectors. We will create a feature branch for this work to allow multiple smaller PR's which will be easier to review and merge. |
@Beau-Gosse-dev, @as14692 please follow the instructions on our Feature Branch Strategy provided by @markwallace-microsoft above. Feature branch for Amazon Bedrock was created, on the next PR's please target this Consider initial namespace naming as Thanks for the contribution! |
Thanks so much @markwallace-microsoft and @RogerBarreto ! One question right away, will we be able to take a dependency on the AWS SDK for Bedrock? source code, nuget |
That should be fine |
I am also very interested in this. Will it suffice to add a class in the connectors namespace and implement IChatCompletion? |
@markwallace-microsoft @RogerBarreto @stephentoub Submitted first PR for ChatCompletionService and TextGenerationService. Please review. |
### 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]>
# Add Amazon's AWS Bedrock Connector - Resolves #4335 Adding support for Amazon AWS Connector to the Semantic Kernel. --------- Co-authored-by: Charlize Yeh <[email protected]> Co-authored-by: Charlize Yeh <[email protected]> Co-authored-by: Roger Barreto <[email protected]>
https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/Bedrock/TBedrockClient.html
The text was updated successfully, but these errors were encountered: