Skip to content

Commit 89b3fcb

Browse files
updates cpk to next
1 parent 8ac16d3 commit 89b3fcb

File tree

9 files changed

+2545
-40
lines changed

9 files changed

+2545
-40
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ yarn-error.log*
3434
# typescript
3535
*.tsbuildinfo
3636
next-env.d.ts
37+
.env

app/api/copilotkit/route.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {
2+
CopilotRuntime,
3+
OpenAIAdapter,
4+
copilotRuntimeNextJSAppRouterEndpoint,
5+
} from "@copilotkit/runtime";
6+
7+
import { NextRequest } from "next/server";
8+
9+
const serviceAdapter = new OpenAIAdapter();
10+
const runtime = new CopilotRuntime();
11+
12+
export const POST = async (req: NextRequest) => {
13+
const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
14+
runtime,
15+
serviceAdapter,
16+
endpoint: "/api/copilotkit",
17+
});
18+
19+
return handleRequest(req);
20+
};

app/favicon.ico

-25.3 KB
Binary file not shown.

app/icon.png

26.7 KB
Loading

app/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import { CopilotPopup } from "@copilotkit/react-ui";
77
import "@copilotkit/react-ui/styles.css";
88

99
export default function Home() {
10-
const COPILOT_CLOUD_PUBLIC_API_KEY = process.env.NEXT_PUBLIC_COPILOT_CLOUD_PUBLIC_API_KEY;
11-
1210
return (
1311
<>
14-
<CopilotKit publicApiKey={COPILOT_CLOUD_PUBLIC_API_KEY}>
12+
<CopilotKit runtimeUrl="/api/copilotkit">
1513
<TasksProvider>
1614
<TasksList />
1715
</TasksProvider>

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@copilotkit/react-core": "^1.3.1",
13-
"@copilotkit/react-ui": "^1.3.1",
14-
"@copilotkit/runtime-client-gql": "^1.3.1",
12+
"@copilotkit/react-core": "1.8.12-next.4",
13+
"@copilotkit/react-ui": "1.8.12-next.4",
14+
"@copilotkit/runtime": "1.8.12-next.4",
15+
"@copilotkit/runtime-client-gql": "1.8.12-next.4",
1516
"@radix-ui/react-checkbox": "^1.1.1",
1617
"@radix-ui/react-dialog": "^1.1.1",
1718
"@radix-ui/react-label": "^2.1.0",

0 commit comments

Comments
 (0)