import { PropertyReference, LinkToCopilotCloud } from "@/components";
import { Tabs } from "nextra/components";
import { Callout } from "nextra/components";
Copilot Runtime adapter for Google Generative AI (e.g. Gemini).
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();
const model = genAI.getGenerativeModel({
model: "gemini-pro"
});
const llmAdapter = new GoogleGenerativeAIAdapter({ model });
return copilotKit.streamHttpServerResponse(req, res, llmAdapter);