Open w1tsky opened 1 year ago
This is an error with the ChatChoice.ToString
method for streamed responses, which you are calling implicitly with Console.Write(token)
.
The response of a streamed ChatChoice
is in Delta
, not in Message
, as is falsely done here https://github.com/OkGoDoIt/OpenAI-API-dotnet/blob/8bc534bc0163e4ca0ddad21a6d58a57910dc6189/OpenAI_API/Chat/ChatResult.cs#L80
An easy workaround would be to write Console.Write(token.Choices.First().Delta.Content)
instead.
Hi I have such simple chat code where token in await foreach loop is equal null:
How can I fix this?