-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net: Fix OpenAI connector compatibility #5338
.Net: Fix OpenAI connector compatibility #5338
Conversation
@SergeyMenshykh I believe this change is not what we intent, right? Our Content should map to the first Text item of a ChatMessage, @JadynWong, can you provide the scenario on what is the current problem and what this solves that the actual impl doesnt? |
@RogerBarreto, I wrote it in #5337. The main reason for this is that we use openai connectors through third party openai compatible endpoints. They currently do not support arrays of content. PR #5088 changes prevented the use of these compatibility endpoints. |
Because Semantickernel currently mainly supports OpenAI and Azure OpenAI, |
...nnectors/Connectors.UnitTests/OpenAI/ChatCompletion/AzureOpenAIChatCompletionServiceTests.cs
Show resolved
Hide resolved
### 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. --> Fix microsoft#5337 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Improved openai connector compatibility. When the user message has only one TextContent, serialize the user message as a string. Otherwise, serialize the user message as an array. ### 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: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Motivation and Context
Fix #5337
Description
Improved openai connector compatibility.
When the user message has only one TextContent, serialize the user message as a string. Otherwise, serialize the user message as an array.
Contribution Checklist