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, model_name=model, request_timeout=120). Confirmed by several reporters; one needed 600. Later langchain versions raised the default.