| title | OpenAIAssistantAdapter |
|---|---|
| description | CopilotKit Adapter for the OpenAI Assistant API. |
{/* GENERATE-DOCS path=packages/runtime/src/service-adapters/openai/openai-assistant-adapter.ts class=OpenAIAssistantAdapter */}
Use this adapter to get responses from the OpenAI Assistant API.
```typescript const copilotKit = new CopilotRuntime(); return copilotKit.response( req, new OpenAIAssistantAdapter({ assistantId: "your-assistant-id" }) ); ``` The ID of the assistant to use. An instance of `OpenAI` to use for the request. If not provided, a new instance will be created. Whether to enable the code interpreter. Defaults to `true`. Whether to enable retrieval. Defaults to `true`.