mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-04 16:49:36 +00:00
Merge pull request #18 from Shchoholiev/bug/fix-product-search-open-ai-roles
Bug fixed
This commit is contained in:
commit
834441d79c
@ -64,12 +64,24 @@ public class ProductService : IProductService
|
|||||||
|
|
||||||
foreach (var item in previousMessages.Items)
|
foreach (var item in previousMessages.Items)
|
||||||
{
|
{
|
||||||
messagesForOpenAI
|
if (item.Role == "Application")
|
||||||
.Add(new OpenAiMessage()
|
{
|
||||||
{
|
messagesForOpenAI
|
||||||
Role = item.Role.ToLower(),
|
.Add(new OpenAiMessage()
|
||||||
Content = item.Text
|
{
|
||||||
});
|
Role = OpenAiRole.Assistant.RequestConvert(),
|
||||||
|
Content = item.Text
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
messagesForOpenAI
|
||||||
|
.Add(new OpenAiMessage()
|
||||||
|
{
|
||||||
|
Role = item.Role.ToLower(),
|
||||||
|
Content = item.Text
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
messagesForOpenAI.Add(new OpenAiMessage()
|
messagesForOpenAI.Add(new OpenAiMessage()
|
||||||
|
Loading…
Reference in New Issue
Block a user