-
Notifications
You must be signed in to change notification settings - Fork 684
Closed
Labels
api: vertex-aiIssues related to the Vertex AI API.Issues related to the Vertex AI API.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 responsetype: 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
- Language runtime version: 3.10.19
- Package version: 1.52.0 (httpx 0.28.1)
Steps to reproduce
from google.genai import Client as GoogleGenAIClient
from google.genai.types import Content, Part
def make_client():
return GoogleGenAIClient(vertexai=True, location="global")
contents = [Content(role="user", parts=[Part.from_text(text="hello world")])]
// this will cause httpx client closed error
make_client().models.generate_content(model="gemini-2.0-flash-001", contents=contents)
// ...
// File "/opt/venv/lib/python3.10/site-packages/httpx/_client.py", line 901, in send
// raise RuntimeError("Cannot send a request, as the client has been closed.")
// this will succeed
client = make_client()
client.models.generate_content(model="gemini-2.0-flash-001", contents=contents)Metadata
Metadata
Assignees
Labels
api: vertex-aiIssues related to the Vertex AI API.Issues related to the Vertex AI API.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 responsetype: 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.