From e79e0bd6b4a4f41b7bbed22c50d595362f7872aa Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Mon, 28 Jul 2025 13:58:23 -0400 Subject: [PATCH] fix(openai): add `max_retries` parameter to ChatOpenAI for handling 503 capacity errors (#32286) Some integration tests were failing --- .../openai/tests/integration_tests/chat_models/test_base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py index 4b02676e2a8..48fa87bbb19 100644 --- a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py +++ b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py @@ -221,6 +221,7 @@ def test_openai_invoke() -> None: llm = ChatOpenAI( model="o4-mini", service_tier="flex", # Also test service_tier + max_retries=3, # Add retries for 503 capacity errors ) result = llm.invoke("Hello", config=dict(tags=["foo"]))