fix(llm): convert Gemini timeout to milliseconds

This commit is contained in:
alvedder 2026-07-23 22:15:23 +05:00
parent 6efcad606a
commit 228885cefc
2 changed files with 2 additions and 2 deletions

View File

@ -321,7 +321,7 @@ class GeminiBackend:
if timeout is not None:
if http_options is None:
http_options = genai_types.HttpOptions()
http_options.timeout = timeout
http_options.timeout = int(timeout * 1000)
if http_options is not None:
config["http_options"] = http_options
return config

View File

@ -129,7 +129,7 @@ async def test_gemini_backend_maps_timeout_to_http_options() -> None:
await_args = client.aio.models.generate_content.await_args
if await_args is None:
raise AssertionError("Expected Gemini generate_content call")
assert await_args.kwargs["config"]["http_options"].timeout == 90.0
assert await_args.kwargs["config"]["http_options"].timeout == 90_000
@pytest.mark.asyncio