Merge pull request #18 from Shchoholiev/bug/fix-product-search-open-ai-roles

Bug fixed
This commit is contained in:
Mykhailo Bilodid 2023-11-16 00:09:11 +02:00 committed by GitHub
commit 834441d79c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,17 @@ public class ProductService : IProductService
var messagesForOpenAI = new List<OpenAiMessage>();
foreach (var item in previousMessages.Items)
{
if (item.Role == "Application")
{
messagesForOpenAI
.Add(new OpenAiMessage()
{
Role = OpenAiRole.Assistant.RequestConvert(),
Content = item.Text
});
}
else
{
messagesForOpenAI
.Add(new OpenAiMessage()
@ -71,6 +82,7 @@ public class ProductService : IProductService
Content = item.Text
});
}
}
messagesForOpenAI.Add(new OpenAiMessage()
{