Skip to content

Setting timeout in genai.Client() does not work #911

Description

@nooransari911

My API requests were getting timed out, after ~5 min ("server disconnected"), so I added http_options=types.HttpOptions(timeout=MAX_TIMEOUT) to genai.Client(). However, they are still getting timed out after ~5 min

Full output from my program:
This file contains 2 instances of running) file contains 2 instances of running the program under exact same conditions. In instance 1, http_options was not added. In instance 2, http_options was added.

I set MAX_TIMEOUT as: MAX_TIMEOUT = 1200 * 1000

Am I using timeouts correctly?

Environment details:

  • Programming language: python 3.13
  • OS: Fedora 41 Linux (6.13.5-200.fc41.x86_64 (64-bit))
  • Language runtime version: python 3.13
  • Package version: 1.15.0

Steps to reproduce

  1. Set http_options var in creating genai Client
  2. It does not increase timeout as expected

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions