Google DeepMind推全新Interactions API 變AI開發新紀元

Ai




谷歌DeepMind推出Interactions API,推進生成式AI進入有狀態自主代理時代

過去兩年,生成式AI的基本運作單位一直是「完成(completion)」。你輸入文字提示,模型回傳文字,交互結束。若要繼續對話,必須重新將整個對話歷史發送給模型。這種「無狀態」架構(如谷歌舊有的`generateContent`端點)適合簡單聊天機械人,但隨著開發者開始打造能使用工具、維持複雜狀態並進行長期思考的自主代理,這種無狀態模式已成為瓶頸。

上星期,谷歌DeepMind終於填補了這一基礎設施缺口,公開測試推出了全新的Interactions API(`/interactions`端點)。雖然OpenAI早在2025年3月已以Responses API率先改變這一局面,谷歌此次進場代表它也積極推動技術前沿。Interactions API不僅是狀態管理工具,更是一個統一介面,將大型語言模型(LLM)視為遠端操作系統,而非單純文本生成器。

「遠端運算」模式的核心創新

Interactions API的核心在於將伺服器端狀態管理設定為預設行為。過去,開發者必須手動管理龐大的JSON對話紀錄,隨每次請求往返數MB數據。新API只需傳遞`previous_interaction_id`,谷歌基礎設施會保留對話歷史、工具輸出及「思考」過程。

DeepMind的Ali Çevik與Philipp Schmid在官方博客指出:「模型正逐步成為系統,甚至未來可能成為代理。若硬將這些功能塞入`generateContent`,API將變得過於複雜且脆弱。」此舉同時啟用「背景執行」功能,讓代理能在後台長時間運作(例如上網搜集資料一小時),避免常見的HTTP超時問題,API成為智慧任務隊列。

本地化「深度研究」與Model Context Protocol(MCP)支持

基於此基礎設施,谷歌推出首個內建代理:Gemini Deep Research。透過同一`/interactions`端點,該代理可執行「長期研究任務」,透過搜尋、閱讀與整合反覆迴圈,超越單純預測下一字元的能力。

此外,谷歌也支持開放生態,原生整合Model Context Protocol(MCP),讓Gemini模型可直接呼叫遠端工具(如天氣服務或資料庫),無需開發者撰寫專用解析程式碼。

谷歌加入有狀態時代,與OpenAI路線分歧

谷歌雖顯得有些追趕,但帶來獨特哲學差異。OpenAI自2025年3月推出Responses API後,採用「壓縮」策略——以「加密壓縮項目」替代工具輸出和推理鏈,優先節省token使用,但對開發者來說成為「黑盒」,過往推理過程難以檢視。

谷歌則採用「託管」方式,完整保留且可組合歷史資料,讓開發者能「除錯、操作、串流及推理交錯訊息」,優先透明可檢視性而非壓縮效率。

支援模型與使用情況

Interactions API現於公開測試階段,開發者可透過Google AI Studio立即使用。支持谷歌最新一代各種規格模型,包括:

– Gemini 3.0:Gemini 3專業預覽版
– Gemini 2.5:Flash、Flash-lite及專業版
– 代理:Deep Research 預覽版(`deep-research-pro-preview-12-2025`)

商業方面,API整合谷歌現有收費結構,依所選模型計算輸入輸出token費用。由於API為有狀態,谷歌須儲存互動歷史以提供隱式快取和上下文檢索功能。免費用戶限1天保存,適合短暫測試,付費用戶則享55天資料保留,能有效降低成本,避免重複處理大量上下文資料。

由於仍處Beta階段,谷歌提醒功能與架構可能調整。

「你正與系統互動」——專家觀點

谷歌機器學習開發專家、Red Dragon AI執行長Sam Witteveen認為,這是開發堆疊的必然演進。他指出:「過去是簡單的文字輸入輸出,但現在你是與一個系統互動。這系統能同時使用多個模型、執行多輪呼叫、使用工具及後端執行代碼。」

他強調此架構帶來的經濟效益:隱式快取。對話歷史存於谷歌伺服器,開發者無需重複上傳相同上下文,節省token成本。

不過他也批評Deep Research代理的引用系統,返回的URL多為谷歌內部或Vertex AI重定向鏈接,非直接可用的原始URL。「若我將這些URL保存並嘗試在不同會話使用,它們會失效。若要給報告附上引用,希望能直接點擊連結,這點目前不理想。」

對團隊的影響與建議

對專注快速部署與微調的AI工程師,這次發布提供了解決「超時」問題的架構方案:背景執行。無需自行管理非同步處理或任務隊列,能將複雜度交給谷歌,但也需在速度便利與細節掌控間做權衡。

資深工程師可利用`previous_interaction_id`實現隱式快取,顯著降低重複上傳上下文的token費用,提升效能與成本控制。

但使用遠端MCP連接外部工具時,須嚴格驗證服務安全性與認證,避免產生風險。若現有token開銷過高,建議優先考慮遷移至有狀態的Interactions API以節省成本。

數據工程師則可從結構化的對話模型中獲益,提升數據完整性與除錯能力。但需注意引用URL的「包裝」問題,可能影響數據擷取與存檔流程,建議開發清洗步驟或測試新格式輸出以取代脆弱的正則表達式解析。

IT安全主管則需評估數據駐留風險。谷歌在付費方案中保留互動歷史達55天,與OpenAI的零資料保留策略形成對比。若政策不允許長期存儲敏感對話,需要設置`store=false`,但會失去有狀態API的成本及效能優勢。

編輯評論:

谷歌DeepMind這次推出的Interactions API,標誌著生成式AI從「單次完成」向「持續狀態」運作模式的重大轉變,對推動自主代理技術具有里程碑意義。相比OpenAI的「壓縮黑盒」策略,谷歌更重視開發者的透明度和可控性,這反映了兩大巨頭在AI生態系統哲學上的不同取向。

這種「遠端運算」思維,不單是技術升級,更是AI服務架構的根本變革。它讓AI代理不再是孤立的文字生成器,而是具備多模型協同、工具整合及長期思考能力的智慧系統。這對企業和開發者而言,意味著更複雜的應用場景和更豐富的功能,但同時也帶來了安全、隱私和數據治理的新挑戰。

尤其是數據駐留與引用鏈接問題,凸顯了AI產業在追求技術突破的同時,必須同步完善生態系統的基礎設施和標準。未來,如何平衡技術創新、透明度、成本效益與用戶信任,將是谷歌與整個AI產業必須面對的課題。

對香港企業和開發者來說,谷歌此舉提供了更靈活且可控的AI工具選擇,尤其適合需要長期記憶和複雜工作流的應用場景。隨著API更廣泛普及,如何在保持數據安全的前提下,善用這些新功能,將成為提升競爭力的關鍵。

以上文章由特價GPT API KEY所翻譯及撰寫。而圖片則由FLUX根據內容自動生成。

🎬 YouTube Premium 家庭 Plan成員一位 只需 HK$148/年

不用提供密碼、不用VPN、無需轉區
直接升級你的香港帳號 ➜ 即享 YouTube + YouTube Music 無廣告播放

立即升級 🔗

🎨 Nano Banana Pro 圖像生成器|打幾句說話就出圖

想畫人像、產品圖、插畫?SSFuture 圖像生成器支援 Flux Gemini Nano Banana Pro 改圖 / 合成, 打廣東話都得,仲可以沿用上一張圖繼續微調。

🆓 Flux 模型即玩,不用登入
🤖 登入後解鎖 Gemini 改圖
📷 支援上載參考圖再生成
⚡ 每天免費額度任你玩
✨ 即刻玩 AI 畫圖
[Subject]: Young Asian female with "Imada Mio-inspired" doll-like aesthetic (精緻洋娃娃臉). She has large round expressive eyes, a small V-line face, and rosy cheeks. Her expression is innocent, energetic, and slightly flirty. [Hair]: Messy morning hair (剛睡醒的凌亂感), long dark brown hair, slightly tousled, natural volume. [Outfit]: Wearing an oversized translucent white button-down shirt (男友風白襯衫), unbuttoned at the top to reveal collarbones, creating a "bottomless" look (下衣失蹤風格). [Style]: Japanese Gravure Photobook style (寫真集風格), Pure & Sexy vibe, bright high-key lighting, soft skin texture, Fujifilm PRO 400H color tone. Generate an ultra-realistic, highly ultra-detailed, 8k resolution with 1080x1080 pixel portrait of me using the uploaded image for reference (preserved the likeness and the original face for reference) of a striking, high-resolution portrait of a young woman with long, flowing wavy brunette hair, seated gracefully on a simple black wooden chair in a dimly lit studio. She wears an oversized, off-white knitted sweater that drapes loosely over her frame, slipping off one shoulder to reveal smooth skin and add a subtle touch of sensuality. Her pose is elegant and contemplative: one arm rests gently on the chair’s backrest while her hand delicately supports her chin, and her gaze is directed thoughtfully toward the side, creating an intimate and introspective mood. The lighting is expertly crafted with a single soft, directional light source positioned to the side, casting gentle shadows that sculpt her form and highlight the texture of the knitwear and the natural contours of her legs and arms. This chiaroscuro effect enhances the depth and dimensionality of the image, emphasizing the softness of her skin and the intricate weave of the sweater. The background is a smooth, muted dark gray, providing a minimalist and distraction-free backdrop that contrasts beautifully with her light-colored apparel and warm skin tones. *** The composition is a full-body vertical frame that captures the model’s seated posture with perfect balance, positioning her slightly off-center to create visual interest and harmony. The overall color palette is subdued and warm, featuring neutral tones that evoke a sense of calm and understated elegance. The image is impeccably sharp, showcasing fine details such as the delicate waves of her hair, the subtle folds in the fabric, and the natural texture of her skin. The style is classic and timeless, blending modern minimalism with emotive portraiture to convey quiet strength, beauty, and introspection.

➖Additional details:
- Negative Prompt: cartoon, 3d render, cgi,a low poly, painting, drawing, sketch, anime, deformed, bad anatomy, mutated hands, extra limbs, low quality, blurry, artifacts, plastic skin, out of frame, out of focus, wrong spelling, rumble letters, missing letter, blurry letter, blurry face, lowres, pixelated, jpeg artifacts, repeated face and repeated word. An intense, close-up portrait set in a smoky, underground jazz club or speakeasy. The subject is the 'Boss' of an information network, hiding in plain sight. The scene is dark, defined by heavy shadows and cigarette smoke swirling in the air. A single spotlight hits the subject from the side, creating a classic 'Rembrandt triangle' on the cheek of [exactly face uploaded image 100%]. He wears a sharp, pinstripe suit with a silk tie, loosened at the collar. He holds a glass of amber whiskey, the condensation rendered in 8K detail. The camera uses a macro 100mm lens, focusing entirely on the eyes and the texture of the skin, blurring out the background patrons into abstract shapes. The mood is conspiratorial, sophisticated, and deeply atmospheric.