.Net: Extended ChatPromptParser.cs to cover additional scenarios #10278
Labels
Build
Features planned for next Build conference
chat history
.NET
Issue or Pull requests regarding .NET code
Discussed in #10252
Originally posted by ThDuquennoy January 21, 2025
Hello,
When parsing a chat prompt, "invalid" messages are discarded
According to the code, a message node is invalid if one of the following condition is met :
role
attribute is missingtext
child nodetext
child node ANDContent
is null(Link to source)
I get it for the first condition but not the other 2
OpenAI API allows messages with :
text
text
but one or more content of typeimage_url
For instance the following payload is valid
When using
KernelFunctionFromPrompt
, I cannot generate that structure of payload because of this parsing and I don't understand why. I'm sure there is a reason behind this, can somebody explain it to me ?I'm asking this because I noticed that GPT-4o answer differently these 2 payloads, and the one working is not possible with this parser
GPT-4o's response :
Response :
The second payload would be considered invalid because the message containing the image does not contain a
text
contentThanks in advance
The text was updated successfully, but these errors were encountered: