Use this adapter for a Google Gemini backend.

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

model
GenerativeModel

A custom GenerativeModel to use for the request.

process(request: CopilotRuntimeChatCompletionRequest)

request
CopilotRuntimeChatCompletionRequest
required