mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-05 00:59:36 +00:00
Bug fixed
This commit is contained in:
parent
e1e29b52ee
commit
3dae306c75
@ -63,6 +63,17 @@ public class ProductService : IProductService
|
|||||||
var messagesForOpenAI = new List<OpenAiMessage>();
|
var messagesForOpenAI = new List<OpenAiMessage>();
|
||||||
|
|
||||||
foreach (var item in previousMessages.Items)
|
foreach (var item in previousMessages.Items)
|
||||||
|
{
|
||||||
|
if (item.Role == "Application")
|
||||||
|
{
|
||||||
|
messagesForOpenAI
|
||||||
|
.Add(new OpenAiMessage()
|
||||||
|
{
|
||||||
|
Role = OpenAiRole.Assistant.RequestConvert(),
|
||||||
|
Content = item.Text
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
messagesForOpenAI
|
messagesForOpenAI
|
||||||
.Add(new OpenAiMessage()
|
.Add(new OpenAiMessage()
|
||||||
@ -71,6 +82,7 @@ public class ProductService : IProductService
|
|||||||
Content = item.Text
|
Content = item.Text
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
messagesForOpenAI.Add(new OpenAiMessage()
|
messagesForOpenAI.Add(new OpenAiMessage()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user