OpenAI-API-dotnet icon indicating copy to clipboard operation
OpenAI-API-dotnet copied to clipboard

Getting 100 sec timeout when using completion endpoint. I tried Httpclient

Open abhishek6616 opened this issue 1 year ago • 1 comments

HttpClient client; OpenAIAPI api = new(new APIAuthentication(apiKey)); var clientFactory = api.HttpClientFactory; if (clientFactory != null) { client = clientFactory.CreateClient(); } else { client = new HttpClient(); } client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", api.Auth.ApiKey); client.DefaultRequestHeaders.Add("api-key", api.Auth.ApiKey); client.DefaultRequestHeaders.Add("User-Agent", "user"); client.Timeout = TimeSpan.FromSeconds(1000);

abhishek6616 avatar Jan 17 '24 08:01 abhishek6616

I assume this is a duplicate of #102, but I'll work on making it easier to set a custom timeout.

OkGoDoIt avatar Jan 27 '24 05:01 OkGoDoIt