Bug fixed

This commit is contained in:
Mykhailo Bilodid 2023-11-15 23:58:49 +02:00
parent e1e29b52ee
commit 3dae306c75

View File

@ -64,12 +64,24 @@ public class ProductService : IProductService
foreach (var item in previousMessages.Items)
{
messagesForOpenAI
.Add(new OpenAiMessage()
{
Role = item.Role.ToLower(),
Content = item.Text
});
if (item.Role == "Application")
{
messagesForOpenAI
.Add(new OpenAiMessage()
{
Role = OpenAiRole.Assistant.RequestConvert(),
Content = item.Text
});
}
else
{
messagesForOpenAI
.Add(new OpenAiMessage()
{
Role = item.Role.ToLower(),
Content = item.Text
});
}
}
messagesForOpenAI.Add(new OpenAiMessage()