Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Fix test_basic_ocr_with_url[True]

Sameer Kankute9cd587f1730e
diff --git a/tests/ocr_tests/base_ocr_unit_tests.py b/tests/ocr_tests/base_ocr_unit_tests.py
index aaa135a4d6b..88d6caf1435 100644
--- a/tests/ocr_tests/base_ocr_unit_tests.py
+++ b/tests/ocr_tests/base_ocr_unit_tests.py
@@ -41,6 +41,13 @@ class BaseOCRTest(ABC):
pytest.skip(f"Rate limit exceeded - {error_msg}")
except litellm.InternalServerError:
pytest.skip("Model is overloaded")
+ except litellm.BadRequestError as e:
+ # Handle URL rejection errors from Vertex AI
+ error_msg = str(e)
+ if "URL_REJECTED" in error_msg or "Cannot fetch content from the provided URL" in error_msg:
+ pytest.skip(f"URL rejected by provider - {error_msg}")
+ else:
+ raise
@pytest.mark.parametrize("sync_mode", [True, False])
@pytest.mark.asyncio