googleapis / googleapis/python-genai
[Interactions API] `interactions.get` with `include_input=True` returns `None` for user input during `requires_action` state
- Dominant language
- Python
- Stars
- 4k
- Forks
- 1k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 40
Description
### Bug Description
The `interactions.get(id="...", include_input=True)` method completely omits the initial user prompt and fails to return any `user_input` fields or steps if the interaction stopped at a `requires_action` (function call) state. This contradicts the official documentation which states: *"The stored resource (retrieved via interactions.get) also includes user_input steps for full context"*.
### To Reproduce
1. Call `client.interactions.create()` with a text input and a `tools` declaration.
2. The model correctly returns a `function_call` step, setting the interaction status to `requires_action`.
3. Call `client.interactions.get(id=..., include_input=True)` on that exact interaction ID.
### Code Example
```python
from google import genai
light_tool = {
"type": "function",
"name": "set_light_values",
"description": "Sets the brightness of a light.",
"parameters": {
"type": "object",
"properties": {"brightness": {"type": "integer"}},
"required": ["brightness"]
}
}
client = genai.Client()
# 1. Create interaction that triggers a function call
interaction = client.interactions.create(
model="gemini-3.5-flash-lite",
input="Turn the lights down to 20%",
tools=[light_tool],
)
# 2. Fetch the interaction with include_input=True
fetched = client.interactions.get(id=interaction.id, include_input=True)
# 3. Bug demonstration
print("Expected string, Got:", fetched.input)
# Expected: "Turn the lights down to 20%"
# Actual: None
print("Expected 'user_input' step, Got:", [s.type for s in fetched.steps])
# Expected: Includes 'user_input'
# Actual: ['thought', 'function_call']
```
### Expected Behavior
The returned payload should populate the top-level `input` string field or include a clear `user_input` step within the history timeline so developers can map the pending tool call back to the original user intent.
### Actual Behavior
The `input` attribute is strictly `None`, and the original prompt text is completely stripped/unavailable from the fetched resource until the entire lifecycle is completed.
Contributor guide
Assessment
This issue has not been assessed yet.