chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:58:18 +08:00
commit 6d5d58c1a9
18293 changed files with 3502153 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* @filePath server.ts
*/
import { createServer } from "node:http";
import {
CopilotRuntime,
OpenAIAdapter,
copilotRuntimeNodeHttpEndpoint,
} from "@copilotkit/runtime";
import OpenAI from "openai";
const openai = new OpenAI();
const serviceAdapter = new OpenAIAdapter({ openai });
const runtime = new CopilotRuntime();
const copilotRuntime = copilotRuntimeNodeHttpEndpoint({
endpoint: "/copilotkit",
runtime,
serviceAdapter,
});
const server = createServer((req, res) => {
return copilotRuntime(req, res);
});
server.listen(4000, () => {
console.log("Listening at http://localhost:4000/copilotkit");
});