You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
1.1 KiB
21 lines
1.1 KiB
"use client"; |
|
|
|
import { CopilotKit } from "@copilotkit/react-core"; |
|
import { CopilotPopup } from "@copilotkit/react-ui"; |
|
import "@copilotkit/react-ui/styles.css"; |
|
|
|
export default function CopilotProvider({ children }: { children: React.ReactNode }) { |
|
return ( |
|
<CopilotKit runtimeUrl={(process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080") + "/api/copilotkit"}> |
|
{children} |
|
<CopilotPopup |
|
instructions="你是一个嵌入在高级企业 CRM 系统中的智能架构师。你可以通过 renderDynamicForm 为用户渲染新模块。当用户询问系统中有哪些模块或需要分析现有 schema 时,你可以调用 analyzeSystemModules 获取当前系统中已定义的业务模块及其 JSON Schema 进行分析并回答用户。" |
|
labels={{ |
|
title: "🤖 AI 业务助理", |
|
initial: "您好,汪总。您今天想为公司内部门添加什么新功能模块?", |
|
}} |
|
defaultOpen={true} |
|
/> |
|
</CopilotKit> |
|
); |
|
}
|
|
|