googleapis / googleapis/python-genai
Interactions API: cannot combine built-in tools with function calling on gemini-3.6-flash / gemini-3.5-flash-lite — server requires tool_config.include_server_side_tool_invocations, but interactions.create() provides no way to set it
- Dominant language
- Python
- Stars
- 4k
- Forks
- 1k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 40
Description
### Description
On the **Interactions API** (`client.interactions.create`), combining a built-in tool (e.g. `google_search`) with a custom `function` declaration in the same request fails for the newest models (`gemini-3.6-flash`, `gemini-3.5-flash-lite`):
```
400 INVALID_ARGUMENT: Please enable tool_config.include_server_side_tool_invocations
to use Built-in tools with Function calling.
```
However, there is **no way to satisfy this requirement on the Interactions API**:
- `interactions.create()` has no `tool_config` parameter.
- `CreateModelInteractionParam` / `GenerationConfig` (the interactions request types in `google/genai/_gaos/types/interactions/`) contain no `tool_config` or `include_server_side_tool_invocations` field.
- Injecting the field via `extra_body` is rejected by the **server** wherever it is placed (see below).
`ToolConfig.include_server_side_tool_invocations` was added in #2137, but only to the `generate_content` / batches / caches / live paths — not to `interactions`. The same tool combination **works on `gemini-3.5-flash`** with no flag, so this is a new-model requirement that the Interactions API surface doesn't yet expose.
### Environment
- `google-genai`: reproduced on **2.11.0**; the interactions request types still lack `tool_config` through **2.13.0** (latest).
- API: Gemini Developer API (AI Studio key), `generativelanguage.googleapis.com`.
- Models: `gemini-3.6-flash`, `gemini-3.5-flash-lite` (fails). `gemini-3.5-flash` (works).
### Steps to reproduce
```python
from google import genai
client = genai.Client(api_key="")
tools = [
{"type": "google_search"},
{
"type": "function",
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
]
# 400: Please enable tool_config.include_server_side_tool_invocations
# to use Built-in tools with Function calling.
client.interactions.create(
model="gemini-3.6-flash",
input="What's the weather in Paris? Use search if you need to.",
tools=tools,
)
```
Attempts to supply the flag via `extra_body` — every placement is rejected server-side:
| `extra_body` | Server response |
|---|---|
| `{"tool_config": {"include_server_side_tool_invocations": True}}` | `Unknown parameter 'tool_config'.` |
| `{"generation_config": {"include_server_side_tool_invocations": True, ...}}` | `Unknown parameter 'include_server_side_tool_invocations' at 'generation_config'.` |
| `{"generation_config": {"tool_config": {...}, ...}}` | `Unknown parameter 'tool_config' at 'generation_config'.` |
| `{"includeServerSideToolInvocations": True}` | `Unknown parameter 'includeServerSideToolInvocations'.` |
### Actual behavior
The request 400s. The server demands `tool_config.include_server_side_tool_invocations`, but the Interactions API accepts no such parameter — an unsatisfiable requirement. (With `thinking_level="medium"` the request 400s even earlier — `'medium' is not a supported thinking level for this model. Allowed values are: low, high.` — despite the docs listing `medium` as the default for `gemini-3.6-flash`; omitting `thinking_level` or using `low`/`high` gets past that, then hits the tool_config error above.)
### Expected behavior
One of:
1. `interactions.create()` (and `CreateModelInteractionParam` / `GenerationConfig`) exposes `include_server_side_tool_invocations` (or a `tool_config`), mirroring #2137 for `generate_content`; **or**
2. the Interactions API no longer requires the flag for `gemini-3.6-flash` / `gemini-3.5-flash-lite`, matching the documented behavior (built-in + function combination working out of the box, as it does for `gemini-3.5-flash`).
### Notes
- Docs pages describing tool combination (interactions/tool-combination) show only `gemini-3.5-flash` and state no flag is needed — they don't reflect this requirement for the newer models.
- Related: #2426 (thinking_level / safety_settings undocumented for Interactions).
Contributor guide
Assessment
This issue has not been assessed yet.