feat(google-vertex/google/gemini-3.6-flash): add new models [bot]#1831
Conversation
|
/test-models |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 549ffed. Configure here.
Gateway test results
Failures (12)
ErrorCode 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.6-flash"
_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="What is the capital of France?")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant.",
max_output_tokens=256,
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
for part in response.candidates[0].content.parts:
if part.text:
print(part.text)
ErrorCode 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.6-flash"
_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 _part.text and _part.thought:
_thought_detected = True
_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")
ErrorCode 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.6-flash"
_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="What is the capital of France?")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant.",
max_output_tokens=256,
)
_chunks = []
for chunk in client.models.generate_content_stream(
model=_model_id,
contents=contents,
config=config,
):
_chunks.append(chunk)
if chunk.text:
print(chunk.text, end="", flush=True)
ErrorCode 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.6-flash"
_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),
)
response_schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"date": {"type": "string"},
"participants": {
"type": "array",
"items": {"type": "string"},
},
},
"required": ["name", "date", "participants"],
}
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="Alice and Bob are going to a science fair on Friday.")]),
]
config = types.GenerateContentConfig(
system_instruction="Extract the event information as a structured CalendarEvent JSON object.",
response_mime_type="application/json",
response_json_schema=response_schema,
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
print(response.text)
import json as _json
_text = response.text
if not _text:
raise Exception("VALIDATION FAILED: structured-output - GenAI response text is empty")
_parsed = _json.loads(_text)
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")
print("VALIDATION: structured-output SUCCESS")
ErrorCode 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.6-flash"
_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),
)
get_weather = types.FunctionDeclaration(
name="get_weather",
description="Get the current weather for a location.",
parameters_json_schema={
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
},
)
tool = types.Tool(function_declarations=[get_weather])
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="Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text.")]),
]
config = types.GenerateContentConfig(
system_instruction="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.",
tools=[tool],
)
_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 part.function_call:
print(f"Tool: {part.function_call.name}", flush=True)
print(f"Args: {part.function_call.args}", flush=True)
elif part.text:
print(part.text, end="", flush=True)
_tool_use_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 _part.function_call:
_tool_use_detected = True
if not _tool_use_detected:
raise Exception("VALIDATION FAILED: tool-call stream - no function calls in GenAI stream")
print("\nVALIDATION: tool-call stream SUCCESS")
ErrorCode 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.6-flash"
_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),
)
get_weather = types.FunctionDeclaration(
name="get_weather",
description="Get the current weather for a location.",
parameters_json_schema={
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
},
)
tool = types.Tool(function_declarations=[get_weather])
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="Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text.")]),
]
config = types.GenerateContentConfig(
system_instruction="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.",
tools=[tool],
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
for part in response.candidates[0].content.parts:
if part.function_call:
print(f"Tool: {part.function_call.name}")
print(f"Args: {part.function_call.args}")
elif part.text:
print(part.text)
_parts = response.candidates[0].content.parts
_function_calls = [p for p in _parts if p.function_call]
if not _function_calls:
raise Exception("VALIDATION FAILED: tool-call - no function calls in GenAI response")
print("VALIDATION: tool-call SUCCESS")
ErrorCode 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.6-flash"
_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
if not _text:
raise Exception("VALIDATION FAILED: json-output - GenAI response text is empty")
_json.loads(_text)
print("VALIDATION: json-output SUCCESS")
ErrorCode 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.6-flash"
_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),
)
get_weather = types.FunctionDeclaration(
name="get_weather",
description="Get the current weather for a location.",
parameters_json_schema={
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
},
)
tool = types.Tool(function_declarations=[get_weather])
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="Use the get_weather tool to check the weather in London and Paris. You MUST make both tool calls strictly in parallel, not sequentially.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially.",
tools=[tool],
)
_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 part.function_call:
print(f"Tool: {part.function_call.name}", flush=True)
print(f"Args: {part.function_call.args}", flush=True)
elif part.text:
print(part.text, end="", flush=True)
_seen_calls = set()
for _chunk in _chunks:
if not _chunk.candidates or not _chunk.candidates[0].content:
continue
for _part in _chunk.candidates[0].content.parts:
if _part.function_call:
_fc = _part.function_call
_seen_calls.add((_fc.id, _fc.name, str(_fc.args)))
if len(_seen_calls) < 1:
raise Exception(
f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
f"got {len(_seen_calls)}"
)
print(f"\nNumber of parallel tool calls: {len(_seen_calls)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")
ErrorCode 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.6-flash"
_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 _part.text and _part.thought:
_thought_detected = 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")
ErrorCode 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.6-flash"
_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),
)
get_weather = types.FunctionDeclaration(
name="get_weather",
description="Get the current weather for a location.",
parameters_json_schema={
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
},
)
tool = types.Tool(function_declarations=[get_weather])
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="Use the get_weather tool to check the weather in London and Paris. You MUST make both tool calls strictly in parallel, not sequentially.")]),
]
config = types.GenerateContentConfig(
system_instruction="You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially.",
tools=[tool],
)
response = client.models.generate_content(
model=_model_id,
contents=contents,
config=config,
)
for part in response.candidates[0].content.parts:
if part.function_call:
print(f"Tool: {part.function_call.name}")
print(f"Args: {part.function_call.args}")
elif part.text:
print(part.text)
_parts = response.candidates[0].content.parts
_function_calls = [p for p in _parts if p.function_call]
if _function_calls:
print(f"Number of parallel tool calls: {len(_function_calls)}")
if not _function_calls or len(_function_calls) < 1:
raise Exception(
f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
f"got {len(_function_calls) if _function_calls else 0}"
)
print("VALIDATION: parallel-tool-call SUCCESS")
ErrorCode 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.6-flash"
_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),
)
response_schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"date": {"type": "string"},
"participants": {
"type": "array",
"items": {"type": "string"},
},
},
"required": ["name", "date", "participants"],
}
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="Alice and Bob are going to a science fair on Friday.")]),
]
config = types.GenerateContentConfig(
system_instruction="Extract the event information as a structured CalendarEvent JSON object.",
response_mime_type="application/json",
response_json_schema=response_schema,
)
_chunks = []
for chunk in client.models.generate_content_stream(
model=_model_id,
contents=contents,
config=config,
):
_chunks.append(chunk)
if chunk.text:
print(chunk.text, end="", flush=True)
import json as _json
_accumulated = ""
for _chunk in _chunks:
if _chunk.text:
_accumulated += _chunk.text
if not _accumulated:
raise Exception("VALIDATION FAILED: structured-output stream - no content received from GenAI stream")
_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")
print("\nVALIDATION: structured-output stream SUCCESS")
ErrorCode 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.6-flash"
_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",
)
_chunks = []
for chunk in client.models.generate_content_stream(
model=_model_id,
contents=contents,
config=config,
):
_chunks.append(chunk)
if chunk.text:
print(chunk.text, end="", flush=True)
import json as _json
_accumulated = ""
for _chunk in _chunks:
if _chunk.text:
_accumulated += _chunk.text
if not _accumulated:
raise Exception("VALIDATION FAILED: json-output stream - no content received from GenAI stream")
_json.loads(_accumulated)
print("\nVALIDATION: json-output stream SUCCESS")Successes (12)
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output
Output |

Auto-generated by model-addition-agent for
google-vertex/google/gemini-3.6-flash.Note
Low Risk
Metadata-only model registration with no runtime or auth changes.
Overview
Registers
google/gemini-3.6-flashon Google Vertex via a new YAML catalog file underproviders/google-vertex/google/.The entry marks the model active and serverless, with thinking enabled, chat-only mode, a 1M context window, and multimodal inputs (text, image, video, audio, PDF). It documents global token pricing (including batch and cache-read rates) and capabilities such as function calling, prompt caching, structured/JSON output, and code execution.
Unlike some sibling Gemini configs, this definition strips
temperatureandtop_pfrom supported params, with doc links to Google’s Gemini 3.6 Flash model and pricing pages.Reviewed by Cursor Bugbot for commit 549ffed. Bugbot is set up for automated code reviews on this repo. Configure here.