-
Notifications
You must be signed in to change notification settings - Fork 698
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status:awaiting user responsestatus:staletype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- Programming language: Python
- OS: Linux
- Language runtime version: 1.55.0
- Package version: 1.55.0
Steps to reproduce
- _http_client = httpx.Client(transport = LogTransport(httpx.HTTPTransport()), event_hooks = {'request': [log_request]}) # Trying to capture what goes on the "wire" via the event hooks
- _http_options = types.HttpOptions(httpx_client = _http_client, timeout = 30000)
- _config=types.GenerateContentConfig(http_options=_http_options)
- client.models.generate_content(config=_config)
The generate_content call does not honor the httpx_client override.
Looing at file _api_client.py, after line 1222, the relevant options are ignored. Adding something like:
try:
if http_options.httpx_client != None:
self._httpx_client = http_options.httpx_client
except:
pass
may enable that the overridden httpx_client is used.
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status:awaiting user responsestatus:staletype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.