You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Support Google Gemini Interactions API (Stateful & Agentic Multi-turn) #915
I would like to propose adding support for Google's Gemini Interactions API to the Gemini provider driver in the Laravel AI SDK.
While the SDK provides rich, first-class support for providers like OpenAI (e.g., stateful Responses API with previous_response_id, structured runs, and server-side state tracking) and Anthropic (e.g., Prompt Caching optimization and native tool workflows), the Gemini driver currently relies on standard, stateless generateContent requests. Supporting the Interactions API will bring feature parity to the Gemini driver by enabling server-side stateful multi-turn interactions, native managed agent execution, and structured step tracking.
Motivation & Problem
Currently, interacting with Gemini in multi-turn or agentic scenarios requires developers to manually maintain, serialize, and re-send the entire message history from the client side.
In contrast to the seamless developer experience available for OpenAI and Anthropic drivers, Gemini users miss out on:
Server-side state management: Google's Interactions API handles session state via previous_interaction_id, eliminating the need to transmit large conversation payloads back and forth.
First-class agent workflows: Intermediate reasoning thoughts, tool calls, and final outputs are structured sequentially into steps, avoiding the need for boilerplate manual function-calling loops.
Background & asynchronous execution: The Interactions API supports asynchronous execution (background: true), which aligns perfectly with Laravel's queue and polling ecosystem for long-running tasks.
Proposed Solution / API Idea
We could introduce support for passing/retrieving interaction IDs and handling stateful conversations cleanly:
useLaravel\AI\Facades\AI;
// 1. Initial interaction$interaction = AI::agent('gemini')
->prompt('Analyze the latest quarterly report.')
->execute();
$interactionId =$interaction->id(); // interaction_xxx// 2. Continuing the conversation via previous_interaction_id$followUp = AI::agent('gemini')
->withPreviousInteraction($interactionId)
->prompt('Summarize the risk factors mentioned above.')
->execute();
Activity
pushpak1300 commentedon Aug 21, 2026
I’ll defer this until another provider offers something similar at least 3.