-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bump-py-ver-20241121
- Loading branch information
Showing
56 changed files
with
1,726 additions
and
569 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
|
||
from enum import Enum | ||
|
||
from semantic_kernel.utils.experimental_decorator import experimental_class | ||
|
||
|
||
@experimental_class | ||
class OperationExtensions(Enum): | ||
"""The operation extensions.""" | ||
|
||
METHOD_KEY = "method" | ||
OPERATION_KEY = "operation" | ||
INFO_KEY = "info" | ||
SECURITY_KEY = "security" | ||
SERVER_URLS_KEY = "server-urls" | ||
METADATA_KEY = "operation-extensions" |
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
16 changes: 16 additions & 0 deletions
16
python/semantic_kernel/connectors/openapi_plugin/models/rest_api_oauth_flow.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,16 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
from dataclasses import dataclass | ||
|
||
from semantic_kernel.utils.experimental_decorator import experimental_class | ||
|
||
|
||
@experimental_class | ||
@dataclass | ||
class RestApiOAuthFlow: | ||
"""Represents the OAuth flow used by the REST API.""" | ||
|
||
authorization_url: str | ||
token_url: str | ||
scopes: dict[str, str] | ||
refresh_url: str | None = None |
17 changes: 17 additions & 0 deletions
17
python/semantic_kernel/connectors/openapi_plugin/models/rest_api_oauth_flows.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,17 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
from dataclasses import dataclass | ||
|
||
from semantic_kernel.connectors.openapi_plugin.models.rest_api_oauth_flow import RestApiOAuthFlow | ||
from semantic_kernel.utils.experimental_decorator import experimental_class | ||
|
||
|
||
@experimental_class | ||
@dataclass | ||
class RestApiOAuthFlows: | ||
"""Represents the OAuth flows used by the REST API.""" | ||
|
||
implicit: RestApiOAuthFlow | None = None | ||
password: RestApiOAuthFlow | None = None | ||
client_credentials: RestApiOAuthFlow | None = None | ||
authorization_code: RestApiOAuthFlow | None = None |
Oops, something went wrong.