File tree Expand file tree Collapse file tree 4 files changed +4
-112
lines changed
Expand file tree Collapse file tree 4 files changed +4
-112
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { HttpAgent } from "@ag-ui/client" ;
22import { CopilotRuntime , copilotRuntimeNextJSAppRouterEndpoint , ExperimentalEmptyAdapter } from "@copilotkit/runtime" ;
33import { 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
88export 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 : {
Original file line number Diff line number Diff line change 66export 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
1212export const COPILOT_DEFAULT_CHAT_ID = "wemcp-chat"
Original file line number Diff line number Diff line change @@ -38,10 +38,6 @@ export const API_ROUTE_SKILL_ADMIN_SERVER_DETAIL = "/api/v1/admin/skill/servers"
3838export const API_ROUTE_SKILL_ADMIN_CATEGORY = "/api/v1/admin/skill/categories/get"
3939export 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
4642export const API_ROUTE_SYS_USERS = "/api/v1/admin/sys/users"
4743export const API_ROUTE_SYS_ROLES = "/api/v1/admin/sys/roles"
You can’t perform that action at this time.
0 commit comments