From 8279cec761d8ab8ae90975373178631b265b8101 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Wed, 3 Dec 2025 17:33:29 -0300 Subject: [PATCH] wait for 2 seconds if its watsonx --- src/api/provider_health.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/api/provider_health.py b/src/api/provider_health.py index 83927131..3802d8dc 100644 --- a/src/api/provider_health.py +++ b/src/api/provider_health.py @@ -1,5 +1,6 @@ """Provider health check endpoint.""" +import asyncio import httpx from starlette.responses import JSONResponse from utils.logging_config import get_logger @@ -149,6 +150,16 @@ async def check_provider_health(request): logger.error(f"LLM provider ({provider}) validation failed: {llm_error}") # Validate embedding provider + # For WatsonX with test_completion=True, wait 2 seconds between completion and embedding tests + if ( + test_completion + and provider == "watsonx" + and embedding_provider == "watsonx" + and llm_error is None + ): + logger.info("Waiting 2 seconds before WatsonX embedding test (after completion test)") + await asyncio.sleep(2) + try: await validate_provider_setup( provider=embedding_provider,