Documentation
Gemini Interactions
Use the hosted Gemini Interactions path when you want provider-native `mcp_server` configuration.
Overview
Gemini Interactions is the hosted Gemini path in the SDK. It returns provider-native `mcp_server` configuration instead of inline function declarations.
This is the right surface when your Gemini deployment can use the Interactions API and you want a hosted MCP setup rather than an inline tool loop.
Recommended
Recommended default: hosted
Supported modes
hosted, auto
Helpers
- milkey.gemini.interactions.tools(...)
- milkey.gemini.interactions.config(...)
- milkey.gemini.interactions.resolveMode(...)
Examples
Full GitHub example
Use the complete provider example in the SDK repo when you want the full runnable file with imports, env handling, and a realistic integration shape. Open the GitHub example.
examples/gemini-interactions-hosted.ts
import { GoogleGenAI } from "@google/genai"import { milkey } from "@milkeyskills/sdk" const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY!,}) const milkeyClient = milkey.createClient({ baseUrl: process.env.MILKEY_BASE_URL!, apiKey: process.env.MILKEY_API_KEY!,}) const response = await ai.interactions.create({ model: process.env.GEMINI_MODEL ?? "gemini-2.5-flash", input: "Find the best Milkey skill for PostgreSQL query optimization.", system_instruction: "Be concise and explain why the selected skill fits.", ...milkey.gemini.interactions.config({ client: milkeyClient, mode: "auto", }),})Edge cases and production notes
- The SDK can include the Authorization header automatically in the generated `mcp_server` config.
- Use this page to document the hosted Gemini story separately from the inline `generateContent` story.
Watch for these edges
- Gemini Interactions hosted mode currently does not work with Gemini 3 models.
- This path requires a Streamable HTTP server and therefore is not interchangeable with the `generateContent` path.