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
•
17 Mar 2025
Refining text analysis for research data from regex to Python automation
IntroductionData extraction and filtering are crucial for developers working with large research datasets. Whether you're working on government archives, industry reports, or academic research projects, extracting meaningful insights efficiently can be challenging. I'm going to explore how we...
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...