forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
30 lines (27 loc) · 643 Bytes
/
Copy pathindex.ts
File metadata and controls
30 lines (27 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {
CopilotRuntime,
createCopilotEndpoint,
VERSION,
BasicAgent,
} from "@copilotkit/runtime/v2";
import { serve } from "@hono/node-server";
// Example: Creating a runtime instance
// Note: BasicAgent is used here to verify the import works
// In practice, agents would be passed with proper AbstractAgent interface
const runtime = new CopilotRuntime({
agents: {
default: new BasicAgent({
model: "openai/gpt-4o-mini",
maxSteps: 5,
temperature: 0.7,
}),
},
});
const endpoint = createCopilotEndpoint({
basePath: "/api/copilotkit",
runtime,
});
serve({
fetch: endpoint.fetch,
port: 8787,
});