@copilotkit/runtime
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
59 lines (57 loc) • 1.97 kB
text/typescript
import { CopilotRuntimeChatCompletionRequest, CopilotRuntimeChatCompletionResponse, CopilotServiceAdapter } from "../service-adapter.cjs";
import OpenAI from "openai";
//#region src/service-adapters/openai/openai-assistant-adapter.d.ts
interface OpenAIAssistantAdapterParams {
/**
* The ID of the assistant to use.
*/
assistantId: string;
/**
* An optional OpenAI instance to use. If not provided, a new instance will be created.
*/
openai?: OpenAI;
/**
* Whether to enable code interpretation.
* @default true
*/
codeInterpreterEnabled?: boolean;
/**
* Whether to enable file search.
* @default true
*/
fileSearchEnabled?: boolean;
/**
* 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)
*
* @default false
*/
disableParallelToolCalls?: boolean;
/**
* Whether to keep the role in system messages as "System".
* By default, it is converted to "developer", which is used by newer OpenAI models
*
* @default false
*/
keepSystemRole?: boolean;
}
declare class OpenAIAssistantAdapter implements CopilotServiceAdapter {
private _openai;
private codeInterpreterEnabled;
private assistantId;
private fileSearchEnabled;
private disableParallelToolCalls;
private keepSystemRole;
get name(): string;
constructor(params: OpenAIAssistantAdapterParams);
private ensureOpenAI;
process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
private submitToolOutputs;
private submitUserMessage;
private streamResponse;
}
//#endregion
export { OpenAIAssistantAdapter, OpenAIAssistantAdapterParams };
//# sourceMappingURL=openai-assistant-adapter.d.cts.map