fix(llm): convert Gemini timeout to milliseconds
This commit is contained in:
parent
6efcad606a
commit
228885cefc
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue