@copilotkit/runtime
Version:
<div align="center"> <a href="https://copilotkit.ai" target="_blank"> <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/banner.png" alt="CopilotKit Logo"> </a>
174 lines (171 loc) • 6.64 kB
TypeScript
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-25a2bd35.js';
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from '../shared-0c31d7c5.js';
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js';
export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
import * as rxjs from 'rxjs';
import { TextMessageStartEvent, TextMessageContentEvent, TextMessageEndEvent, ToolCallStartEvent, ToolCallArgsEvent, ToolCallEndEvent, RunAgentInput, EventType } from '@ag-ui/client';
import { LangGraphAgent as LangGraphAgent$1, LangGraphAgentConfig, ProcessedEvents } from '@ag-ui/langgraph';
import { Message } from '@langchain/langgraph-sdk/dist/types.messages';
import 'openai';
import '../langserve-4a5c9217.js';
import '../index-d4614f9b.js';
import '../graphql/types/base/index.js';
import '@copilotkit/shared';
import '@langchain/core/messages';
import '@langchain/core/tools';
import '@langchain/core/utils/stream';
import 'groq-sdk';
import 'graphql';
import 'pino';
import 'graphql-yoga';
import './cloud/index.js';
interface PredictStateTool {
tool: string;
state_key: string;
tool_argument: string;
}
type State = Record<string, any>;
type TextMessageEvents = TextMessageStartEvent | TextMessageContentEvent | TextMessageEndEvent;
type ToolCallEvents = ToolCallStartEvent | ToolCallArgsEvent | ToolCallEndEvent;
declare enum CustomEventNames {
CopilotKitManuallyEmitMessage = "copilotkit_manually_emit_message",
CopilotKitManuallyEmitToolCall = "copilotkit_manually_emit_tool_call",
CopilotKitManuallyEmitIntermediateState = "copilotkit_manually_emit_intermediate_state",
CopilotKitExit = "copilotkit_exit"
}
declare class LangGraphAgent extends LangGraphAgent$1 {
constructor(config: LangGraphAgentConfig);
dispatchEvent(event: ProcessedEvents): boolean;
run(input: RunAgentInput): rxjs.Observable<{
type: EventType.TEXT_MESSAGE_START;
role: "assistant";
messageId: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.TEXT_MESSAGE_CONTENT;
messageId: string;
delta: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.TEXT_MESSAGE_END;
messageId: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.TOOL_CALL_START;
toolCallId: string;
toolCallName: string;
timestamp?: number | undefined;
rawEvent?: any;
parentMessageId?: string | undefined;
} | {
type: EventType.TOOL_CALL_ARGS;
toolCallId: string;
delta: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.TOOL_CALL_END;
toolCallId: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.STATE_SNAPSHOT;
timestamp?: number | undefined;
rawEvent?: any;
snapshot?: any;
} | {
type: EventType.STATE_DELTA;
delta: any[];
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.MESSAGES_SNAPSHOT;
messages: ({
id: string;
role: "developer";
content: string;
name?: string | undefined;
} | {
id: string;
role: "system";
content: string;
name?: string | undefined;
} | {
id: string;
role: "assistant";
name?: string | undefined;
content?: string | undefined;
toolCalls?: {
function: {
name: string;
arguments: string;
};
type: "function";
id: string;
}[] | undefined;
} | {
id: string;
role: "user";
content: string;
name?: string | undefined;
} | {
id: string;
role: "tool";
content: string;
toolCallId: string;
})[];
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.RAW;
timestamp?: number | undefined;
rawEvent?: any;
event?: any;
source?: string | undefined;
} | {
name: string;
type: EventType.CUSTOM;
value?: any;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.RUN_STARTED;
threadId: string;
runId: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.RUN_FINISHED;
threadId: string;
runId: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
message: string;
type: EventType.RUN_ERROR;
code?: string | undefined;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.STEP_STARTED;
stepName: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType.STEP_FINISHED;
stepName: string;
timestamp?: number | undefined;
rawEvent?: any;
} | {
type: EventType;
name: string;
value: any;
}>;
langGraphDefaultMergeState(state: State, messages: Message[], tools: any): State;
}
export { CustomEventNames, LangGraphAgent, PredictStateTool, State, TextMessageEvents, ToolCallEvents };