UNPKG

@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;" />

45 lines (44 loc) 1.85 kB
import "reflect-metadata"; import { ExtensionsResponse } from "../graphql/types/extensions-response.type.mjs"; import { Message } from "../graphql/types/converted/index.mjs"; import { RuntimeEventSource } from "./events.mjs"; import { ActionInput } from "../graphql/inputs/action.input.mjs"; import { ForwardedParametersInput } from "../graphql/inputs/forwarded-parameters.input.mjs"; import { ExtensionsInput } from "../graphql/inputs/extensions.input.mjs"; import { AgentSessionInput } from "../graphql/inputs/agent-session.input.mjs"; import { AgentStateInput } from "../graphql/inputs/agent-state.input.mjs"; import { LanguageModel } from "ai"; //#region src/service-adapters/service-adapter.d.ts interface CopilotRuntimeChatCompletionRequest { eventSource: RuntimeEventSource; messages: Message[]; actions: ActionInput[]; model?: string; threadId?: string; runId?: string; forwardedParameters?: ForwardedParametersInput; extensions?: ExtensionsInput; agentSession?: AgentSessionInput; agentStates?: AgentStateInput[]; } interface CopilotRuntimeChatCompletionResponse { threadId: string; runId?: string; extensions?: ExtensionsResponse; } interface CopilotServiceAdapter { provider?: string; model?: string; process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>; name?: string; /** * Returns a pre-configured LanguageModel for use with BuiltInAgent. * Adapters that support custom provider configurations (e.g., Azure OpenAI * with custom baseURL/apiKey) should implement this to ensure the * configuration is propagated to the agent layer. */ getLanguageModel?(): LanguageModel; } //#endregion export { CopilotRuntimeChatCompletionRequest, CopilotRuntimeChatCompletionResponse, CopilotServiceAdapter }; //# sourceMappingURL=service-adapter.d.mts.map