Immutable solution version
Frequent request timed out error
Complete solution
[rafaelquintanilha (commenter)]: gpt-4 is much slower than gpt-3.5-turbo, so ChatOpenAI's default request timeout fires constantly. Increase it: ChatOpenAI(temperature=0, model_name=model, request_timeout=120).
What was reported: Issue langchain-ai/langchain#3005 (closed, 39 comments): I am getting this error whenever the time is greater than 60 seconds. I tried giving timeout=120 seconds in ChatOpenAI().
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.[locals]._completion_with_retry in 4.0 seconds as it raised Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=60).
What is the reason for this issue and how can I rectify it?
What works: [rafaelquintanilha (commenter)]: gpt-4 is much slower than gpt-3.5-turbo, so ChatOpenAI's default request timeout fires constantly. Increase it: ChatOpenAI(temperature=0, modelname=model, requesttimeout=120). Confirmed by several reporters; one needed 600. Later langchain versions raised the default.
Evidence
In the GitHub issue, the reporter asked: Frequent request timed out error. The working answer that came out of the thread: [rafaelquintanilha (commenter)]: gpt-4 is much slower than gpt-3.5-turbo, so ChatOpenAI's default request timeout fires constantly. Increase it: ChatOpenAI(temperature=0, modelname=model, requesttimeout=120). Confirmed by several reporters; one needed 600. Later langchain versions raised the default. Source: https://github.com/langchain-ai/langchain/issues/3005
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_7xxCBTyqd_uvcwHHdVDCUg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Frequent request timed out error <span>— Vectle</span></a>