Documentation Bug: Interactions API shows incorrect 'role' value in Deep Research agent example response

The Interactions API documentation contains an incorrect example response for the Deep Research agent.

Documentation URL:

The example response shows "role": "model", but the actual API response returns "role": "agent".


Steps to Reproduce

Run the curl example provided in the documentation:

curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "deep-research-pro-preview-12-2025",
    "input": "Find a cure to cancer",
    "background": true
  }'


Expected vs Actual Behavior

Documented Response (Incorrect):

{
  "role": "model",
  ...
}

Actual API Response (Correct):

{
  "role": "agent",
  ...
}


Impact

  • Developers relying on the documentation may expect an incorrect role value.

  • This can lead to confusion or validation issues in client implementations.

  • The documentation example should be updated to reflect "role": "agent".

Hi there, thanks for flagging this bug. It’s now fixed