Python: #6499 Mistral AI Chat Completion#7049
Merged
moonbox3 merged 22 commits intomicrosoft:mainfrom Jul 4, 2024
Merged
Conversation
Contributor
Contributor
Author
|
As commented on #6921, i decided to split the PR's into a more Lightweight PR and then increase the connector. |
eavanvalkenburg
requested changes
Jul 2, 2024
Collaborator
|
Hi @nmoeller, we just merged a PR that messed with the |
…-Connector-chat-completion
Contributor
Author
moonbox3
reviewed
Jul 2, 2024
moonbox3
approved these changes
Jul 2, 2024
Collaborator
moonbox3
left a comment
There was a problem hiding this comment.
LGTM. Thanks for working on this!
…ps://github.com/nmoeller/semantic-kernel into issue-6499-Mistral-Ai-Connector-chat-completion
moonbox3
approved these changes
Jul 3, 2024
juliomenendez
approved these changes
Jul 3, 2024
Contributor
juliomenendez
left a comment
There was a problem hiding this comment.
Looks good! Just a few minor comments.
eavanvalkenburg
approved these changes
Jul 3, 2024
…ps://github.com/nmoeller/semantic-kernel into issue-6499-Mistral-Ai-Connector-chat-completion
moonbox3
approved these changes
Jul 4, 2024
…ps://github.com/nmoeller/semantic-kernel into issue-6499-Mistral-Ai-Connector-chat-completion
moonbox3
approved these changes
Jul 4, 2024
7 tasks
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jul 11, 2024
### Motivation and Context 1. I saw that you are having spikes regarding enabling MyPy 2. On ##7049 i had the Liskov Principle commented 3. In #7144 is saw how you plan to solve this so i decided to adjust the mistral connector to this ### Description The PR contains changes to be compliant to MyPy in Mistral AI Connector. Changes input Parameter for MistralAIChatCompletion from MistralAIPromptExecutionSettings to PromptExecutionSettings. Adding Test Cases for MistralAIPromptExecutionSettings and PromptExecutionSettings.  ### Tasks - [x] Changes input Parameter for Liskov - [x] Settings conversion - [x] Adjust TestCases to 100% ### Contribution Checklist <!-- 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 😄 --------- Co-authored-by: Nico Möller <nicomoller@microsoft.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
LudoCorporateShark
pushed a commit
to LudoCorporateShark/semantic-kernel
that referenced
this pull request
Aug 25, 2024
### 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. --> 1. Why is this changed required ? To enable Mistral Models with Semantic Kernel, there was the issue microsoft#6499 in the Backlog to add a MistralAI Connector 2. What problem does it solve ? It solves the problem, that semantic kernel is not yet integrated with MistralAI 3. What scenario does it contribute to? The scenario is to use different connector than HF,OpenAI or AzureOpenAI. When User's want to use Mistral they can easliy integrate it now 4. If it fixes an open issue, please link to the issue here. microsoft#6499 ### Description The changes made are designed by the open_ai connector, i tried to stay as close as possible to the structure. For the integration i installed the mistral python package in the repository. I added the following Classes : - MistrealAIChatPromptExcecutionSettings --> Responsible to administrate the Prompt Execution against MistralAI - MistralAIChatCompletion --> Responsible to coordinate the Classes and for Content parsing - MistralAISettings --> Basic Settings to work with the MistralAIClient **To test the changes with the tests please add MISTRALAI_API_KEY and MISTRALAI_CHAT_MODEL_ID as Enviorment Variable** From a design decision i moved the processing of Functions from Connectors to the ChatCompletionClientBaseClass What is integrated yet : - [X] Integrate Mistral AI ChatCompletion Models without Streaming - [X] Integrate Mistral AI Chat Completion Models with Streaming - [X] Simple Integration Test to test Streaming and non Streaming - [x] Extended Testing including Unit Testing & More Integration Tests ### Contribution Checklist <!-- 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 😄 --------- Co-authored-by: Nico Möller <nicomoller@microsoft.com>
LudoCorporateShark
pushed a commit
to LudoCorporateShark/semantic-kernel
that referenced
this pull request
Aug 25, 2024
### Motivation and Context 1. I saw that you are having spikes regarding enabling MyPy 2. On #microsoft#7049 i had the Liskov Principle commented 3. In microsoft#7144 is saw how you plan to solve this so i decided to adjust the mistral connector to this ### Description The PR contains changes to be compliant to MyPy in Mistral AI Connector. Changes input Parameter for MistralAIChatCompletion from MistralAIPromptExecutionSettings to PromptExecutionSettings. Adding Test Cases for MistralAIPromptExecutionSettings and PromptExecutionSettings.  ### Tasks - [x] Changes input Parameter for Liskov - [x] Settings conversion - [x] Adjust TestCases to 100% ### Contribution Checklist <!-- 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 😄 --------- Co-authored-by: Nico Möller <nicomoller@microsoft.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
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.
Motivation and Context
To enable Mistral Models with Semantic Kernel, there was the issue Python: Add Mistral AI Connector #6499 in the Backlog to add a MistralAI Connector
It solves the problem, that semantic kernel is not yet integrated with MistralAI
The scenario is to use different connector than HF,OpenAI or AzureOpenAI. When User's want to use Mistral they can easliy integrate it now
Python: Add Mistral AI Connector #6499
Description
The changes made are designed by the open_ai connector, i tried to stay as close as possible to the structure.
For the integration i installed the mistral python package in the repository.
I added the following Classes :
To test the changes with the tests please add MISTRALAI_API_KEY and MISTRALAI_CHAT_MODEL_ID as Enviorment Variable
From a design decision i moved the processing of Functions from Connectors to the ChatCompletionClientBaseClass
What is integrated yet :
Contribution Checklist