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

.Net: Use empty string instead of null content in assistant message in Azure/OpenAI connectors #9150

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

dmytrostruk
Copy link
Member

Motivation and Context

Resolves: #8072
Resolves: #8488

Azure Chat Completion with data service returns 400 (Bad Request) Invalid chat message detected: message content must be string response when assistant message in chat history doesn't contain content property or when this property is an array of content items. This case is applicable for function calling, where AI model returns set of tools to call instead of message content.

This PR contains a change to set content property as an empty string only for cases when content doesn't exist (null).

Description

Contribution Checklist

@dmytrostruk dmytrostruk self-assigned this Oct 8, 2024
@dmytrostruk dmytrostruk requested a review from a team as a code owner October 8, 2024 01:42
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Oct 8, 2024
@dmytrostruk dmytrostruk added this pull request to the merge queue Oct 8, 2024
Merged via the queue into microsoft:main with commit 639df11 Oct 8, 2024
15 checks passed
@dmytrostruk dmytrostruk deleted the assistant-message-fix branch October 8, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
4 participants