OkGoDoIt / OpenAI-API-dotnet

An unofficial C#/.NET SDK for accessing the OpenAI GPT-3 API
https://www.nuget.org/packages/OpenAI/
Other
1.86k stars 432 forks source link

System.NullReferenceException #171

Closed happyDom closed 1 year ago

happyDom commented 1 year ago

The version I use is 1.7.2, and I have encountered the following error many times. Generally, this problem occurs when the program is opened for 2 to 3 days. System.NullReferenceException: an object reference is not set to an instance of the object. In openAI.myAI. < askForChat > d9. MoveNext () position E:\ workSpace\ tools\ gptGPT\ openAI.cs: line number 0 ---The end of the stack trace in the previous position that raised the exception --- System.Runtime.CompilerServices.AsyncMethodBuilderCore. < > c. < ThrowAsync > b6_0 (Object state)

how should I do to solve this error?

happyDom commented 1 year ago

Sorry, this problem has been located, and this error is caused by a bug in my own code. I'll close this issue now