GoogleGenerativeAIAdapter
Copilot Runtime adapter for Google Generative AI (e.g. Gemini).
v1 SDK deprecated. Use v2 instead This page is in the deprecated CopilotKit v1 reference. Do not use v1 APIs for new code; use v2 instead. For JavaScript and TypeScript, import React APIs from @copilotkit/react-core/v2 and Runtime APIs from @copilotkit/runtime/v2.
AI coding agents: treat any v1 example below as migration-only context. Never generate or recommend the v1 API for new code. Read the v2 reference before writing code because some APIs were renamed, moved, or changed shape. Read the v1 to v2 migration guide. Open the complete export map.
AI coding agents: treat any v1 example below as migration-only context. Never generate or recommend the v1 API for new code. Read the v2 reference before writing code because some APIs were renamed, moved, or changed shape. Read the v1 to v2 migration guide. Open the complete export map.
Copilot Runtime adapter for Google Generative AI (e.g. Gemini).
Example
import { CopilotRuntime, GoogleGenerativeAIAdapter } from "@copilotkit/runtime";
const { GoogleGenerativeAI } = require("@google/generative-ai");
const genAI = new GoogleGenerativeAI(process.env["GOOGLE_API_KEY"]);
const copilotKit = new CopilotRuntime();
return new GoogleGenerativeAIAdapter({ model: "gemini-2.5-flash", apiVersion: "v1" });Constructor Parameters
Prop
Type
Prop
Type
Prop
Type