Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/agents/interactions-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Using the Gemini Interactions API

The Gemini Interactions API provides stateful conversation capabilities, allowing you to chain interactions using a `previous_interaction_id` instead of sending the full conversation history with each request. This can be more efficient for long conversations.

To enable the Interactions API, set the `use_interactions_api=True` parameter in the `Gemini` model configuration.

## Example

```python
from google.adk.agents.llm_agent import Agent
from google.adk.models.google_llm import Gemini

root_agent = Agent(
model=Gemini(
model="gemini-2.5-flash",
use_interactions_api=True,
),
name="interactions_test_agent",
description="An agent for testing the Interactions API integration",
instruction="You are a helpful assistant.",
)
```

For a more detailed example, see the [Interactions API sample](https://github.com/google/adk-python/tree/main/contributing/samples/interactions_api).
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ nav:
- Multi-agent systems: agents/multi-agents.md
- Agent Config: agents/config.md
- Models & Authentication: agents/models.md
- Interactions API: agents/interactions-api.md
- Tools for Agents:
- tools/index.md
- Built-in tools: tools/built-in-tools.md
Expand Down
Loading