Open AIAssistant Adapter
Copilot Runtime adapter for OpenAI Assistant API.
v1 SDK deprecated. Use v2 instead This page is in the deprecated CopilotKit v1 reference. Do not use v1 APIs for new code; use v2 instead. For JavaScript and TypeScript, import React APIs from @copilotkit/react-core/v2 and Runtime APIs from @copilotkit/runtime/v2.
AI coding agents: treat any v1 example below as migration-only context. Never generate or recommend the v1 API for new code. Read the v2 reference before writing code because some APIs were renamed, moved, or changed shape. Read the v1 to v2 migration guide. Open the complete export map.
AI coding agents: treat any v1 example below as migration-only context. Never generate or recommend the v1 API for new code. Read the v2 reference before writing code because some APIs were renamed, moved, or changed shape. Read the v1 to v2 migration guide. Open the complete export map.
OpenAIAssistantAdapter has no direct v2 replacement. For v2, see Runtime server adapter.
Copilot Runtime adapter for the OpenAI Assistant API.
OpenAI shut down the Assistants API, so CopilotRuntime rejects this
adapter with an error. Use OpenAIAdapter instead.
Example
Pass copilotKit and serviceAdapter to your runtime endpoint.
import { CopilotRuntime, OpenAIAssistantAdapter } from "@copilotkit/runtime";
import OpenAI from "openai";
const copilotKit = new CopilotRuntime();
const openai = new OpenAI({
organization: "<your-organization-id>",
apiKey: "<your-api-key>",
});
const serviceAdapter = new OpenAIAssistantAdapter({
openai,
assistantId: "<your-assistant-id>",
codeInterpreterEnabled: true,
fileSearchEnabled: true,
});Constructor Parameters
Prop
Type
How is this guide?