import { PropertyReference, LinkToCopilotCloud } from "@/components";
import { Tabs } from "nextra/components";
import { Callout } from "nextra/components";
This is the reference for the `CopilotRuntime` class. For more information and example code snippets, please see [Concept: Copilot Runtime](/concepts/copilot-runtime).import { CopilotRuntime } from "@copilotkit/runtime";
const copilotKit = new CopilotRuntime();onBeforeRequest: (options: {
threadId?: string;
runId?: string;
inputMessages: Message[];
properties: any;
}) => void | Promise<void>;onAfterRequest: (options: {
threadId?: string;
runId?: string;
inputMessages: Message[];
outputMessages: Message[];
properties: any;
}) => void | Promise<void>;