Interactions API × Google ADK で10行Deep Research
**投稿者:** na0 (@na0fu3y)
**投稿日時:** 2025年12月11日 (木) 18:27 JST
**URL:** https://x.com/na0fu3y/status/1999184173425393973
**エンゲージメント:** 0返信 / 45リポスト / 412いいね / 598ブックマーク / 140,591表示
**カテゴリ:** 💻 技術Tips
**有益度:** ⭐⭐⭐ HIGH
---
概要
Interactions API×Google ADK を使えば、カスタムツール付き Deep Research を、たった 10 行のソースコードでつくれる
---
まとめ
GoogleのInteractions APIは、従来のgenerateContent APIの代替として、マルチターン・ステートフルなエージェントワークフローに最適化されている。ADK(Agent Development Kit)と組み合わせることで、カスタムツールを持つDeep Researchエージェントを簡単に構築可能。
記事詳細
**Pattern 1: ADKエージェントの推論エンジンとして使用**
- `use_interactions_api=True`を指定するだけ
- 統一されたモデル&エージェントアクセス
- サーバーサイドでの状態管理(previous_interaction_id)
- バックグラウンド実行モード対応
- Thoughtsの明示的なハンドリング
**Pattern 2: A2Aプロトコルでリモートエージェントとして接続**
- InteractionsApiTransportでA2Aプロトコルにマッピング
- 既存のA2Aクライアントからそのまま接続可能
- Gemini Deep Research Agentを通常のリモートエージェントとして扱える
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",
tools=[GoogleSearchTool(), get_current_weather],
)---
関連リンク
- [Google Developers Blog](https://developers.googleblog.com/building-agents-with-the-adk-and-the-new-interactions-api/)
- [Gemini Interactions API Docs](https://ai.google.dev/gemini-api/docs/interactions)
- [ADK Python Samples](https://github.com/google/adk-python/tree/main/contributing/samples/interactions_api)