-
Notifications
You must be signed in to change notification settings - Fork 765
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.type: 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
Following the creation of the new Flex VertexAI pricing, we get a warning when using the new flex price:
/Users/joachim/src/pydantic-ai/.venv/lib/python3.12/site-packages/google/genai/_common.py:651: UserWarning: ON_DEMAND_FLEX is not a valid TrafficType
warnings.warn(f'{value} is not a valid {cls.__name__}')
Which as far as I can tell, comes from ON_DEMAND_FLEX being absent from TrafficTypes (generated from the API doc).
Environment details
- Programming language: Python
- OS: MacOS
- Language runtime version: 3.12
- Package version: 1.56.0
Steps to reproduce
from google import genai
client = genai.Client(vertexai=True, location='global')
response = client.models.generate_content(
model='gemini-3-flash-preview',
contents='Say hello',
config={'http_options': {'headers': {'X-Vertex-AI-LLM-Shared-Request-Type': 'flex'}}},
)
print(response.usage_metadata.traffic_type) # Triggers warning
Reactions are currently unavailable
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.type: 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.