-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: Add AI connector README (#9764)
### 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. --> We need a README in the connectors/ai directory to list all the existing AI connectors. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist 1. Add a README 2. Refactor some connector package paths <!-- 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 - [x] I didn't break anyone 😄
- Loading branch information
1 parent
51675d2
commit ea2ba47
Showing
15 changed files
with
169 additions
and
164 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# AI Connectors | ||
|
||
This directory contains the implementation of the AI connectors (aka AI services) that are used to interact with AI models. | ||
|
||
Depending on the modality, the AI connector can inherit from one of the following classes: | ||
- [`ChatCompletionClientBase`](./chat_completion_client_base.py) for chat completion tasks. | ||
- [`TextCompletionClientBase`](./text_completion_client_base.py) for text completion tasks. | ||
- [`AudioToTextClientBase`](./audio_to_text_client_base.py) for audio to text tasks. | ||
- [`TextToAudioClientBase`](./text_to_audio_client_base.py) for text to audio tasks. | ||
- [`TextToImageClientBase`](./text_to_image_client_base.py) for text to image tasks. | ||
- [`EmbeddingGeneratorBase`](./embeddings/embedding_generator_base.py) for text embedding tasks. | ||
|
||
|
||
All base clients inherit from the [`AIServiceClientBase`](../../services/ai_service_client_base.py) class. | ||
|
||
## Existing AI connectors | ||
|
||
| Services | Connectors | | ||
|-------------------------|--------------------------------------| | ||
| OpenAI | [`OpenAIChatCompletion`](./open_ai/services/open_ai_chat_completion.py) | | ||
| | [`OpenAITextCompletion`](./open_ai/services/open_ai_text_completion.py) | | ||
| | [`OpenAITextEmbedding`](./open_ai/services/open_ai_text_embedding.py) | | ||
| | [`OpenAITextToImage`](./open_ai/services/open_ai_text_to_image.py) | | ||
| | [`OpenAITextToAudio`](./open_ai/services/open_ai_text_to_audio.py) | | ||
| | [`OpenAIAudioToText`](./open_ai/services/open_ai_audio_to_text.py) | | ||
| Azure OpenAI | [`AzureChatCompletion`](./open_ai/services/azure_chat_completion.py) | | ||
| | [`AzureTextCompletion`](./open_ai/services/azure_text_completion.py) | | ||
| | [`AzureTextEmbedding`](./open_ai/services/azure_text_embedding.py) | | ||
| | [`AzureTextToImage`](./open_ai/services/azure_text_to_image.py) | | ||
| | [`AzureTextToAudio`](./open_ai/services/azure_text_to_audio.py) | | ||
| | [`AzureAudioToText`](./open_ai/services/azure_audio_to_text.py) | | ||
| Azure AI Inference | [`AzureAIInferenceChatCompletion`](./azure_ai_inference/services/azure_ai_inference_chat_completion.py) | | ||
| | [`AzureAIInferenceTextEmbedding`](./azure_ai_inference/services/azure_ai_inference_text_embedding.py) | | ||
| Anthropic | [`AnthropicChatCompletion`](./anthropic/services/anthropic_chat_completion.py) | | ||
| [Bedrock](./bedrock/README.md) | [`BedrockChatCompletion`](./bedrock/services/bedrock_chat_completion.py) | | ||
| | [`BedrockTextCompletion`](./bedrock/services/bedrock_text_completion.py) | | ||
| | [`BedrockTextEmbedding`](./bedrock/services/bedrock_text_embedding.py) | | ||
| [Google AI](./google/README.md) | [`GoogleAIChatCompletion`](./google/google_ai/services/google_ai_chat_completion.py) | | ||
| | [`GoogleAITextCompletion`](./google/google_ai/services/google_ai_text_completion.py) | | ||
| | [`GoogleAITextEmbedding`](./google/google_ai/services/google_ai_text_embedding.py) | | ||
| [Vertex AI](./google/README.md) | [`VertexAIChatCompletion`](./google/vertex_ai/services/vertex_ai_chat_completion.py) | | ||
| | [`VertexAITextCompletion`](./google/vertex_ai/services/vertex_ai_text_completion.py) | | ||
| | [`VertexAITextEmbedding`](./google/vertex_ai/services/vertex_ai_text_embedding.py) | | ||
| HuggingFace | [`HuggingFaceTextCompletion`](./hugging_face/services/hf_text_completion.py) | | ||
| | [`HuggingFaceTextEmbedding`](./hugging_face/services/hf_text_embedding.py) | | ||
| Mistral AI | [`MistralAIChatCompletion`](./mistral_ai/services/mistral_ai_chat_completion.py) | | ||
| | [`MistralAITextEmbedding`](./mistral_ai/services/mistral_ai_text_embedding.py) | | ||
| Ollama | [`OllamaChatCompletion`](./ollama/services/ollama_chat_completion.py) | | ||
| | [`OllamaTextCompletion`](./ollama/services/ollama_text_completion.py) | | ||
| | [`OllamaTextEmbedding`](./ollama/services/ollama_text_embedding.py) | | ||
| Onnx | [`OnnxGenAIChatCompletion`](./onnx/services/onnx_gen_ai_chat_completion.py) | | ||
| | [`OnnxGenAITextCompletion`](./onnx/services/onnx_gen_ai_text_completion.py) | |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
from semantic_kernel.connectors.ai.bedrock.bedrock_prompt_execution_settings import ( | ||
BedrockChatPromptExecutionSettings, | ||
BedrockEmbeddingPromptExecutionSettings, | ||
BedrockPromptExecutionSettings, | ||
BedrockTextPromptExecutionSettings, | ||
) | ||
from semantic_kernel.connectors.ai.bedrock.bedrock_settings import BedrockSettings | ||
from semantic_kernel.connectors.ai.bedrock.services.bedrock_chat_completion import BedrockChatCompletion | ||
from semantic_kernel.connectors.ai.bedrock.services.bedrock_text_completion import BedrockTextCompletion | ||
from semantic_kernel.connectors.ai.bedrock.services.bedrock_text_embedding import BedrockTextEmbedding | ||
|
||
__all__ = [ | ||
"BedrockChatCompletion", | ||
"BedrockChatPromptExecutionSettings", | ||
"BedrockEmbeddingPromptExecutionSettings", | ||
"BedrockPromptExecutionSettings", | ||
"BedrockSettings", | ||
"BedrockTextCompletion", | ||
"BedrockTextEmbedding", | ||
"BedrockTextPromptExecutionSettings", | ||
] |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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