program stopped without any prompt
willhuo opened this issue · comments
willhuo commented
` private static async Task ChatgptNetTestAsync()
{
var chatGpt = new ChatGpt(new ChatGptConfig
{
UseCache = true
});
await chatGpt.WaitForReady();
var chatGptClient = await chatGpt.CreateClient(new ChatGptClientConfig
{
SessionToken = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..",
AccountType = AccountType.Free
});
//init unique conversation id
//var conversationId = Guid.NewGuid().ToString("N");
var conversationId = "a-unique-string-id";
while (true)
{
Serilog.Log.Information("pls ask a question");
var question = Console.ReadLine();
var response = await chatGptClient.Ask(question, conversationId);
Serilog.Log.Information("answer:{0}", response);
}
}
`
willhuo commented
I find the bug finally.
The async method caused the problem.