Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 891 Bytes

File metadata and controls

35 lines (21 loc) · 891 Bytes

import { PropertyReference, LinkToCopilotCloud } from "@/components";

import { Tabs } from "nextra/components";

import { Callout } from "nextra/components";

GoogleGenerativeAIAdapter

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();
 
const model = genAI.getGenerativeModel({
  model: "gemini-pro"
});
 
const llmAdapter = new GoogleGenerativeAIAdapter({ model });
 
return copilotKit.streamHttpServerResponse(req, res, llmAdapter);

Constructor Parameters

A custom Google Generative AI model to use.