import { PropertyReference, LinkToCopilotCloud } from "@/components";
import { Tabs } from "nextra/components";
import { Callout } from "nextra/components";
Copilot Runtime adapter for OpenAI.
import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";
import OpenAI from "openai";
const copilotKit = new CopilotRuntime();
const openai = new OpenAI({
organization: "<your-organization-id>", // optional
apiKey: "<your-api-key>",
});
const llmAdapter = new OpenAIAdapter({ openai });
return copilotKit.streamHttpServerResponse(req, res, llmAdapter);