You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenAI engine: requests over ~300 s fail with openai >= 5, whatever the timeout #59
engines.openai() cannot wait more than about 5 minutes for a clip when the installed openai SDK is version 5 or newer, whatever timeout the SDK is given.
From v5 the SDK uses Node's built-in fetch (undici), whose headersTimeout is 300 s by default. The SDK's own timeout (10 minutes by default) does not raise it, so a request that has not received response headers after 300 s fails with APIConnectionTimeoutError. With v4 (node-fetch) there is no such limit.
OpenAI's own API answers well within that, so this mostly affects self-hosted OpenAI-compatible servers (see the baseUrl option in #58): on CPU a long sentence can take several minutes. The peer range is openai: ">=4", so a fresh install gets v6 and hits it.
APIConnectionTimeoutError: Request timed out. after 304 s
Possible fixes (maintainer's call)
Let callers pass a fetch (or fetchOptions) through engines.openai(), e.g. one using an undici Agent with a larger headersTimeout. No new dependency in Argo.
Have the engine create an undici Agent from timeoutMs itself. Works out of the box, adds undici as a dependency.
A request through engines.openai() with openai >= 5 can wait longer than 300 s for a response when configured to, or the README states the limit and how to work around it.
A test or reproduction shows the chosen behaviour.
Activity
feat(tts): pass fetchOptions through engines.openai() (shreyaskarnik#61)