feat(google-vertex): update model YAMLs [bot]#1113
Conversation
|
/test-models |
Gateway test results
Failures (6)
Error: Code snippetfrom google import genai
from google.genai import types
_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_full_model = "test-v2-vertex/google/gemini-3.1-flash-image-preview"
_parts = _full_model.split("/")
_provider_account = _parts[0]
_model_id = "/".join(_parts[1:])
if "/" in _model_id:
_model_id = _model_id.rsplit("/", 1)[-1]
_base_url = f"{_endpoint}/gemini/{_provider_account}/proxy"
client = genai.Client(
api_key=_api_key,
http_options=types.HttpOptions(base_url=_base_url),
)
contents = [
types.Content(role="user", parts=[types.Part.from_text(text="Hi")]),
types.Content(role="model", parts=[types.Part.from_text(text="Hi, how can I help you")]),
types.Content(role="user", parts=[types.Part.from_text(text="How to calculate 3^3^3^3? Think step by step and show all reasoning.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps.",
thinking_config=types.ThinkingConfig(
include_thoughts=True,
thinking_budget=5000,
),
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
for part in response.candidates[0].content.parts:
if not part.text:
continue
if part.thought:
print(f"[Thinking] {part.text}")
else:
print(part.text)
_parts = response.candidates[0].content.parts
_thought_detected = False
for _part in _parts:
if not _part.text:
continue
if _part.thought:
_thought_detected = True
print(f"Thinking: {_part.text[:200]}...")
else:
print(_part.text)
_usage = getattr(response, "usage_metadata", None)
if _usage and getattr(_usage, "thoughts_token_count", 0):
_thought_detected = True
if not _thought_detected:
print("Response: ", response)
raise Exception("VALIDATION FAILED: reasoning - no thinking information in GenAI response")
print("VALIDATION: reasoning SUCCESS")
Error: Code snippetfrom google import genai
from google.genai import types
_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_full_model = "test-v2-vertex/google/gemini-3.1-flash-image-preview"
_parts = _full_model.split("/")
_provider_account = _parts[0]
_model_id = "/".join(_parts[1:])
if "/" in _model_id:
_model_id = _model_id.rsplit("/", 1)[-1]
_base_url = f"{_endpoint}/gemini/{_provider_account}/proxy"
client = genai.Client(
api_key=_api_key,
http_options=types.HttpOptions(base_url=_base_url),
)
contents = [
types.Content(role="user", parts=[types.Part.from_text(text="Hi")]),
types.Content(role="model", parts=[types.Part.from_text(text="Hi, how can I help you")]),
types.Content(role="user", parts=[types.Part.from_text(text="How to calculate 3^3^3^3? Think step by step and show all reasoning.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps.",
thinking_config=types.ThinkingConfig(
include_thoughts=True,
thinking_budget=5000,
),
)
_chunks = []
for chunk in client.models.generate_content_stream(
model=_model_id,
contents=contents,
config=config,
):
_chunks.append(chunk)
if chunk.candidates and chunk.candidates[0].content and chunk.candidates[0].content.parts:
for part in chunk.candidates[0].content.parts:
if not part.text:
continue
if part.thought:
print(f"[Thinking] {part.text}", end="", flush=True)
else:
print(part.text, end="", flush=True)
_thought_detected = False
for _chunk in _chunks:
if not _chunk.candidates or not _chunk.candidates[0].content:
continue
for _part in _chunk.candidates[0].content.parts:
if not _part.text:
continue
if _part.thought:
_thought_detected = True
print(_part.text, end="", flush=True)
else:
print(_part.text, end="", flush=True)
if not _thought_detected:
_usage = getattr(_chunks[-1], "usage_metadata", None) if _chunks else None
if _usage and getattr(_usage, "thoughts_token_count", 0):
_thought_detected = True
if not _thought_detected:
raise Exception("VALIDATION FAILED: reasoning stream - no thinking information in GenAI stream")
print("\nVALIDATION: reasoning stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "Extract the event information as JSON."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=True,
)
import json as _json
_accumulated = ""
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
_accumulated += delta.content
print(delta.content, end="", flush=True)
if not _accumulated:
raise Exception("VALIDATION FAILED: structured-output stream - no content received")
_parsed = _json.loads(_accumulated)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output stream - unexpected keys present: {set(_parsed.keys())}"
)
print("\nVALIDATION: structured-output stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
for _tc in _message.tool_calls:
print(f"Function: {_tc.function.name}")
print(f"Arguments: {_tc.function.arguments}")
else:
print(_message.content)
if not _message.tool_calls or len(_message.tool_calls) == 0:
raise Exception("VALIDATION FAILED: tool-call - no tool calls in response")
print("VALIDATION: tool-call SUCCESS")
Error: Code snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=True,
)
_tool_calls_made = False
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
print(delta.content, end="", flush=True)
if delta.tool_calls:
_tool_calls_made = True
for _tc in delta.tool_calls:
if _tc.function:
print(_tc.function.arguments or "", end="", flush=True)
if not _tool_calls_made:
raise Exception("VALIDATION FAILED: tool-call stream - no tool calls received")
print("\nVALIDATION: tool-call stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "Extract the event information as JSON."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=False,
)
import json as _json
_content = response.choices[0].message.content
print(_content)
if not _content:
raise Exception("VALIDATION FAILED: structured-output - response content is empty")
_parsed = _json.loads(_content)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
)
print("VALIDATION: structured-output SUCCESS")Skipped (11)
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason: |
|
/test-models |
|
/test-models |
Gateway test results
Failures (6)
Error: Code snippetfrom google import genai
from google.genai import types
_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_full_model = "test-v2-vertex/google/gemini-3.1-flash-image-preview"
_parts = _full_model.split("/")
_provider_account = _parts[0]
_model_id = "/".join(_parts[1:])
if "/" in _model_id:
_model_id = _model_id.rsplit("/", 1)[-1]
_base_url = f"{_endpoint}/gemini/{_provider_account}/proxy"
client = genai.Client(
api_key=_api_key,
http_options=types.HttpOptions(base_url=_base_url),
)
contents = [
types.Content(role="user", parts=[types.Part.from_text(text="Hi")]),
types.Content(role="model", parts=[types.Part.from_text(text="Hi, how can I help you")]),
types.Content(role="user", parts=[types.Part.from_text(text="How to calculate 3^3^3^3? Think step by step and show all reasoning.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps.",
thinking_config=types.ThinkingConfig(
include_thoughts=True,
thinking_budget=5000,
),
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
for part in response.candidates[0].content.parts:
if not part.text:
continue
if part.thought:
print(f"[Thinking] {part.text}")
else:
print(part.text)
_parts = response.candidates[0].content.parts
_thought_detected = False
for _part in _parts:
if not _part.text:
continue
if _part.thought:
_thought_detected = True
print(f"Thinking: {_part.text[:200]}...")
else:
print(_part.text)
_usage = getattr(response, "usage_metadata", None)
if _usage and getattr(_usage, "thoughts_token_count", 0):
_thought_detected = True
if not _thought_detected:
print("Response: ", response)
raise Exception("VALIDATION FAILED: reasoning - no thinking information in GenAI response")
print("VALIDATION: reasoning SUCCESS")
Error: Code snippetfrom google import genai
from google.genai import types
_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_full_model = "test-v2-vertex/google/gemini-3.1-flash-image-preview"
_parts = _full_model.split("/")
_provider_account = _parts[0]
_model_id = "/".join(_parts[1:])
if "/" in _model_id:
_model_id = _model_id.rsplit("/", 1)[-1]
_base_url = f"{_endpoint}/gemini/{_provider_account}/proxy"
client = genai.Client(
api_key=_api_key,
http_options=types.HttpOptions(base_url=_base_url),
)
contents = [
types.Content(role="user", parts=[types.Part.from_text(text="Hi")]),
types.Content(role="model", parts=[types.Part.from_text(text="Hi, how can I help you")]),
types.Content(role="user", parts=[types.Part.from_text(text="How to calculate 3^3^3^3? Think step by step and show all reasoning.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps.",
thinking_config=types.ThinkingConfig(
include_thoughts=True,
thinking_budget=5000,
),
)
_chunks = []
for chunk in client.models.generate_content_stream(
model=_model_id,
contents=contents,
config=config,
):
_chunks.append(chunk)
if chunk.candidates and chunk.candidates[0].content and chunk.candidates[0].content.parts:
for part in chunk.candidates[0].content.parts:
if not part.text:
continue
if part.thought:
print(f"[Thinking] {part.text}", end="", flush=True)
else:
print(part.text, end="", flush=True)
_thought_detected = False
for _chunk in _chunks:
if not _chunk.candidates or not _chunk.candidates[0].content:
continue
for _part in _chunk.candidates[0].content.parts:
if not _part.text:
continue
if _part.thought:
_thought_detected = True
print(_part.text, end="", flush=True)
else:
print(_part.text, end="", flush=True)
if not _thought_detected:
_usage = getattr(_chunks[-1], "usage_metadata", None) if _chunks else None
if _usage and getattr(_usage, "thoughts_token_count", 0):
_thought_detected = True
if not _thought_detected:
raise Exception("VALIDATION FAILED: reasoning stream - no thinking information in GenAI stream")
print("\nVALIDATION: reasoning stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=True,
)
_tool_calls_made = False
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
print(delta.content, end="", flush=True)
if delta.tool_calls:
_tool_calls_made = True
for _tc in delta.tool_calls:
if _tc.function:
print(_tc.function.arguments or "", end="", flush=True)
if not _tool_calls_made:
raise Exception("VALIDATION FAILED: tool-call stream - no tool calls received")
print("\nVALIDATION: tool-call stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
for _tc in _message.tool_calls:
print(f"Function: {_tc.function.name}")
print(f"Arguments: {_tc.function.arguments}")
else:
print(_message.content)
if not _message.tool_calls or len(_message.tool_calls) == 0:
raise Exception("VALIDATION FAILED: tool-call - no tool calls in response")
print("VALIDATION: tool-call SUCCESS")
Error: Code snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "Extract the event information as JSON."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=True,
)
import json as _json
_accumulated = ""
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
_accumulated += delta.content
print(delta.content, end="", flush=True)
if not _accumulated:
raise Exception("VALIDATION FAILED: structured-output stream - no content received")
_parsed = _json.loads(_accumulated)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output stream - unexpected keys present: {set(_parsed.keys())}"
)
print("\nVALIDATION: structured-output stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "Extract the event information as JSON."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=False,
)
import json as _json
_content = response.choices[0].message.content
print(_content)
if not _content:
raise Exception("VALIDATION FAILED: structured-output - response content is empty")
_parsed = _json.loads(_content)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
)
print("VALIDATION: structured-output SUCCESS")Skipped (10)
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason: |
Gateway test results
Failures (8)
Error: Code snippetfrom google import genai
from google.genai import types
_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_full_model = "test-v2-vertex/google/gemini-3.1-flash-lite-preview"
_parts = _full_model.split("/")
_provider_account = _parts[0]
_model_id = "/".join(_parts[1:])
if "/" in _model_id:
_model_id = _model_id.rsplit("/", 1)[-1]
_base_url = f"{_endpoint}/gemini/{_provider_account}/proxy"
client = genai.Client(
api_key=_api_key,
http_options=types.HttpOptions(base_url=_base_url),
)
contents = [
types.Content(role="user", parts=[types.Part.from_text(text="Hi")]),
types.Content(role="model", parts=[types.Part.from_text(text="Hi, how can I help you")]),
types.Content(role="user", parts=[types.Part.from_text(text="List 3 colors with their hex codes in JSON.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant. Respond in JSON format.",
response_mime_type="application/json",
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
print(response.text)
import json as _json
_text = response.text
print(_text)
if not _text:
raise Exception("VALIDATION FAILED: json-output - GenAI response text is empty")
_json.loads(_text)
print("VALIDATION: json-output SUCCESS")
Error: Code snippetfrom google import genai
from google.genai import types
_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_full_model = "test-v2-vertex/google/gemini-3.1-flash-image-preview"
_parts = _full_model.split("/")
_provider_account = _parts[0]
_model_id = "/".join(_parts[1:])
if "/" in _model_id:
_model_id = _model_id.rsplit("/", 1)[-1]
_base_url = f"{_endpoint}/gemini/{_provider_account}/proxy"
client = genai.Client(
api_key=_api_key,
http_options=types.HttpOptions(base_url=_base_url),
)
contents = [
types.Content(role="user", parts=[types.Part.from_text(text="Hi")]),
types.Content(role="model", parts=[types.Part.from_text(text="Hi, how can I help you")]),
types.Content(role="user", parts=[types.Part.from_text(text="How to calculate 3^3^3^3? Think step by step and show all reasoning.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps.",
thinking_config=types.ThinkingConfig(
include_thoughts=True,
thinking_budget=5000,
),
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
for part in response.candidates[0].content.parts:
if not part.text:
continue
if part.thought:
print(f"[Thinking] {part.text}")
else:
print(part.text)
_parts = response.candidates[0].content.parts
_thought_detected = False
for _part in _parts:
if not _part.text:
continue
if _part.thought:
_thought_detected = True
print(f"Thinking: {_part.text[:200]}...")
else:
print(_part.text)
_usage = getattr(response, "usage_metadata", None)
if _usage and getattr(_usage, "thoughts_token_count", 0):
_thought_detected = True
if not _thought_detected:
print("Response: ", response)
raise Exception("VALIDATION FAILED: reasoning - no thinking information in GenAI response")
print("VALIDATION: reasoning SUCCESS")
Error: Code snippetfrom google import genai
from google.genai import types
_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_full_model = "test-v2-vertex/google/gemini-3.1-flash-image-preview"
_parts = _full_model.split("/")
_provider_account = _parts[0]
_model_id = "/".join(_parts[1:])
if "/" in _model_id:
_model_id = _model_id.rsplit("/", 1)[-1]
_base_url = f"{_endpoint}/gemini/{_provider_account}/proxy"
client = genai.Client(
api_key=_api_key,
http_options=types.HttpOptions(base_url=_base_url),
)
contents = [
types.Content(role="user", parts=[types.Part.from_text(text="Hi")]),
types.Content(role="model", parts=[types.Part.from_text(text="Hi, how can I help you")]),
types.Content(role="user", parts=[types.Part.from_text(text="How to calculate 3^3^3^3? Think step by step and show all reasoning.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps.",
thinking_config=types.ThinkingConfig(
include_thoughts=True,
thinking_budget=5000,
),
)
_chunks = []
for chunk in client.models.generate_content_stream(
model=_model_id,
contents=contents,
config=config,
):
_chunks.append(chunk)
if chunk.candidates and chunk.candidates[0].content and chunk.candidates[0].content.parts:
for part in chunk.candidates[0].content.parts:
if not part.text:
continue
if part.thought:
print(f"[Thinking] {part.text}", end="", flush=True)
else:
print(part.text, end="", flush=True)
_thought_detected = False
for _chunk in _chunks:
if not _chunk.candidates or not _chunk.candidates[0].content:
continue
for _part in _chunk.candidates[0].content.parts:
if not _part.text:
continue
if _part.thought:
_thought_detected = True
print(_part.text, end="", flush=True)
else:
print(_part.text, end="", flush=True)
if not _thought_detected:
_usage = getattr(_chunks[-1], "usage_metadata", None) if _chunks else None
if _usage and getattr(_usage, "thoughts_token_count", 0):
_thought_detected = True
if not _thought_detected:
raise Exception("VALIDATION FAILED: reasoning stream - no thinking information in GenAI stream")
print("\nVALIDATION: reasoning stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "Extract the event information as JSON."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=False,
)
import json as _json
_content = response.choices[0].message.content
print(_content)
if not _content:
raise Exception("VALIDATION FAILED: structured-output - response content is empty")
_parsed = _json.loads(_content)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
)
print("VALIDATION: structured-output SUCCESS")
Error: Code snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=True,
)
_tool_calls_made = False
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
print(delta.content, end="", flush=True)
if delta.tool_calls:
_tool_calls_made = True
for _tc in delta.tool_calls:
if _tc.function:
print(_tc.function.arguments or "", end="", flush=True)
if not _tool_calls_made:
raise Exception("VALIDATION FAILED: tool-call stream - no tool calls received")
print("\nVALIDATION: tool-call stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "Extract the event information as JSON."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=True,
)
import json as _json
_accumulated = ""
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
_accumulated += delta.content
print(delta.content, end="", flush=True)
if not _accumulated:
raise Exception("VALIDATION FAILED: structured-output stream - no content received")
_parsed = _json.loads(_accumulated)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output stream - unexpected keys present: {set(_parsed.keys())}"
)
print("\nVALIDATION: structured-output stream SUCCESS")
Error: Code snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-vertex/meta-llama-4-scout-17b-16e-instruct-maas",
messages=[
{"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
for _tc in _message.tool_calls:
print(f"Function: {_tc.function.name}")
print(f"Arguments: {_tc.function.arguments}")
else:
print(_message.content)
if not _message.tool_calls or len(_message.tool_calls) == 0:
raise Exception("VALIDATION FAILED: tool-call - no tool calls in response")
print("VALIDATION: tool-call SUCCESS")
Error: Code snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-vertex/openai-gpt-oss-120b-maas",
messages=[
{"role": "system", "content": "Extract the event information as JSON."},
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hi, how can I help you"},
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=False,
)
import json as _json
_content = response.choices[0].message.content
print(_content)
if not _content:
raise Exception("VALIDATION FAILED: structured-output - response content is empty")
_parsed = _json.loads(_content)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
)
print("VALIDATION: structured-output SUCCESS")Skipped (10)
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason:
Skip reason: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
There are 5 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b6858ce. Configure here.

Auto-generated by poc-agent for provider
google-vertex.Note
Medium Risk
Primarily data/config changes, but updates to per-token/per-second pricing, limits, and deprecation flags can affect downstream cost estimation and model availability selection.
Overview
Refreshes Google Vertex model YAML metadata across multiple providers, updating pricing fields (including new
cache_creation_input_token_cost_per_hourand additional regional cost entries) and capability flags (e.g.,parallel_function_calling,system_messages,structured_output, modality support such aspdf/code/imageinputs).Adds/adjusts lifecycle and limits metadata (new
deprecationDate/isDeprecated/status changes liketext-embedding-004to retired andgemini-2.5-flash-lite-preview-09-2025deprecated, plus token/output limit tweaks), and expands sources/provisioning/supportedModes for several models.Reviewed by Cursor Bugbot for commit b6858ce. Bugbot is set up for automated code reviews on this repo. Configure here.