Skip to content

fix(interactions): use NOT_GIVEN instead of None for default timeout#2464

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/916923417
Open

fix(interactions): use NOT_GIVEN instead of None for default timeout#2464
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/916923417

Conversation

@copybara-service
Copy link
Copy Markdown

fix(interactions): use NOT_GIVEN instead of None for default timeout

When http_opts.timeout is not set by the user, the google.genai wrapper
was passing timeout=None to the Stainless client. In httpx, None means
'no timeout' (wait forever). The Stainless SyncAPIClient.init only
falls back to DEFAULT_TIMEOUT (60s) when the value is NotGiven, not
None. This caused all interactions requests to have no timeout at all,
hanging indefinitely on unresponsive servers instead of raising
APITimeoutError after 60 seconds.

When http_opts.timeout is not set by the user, the google.genai wrapper
was passing timeout=None to the Stainless client. In httpx, None means
'no timeout' (wait forever). The Stainless SyncAPIClient.__init__ only
falls back to DEFAULT_TIMEOUT (60s) when the value is NotGiven, not
None. This caused all interactions requests to have no timeout at all,
hanging indefinitely on unresponsive servers instead of raising
APITimeoutError after 60 seconds.

PiperOrigin-RevId: 916923417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant