semantic-kernel
semantic-kernel copied to clipboard
Fix some issues when parsing <message> tags in prompts
Issue 1
<message role="system">You are a helpful assistant who knows all about cities in the USA</message>
<message role="user"><text>What is Washington?</text></message>
<message role="user"><text>What is Seattle?</text><text>What is New York?</text></message>
Multiple
{
"messages": [
{
"content": "You are a helpful assistant who knows all about cities in the USA",
"role": "system"
},
{
"content": "What is Washington?",
"role": "user"
}
],
"temperature": 1,
"top_p": 1,
"n": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"model": "gpt-3.5-turbo-0125"
}
Issue 2
<message role=user>Some random text <text>in tag text</text></message>
Text outside of the
{
"messages": [
{
"content": "You are a helpful assistant who knows all about cities in the USA",
"role": "system"
},
{
"content": "What is Washington?",
"role": "user"
},
{
"content": "in tag text",
"role": "user"
}
],
"temperature": 1,
"top_p": 1,
"n": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"model": "gpt-3.5-turbo-0125"
}
In both cases an exception should be thrown