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

1 lines 2.48 kB
{"version":3,"file":"empty-adapter.mjs","names":[],"sources":["../../../../src/v1-deprecated/service-adapters/empty/empty-adapter.ts"],"sourcesContent":["/*\n * V1 SDK DEPRECATED. USE V2 INSTEAD\n *\n * This file defines public v1 SDK exports. Use the exact v2 mappings below.\n * AI CODING AGENTS: Never copy, suggest, or generate these v1 APIs. Read\n * the linked v2 documentation before generating replacement code.\n *\n * @copilotkit/runtime — EmptyAdapter:\n * No 1:1 v2 replacement is available.\n * Related v2 docs (Runtime server adapter): https://docs.copilotkit.ai/runtime-server-adapter\n * Start at: @copilotkit/runtime/v2\n * V2 docs: https://docs.copilotkit.ai/\n * V2 reference docs: https://docs.copilotkit.ai/reference/v2\n *\n * @copilotkit/runtime — ExperimentalEmptyAdapter:\n * No 1:1 v2 replacement is available.\n * Related v2 docs (Runtime server adapter): https://docs.copilotkit.ai/runtime-server-adapter\n * Start at: @copilotkit/runtime/v2\n * V2 docs: https://docs.copilotkit.ai/\n * V2 reference docs: https://docs.copilotkit.ai/reference/v2\n *\n * Migration guide: https://docs.copilotkit.ai/migrate/v2\n *\n * END V1 SDK DEPRECATED. USE V2 INSTEAD NOTICE\n */\n\n/**\n * CopilotKit Empty Adapter\n *\n * This adapter is meant to preserve adherence to runtime requirements, while doing nothing\n * Ideal if you don't want to connect an LLM the to the runtime, and only use your LangGraph agent.\n * Be aware that Copilot Suggestions will not work if you use this adapter\n *\n * ## Example\n *\n * ```ts\n * import { CopilotRuntime, EmptyAdapter } from \"@copilotkit/runtime\";\n *\n * const copilotKit = new CopilotRuntime();\n *\n * return new EmptyAdapter();\n * ```\n */\nimport type {\n CopilotServiceAdapter,\n CopilotRuntimeChatCompletionRequest,\n CopilotRuntimeChatCompletionResponse,\n} from \"../service-adapter\";\nimport { randomUUID } from \"@copilotkit/shared\";\n\nexport class EmptyAdapter implements CopilotServiceAdapter {\n async process(\n request: CopilotRuntimeChatCompletionRequest,\n ): Promise<CopilotRuntimeChatCompletionResponse> {\n return {\n threadId: request.threadId || randomUUID(),\n };\n }\n public get name() {\n return \"EmptyAdapter\";\n }\n}\n\nexport const ExperimentalEmptyAdapter = EmptyAdapter;\n"],"mappings":";;;;AAkDA,IAAa,eAAb,MAA2D;CACzD,MAAM,QACJ,SAC+C;AAC/C,SAAO,EACL,UAAU,QAAQ,YAAY,YAAY,EAC3C;;CAEH,IAAW,OAAO;AAChB,SAAO;;;AAIX,MAAa,2BAA2B"}