I am using the OpenAI library in my c# project, but I get the following error if it does not receive a response for more than 100 seconds. I cannot add a custom httpclient element. how can I solve this problem. Thanks in advance.
‘system Threading Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing,‘
The library I use: https://github.com/OkGoDoIt/OpenAI-API-dotnet
my code:
OpenAIAPI api = new OpenAIAPI(apiKey);
var result = await api.Chat.CreateChatCompletionAsync(new ChatRequest()
{
Model = Model.ChatGPTTurbo,
Temperature = 0.5,
Messages = new ChatMessage[]
{
new ChatMessage(ChatMessageRole.System, ""),
new ChatMessage(ChatMessageRole.User, prompt)
}
});