const copilotKit = new CopilotRuntime();
return copilotKit.response(
  req,
  new OpenAIAssistantAdapter({
   assistantId: "your-assistant-id"
  })
);

Use this adapter to get responses from the OpenAI Assistant API.

const copilotKit = new CopilotRuntime();
return copilotKit.response(
  req,
  new OpenAIAssistantAdapter({
   assistantId: "your-assistant-id"
  })
);

Constructor

assistantId
string
required

The ID of the assistant to use.

openai
OpenAI

An instance of OpenAI to use for the request. If not provided, a new instance will be created.

codeInterpreterEnabled
boolean

Whether to enable the code interpreter. Defaults to true.

retrievalEnabled
boolean

Whether to enable retrieval. Defaults to true.

getResponse(forwardedProps: any)

forwardedProps
any
required