Skip to content

Instantly share code, notes, and snippets.

@tazarov
Created May 22, 2025 17:33
Show Gist options
  • Save tazarov/a93a5dd9badceb1c3bff149faddfc927 to your computer and use it in GitHub Desktop.
Save tazarov/a93a5dd9badceb1c3bff149faddfc927 to your computer and use it in GitHub Desktop.
OpenAI EF retry and timeouts
openai_ef = OpenAIEmbeddingFunction(
api_key=os.getenv("OPENAI_API_KEY"),
model_name=QAExecutor.embeddings_model
)
openai_ef._client._client.timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0)
openai_ef._client._client.max_retries=3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment