chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
OPENAI_API_KEY=your-openai-api-key
|
||||
PORT=4005
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"nodeModulesDir": "manual",
|
||||
"tasks": {
|
||||
"dev": "deno run --allow-net --allow-env --allow-read --watch src/index.ts",
|
||||
"start": "deno run --allow-net --allow-env --allow-read src/index.ts"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "@copilotkit/example-runtime-deno",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"example-dev": "deno run --allow-net --allow-env --allow-read src/index.ts",
|
||||
"example-start": "deno run --allow-net --allow-env --allow-read src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@copilotkit/runtime": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
CopilotRuntime,
|
||||
createCopilotRuntimeHandler,
|
||||
BuiltInAgent,
|
||||
} from "@copilotkit/runtime/v2";
|
||||
|
||||
const runtime = new CopilotRuntime({
|
||||
agents: {
|
||||
default: new BuiltInAgent({ model: "openai/gpt-5-mini" }),
|
||||
},
|
||||
});
|
||||
|
||||
const handler = createCopilotRuntimeHandler({
|
||||
runtime,
|
||||
basePath: "/api/copilotkit",
|
||||
cors: true,
|
||||
});
|
||||
|
||||
const port = Number(Deno.env.get("PORT") ?? "4005");
|
||||
Deno.serve({ port }, handler);
|
||||
console.log(
|
||||
`Deno runtime listening on http://localhost:${port}/api/copilotkit`,
|
||||
);
|
||||
Reference in New Issue
Block a user