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

Text Generation and Chat Completion #1

Merged

Conversation

charlizeyeh
Copy link
Collaborator

@charlizeyeh charlizeyeh commented Jul 12, 2024

Add Amazon Bedrock Connector

This pull request creates a connector for Amazon Bedrock, expanding the Semantic Kernel's integration capabilities with Bedrock's many foundation models.

Key Features:

  • Implements IChatCompletionService and ITextGenerationService from the Semantic Kernel
  • Includes client authentication and secure API communication with Amazon Bedrock
  • Has core, client, service, and extension folders as directory organization and namespace similar to other connectors
  • Includes unit tests and integration tests for available models

Implementation Details:

  • Amazon Bedrock Runtime actions InvokeModelAsync and InvokeModelWithResponseStreamAsync were used for GetTextContentsAsync and GetStreamingTextContentsAsync respectively

  • Amazon Bedrock Runtime actions ConverseAsync and ConverseStreamAsync were used for GetChatMessageContentsAsync and GetStreamingChatMessageContentsAsync respectively

  • All versions of the following base models are currently connected and available for use under Bedrock:

    • AI21 Labs Jamba
    • AI 21 Labs Jurassic-2 series
    • Amazon Titan
    • Anthropic Claude
    • Cohere Command
    • Meta Llama 3
    • Mistral AI Mistral
  • The following authentication scenarios are supported by the kernel builder extension methods:

    • User provides the IAmazonBedrockRuntime object and model ID: This approach gives the user more control over the configuration of the IAmazonBedrockRuntime object, such as specifying custom credentials, endpoints, or other settings.
    • User only provides model ID: An instance of IAmazonBedrockRuntime is automatically created and registered in the dependency injection (DI) container using the AWSSDK.Extensions.NETCore.Setup package, which adds AWS service clients to the DI container. In this case, the IAmazonBedrockRuntime object will be configured with default settings, such as credentials obtained from the environment variables, AWS credentials file, or instance profile credentials.

Testing:

  • Unit tests cover core functionality and error handling
  • Integration tests demonstrate successful communication with Bedrock API, request/response mapping, and output generation

charyeh added 30 commits July 1, 2024 14:54
Copy link

@Beau-Gosse-dev Beau-Gosse-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need to review the implementation specific to each model/IOService

Copy link

@Beau-Gosse-dev Beau-Gosse-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, these are my last comments. Looks really good overall though, great job!

@charlizeyeh charlizeyeh merged commit 96629dd into feature-connectors-amazon Jul 31, 2024
@Beau-Gosse-dev
Copy link

Main review is now here: microsoft#7587

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.

6 participants