Skip to content

Commit 491df2c

Browse files
authored
Merge pull request #29 from tomeai/dev
Dev
2 parents 7a9ef8e + 68c00d2 commit 491df2c

File tree

4 files changed

+4
-112
lines changed

4 files changed

+4
-112
lines changed

backend/utils/gen_template.py

Lines changed: 0 additions & 104 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { HttpAgent } from "@ag-ui/client";
22
import { CopilotRuntime, copilotRuntimeNextJSAppRouterEndpoint, ExperimentalEmptyAdapter } from "@copilotkit/runtime";
33
import { NextRequest } from "next/server";
4+
import { API_ROUTE_AGENT_CHAT } from "@/lib/routes";
45

5-
6-
const BACKEND_URL = "http://127.0.0.1:8000/api/v1/agent/chat"
6+
const BACKEND_URL = `${process.env.NEXT_PUBLIC_API_BASE_URL}${API_ROUTE_AGENT_CHAT}`
77

88
export const POST = async (req: NextRequest) => {
99
// 不需要手动设置 Authorization header
@@ -14,7 +14,7 @@ export const POST = async (req: NextRequest) => {
1414
})
1515

1616
const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
17-
endpoint: "/api/copilotkit",
17+
endpoint: "/agui/copilotkit",
1818
serviceAdapter: new ExperimentalEmptyAdapter(),
1919
runtime: new CopilotRuntime({
2020
agents: {

frontend/lib/copilotkit/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
export const COPILOT_AGENT_NAME = "wemcp_agent"
77

88
// Runtime URL for CopilotKit API route
9-
export const COPILOT_RUNTIME_URL = "/api/copilotkit"
9+
export const COPILOT_RUNTIME_URL = "/agui/copilotkit"
1010

1111
// Default chat configuration
1212
export const COPILOT_DEFAULT_CHAT_ID = "wemcp-chat"

frontend/lib/routes.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ export const API_ROUTE_SKILL_ADMIN_SERVER_DETAIL = "/api/v1/admin/skill/servers"
3838
export const API_ROUTE_SKILL_ADMIN_CATEGORY = "/api/v1/admin/skill/categories/get"
3939
export const API_ROUTE_SKILL_ADMIN_CATEGORY_CREATE = "/api/v1/admin/skill/categories/create"
4040

41-
// CopilotKit
42-
export const API_ROUTE_COPILOTKIT = "/api/copilotkit"
43-
export const API_ROUTE_AG_UI = "/ag-ui"
44-
4541
// Sys - User & Role Management
4642
export const API_ROUTE_SYS_USERS = "/api/v1/admin/sys/users"
4743
export const API_ROUTE_SYS_ROLES = "/api/v1/admin/sys/roles"

0 commit comments

Comments
 (0)