@gientech/modual 1.9.4-fix.1 → 1.9.4-fix.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +43 -106
- package/.editorconfig +0 -38
- package/.prettierignore +0 -16
- package/.prettierrc +0 -17
- package/USAGE.md +0 -247
- package/bash.exe.stackdump +0 -40
- package/components.json +0 -21
- package/dist/README.md +0 -643
- package/dist/package.json +0 -68
- package/doc_assets/2.png +0 -0
- package/doc_assets/demo.md +0 -27
- package/doc_assets/demos/dist-app/assets/index.Dh-ZAS9Z.css +0 -2
- package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js +0 -23699
- package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js.map +0 -1
- package/doc_assets/demos/dist-app/index.html +0 -14
- package/doc_assets/demos/dist-app/vite.svg +0 -1
- package/doc_assets/images/1.png +0 -0
- package/doc_assets/images/3.png +0 -0
- package/doc_assets/images/component-screenshot.png +0 -1
- package/doc_assets/install.md +0 -5
- package/doc_assets//346/226/271/346/241/210//344/274/230/345/214/226/346/226/271/346/241/210-/345/244/232/344/274/232/350/257/235SSE/350/277/236/346/216/245/347/256/241/347/220/206.md +0 -504
- package/eslint.config.js +0 -92
- package/index.html +0 -13
- package/package.json.demo-backup +0 -109
- package/postcss.config.cjs +0 -19
- package/public/icons/answerAwartar.png +0 -0
- package/public/icons/docx-file.png +0 -0
- package/public/icons/folder.png +0 -0
- package/public/icons/html.png +0 -0
- package/public/icons/image.png +0 -0
- package/public/icons/jpg-file.png +0 -0
- package/public/icons/json.png +0 -0
- package/public/icons/md.png +0 -0
- package/public/icons/pdf.png +0 -0
- package/public/icons/pptx.png +0 -0
- package/public/icons/questionAwartar.png +0 -0
- package/public/icons/sheets.png +0 -0
- package/public/icons/txt.png +0 -0
- package/public/icons/xlsx.png +0 -0
- package/public/vite.svg +0 -1
- package/public/worker/pdf.worker.min.js +0 -22
- package/rag/assets/Doris.3ZRHc3Fu.png +0 -0
- package/rag/assets/PostgreSQL.DuLqLAFX.png +0 -0
- package/rag/assets/SQLServer.CWyNu24v.png +0 -0
- package/rag/assets/empty.BfkDKJsb.png +0 -0
- package/rag/assets/homeBg.Mr_kGuA9.png +0 -0
- package/rag/assets/index.Bd0tNzw0.js +0 -2797
- package/rag/assets/index.D6t67hlu.css +0 -1
- package/rag/assets/left.KBHV5h7q.jpg +0 -0
- package/rag/assets/logoImg.Gmp_tdkD.png +0 -0
- package/rag/assets/worker-BbpylX7l.DptbXke_.js +0 -13
- package/rag/icons/answerAwartar.png +0 -0
- package/rag/icons/docx-file.png +0 -0
- package/rag/icons/folder.png +0 -0
- package/rag/icons/html.png +0 -0
- package/rag/icons/image.png +0 -0
- package/rag/icons/jpg-file.png +0 -0
- package/rag/icons/json.png +0 -0
- package/rag/icons/md.png +0 -0
- package/rag/icons/pdf.png +0 -0
- package/rag/icons/pptx.png +0 -0
- package/rag/icons/questionAwartar.png +0 -0
- package/rag/icons/sheets.png +0 -0
- package/rag/icons/txt.png +0 -0
- package/rag/icons/xlsx.png +0 -0
- package/scripts/README.md +0 -133
- package/scripts/build-demo.js +0 -88
- package/scripts/decrypt-api-key.js +0 -95
- package/scripts/demo-selector.js +0 -216
- package/scripts/dev-demo.js +0 -76
- package/scripts/preview-demo.js +0 -130
- package/scripts/run-demo.bat +0 -34
- package/src/assets/img/close.png +0 -0
- package/src/assets/img/database.png +0 -0
- package/src/assets/img/downArrow.png +0 -0
- package/src/assets/img/downLoad.png +0 -0
- package/src/assets/img/excel.png +0 -0
- package/src/assets/img/graphIcon.png +0 -0
- package/src/assets/img/img.png +0 -0
- package/src/assets/img/pdf.png +0 -0
- package/src/assets/img/ppt.png +0 -0
- package/src/assets/img/singleQa.png +0 -0
- package/src/assets/img/txt.png +0 -0
- package/src/assets/img/webSearch.png +0 -0
- package/src/assets/img/word.png +0 -0
- package/src/assets/login/homeBg.png +0 -0
- package/src/assets/login/left.jpg +0 -0
- package/src/assets/login/logoImg.png +0 -0
- package/src/examples/ConversationAssistantPage/index.tsx +0 -41
- package/src/examples/Demo/index.tsx +0 -12
- package/src/examples/LoginPage/index.tsx +0 -18
- package/src/examples/chat/components/DrawerGraphPreview.tsx +0 -78
- package/src/examples/chat/index.tsx +0 -162
- package/src/examples/chat/logo03.png +0 -0
- package/src/examples/gientechStreamFilesReader/index.tsx +0 -951
- package/src/examples/headlessChat/index.tsx +0 -218
- package/src/examples/ragDatabaseDataPage/index.tsx +0 -40
- package/src/examples/ragDatabaseIdPage/index.tsx +0 -47
- package/src/examples/ragDatabasePage/index.tsx +0 -36
- package/src/examples/ragModelManagePage/index.tsx +0 -37
- package/src/examples/ragSearchPage/index.tsx +0 -0
- package/src/examples/ragSensitiveWordsPage/index.tsx +0 -32
- package/src/examples/streamFiles/index.tsx +0 -417
- package/src/lib_enter.ts +0 -43
- package/src/main.tsx +0 -5
- package/src/main.tsx.backup +0 -5
- package/src/modules/assistantConfig/assets/databse.svg +0 -6
- package/src/modules/assistantConfig/assets/empty.png +0 -0
- package/src/modules/assistantConfig/assets/graph.svg +0 -4
- package/src/modules/assistantConfig/assets/knowledge.svg +0 -4
- package/src/modules/assistantConfig/assets/sensitive.svg +0 -5
- package/src/modules/assistantConfig/components/Database.tsx +0 -171
- package/src/modules/assistantConfig/components/Graph.tsx +0 -177
- package/src/modules/assistantConfig/components/Knowledge.tsx +0 -276
- package/src/modules/assistantConfig/components/NotFoundContent.tsx +0 -21
- package/src/modules/assistantConfig/components/Paragraph.tsx +0 -51
- package/src/modules/assistantConfig/components/ParamsItem.tsx +0 -39
- package/src/modules/assistantConfig/components/ResourceBinderItem.tsx +0 -133
- package/src/modules/assistantConfig/components/SearchableSelector.tsx +0 -500
- package/src/modules/assistantConfig/components/Sensitive.tsx +0 -221
- package/src/modules/assistantConfig/components/SliderInput.tsx +0 -65
- package/src/modules/assistantConfig/constants.tsx +0 -75
- package/src/modules/assistantConfig/index.tsx +0 -706
- package/src/modules/assistantConfig/server.ts +0 -262
- package/src/modules/chat/Conversations/Item.tsx +0 -167
- package/src/modules/chat/Conversations/List.tsx +0 -210
- package/src/modules/chat/Conversations/groupByTime.ts +0 -39
- package/src/modules/chat/Conversations/index.tsx +0 -252
- package/src/modules/chat/ReferenceBar.tsx +0 -622
- package/src/modules/chat/constants.tsx +0 -56
- package/src/modules/chat/data.txt +0 -82
- package/src/modules/chat/index.tsx +0 -2087
- package/src/modules/chat/referenceCom/DeleteModal.tsx +0 -75
- package/src/modules/chat/referenceCom/DrawerContent.tsx +0 -136
- package/src/modules/chat/referenceCom/DrawerDatabase.tsx +0 -102
- package/src/modules/chat/referenceCom/DrawerGraphPreview.tsx +0 -86
- package/src/modules/chat/referenceCom/DrawerPreview.tsx +0 -73
- package/src/modules/chat/referenceCom/DrawerTitle.tsx +0 -26
- package/src/modules/chat/referenceCom/RenameModal.tsx +0 -86
- package/src/modules/chat/referenceCom/TagCom.tsx +0 -30
- package/src/modules/chat/style.less +0 -3
- package/src/modules/chat/types.ts +0 -17
- package/src/modules/chat/utils/index.ts +0 -348
- package/src/modules/database/CreateModal.tsx +0 -403
- package/src/modules/database/assets/Doris.png +0 -0
- package/src/modules/database/assets/PostgreSQL.png +0 -0
- package/src/modules/database/assets/SQLServer.png +0 -0
- package/src/modules/database/assets/database.svg +0 -11
- package/src/modules/database/assets/database_add.svg +0 -53
- package/src/modules/database/assets/database_connect.svg +0 -66
- package/src/modules/database/assets/database_upload.svg +0 -29
- package/src/modules/database/assets/empty.png +0 -0
- package/src/modules/database/assets/mysql.svg +0 -14
- package/src/modules/database/index.tsx +0 -477
- package/src/modules/database/server.ts +0 -196
- package/src/modules/databaseId/CustomCom.tsx +0 -156
- package/src/modules/databaseId/EditConfig.tsx +0 -280
- package/src/modules/databaseId/UploadDrawer.tsx +0 -535
- package/src/modules/databaseId/assets/aiOptimize.svg +0 -10
- package/src/modules/databaseId/assets/empty.png +0 -0
- package/src/modules/databaseId/assets/template.svg +0 -6
- package/src/modules/databaseId/assets/upload.svg +0 -9
- package/src/modules/databaseId/assets/useTemp.svg +0 -6
- package/src/modules/databaseId/index.tsx +0 -769
- package/src/modules/databaseId/server.ts +0 -286
- package/src/modules/databaseId/style.css +0 -5
- package/src/modules/databaseTable/EditRowDrawer.tsx +0 -124
- package/src/modules/databaseTable/index.tsx +0 -359
- package/src/modules/databaseTable/server.ts +0 -180
- package/src/modules/headlessChat/ReferenceBar.tsx +0 -783
- package/src/modules/headlessChat/constants.tsx +0 -32
- package/src/modules/headlessChat/index.tsx +0 -1411
- package/src/modules/headlessChat/referenceCom/DeleteModal.tsx +0 -75
- package/src/modules/headlessChat/referenceCom/DrawerContent.tsx +0 -136
- package/src/modules/headlessChat/referenceCom/DrawerDatabase.tsx +0 -102
- package/src/modules/headlessChat/referenceCom/DrawerGraphPreview.tsx +0 -86
- package/src/modules/headlessChat/referenceCom/DrawerPreview.tsx +0 -73
- package/src/modules/headlessChat/referenceCom/DrawerTitle.tsx +0 -26
- package/src/modules/headlessChat/referenceCom/RenameModal.tsx +0 -86
- package/src/modules/headlessChat/referenceCom/TagCom.tsx +0 -30
- package/src/modules/headlessChat/style.less +0 -3
- package/src/modules/headlessChat/types.ts +0 -23
- package/src/modules/headlessChat/utils/index.ts +0 -348
- package/src/modules/login/components/Login/LoginBox/index.tsx +0 -102
- package/src/modules/login/components/Login/RegisterBox/index.tsx +0 -180
- package/src/modules/login/components/Login/index.tsx +0 -100
- package/src/modules/login/index.tsx +0 -106
- package/src/modules/login/style.css +0 -3
- package/src/modules/login/useServices.ts +0 -53
- package/src/modules/login/utils.ts +0 -42
- package/src/modules/modelManage/ConfigDrawer.tsx +0 -249
- package/src/modules/modelManage/ReplaceModal.tsx +0 -124
- package/src/modules/modelManage/assets/empty.png +0 -0
- package/src/modules/modelManage/const.ts +0 -51
- package/src/modules/modelManage/index.tsx +0 -599
- package/src/modules/modelManage/server.ts +0 -223
- package/src/modules/nodegraph/index.tsx +0 -1
- package/src/modules/search/assets/Icon-history.svg +0 -8
- package/src/modules/search/assets/answerAwartar.png +0 -0
- package/src/modules/search/assets/doc.png +0 -0
- package/src/modules/search/assets/genera.gif +0 -0
- package/src/modules/search/assets/icon-robot.svg +0 -9
- package/src/modules/search/assets/icon-search-bar.svg +0 -14
- package/src/modules/search/assets/icon-sub-title.svg +0 -3
- package/src/modules/search/assets/icon-title.svg +0 -9
- package/src/modules/search/assets/icon-zoomOut.svg +0 -9
- package/src/modules/search/assets/iconAi.svg +0 -9
- package/src/modules/search/assets/pdf.png +0 -0
- package/src/modules/search/assets/ppt.png +0 -0
- package/src/modules/search/assets/search.svg +0 -3
- package/src/modules/search/assets/selected.svg +0 -4
- package/src/modules/search/assets/txt.png +0 -0
- package/src/modules/search/assets/xls.png +0 -0
- package/src/modules/search/components/AssisSelect.tsx +0 -137
- package/src/modules/search/components/Editor/ChatViewEditor.tsx +0 -261
- package/src/modules/search/components/Editor/aichat.css +0 -1
- package/src/modules/search/components/Editor/constant.ts +0 -13
- package/src/modules/search/components/Editor/index.tsx +0 -113
- package/src/modules/search/components/Editor/plugins/autofomatRules.ts +0 -332
- package/src/modules/search/components/Editor/plugins/convertImgPlugins.tsx +0 -20
- package/src/modules/search/components/Editor/plugins/createIndexes.tsx +0 -38
- package/src/modules/search/components/Editor/plugins/displayer.ts +0 -298
- package/src/modules/search/components/Editor/plugins/imageClick.tsx +0 -32
- package/src/modules/search/components/Editor/plugins/myplugin.tsx +0 -98
- package/src/modules/search/components/Editor/ui/avatar.tsx +0 -19
- package/src/modules/search/components/Editor/ui/blockquote-element.tsx +0 -21
- package/src/modules/search/components/Editor/ui/button.tsx +0 -58
- package/src/modules/search/components/Editor/ui/calendar.tsx +0 -68
- package/src/modules/search/components/Editor/ui/caption.tsx +0 -46
- package/src/modules/search/components/Editor/ui/checkbox.tsx +0 -27
- package/src/modules/search/components/Editor/ui/code-block-combobox.tsx +0 -188
- package/src/modules/search/components/Editor/ui/code-block-element.css +0 -434
- package/src/modules/search/components/Editor/ui/code-block-element.tsx +0 -39
- package/src/modules/search/components/Editor/ui/code-leaf.tsx +0 -24
- package/src/modules/search/components/Editor/ui/code-line-element.tsx +0 -10
- package/src/modules/search/components/Editor/ui/code-syntax-leaf.tsx +0 -21
- package/src/modules/search/components/Editor/ui/column-element.tsx +0 -30
- package/src/modules/search/components/Editor/ui/column-group-element.tsx +0 -94
- package/src/modules/search/components/Editor/ui/command.tsx +0 -75
- package/src/modules/search/components/Editor/ui/comment-avatar.tsx +0 -22
- package/src/modules/search/components/Editor/ui/comment-create-form.tsx +0 -37
- package/src/modules/search/components/Editor/ui/comment-item.tsx +0 -74
- package/src/modules/search/components/Editor/ui/comment-leaf.tsx +0 -49
- package/src/modules/search/components/Editor/ui/comment-more-dropdown.tsx +0 -42
- package/src/modules/search/components/Editor/ui/comment-reply-items.tsx +0 -22
- package/src/modules/search/components/Editor/ui/comment-resolve-button.tsx +0 -32
- package/src/modules/search/components/Editor/ui/comment-value.tsx +0 -34
- package/src/modules/search/components/Editor/ui/comments-popover.tsx +0 -63
- package/src/modules/search/components/Editor/ui/date-element.tsx +0 -83
- package/src/modules/search/components/Editor/ui/dialog.tsx +0 -63
- package/src/modules/search/components/Editor/ui/draggable.tsx +0 -177
- package/src/modules/search/components/Editor/ui/dropdown-menu.tsx +0 -180
- package/src/modules/search/components/Editor/ui/emoji-input-element.tsx +0 -85
- package/src/modules/search/components/Editor/ui/excalidraw-element.tsx +0 -28
- package/src/modules/search/components/Editor/ui/fixed-toolbar-buttons.tsx +0 -76
- package/src/modules/search/components/Editor/ui/fixed-toolbar.tsx +0 -8
- package/src/modules/search/components/Editor/ui/floating-toolbar-buttons.tsx +0 -51
- package/src/modules/search/components/Editor/ui/floating-toolbar.tsx +0 -77
- package/src/modules/search/components/Editor/ui/heading-element.tsx +0 -48
- package/src/modules/search/components/Editor/ui/highlight-leaf.tsx +0 -17
- package/src/modules/search/components/Editor/ui/hr-element.tsx +0 -30
- package/src/modules/search/components/Editor/ui/icons.tsx +0 -267
- package/src/modules/search/components/Editor/ui/image-element.tsx +0 -74
- package/src/modules/search/components/Editor/ui/inline-combobox.tsx +0 -368
- package/src/modules/search/components/Editor/ui/input.tsx +0 -25
- package/src/modules/search/components/Editor/ui/insert-dropdown-menu.tsx +0 -218
- package/src/modules/search/components/Editor/ui/kbd-leaf.tsx +0 -20
- package/src/modules/search/components/Editor/ui/link-element.tsx +0 -29
- package/src/modules/search/components/Editor/ui/link-floating-toolbar.tsx +0 -161
- package/src/modules/search/components/Editor/ui/list-element.tsx +0 -30
- package/src/modules/search/components/Editor/ui/mark-toolbar-button.tsx +0 -24
- package/src/modules/search/components/Editor/ui/media-embed-element.tsx +0 -133
- package/src/modules/search/components/Editor/ui/media-popover.tsx +0 -97
- package/src/modules/search/components/Editor/ui/mention-element.tsx +0 -43
- package/src/modules/search/components/Editor/ui/mention-input-element.tsx +0 -141
- package/src/modules/search/components/Editor/ui/mode-dropdown-menu.tsx +0 -93
- package/src/modules/search/components/Editor/ui/more-dropdown-menu.tsx +0 -67
- package/src/modules/search/components/Editor/ui/paragraph-element.tsx +0 -4
- package/src/modules/search/components/Editor/ui/placeholder.tsx +0 -52
- package/src/modules/search/components/Editor/ui/popover.tsx +0 -32
- package/src/modules/search/components/Editor/ui/resizable.tsx +0 -66
- package/src/modules/search/components/Editor/ui/separator.tsx +0 -25
- package/src/modules/search/components/Editor/ui/style.less +0 -12
- package/src/modules/search/components/Editor/ui/table-cell-element.tsx +0 -143
- package/src/modules/search/components/Editor/ui/table-element.tsx +0 -243
- package/src/modules/search/components/Editor/ui/table-row-element.tsx +0 -22
- package/src/modules/search/components/Editor/ui/tableValue.tsx +0 -135
- package/src/modules/search/components/Editor/ui/todo-list-element.tsx +0 -43
- package/src/modules/search/components/Editor/ui/toggle-element.tsx +0 -31
- package/src/modules/search/components/Editor/ui/toolbar.tsx +0 -157
- package/src/modules/search/components/Editor/ui/tooltip.tsx +0 -65
- package/src/modules/search/components/Editor/ui/turn-into-dropdown-menu.tsx +0 -160
- package/src/modules/search/components/Editor/ui/with-draggables.tsx +0 -175
- package/src/modules/search/components/FileList.tsx +0 -287
- package/src/modules/search/components/ImageGroupView/index.tsx +0 -85
- package/src/modules/search/components/ResultContent.tsx +0 -232
- package/src/modules/search/components/SearchInput.tsx +0 -232
- package/src/modules/search/components/SearchLanding.tsx +0 -74
- package/src/modules/search/components/SearchView.tsx +0 -563
- package/src/modules/search/components/SimpleEditor.tsx +0 -158
- package/src/modules/search/components/SimpleFileList.tsx +0 -215
- package/src/modules/search/index.tsx +0 -10
- package/src/modules/search/reademe.md +0 -1
- package/src/modules/search/servers/apis.tsx +0 -19
- package/src/modules/search/servers/index.ts +0 -184
- package/src/modules/search/style.less +0 -503
- package/src/modules/search/type.ts +0 -22
- package/src/modules/search/utils.ts +0 -34
- package/src/modules/sensitive/index.tsx +0 -313
- package/src/modules/sensitive/server.ts +0 -122
- package/src/modules/streamFilesReader/GientechStreamReader.tsx +0 -1625
- package/src/modules/streamFilesReader/components/Header/Toolbar.tsx +0 -0
- package/src/modules/streamFilesReader/components/Header/index.tsx +0 -297
- package/src/modules/streamFilesReader/index.tsx +0 -3
- package/src/style.css +0 -6
- package/src/type.d.ts +0 -0
- package/src/utils/commonFn.tsx +0 -111
- package/src/utils/decryptApiKey.ts +0 -40
- package/src/utils/gientechCommon/components/AppError.tsx +0 -32
- package/src/utils/gientechCommon/components/AppLoading.tsx +0 -75
- package/src/utils/gientechCommon/components/DeleteModal.tsx +0 -75
- package/src/utils/gientechCommon/components/DisplayError.tsx +0 -33
- package/src/utils/gientechCommon/components/DisplayLoading.tsx +0 -38
- package/src/utils/gientechCommon/components/FeedBackModal.tsx +0 -318
- package/src/utils/gientechCommon/components/FileCardCommon.tsx +0 -82
- package/src/utils/gientechCommon/components/FileManager/index.tsx +0 -390
- package/src/utils/gientechCommon/components/FileManager/style.css +0 -5
- package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +0 -581
- package/src/utils/gientechCommon/components/Messages/ReferenceCard.tsx +0 -339
- package/src/utils/gientechCommon/components/Messages/RetriveItem.tsx +0 -245
- package/src/utils/gientechCommon/components/Messages/WebRetriveItem.tsx +0 -209
- package/src/utils/gientechCommon/components/Messages/defaultBot.png +0 -0
- package/src/utils/gientechCommon/components/Messages/defaultStyleSet.tsx +0 -148
- package/src/utils/gientechCommon/components/Messages/defaultWeLogo.svg +0 -14
- package/src/utils/gientechCommon/components/RenameModal.tsx +0 -86
- package/src/utils/gientechCommon/components/style.less +0 -11
- package/src/utils/gientechCommon/configs/commonConfig.ts +0 -2
- package/src/utils/gientechCommon/configs/senderConfig.ts +0 -0
- package/src/utils/gientechCommon/configs/stylesConfig.ts +0 -142
- package/src/utils/gientechCommon/hooks/AichatUseController.tsx +0 -417
- package/src/utils/gientechCommon/slate/converters/deserializers.ts +0 -763
- package/src/utils/gientechCommon/slate/converters/mockData.ts +0 -232
- package/src/utils/gientechCommon/slate/converters/slateConverters.ts +0 -258
- package/src/utils/gientechCommon/slate/richElements/index.tsx +0 -499
- package/src/utils/gientechCommon/utils/request.ts +0 -37
- package/src/utils/gientechCommon/utils/serverFn.ts +0 -172
- package/src/utils/index.tsx +0 -132
- package/src/utils/testconfigs/demologin/index.tsx +0 -32
- package/src/utils/testconfigs/index.ts +0 -59
- package/src/vite-env.d.ts +0 -11
- package/stats.html +0 -4949
- package/tailwind.config.js +0 -170
- package/tsconfig.app.json +0 -30
- package/tsconfig.app.tsbuildinfo +0 -11
- package/tsconfig.json +0 -13
- package/tsconfig.node.json +0 -22
- package/tsconfig.node.tsbuildinfo +0 -1
- package/vite.config.app.ts +0 -93
- package/vite.config.ts +0 -231
- package/workflows/release.yml +0 -60
- package//346/215/242/350/241/214/346/240/274/345/274/217/344/277/235/346/214/201/344/274/230/345/214/226/346/226/271/346/241/210.md +0 -359
- /package/{dist/assets → assets}/Doris.png +0 -0
- /package/{dist/assets → assets}/GientechStreamReader-DydY9Vu3.js +0 -0
- /package/{dist/assets → assets}/PostgreSQL.png +0 -0
- /package/{dist/assets → assets}/SQLServer.png +0 -0
- /package/{dist/assets → assets}/database.svg +0 -0
- /package/{dist/assets → assets}/database_add.svg +0 -0
- /package/{dist/assets → assets}/database_connect.svg +0 -0
- /package/{dist/assets → assets}/database_upload.svg +0 -0
- /package/{dist/assets → assets}/databse.svg +0 -0
- /package/{dist/assets → assets}/defaultWeLogo.svg +0 -0
- /package/{dist/assets → assets}/empty.png +0 -0
- /package/{dist/assets → assets}/graph.svg +0 -0
- /package/{dist/assets → assets}/homeBg.png +0 -0
- /package/{dist/assets → assets}/index-4Ac00q5P.js +0 -0
- /package/{dist/assets → assets}/index-7FYeBShT.js +0 -0
- /package/{dist/assets → assets}/index-B2rczyCX.js +0 -0
- /package/{dist/assets → assets}/index-CQMGllKT.js +0 -0
- /package/{dist/assets → assets}/index-CpW6Dhpp.js +0 -0
- /package/{dist/assets → assets}/index-CwGOSlVC.js +0 -0
- /package/{dist/assets → assets}/index-DBPtDW8Y.js +0 -0
- /package/{dist/assets → assets}/index-DJPAws60.js +0 -0
- /package/{dist/assets → assets}/index-antI2hFx.js +0 -0
- /package/{dist/assets → assets}/index-q0nZjKAG.js +0 -0
- /package/{dist/assets → assets}/index-rkRJ-e_U.js +0 -0
- /package/{dist/assets → assets}/knowledge.svg +0 -0
- /package/{dist/assets → assets}/left.jpg +0 -0
- /package/{dist/assets → assets}/logoImg.png +0 -0
- /package/{dist/assets → assets}/mysql.svg +0 -0
- /package/{dist/assets → assets}/plus-qlmqrjBc.js +0 -0
- /package/{dist/assets → assets}/sensitive.svg +0 -0
- /package/{dist/assets → assets}/style-BeYL_E4J.js +0 -0
- /package/{dist/assets → assets}/style.css +0 -0
- /package/{dist/assets → assets}/style2.css +0 -0
- /package/{dist/assets → assets}/style3.css +0 -0
- /package/{dist/assets → assets}/style4.css +0 -0
- /package/{dist/assets → assets}/worker-BbpylX7l.js +0 -0
- /package/{dist/assets → assets}/x-DxuhxSb6.js +0 -0
- /package/{dist/assistantConfig.d.ts → assistantConfig.d.ts} +0 -0
- /package/{dist/assistantConfig.js → assistantConfig.js} +0 -0
- /package/{dist/chat.d.ts → chat.d.ts} +0 -0
- /package/{dist/chat.js → chat.js} +0 -0
- /package/{dist/database.d.ts → database.d.ts} +0 -0
- /package/{dist/database.js → database.js} +0 -0
- /package/{dist/databaseId.d.ts → databaseId.d.ts} +0 -0
- /package/{dist/databaseId.js → databaseId.js} +0 -0
- /package/{dist/databaseTable.d.ts → databaseTable.d.ts} +0 -0
- /package/{dist/databaseTable.js → databaseTable.js} +0 -0
- /package/{dist/icons → icons}/answerAwartar.png +0 -0
- /package/{dist/icons → icons}/docx-file.png +0 -0
- /package/{dist/icons → icons}/folder.png +0 -0
- /package/{dist/icons → icons}/html.png +0 -0
- /package/{dist/icons → icons}/image.png +0 -0
- /package/{dist/icons → icons}/jpg-file.png +0 -0
- /package/{dist/icons → icons}/json.png +0 -0
- /package/{dist/icons → icons}/md.png +0 -0
- /package/{dist/icons → icons}/pdf.png +0 -0
- /package/{dist/icons → icons}/pptx.png +0 -0
- /package/{dist/icons → icons}/questionAwartar.png +0 -0
- /package/{dist/icons → icons}/sheets.png +0 -0
- /package/{dist/icons → icons}/txt.png +0 -0
- /package/{dist/icons → icons}/xlsx.png +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/modelManage.d.ts → modelManage.d.ts} +0 -0
- /package/{dist/modelManage.js → modelManage.js} +0 -0
- /package/{dist/sensitive.d.ts → sensitive.d.ts} +0 -0
- /package/{dist/sensitive.js → sensitive.js} +0 -0
- /package/{dist/streamFilesReader.d.ts → streamFilesReader.d.ts} +0 -0
- /package/{dist/streamFilesReader.js → streamFilesReader.js} +0 -0
- /package/{dist/vite.svg → vite.svg} +0 -0
- /package/{dist/worker → worker}/pdf.worker.min.js +0 -0
|
@@ -1,706 +0,0 @@
|
|
|
1
|
-
import React, { useState, useMemo, useEffect, useRef } from 'react';
|
|
2
|
-
import { Form, Input, Select, Checkbox, Switch, Row, Col, message, Button } from 'antd';
|
|
3
|
-
import { ArrowLeft } from 'lucide-react';
|
|
4
|
-
import Paragraph from './components/Paragraph';
|
|
5
|
-
import NotFoundContent from './components/NotFoundContent';
|
|
6
|
-
import { Styles } from '@mxmweb/zui';
|
|
7
|
-
import { CustomComponents } from '@mxmweb/xviewer';
|
|
8
|
-
import {
|
|
9
|
-
EXPLANATION_PROMPT,
|
|
10
|
-
EXPLANATION_DEPENDON_KB,
|
|
11
|
-
DEFAULT_PROMPT,
|
|
12
|
-
SearchPolicyOptions,
|
|
13
|
-
ASSISTANT_MIN_MAX,
|
|
14
|
-
ASSISTANT_DEFAULT,
|
|
15
|
-
TraceabilityStrategy,
|
|
16
|
-
DEFAULT_ANSWER,
|
|
17
|
-
} from './constants';
|
|
18
|
-
import AxiosInstance from './server';
|
|
19
|
-
import SensitiveSection from './components/Sensitive';
|
|
20
|
-
import KnowledgeSection from './components/Knowledge';
|
|
21
|
-
import DatabaseSection from './components/Database';
|
|
22
|
-
import GraphSection from './components/Graph';
|
|
23
|
-
import ParamsItem from './components/ParamsItem';
|
|
24
|
-
|
|
25
|
-
import '@mxmweb/zui/style.css';
|
|
26
|
-
|
|
27
|
-
const { Item } = Form;
|
|
28
|
-
|
|
29
|
-
interface ConversationAssistantProps {
|
|
30
|
-
url?: string;
|
|
31
|
-
token?: string;
|
|
32
|
-
role?: string;
|
|
33
|
-
id?: string;
|
|
34
|
-
showDatabase: boolean;
|
|
35
|
-
showGraph: boolean;
|
|
36
|
-
isShare?: boolean;
|
|
37
|
-
styles?: Styles;
|
|
38
|
-
disabled?: boolean;
|
|
39
|
-
CustomComponents?: CustomComponents;
|
|
40
|
-
eventsEmit?: (name: string, data?: any) => void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const ConversationAssistant: React.FC<ConversationAssistantProps> = ({
|
|
44
|
-
url,
|
|
45
|
-
token,
|
|
46
|
-
role,
|
|
47
|
-
id,
|
|
48
|
-
showDatabase,
|
|
49
|
-
showGraph,
|
|
50
|
-
isShare,
|
|
51
|
-
disabled, //查看时,不可修改
|
|
52
|
-
eventsEmit,
|
|
53
|
-
CustomComponents,
|
|
54
|
-
}) => {
|
|
55
|
-
const { ContentLoading } = CustomComponents;
|
|
56
|
-
const [form] = Form.useForm();
|
|
57
|
-
const [configData, setConfigData]: any = useState();
|
|
58
|
-
const [modelList, setModelList]: any = useState();
|
|
59
|
-
const [rerankOptions, setRerankOptions]: any = useState();
|
|
60
|
-
const [multiModelOptions, setMultiModalOptions]: any = useState();
|
|
61
|
-
const [loading, setLoading] = useState(true);
|
|
62
|
-
const [btnLoading, seBtntLoading] = useState(false);
|
|
63
|
-
const [configScale, setConfigScale] = useState(ASSISTANT_MIN_MAX);
|
|
64
|
-
|
|
65
|
-
const resourceBindData = useRef<{
|
|
66
|
-
knowledge_base_name?: string;
|
|
67
|
-
knowledge_base_name_source?: string;
|
|
68
|
-
selectedKnowledgeBase?: any[];
|
|
69
|
-
sensitiveWordIds?: string;
|
|
70
|
-
database_name?: any[];
|
|
71
|
-
graph_nb_name?: any[];
|
|
72
|
-
}>({}); //存储资源绑定里选择的数据
|
|
73
|
-
|
|
74
|
-
const {
|
|
75
|
-
getConfigById,
|
|
76
|
-
fetchModels,
|
|
77
|
-
fetchConfigItemLimit,
|
|
78
|
-
checkName,
|
|
79
|
-
addConversationAssistant,
|
|
80
|
-
updateConversationAssistant,
|
|
81
|
-
} = AxiosInstance({
|
|
82
|
-
url,
|
|
83
|
-
token,
|
|
84
|
-
role,
|
|
85
|
-
eventsEmit,
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
init();
|
|
90
|
-
}, [id]);
|
|
91
|
-
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
if (id) {
|
|
94
|
-
//编辑的话,只有模型列表返回为空才需要校验
|
|
95
|
-
if (Array.isArray(modelList) && Array.isArray(rerankOptions)) {
|
|
96
|
-
form.validateFields([
|
|
97
|
-
'model_name',
|
|
98
|
-
'plan_model_name',
|
|
99
|
-
'recommend_model_name',
|
|
100
|
-
'rerank_model_name',
|
|
101
|
-
'multi_model_name',
|
|
102
|
-
]);
|
|
103
|
-
}
|
|
104
|
-
if (Array.isArray(multiModelOptions)) {
|
|
105
|
-
form.validateFields(['multi_model_name']);
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
//新增的话,只有模型列表返回为空才需要校验
|
|
109
|
-
if (Array.isArray(modelList) && modelList?.length == 0) {
|
|
110
|
-
form.validateFields(['model_name', 'plan_model_name', 'recommend_model_name']);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (Array.isArray(rerankOptions) && rerankOptions?.length == 0) {
|
|
114
|
-
form.validateFields(['rerank_model_name']);
|
|
115
|
-
}
|
|
116
|
-
if (Array.isArray(multiModelOptions) && multiModelOptions?.length == 0) {
|
|
117
|
-
form.validateFields(['multi_model_name']);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}, [rerankOptions, modelList, multiModelOptions, id]);
|
|
121
|
-
|
|
122
|
-
// 初始化数据
|
|
123
|
-
const init = async () => {
|
|
124
|
-
let _configData;
|
|
125
|
-
if (id) {
|
|
126
|
-
if (!loading) setLoading(true);
|
|
127
|
-
try {
|
|
128
|
-
const res = await getConfigById(id);
|
|
129
|
-
if (res) {
|
|
130
|
-
const { configJson, ...rest } = res;
|
|
131
|
-
const config = configJson && JSON.parse(configJson);
|
|
132
|
-
const {
|
|
133
|
-
knowledge_base_name,
|
|
134
|
-
knowledge_base_name_source,
|
|
135
|
-
selectedKnowledgeBase,
|
|
136
|
-
sensitiveWordIds,
|
|
137
|
-
database_name,
|
|
138
|
-
graph_nb_name,
|
|
139
|
-
} = config;
|
|
140
|
-
_configData = {
|
|
141
|
-
...rest,
|
|
142
|
-
...config,
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
resourceBindData.current = {
|
|
146
|
-
knowledge_base_name,
|
|
147
|
-
knowledge_base_name_source,
|
|
148
|
-
selectedKnowledgeBase,
|
|
149
|
-
sensitiveWordIds,
|
|
150
|
-
database_name,
|
|
151
|
-
graph_nb_name,
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
setConfigData(_configData);
|
|
155
|
-
console.log('_configData--->', _configData);
|
|
156
|
-
|
|
157
|
-
form.setFieldsValue(_configData);
|
|
158
|
-
setLoading(false);
|
|
159
|
-
}
|
|
160
|
-
} catch (e) {}
|
|
161
|
-
} else {
|
|
162
|
-
setLoading(false);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
await fetchList(_configData);
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const fetchList = async (configData?: any) => {
|
|
169
|
-
try {
|
|
170
|
-
const [modelRes, recallModelRes, multiModelRes, configItemLimitRes] =
|
|
171
|
-
await Promise.allSettled([
|
|
172
|
-
fetchModels({
|
|
173
|
-
pageNum: 1,
|
|
174
|
-
pageSize: 9999,
|
|
175
|
-
status: 1,
|
|
176
|
-
type: 1,
|
|
177
|
-
}),
|
|
178
|
-
fetchModels({
|
|
179
|
-
pageNum: 1,
|
|
180
|
-
pageSize: 9999,
|
|
181
|
-
status: 1,
|
|
182
|
-
type: 3,
|
|
183
|
-
}),
|
|
184
|
-
fetchModels({
|
|
185
|
-
pageNum: 1,
|
|
186
|
-
pageSize: 9999,
|
|
187
|
-
status: 1,
|
|
188
|
-
type: 4,
|
|
189
|
-
}),
|
|
190
|
-
fetchConfigItemLimit(),
|
|
191
|
-
]);
|
|
192
|
-
if (modelRes.status === 'fulfilled' && modelRes.value) {
|
|
193
|
-
const list = modelRes.value?.records || [];
|
|
194
|
-
const options = list.map((item: any) => ({
|
|
195
|
-
...item,
|
|
196
|
-
label: item.modelName,
|
|
197
|
-
value: item.modelName,
|
|
198
|
-
}));
|
|
199
|
-
setModelList(options);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (recallModelRes.status === 'fulfilled' && recallModelRes.value) {
|
|
203
|
-
const options = (recallModelRes.value?.records || []).map((item: any) => ({
|
|
204
|
-
label: item.modelName || item.name,
|
|
205
|
-
value: item.modelName || item.name,
|
|
206
|
-
}));
|
|
207
|
-
setRerankOptions(options);
|
|
208
|
-
if (options.length > 0) {
|
|
209
|
-
!configData?.rerank_model_name &&
|
|
210
|
-
form.setFieldsValue({ rerank_model_name: options[0].value });
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (multiModelRes.status === 'fulfilled' && multiModelRes.value) {
|
|
214
|
-
const options = (multiModelRes.value?.records || []).map((item: any) => ({
|
|
215
|
-
label: item.modelName || item.name,
|
|
216
|
-
value: item.modelName || item.name,
|
|
217
|
-
}));
|
|
218
|
-
setMultiModalOptions(options);
|
|
219
|
-
if (options.length > 0) {
|
|
220
|
-
!configData?.multi_model_name &&
|
|
221
|
-
form.setFieldsValue({ multi_model_name: options[0].value });
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
if (configItemLimitRes.status === 'fulfilled' && configItemLimitRes.value) {
|
|
225
|
-
if (configItemLimitRes.value) {
|
|
226
|
-
const config = configItemLimitRes.value;
|
|
227
|
-
|
|
228
|
-
Object.keys(ASSISTANT_MIN_MAX).forEach(key => {
|
|
229
|
-
if (config.hasOwnProperty(key)) {
|
|
230
|
-
const { max, min } = config[key];
|
|
231
|
-
ASSISTANT_MIN_MAX[key] = {
|
|
232
|
-
...ASSISTANT_MIN_MAX[key],
|
|
233
|
-
min,
|
|
234
|
-
max,
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
setConfigScale(ASSISTANT_MIN_MAX);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
} catch (e) {
|
|
242
|
-
console.error('获取列表失败:', e);
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const checkConfigName = async (_, value: any) => {
|
|
247
|
-
const res = await checkName(value, id);
|
|
248
|
-
if (res) {
|
|
249
|
-
message.warning('名称重复!', 2);
|
|
250
|
-
return Promise.reject('名称重复');
|
|
251
|
-
}
|
|
252
|
-
return Promise.resolve();
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
const validateModel = (options: any[], msg: string) => ({
|
|
256
|
-
validator(_: any, value: any) {
|
|
257
|
-
if (!value) {
|
|
258
|
-
if (Array.isArray(options) && options.length === 0) {
|
|
259
|
-
return Promise.reject('暂无可用模型,请联系管理员');
|
|
260
|
-
} else {
|
|
261
|
-
return Promise.reject(msg);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
if (
|
|
265
|
-
(Array.isArray(options) && options.length === 0) ||
|
|
266
|
-
!options.find((m: any) => m.value == value)
|
|
267
|
-
) {
|
|
268
|
-
return Promise.reject('模型无法使用,请联系管理员');
|
|
269
|
-
}
|
|
270
|
-
return Promise.resolve();
|
|
271
|
-
},
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
const handleEventsEmit = (name: string, data?: any) => {
|
|
275
|
-
console.log('++++助手配置', name, data);
|
|
276
|
-
switch (name) {
|
|
277
|
-
case 'knowledge_selected':
|
|
278
|
-
resourceBindData.current = {
|
|
279
|
-
...resourceBindData.current,
|
|
280
|
-
...data,
|
|
281
|
-
};
|
|
282
|
-
break;
|
|
283
|
-
case 'sensitive_selected':
|
|
284
|
-
resourceBindData.current = {
|
|
285
|
-
...resourceBindData.current,
|
|
286
|
-
sensitiveWordIds: data,
|
|
287
|
-
};
|
|
288
|
-
break;
|
|
289
|
-
case 'database_selected':
|
|
290
|
-
resourceBindData.current = {
|
|
291
|
-
...resourceBindData.current,
|
|
292
|
-
database_name: data,
|
|
293
|
-
};
|
|
294
|
-
break;
|
|
295
|
-
case 'graph_selected':
|
|
296
|
-
resourceBindData.current = {
|
|
297
|
-
...resourceBindData.current,
|
|
298
|
-
graph_nb_name: data,
|
|
299
|
-
};
|
|
300
|
-
break;
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
const handleSubmit = async () => {
|
|
305
|
-
let params = {};
|
|
306
|
-
try {
|
|
307
|
-
seBtntLoading(true);
|
|
308
|
-
const data = await form.validateFields();
|
|
309
|
-
const {
|
|
310
|
-
knowledge_base_name,
|
|
311
|
-
knowledge_base_name_source,
|
|
312
|
-
selectedKnowledgeBase,
|
|
313
|
-
sensitiveWordIds,
|
|
314
|
-
database_name,
|
|
315
|
-
graph_nb_name,
|
|
316
|
-
} = resourceBindData.current;
|
|
317
|
-
|
|
318
|
-
data.thinking =
|
|
319
|
-
(modelList.find((item: any) => item.modelName == data.model_name) as any)?.thinking ||
|
|
320
|
-
false;
|
|
321
|
-
|
|
322
|
-
const configJson = JSON.stringify({
|
|
323
|
-
...data,
|
|
324
|
-
knowledge_base_name,
|
|
325
|
-
knowledge_base_name_source,
|
|
326
|
-
selectedKnowledgeBase,
|
|
327
|
-
sensitiveWordIds,
|
|
328
|
-
...(showDatabase ? { database_name } : {}),
|
|
329
|
-
...(showGraph ? { graph_nb_name } : {}),
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
params = {
|
|
333
|
-
configJson,
|
|
334
|
-
name: data.config_name,
|
|
335
|
-
isDefault: data.isDefault,
|
|
336
|
-
defaultAnswer: data.defaultAnswer,
|
|
337
|
-
dependOnKb: data.dependOnKb,
|
|
338
|
-
sensitiveWordIds: sensitiveWordIds,
|
|
339
|
-
};
|
|
340
|
-
if (id) {
|
|
341
|
-
const res = await updateConversationAssistant(id, params);
|
|
342
|
-
if (res) {
|
|
343
|
-
message.success('更新助手配置成功');
|
|
344
|
-
eventsEmit && eventsEmit('go_back');
|
|
345
|
-
}
|
|
346
|
-
} else {
|
|
347
|
-
const res = await addConversationAssistant(params);
|
|
348
|
-
if (res) {
|
|
349
|
-
message.success('新增助手配置成功');
|
|
350
|
-
eventsEmit && eventsEmit('go_back');
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
} catch (e) {
|
|
354
|
-
console.error('submit error', e);
|
|
355
|
-
} finally {
|
|
356
|
-
seBtntLoading(false);
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
const formInitialValue = useMemo(() => {
|
|
361
|
-
// 获取 检索与生成参数(ASSISTANT_MIN_MAX) 和 功能开关的初始值(ASSISTANT_DEFAULT)
|
|
362
|
-
const _default: any = {};
|
|
363
|
-
Object.keys(ASSISTANT_MIN_MAX).forEach(key => {
|
|
364
|
-
_default[key] = ASSISTANT_MIN_MAX[key]?.default;
|
|
365
|
-
});
|
|
366
|
-
return {
|
|
367
|
-
...ASSISTANT_DEFAULT,
|
|
368
|
-
..._default,
|
|
369
|
-
};
|
|
370
|
-
}, []);
|
|
371
|
-
|
|
372
|
-
return (
|
|
373
|
-
<div
|
|
374
|
-
style={{
|
|
375
|
-
height: '100%',
|
|
376
|
-
width: '100%',
|
|
377
|
-
}}
|
|
378
|
-
>
|
|
379
|
-
<div
|
|
380
|
-
className="flex items-center justify-between"
|
|
381
|
-
style={{
|
|
382
|
-
width: '100%',
|
|
383
|
-
padding: '4px 10px 16px 10px',
|
|
384
|
-
}}
|
|
385
|
-
>
|
|
386
|
-
<div className="flex items-center">
|
|
387
|
-
<ArrowLeft color="#2468F2" onClick={() => eventsEmit && eventsEmit('go_back')} />
|
|
388
|
-
<div
|
|
389
|
-
className="text-[16px] text-[#1D2129] bold"
|
|
390
|
-
style={{
|
|
391
|
-
marginLeft: 20,
|
|
392
|
-
}}
|
|
393
|
-
>
|
|
394
|
-
{id ? '编辑会话助手' : '新建会话助手'}
|
|
395
|
-
</div>
|
|
396
|
-
</div>
|
|
397
|
-
{!loading && (
|
|
398
|
-
<Button
|
|
399
|
-
type="primary"
|
|
400
|
-
onClick={() => handleSubmit()}
|
|
401
|
-
loading={btnLoading}
|
|
402
|
-
disabled={disabled}
|
|
403
|
-
// style={{
|
|
404
|
-
// backgroundColor: '#055aff',
|
|
405
|
-
// }}
|
|
406
|
-
>
|
|
407
|
-
确定
|
|
408
|
-
</Button>
|
|
409
|
-
)}
|
|
410
|
-
</div>
|
|
411
|
-
|
|
412
|
-
{loading || false ? (
|
|
413
|
-
ContentLoading && <ContentLoading />
|
|
414
|
-
) : (
|
|
415
|
-
<Form
|
|
416
|
-
style={{
|
|
417
|
-
padding: 20,
|
|
418
|
-
height: 'calc(100vh - 150px)',
|
|
419
|
-
backgroundColor: '#fff',
|
|
420
|
-
}}
|
|
421
|
-
form={form}
|
|
422
|
-
layout="vertical"
|
|
423
|
-
initialValues={formInitialValue}
|
|
424
|
-
disabled={disabled}
|
|
425
|
-
colon={false}
|
|
426
|
-
>
|
|
427
|
-
<Row
|
|
428
|
-
gutter={24}
|
|
429
|
-
style={{
|
|
430
|
-
height: '100%',
|
|
431
|
-
}}
|
|
432
|
-
>
|
|
433
|
-
<Col
|
|
434
|
-
span={12}
|
|
435
|
-
style={{
|
|
436
|
-
borderRight: '1px solid #E5E6EB',
|
|
437
|
-
padding: '10px 32px',
|
|
438
|
-
height: '100%',
|
|
439
|
-
overflowY: 'auto',
|
|
440
|
-
}}
|
|
441
|
-
>
|
|
442
|
-
<Item
|
|
443
|
-
label="助手名称"
|
|
444
|
-
name="config_name"
|
|
445
|
-
validateTrigger="onBlur"
|
|
446
|
-
rules={[
|
|
447
|
-
{ required: true, message: '请输入助手名称' },
|
|
448
|
-
{
|
|
449
|
-
validator: checkConfigName,
|
|
450
|
-
},
|
|
451
|
-
]}
|
|
452
|
-
>
|
|
453
|
-
<Input placeholder="请输入" />
|
|
454
|
-
</Item>
|
|
455
|
-
|
|
456
|
-
<Row gutter={16}>
|
|
457
|
-
<Col span={12}>
|
|
458
|
-
<Item
|
|
459
|
-
label="问答模型"
|
|
460
|
-
name="model_name"
|
|
461
|
-
rules={[
|
|
462
|
-
{ required: true, message: '' },
|
|
463
|
-
validateModel(modelList, '请选择问答模型'),
|
|
464
|
-
]}
|
|
465
|
-
>
|
|
466
|
-
<Select
|
|
467
|
-
placeholder="请选择"
|
|
468
|
-
options={modelList}
|
|
469
|
-
notFoundContent={<NotFoundContent />}
|
|
470
|
-
/>
|
|
471
|
-
</Item>
|
|
472
|
-
</Col>
|
|
473
|
-
<Col span={12}>
|
|
474
|
-
<Item
|
|
475
|
-
label="规划模型"
|
|
476
|
-
name="plan_model_name"
|
|
477
|
-
rules={[
|
|
478
|
-
{ required: true, message: '' },
|
|
479
|
-
validateModel(modelList, '请选择规划模型'),
|
|
480
|
-
]}
|
|
481
|
-
>
|
|
482
|
-
<Select
|
|
483
|
-
placeholder="请选择"
|
|
484
|
-
options={modelList}
|
|
485
|
-
notFoundContent={<NotFoundContent />}
|
|
486
|
-
/>
|
|
487
|
-
</Item>
|
|
488
|
-
</Col>
|
|
489
|
-
</Row>
|
|
490
|
-
<Row gutter={16}>
|
|
491
|
-
<Col span={12}>
|
|
492
|
-
<Item
|
|
493
|
-
label="上传文档问答多模态模型"
|
|
494
|
-
name="multi_model_name"
|
|
495
|
-
rules={[
|
|
496
|
-
{ required: true, message: '' },
|
|
497
|
-
validateModel(multiModelOptions, '请选择上传文档问答多模态模型模型'),
|
|
498
|
-
]}
|
|
499
|
-
>
|
|
500
|
-
<Select
|
|
501
|
-
placeholder="请选择"
|
|
502
|
-
options={multiModelOptions}
|
|
503
|
-
notFoundContent={<NotFoundContent />}
|
|
504
|
-
/>
|
|
505
|
-
</Item>
|
|
506
|
-
</Col>
|
|
507
|
-
<Col span={12}>
|
|
508
|
-
<Item
|
|
509
|
-
label="Rerank模型"
|
|
510
|
-
name="rerank_model_name"
|
|
511
|
-
rules={[
|
|
512
|
-
{ required: true, message: '' },
|
|
513
|
-
validateModel(rerankOptions, '请选择Rerank模型'),
|
|
514
|
-
]}
|
|
515
|
-
>
|
|
516
|
-
<Select
|
|
517
|
-
placeholder="请选择"
|
|
518
|
-
options={rerankOptions}
|
|
519
|
-
notFoundContent={<NotFoundContent />}
|
|
520
|
-
/>
|
|
521
|
-
</Item>
|
|
522
|
-
</Col>
|
|
523
|
-
</Row>
|
|
524
|
-
|
|
525
|
-
<Item label="开场白" name="prologue">
|
|
526
|
-
<Input.TextArea
|
|
527
|
-
maxLength={50}
|
|
528
|
-
showCount
|
|
529
|
-
placeholder="请输入开场白"
|
|
530
|
-
autoSize={{ minRows: 2 }}
|
|
531
|
-
/>
|
|
532
|
-
</Item>
|
|
533
|
-
|
|
534
|
-
<Item label="提示词" name="system_prompt" tooltip={EXPLANATION_PROMPT}>
|
|
535
|
-
<Input.TextArea
|
|
536
|
-
showCount
|
|
537
|
-
rows={8}
|
|
538
|
-
maxLength={3000}
|
|
539
|
-
autoSize={{ minRows: 10 }}
|
|
540
|
-
placeholder={`例如:${DEFAULT_PROMPT}`}
|
|
541
|
-
/>
|
|
542
|
-
</Item>
|
|
543
|
-
|
|
544
|
-
<Item
|
|
545
|
-
name="isDefault"
|
|
546
|
-
valuePropName="checked"
|
|
547
|
-
normalize={value => (value === true ? 1 : 0)}
|
|
548
|
-
>
|
|
549
|
-
<Checkbox>选择为默认助手</Checkbox>
|
|
550
|
-
</Item>
|
|
551
|
-
</Col>
|
|
552
|
-
<Col
|
|
553
|
-
span={12}
|
|
554
|
-
style={{
|
|
555
|
-
height: '100%',
|
|
556
|
-
padding: '10px 32px',
|
|
557
|
-
overflowY: 'auto',
|
|
558
|
-
}}
|
|
559
|
-
>
|
|
560
|
-
<Paragraph title="检索与生成参数">
|
|
561
|
-
<Item
|
|
562
|
-
label="问题推荐模型"
|
|
563
|
-
name="recommend_model_name"
|
|
564
|
-
rules={[
|
|
565
|
-
{ required: true, message: '' },
|
|
566
|
-
validateModel(modelList, '请选择问题推荐模型'),
|
|
567
|
-
]}
|
|
568
|
-
>
|
|
569
|
-
<Select
|
|
570
|
-
placeholder="请选择"
|
|
571
|
-
options={modelList}
|
|
572
|
-
notFoundContent={<NotFoundContent />}
|
|
573
|
-
/>
|
|
574
|
-
</Item>
|
|
575
|
-
|
|
576
|
-
<Item label="检索策略" name="search_policy">
|
|
577
|
-
<Select options={SearchPolicyOptions} placeholder="请选择" />
|
|
578
|
-
</Item>
|
|
579
|
-
|
|
580
|
-
<Row gutter={16}>
|
|
581
|
-
<ParamsItem label="温度" name="temperature" configScale={configScale} />
|
|
582
|
-
<ParamsItem label="多样性" name="top_p" configScale={configScale} />
|
|
583
|
-
</Row>
|
|
584
|
-
|
|
585
|
-
<Row gutter={16}>
|
|
586
|
-
<ParamsItem label="召回数" name="top_k" configScale={configScale} />
|
|
587
|
-
<ParamsItem label="相似度阈值" name="score_threshold" configScale={configScale} />
|
|
588
|
-
</Row>
|
|
589
|
-
<Row gutter={16}>
|
|
590
|
-
<ParamsItem label="最大令牌数" name="max_tokens" configScale={configScale} />
|
|
591
|
-
<ParamsItem label="上下文最大轮数" name="max_round" configScale={configScale} />
|
|
592
|
-
</Row>
|
|
593
|
-
</Paragraph>
|
|
594
|
-
<Paragraph title="功能开关">
|
|
595
|
-
<Item
|
|
596
|
-
label="开启FAQ优先"
|
|
597
|
-
name="enabled_faq"
|
|
598
|
-
valuePropName="checked"
|
|
599
|
-
layout="horizontal"
|
|
600
|
-
>
|
|
601
|
-
<Switch />
|
|
602
|
-
</Item>
|
|
603
|
-
{/* <Item
|
|
604
|
-
label="启用图谱增强"
|
|
605
|
-
name="enabled_graph"
|
|
606
|
-
valuePropName="checked"
|
|
607
|
-
layout="horizontal"
|
|
608
|
-
>
|
|
609
|
-
<Switch />
|
|
610
|
-
</Item> */}
|
|
611
|
-
<Item
|
|
612
|
-
label="开启强企业知识依赖"
|
|
613
|
-
name="dependOnKb"
|
|
614
|
-
valuePropName="checked"
|
|
615
|
-
layout="horizontal"
|
|
616
|
-
tooltip={EXPLANATION_DEPENDON_KB}
|
|
617
|
-
normalize={value => (value === true ? 1 : 0)}
|
|
618
|
-
>
|
|
619
|
-
<Switch />
|
|
620
|
-
</Item>
|
|
621
|
-
<Item
|
|
622
|
-
label="开启问题改写"
|
|
623
|
-
name="enabled_question_rewrite"
|
|
624
|
-
valuePropName="checked"
|
|
625
|
-
layout="horizontal"
|
|
626
|
-
>
|
|
627
|
-
<Switch />
|
|
628
|
-
</Item>
|
|
629
|
-
<Item
|
|
630
|
-
label="开启溯源"
|
|
631
|
-
name="need_trace_source"
|
|
632
|
-
valuePropName="checked"
|
|
633
|
-
layout="horizontal"
|
|
634
|
-
>
|
|
635
|
-
<Switch />
|
|
636
|
-
</Item>
|
|
637
|
-
<Item
|
|
638
|
-
noStyle
|
|
639
|
-
shouldUpdate={(prev, cur) => prev.need_trace_source !== cur.need_trace_source}
|
|
640
|
-
>
|
|
641
|
-
{({ getFieldValue }) =>
|
|
642
|
-
getFieldValue('need_trace_source') ? (
|
|
643
|
-
<>
|
|
644
|
-
<Item label="溯源策略" name="trace_by_llm" layout="horizontal">
|
|
645
|
-
<Select placeholder="请选择" options={TraceabilityStrategy} />
|
|
646
|
-
</Item>
|
|
647
|
-
<Item name="is_download" valuePropName="checked" layout="horizontal">
|
|
648
|
-
<Checkbox>允许下载溯源文件</Checkbox>
|
|
649
|
-
</Item>
|
|
650
|
-
</>
|
|
651
|
-
) : null
|
|
652
|
-
}
|
|
653
|
-
</Item>
|
|
654
|
-
</Paragraph>
|
|
655
|
-
<Paragraph title="资源绑定">
|
|
656
|
-
<SensitiveSection
|
|
657
|
-
url={url}
|
|
658
|
-
token={token}
|
|
659
|
-
role={role}
|
|
660
|
-
sectionData={configData?.sensitiveWordIds}
|
|
661
|
-
eventsEmit={handleEventsEmit}
|
|
662
|
-
defaultAnswer={configData?.defaultAnswer}
|
|
663
|
-
form={form}
|
|
664
|
-
/>
|
|
665
|
-
<KnowledgeSection
|
|
666
|
-
url={url}
|
|
667
|
-
token={token}
|
|
668
|
-
role={role}
|
|
669
|
-
sectionData={{
|
|
670
|
-
knowledge_base_name: configData?.knowledge_base_name,
|
|
671
|
-
knowledge_base_name_source: configData?.knowledge_base_name_source,
|
|
672
|
-
selectedKnowledgeBase: configData?.selectedKnowledgeBase,
|
|
673
|
-
}}
|
|
674
|
-
createBy={isShare ? configData?.createBy : undefined}
|
|
675
|
-
eventsEmit={handleEventsEmit}
|
|
676
|
-
/>
|
|
677
|
-
|
|
678
|
-
{showDatabase && (
|
|
679
|
-
<DatabaseSection
|
|
680
|
-
url={url}
|
|
681
|
-
token={token}
|
|
682
|
-
role={role}
|
|
683
|
-
disabled={disabled}
|
|
684
|
-
sectionData={configData?.database_name}
|
|
685
|
-
eventsEmit={handleEventsEmit}
|
|
686
|
-
/>
|
|
687
|
-
)}
|
|
688
|
-
{showGraph && (
|
|
689
|
-
<GraphSection
|
|
690
|
-
url={url}
|
|
691
|
-
token={token}
|
|
692
|
-
role={role}
|
|
693
|
-
sectionData={configData?.graph_nb_name}
|
|
694
|
-
eventsEmit={handleEventsEmit}
|
|
695
|
-
/>
|
|
696
|
-
)}
|
|
697
|
-
</Paragraph>
|
|
698
|
-
</Col>
|
|
699
|
-
</Row>
|
|
700
|
-
</Form>
|
|
701
|
-
)}
|
|
702
|
-
</div>
|
|
703
|
-
);
|
|
704
|
-
};
|
|
705
|
-
|
|
706
|
-
export default ConversationAssistant;
|