Andrew Fletcher published: 19 October 2023 1 minute read
OpenAI request timeout?
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised ServiceUnavailableError: The server is overloaded or not ready yet..
Try increasing the timeout parameter. For example,
llm = ChatOpenAI(temperature=0, model_name=model)
Change to
llm = ChatOpenAI(temperature=0, model_name=model, request_timeout=120)
Related articles
Andrew Fletcher
•
13 Feb 2025
Deploying a Python project from UAT to production using Git
When deploying a Python project from a User Acceptance Testing (UAT) environment to Production, it’s essential to ensure that all dependencies and configurations remain consistent. Particularly in our situation where this was going to be the first deployment of AI semantic search functionality to...
Andrew Fletcher
•
07 Dec 2024
Navigating technical infrastructure hiccups when running Python packages in virtual environments
Seemingly minor technical misconfigurations can escalate into major organisational inefficiencies. Consider a scenario where a Python-based web application experiences repeated errors due to missing dependencies, incorrect permissions, and environment mismanagement. Although these challenges appear...
Andrew Fletcher
•
19 Nov 2024
How to resolve issues with Python and virtual environments in pyenv
For developers working with Python, setting up and managing environments can sometimes lead to frustrating terminal errors. If you’ve encountered issues like the `python: command not found` error or struggled to create a virtual environment, this guide walks through resolving these common problems...