Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This is caused if upstream delta Role was not provided, then "user" will returned.
  • Loading branch information
sdcb authored Apr 20, 2023
1 parent 8bc534b commit 975149c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenAI_API/Chat/Conversation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public async IAsyncEnumerable<string> StreamResponseEnumerableFromChatbotAsync()
{
if (res.Choices.FirstOrDefault()?.Delta is ChatMessage delta)
{
if (delta.Role != null)
if (responseRole == null && delta.Role != null)
responseRole = delta.Role;

string deltaContent = delta.Content;
Expand Down

0 comments on commit 975149c

Please sign in to comment.