Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.3 KB

File metadata and controls

46 lines (31 loc) · 1.3 KB

import { PropertyReference, LinkToCopilotCloud } from "@/components";

import { Tabs } from "nextra/components";

import { Callout } from "nextra/components";

OpenAIAdapter

Copilot Runtime adapter for OpenAI.

Example

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);

Constructor Parameters

An optional OpenAI instance to use. If not provided, a new instance will be created. The model to use. Whether to disable parallel tool calls. You can disable parallel tool calls to force the model to execute tool calls sequentially. This is useful if you want to execute tool calls in a specific order so that the state changes introduced by one tool call are visible to the next tool call. (i.e. new actions or readables)