HttpClient timeout exception for Whisper API calls #266
-
Bug ReportOverviewWhen trying to make a call to the Whisper API ( This also occasionally happens for shorter duration audio files too. Exception thrown: To ReproduceSteps to reproduce the behavior:
Expected behaviorAllow the HTTP request to finish or allow the Timeout in seconds to be configurable. Open AI is clearly taking longer than 100 seconds to create the transcription I am submitting. ScreenshotsN/A Additional contextI am working with a lot of long duration audio files. I cannot split the files when submitting to the Whisper API, because the Verbose JSON response will have the incorrect start and end times (because Whisper is treating them as separate audio files). My only option is to compress the audio files and submit them to Whisper. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Can you configure the HttpClient timeout by passing it in the constructor of the OpenAIClient: using var customHttpClient = new HttpClient();
// set custom http client properties here
customHttpClient.Timeout = TimeSpan.FromMinutes(30);
var api = new OpenAIClient(client: customHttpClient); |
Beta Was this translation helpful? Give feedback.
Can you configure the HttpClient timeout by passing it in the constructor of the OpenAIClient: