fix(gigachat): honor ssl_verify config on router passthrough and type the request body

This commit is contained in:
mateo-berri 2026-08-30 12:28:41 -07:00
parent b0ce17c755
commit ce52e39052
2 changed files with 4 additions and 3 deletions

View file

@ -2839,10 +2839,11 @@ async def gigachat_proxy_route(
)
## check for streaming
request_body: Final = await get_request_body(request) # pyright: ignore[reportUnknownVariableType] # get_request_body returns Unknown
request_body: Final[dict[str, object]] = await get_request_body(request)
is_router_model = False # rebind-ok: conditionally set to True when model uses router
model: Final = request_body.get("model") # pyright: ignore[reportUnknownVariableType] # get_request_body returns Unknown
raw_model: Final = request_body.get("model")
model: Final = raw_model if isinstance(raw_model, str) else None
if model:
is_router_model = is_passthrough_request_using_router_model(
request_body, llm_router
@ -2995,7 +2996,6 @@ async def handle_gigachat_passthrough_router_model(
llm_provider=LlmProviders.GIGACHAT,
params={ # mutable-ok: httpx client params
"timeout": httpx.Timeout(timeout=600.0, connect=5.0),
"ssl_verify": False,
},
)

View file

@ -2228,6 +2228,7 @@ class TestGigachatProxyRoute:
assert isinstance(result, Response)
assert result.status_code == 200
assert captured_kwargs["target"] == "https://gigachat.devices.sberbank.ru/api/v1/models"
assert captured_kwargs["custom_headers"] == {"Authorization": "Bearer gigachat-test-token"}
@pytest.mark.asyncio
async def test_allm_passthrough_streaming_preserves_upstream_headers(self):