Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove bad dependency
  • Loading branch information
plpxsk authored and RobinPicard committed Mar 26, 2026
commit bf6ef200deb10e9cb3f26c5e629822a69aef8b3a
3 changes: 0 additions & 3 deletions outlines/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ def _build_exception_map(provider: str) -> dict[type, type[APIError]]:

if provider == "gemini":
import httpx
import aiohttp
from google.genai import errors as genai_errors
return {
genai_errors.ServerError: ServerError,
Expand All @@ -283,8 +282,6 @@ def _build_exception_map(provider: str) -> dict[type, type[APIError]]:
# normalize_provider_exception, which maps it to the right subclass.
httpx.TimeoutException: APITimeoutError,
httpx.ConnectError: APIConnectionError,
aiohttp.ServerTimeoutError: APITimeoutError,
aiohttp.ClientConnectorError: APIConnectionError,
}

if provider == "ollama":
Expand Down
9 changes: 0 additions & 9 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ class TestGeminiExceptionMap:
@pytest.fixture(autouse=True)
def _require_gemini(self):
pytest.importorskip("google.genai")
pytest.importorskip("aiohttp")

def _check(self, sdk_exc_cls, expected_outlines_cls):
result = normalize_provider_exception(Mock(spec=sdk_exc_cls), "gemini")
Expand All @@ -473,14 +472,6 @@ def test_httpx_connect_error(self):
import httpx
self._check(httpx.ConnectError, APIConnectionError)

def test_aiohttp_server_timeout(self):
import aiohttp
self._check(aiohttp.ServerTimeoutError, APITimeoutError)

def test_aiohttp_client_connector_error(self):
import aiohttp
self._check(aiohttp.ClientConnectorError, APIConnectionError)

def test_client_error_status_code_fallback(self):
from google.genai import errors as genai_errors
mock_exc = Mock(spec=genai_errors.ClientError)
Expand Down