-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds #102
Comments
I am also having this error sometimes |
could someone change it? if yes, please write in telegram, help @volume_k |
+1 We need to accept CancellationToken on async functions and pass it to the HTTP requests. |
a vote for making this user settable. I'm working with some big contexts in GPT-4 and they can take awhile. I have verified in OpenAI's Playground that in GPT-4 chat mode my prompts take well over 100 seconds to successfully complete. |
I download the repository and made an ad-hoc fix, increasing the timeout to 1000 seconds. I rebuilt the nuget file and installed it locally. I tested it on my application and it works. At temporary fix to the problem. Much better would be a user parameter when creating a chat or other session. in EndpointBase.cs: protected HttpClient GetClient()
|
Why not instantiate your own HttpClient with whatever timeout settings you want, and pass that into the existing service constructors? |
Do you have an example of this? |
Of what? chatGPT can show you how to instantiate an HttpClient and set its timeout settings. Then you pass it into the constructor that accepts an HttpClient reference |
For people that are new to .NET like me, this is how I did it in C# (Warning, I have no idea what I'm doing and chatgpt did most of this work ) Add a reference to System.Net.Http to your project Add the following lines in the right places in your project:
|
I have sort of the opposite issue. Some times the call hangs for 100 seconds and that's a long time if the answer is not coming. So I would need a timeout of maybe 10-15 seconds but only if it hasn't started answering yet. As soon as it is answering, then there should not be any timeout in my opinion. |
Is there a way to understand that |
Perhaps use |
Do we have any fix for this? |
I'm not sure this is a bug to be fixed. The SDK allows you to pass in your own HttpClient with your own preferences for timeouts, etc: #102 (comment) |
The custom HTTP client is the "right" way to do this, but I should probably add a helper to make it easy to set a custom timeout and take care of this behind the scenes. The custom HTTP client is a bit clunky. |
I often get this error. But other times it works without issues. Any ideas on how to change the timeout?
Has anyone else had this issue?
The text was updated successfully, but these errors were encountered: