Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1.04 KB

File metadata and controls

49 lines (36 loc) · 1.04 KB
title GoogleGenerativeAIAdapter
description CopilotKit Adapter for Google Gemini

{/* GENERATE-DOCS path=packages/runtime/src/service-adapters/google/google-genai-adapter.ts class=GoogleGenerativeAIAdapter */}

Use this adapter for a Google Gemini backend.

```typescript const copilotKit = new CopilotRuntime(); return copilotKit.response( req, new GoogleGenerativeAIAdapter() ); ```

To set up a different model, pass the model prop:

const copilotKit = new CopilotRuntime();
const genAI = new GoogleGenerativeAI(
 process.env["GOOGLE_API_KEY"]!
);
const model = genAI.getGenerativeModel(
 { model: "gemini-pro" }
);
return copilotKit.response(
  req,
  new GoogleGenerativeAIAdapter()
);

Constructor

A custom `GenerativeModel` to use for the request.

process(request: CopilotRuntimeChatCompletionRequest)