はじめに
七尾百合子さん、お誕生日 272日目 おめでとうございます! nikkieです。
GPT-5.2 と同タイミングで Google が Interactions API を発表しました。
なんでも Deep Research も提供される ようで、気になったので触ります。
目次
Interactions API
Introducing the Interactions API, a unified interface for models like Gemini 3 Pro and agents like Gemini Deep Research.
— Google AI Developers (@googleaidevs) 2025年12月11日
Now available in public beta via the Gemini API (get an API key from @GoogleAIStudio) it’s designed for building agentic apps with:
- Optional server-side…
DeepMind の Gemini API の方に Interactions API が追加されました。
無料で API キーを作って使えますが、入力が Google により Gemini などの訓練に使われる方です1。
google-genai 1.55.0 以降では client.interactions.create() として使い出せます。
構造化出力
過去記事でも扱った構造化出力で、これまでの generateContent との比較をします。
https://ai.google.dev/gemini-api/docs/interactions?hl=ja&ua=chat#structured-output-json-schema
generateContentの例(client.models.generate_content())
Google AIのGemini APIで出力をJSON形式で構造化するには(google-generativeai、google-genai) - nikkie-ftnextの日記
Interactions API では
Pydantic のBaseModelを継承したクラスを、model_json_schema()してresponse_format引数に渡しています
実行するには、まず環境変数GEMINI_API_KEYまたはGOOGLE_API_KEYを指定します2
% uv run --python 3.13 script.py name='United States' population=331000000 capital='Washington, D.C.' continent='North America' gdp=23000000000000 official_language='English' total_area_sq_mi=3797000
Gemini Deep Research agent!
Interactions API は、Gemini モデルとエージェントを操作するための統合インターフェースです。
ということで、Deep Research の利用も確認します。
Introducing the Gemini Deep Research agent for developers.
— Google DeepMind (@GoogleDeepMind) 2025年12月11日
It can create a plan, spot gaps, and autonomously navigate the web to produce detailed reports. 🧵 pic.twitter.com/L6dBjYg8Yv
model引数の代わりにagentを指定background=Trueを指定し、状況確認のポーリングagentでのみサポート(ref: Interactions API | Gemini API | Google AI for Developers)
% PYTHONUNBUFFERED=1 uv run --python 3.13 deep_research.py Research started: v1_Ch... # Comprehensive Analysis of The Idolmaster 20th Anniversary Year Projects and Events
レポートを見るとたしかに以下をやっていそうです。
デフォルトでは、エージェントは
google_searchツールとurl_contextツールを使用して、一般公開されているインターネット上の情報にアクセスできます。(独自のデータでリサーチする)
file_search_store_namesを指定したfile_searchツールで独自のデータでリサーチできるようです
落ち穂拾い
(1) Deep Research の例ではポーリングのためにinteraction.idを取得していました。
ポーリング以外に、previous_interaction_id引数と合わせて使えるようです。
会話を続けるには、前のやり取りの id を previous_interaction_id パラメータに渡します。(ステートフルな会話)
previous_interaction_idを使用して会話を継続すると、システムは会話履歴の暗黙的なキャッシュ保存をより簡単に利用できるようになり、パフォーマンスが向上し、費用が削減されます。(ベスト プラクティス)
(2) ADK (Python) は(GitHub にリリースがないですが)、1.21.0 で Interactions API をサポートしたようです。
https://pypi.org/project/google-adk/1.21.0/
Agent(
model=Gemini(
model="gemini-3-pro-preview",
use_interactions_api=True, # ココ
),
)
use_interactions_api=Trueで具体的に何が嬉しくなったのか、samples が積ん読です
終わりに
Google が新たにリリースした Interactions API を触りました。
Gemini の model ファミリーと Deep Research のような agent が、client.interactions.create() という共通のインターフェースで扱えます!
これまでの DeepMind の Gemini API への機能追加(google_search、url_context、file_searchツール)の多くを回収する(「一話完結じゃない一話完結」)ような機能追加と感じます。
agentを Google 内製のもの以外にサードパーティまでサポートする気があるのか、気になるところです。
例えば ADK で実装したエージェントが Interactions API と同じコードで呼べたら便利だと思うのですが、果たして
- 本番利用できるのは Vertex AI の Gemini API です↩
- ref: https://googleapis.github.io/python-genai/#create-a-client↩