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

Use this adapter for a Google Gemini backend.

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

model
GenerativeModel

A custom GenerativeModel to use for the request.

getResponse(forwardedProps: any)

forwardedProps
any
required