From 507289ff6cbb8e3b0e86af948fd01e20109cb6a6 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Mon, 7 Apr 2025 14:08:27 +0800 Subject: [PATCH] =?UTF-8?q?AIGC=E5=BA=94=E7=94=A8=E5=B9=B3=E5=8F=B0+?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/assets/images/ai/aiflow.png | Bin 0 -> 2853 bytes .../src/views/super/airag/aiapp/AiApp.api.ts | 81 ++ .../src/views/super/airag/aiapp/AiApp.data.ts | 88 ++ .../src/views/super/airag/aiapp/AiAppList.vue | 494 +++++++ .../views/super/airag/aiapp/chat/AiChat.vue | 372 ++++++ .../super/airag/aiapp/chat/AiChatIcon.vue | 87 ++ .../src/views/super/airag/aiapp/chat/chat.vue | 919 +++++++++++++ .../super/airag/aiapp/chat/chatMessage.vue | 157 +++ .../super/airag/aiapp/chat}/chatText.vue | 9 +- .../super/airag/aiapp/chat}/hooks/useChat.ts | 22 +- .../super/airag/aiapp/chat/hooks/useScroll.ts | 41 + .../views/super/airag/aiapp/chat/js/chat.js | 159 +++ .../super/airag/aiapp/chat/js/useScroll.ts | 41 + .../airag/aiapp/chat}/presetQuestion.vue | 29 +- .../super/airag/aiapp/chat/route/register.ts | 65 + .../super/airag/aiapp/chat}/slide.vue | 171 ++- .../aiapp/chat}/style/github-markdown.less | 165 ++- .../airag/aiapp/chat/style/highlight.less | 206 +++ .../super/airag/aiapp/chat/style/style.less | 132 ++ .../super/airag/aiapp/components/AiApp.json | 5 + .../aiapp/components/AiAppAddFlowModal.vue | 330 +++++ .../components/AiAppAddKnowledgeModal.vue | 244 ++++ .../components/AiAppGeneratedPromptModal.vue | 256 ++++ .../airag/aiapp/components/AiAppModal.vue | 164 +++ .../components/AiAppParamsSettingModal.vue | 95 ++ .../components/AiAppQuickCommandModal.vue | 100 ++ .../airag/aiapp/components/AiAppSendModal.vue | 274 ++++ .../aiapp/components/AiAppSettingModal.vue | 1166 +++++++++++++++++ .../views/super/airag/aiapp/img/ailogo.png | Bin 0 -> 12862 bytes .../super/airag/aiapp/img/iconWebEmbedded.png | Bin 0 -> 30036 bytes .../super/airag/aiapp/img/webEmbedded.png | Bin 0 -> 21670 bytes .../airag/aiknowledge/AiKnowledgeBase.api.ts | 124 ++ .../airag/aiknowledge/AiKnowledgeBase.data.ts | 125 ++ .../airag/aiknowledge/AiKnowledgeBaseList.vue | 479 +++++++ .../components/AiKnowledgeBaseModal.vue | 101 ++ .../components/AiTextDescModal.vue | 70 + .../components/AiragKnowledgeDocListModal.vue | 900 +++++++++++++ .../components/AiragKnowledgeDocTextModal.vue | 111 ++ .../super/airag/aiknowledge/icon/draft.png | Bin 0 -> 2808 bytes .../airag/aiknowledge/icon/knowledge.png | Bin 0 -> 10370 bytes .../views/super/airag/aimodel/AiModelList.vue | 433 ++++++ .../airag/aimodel/components/AiModelModal.vue | 432 ++++++ .../aimodel/components/AiModelSeniorForm.vue | 360 +++++ .../super/airag/aimodel/components/model.json | 148 +++ .../views/super/airag/aimodel/icon/OpenAi.png | Bin 0 -> 867 bytes .../super/airag/aimodel/icon/deepspeek.png | Bin 0 -> 923 bytes .../views/super/airag/aimodel/icon/ollama.png | Bin 0 -> 7487 bytes .../super/airag/aimodel/icon/qianfan.png | Bin 0 -> 910 bytes .../super/airag/aimodel/icon/qianwen.png | Bin 0 -> 29439 bytes .../super/airag/aimodel/icon/zhipuai.png | Bin 0 -> 1267 bytes .../views/super/airag/aimodel/model.api.ts | 61 + .../views/super/airag/aimodel/model.data.ts | 92 ++ 52 files changed, 9147 insertions(+), 161 deletions(-) create mode 100644 jeecgboot-vue3/src/assets/images/ai/aiflow.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.api.ts create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.data.ts create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/AiAppList.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChat.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChatIcon.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/chat.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/chatMessage.vue rename jeecgboot-vue3/src/{components/jeecg/AiChat/components => views/super/airag/aiapp/chat}/chatText.vue (91%) rename jeecgboot-vue3/src/{components/jeecg/AiChat => views/super/airag/aiapp/chat}/hooks/useChat.ts (56%) create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/hooks/useScroll.ts create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/js/chat.js create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/js/useScroll.ts rename jeecgboot-vue3/src/{components/jeecg/AiChat/components => views/super/airag/aiapp/chat}/presetQuestion.vue (63%) create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/route/register.ts rename jeecgboot-vue3/src/{components/jeecg/AiChat/components => views/super/airag/aiapp/chat}/slide.vue (61%) rename jeecgboot-vue3/src/{components/jeecg/AiChat => views/super/airag/aiapp/chat}/style/github-markdown.less (88%) create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/style/highlight.less create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/chat/style/style.less create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiApp.json create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppAddFlowModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppAddKnowledgeModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppGeneratedPromptModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppParamsSettingModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppQuickCommandModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppSendModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/components/AiAppSettingModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/img/ailogo.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/img/iconWebEmbedded.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aiapp/img/webEmbedded.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/AiKnowledgeBase.api.ts create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/AiKnowledgeBase.data.ts create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/AiKnowledgeBaseList.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/components/AiKnowledgeBaseModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/components/AiTextDescModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/components/AiragKnowledgeDocListModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/components/AiragKnowledgeDocTextModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/icon/draft.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aiknowledge/icon/knowledge.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/AiModelList.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/components/AiModelModal.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/components/AiModelSeniorForm.vue create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/components/model.json create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/icon/OpenAi.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/icon/deepspeek.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/icon/ollama.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/icon/qianfan.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/icon/qianwen.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/icon/zhipuai.png create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/model.api.ts create mode 100644 jeecgboot-vue3/src/views/super/airag/aimodel/model.data.ts diff --git a/jeecgboot-vue3/src/assets/images/ai/aiflow.png b/jeecgboot-vue3/src/assets/images/ai/aiflow.png new file mode 100644 index 0000000000000000000000000000000000000000..49ffd3d71f1af01c8441a3e85087cf022574d4ce GIT binary patch literal 2853 zcmds2{X5g^AD@}b^ERDOQ!~S4k$En$X_$>jB?=wk)Iu#f$+NMtg*8GX(GJe3JcRQ6 z{E(-`>6_%7m?2srk9n5whx60-y1swF_xj$i>wUlP`+mLO_w~Ns*Xz1(w$lk)IqAL9 zAP`8-j!bd}e8;vycL8&uYtduCi3K^^T7imskY7L`>0vt(@$@av=`05qq#2Bc8xnO3T+DO8wdw)&DtB>6BZt6R9~iaS>CX$V zv#K0se@t%hgvNGyeE8H*f86ZHy6Wkcd+`CBvqj%kBMW65J(e*Evu(pS)SzDag4;E5 zlkp$>jEeR5Gq5)|KW;7r(0|y#|HeU*L^-x7tQfeXWq!{PG6x4&I0(@RF*lqom#{D9q+W$vt>P@7#AgwnN#B z`faY>ol?lkYA5mtr4##WtjEyvOJgXojpmT|hj^!7*wRFl&K}lpd@B?h3}w!sWsr?T z2t#($%c)D=l*NP%6ERE}i^-kd;=~G3DXuB5Yq+>rQArt$4eU*!^1NPOQ`Y{YGD*NX z1~^)Czw>`Xr_EqLNgHPZHS}eA#Py>B{^T2FMu8h@Fi_{9 z9D@ZjyY%X0RISCOt=pTDIZ%cxt_)j@HWrxa&LzZlrpME30;bBWWlb>V0QKHGBLW{@jdme2DGcGv0)ALmpTl7 z#`o@z)5Ucj&)qXjpYJPr=l8q@My?1>Eav2G;%-$ht&OaWmVZxpDE(3=*?v-;x9i)+Gq-&kO=|~b$?VV+52pI+r1B1j6U{LTAy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@bq`mEC#bX7qN(RKJRo_tRAgcv!At`}B{pMH%e^v3@(wPgtIi};s z4NojbNUcCGRdsKe9prBMA69JI`S|7L4{=6@{G;w;^BeqR#)hjLe4ic-%Dg(8(X@I% geb%foUvYL-!9gIB9hyF<3Ic|m^$Aju)z2~i1}2RBcmMzZ literal 0 HcmV?d00001 diff --git a/jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.api.ts b/jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.api.ts new file mode 100644 index 00000000..e24b301f --- /dev/null +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.api.ts @@ -0,0 +1,81 @@ +import { defHttp } from '/@/utils/http/axios'; +import { Modal } from 'ant-design-vue'; + +export enum Api { + //知识库管理 + list = '/airag/app/list', + save = '/airag/app/edit', + delete = '/airag/app/delete', + queryById = '/airag/app/queryById', + queryBathById = '/airag/knowledge/query/batch/byId', + queryFlowById = '/airag/flow/queryById', + promptGenerate = '/airag/app/prompt/generate', +} + +/** + * 查询应用 + * @param params + */ +export const appList = (params) => { + return defHttp.get({ url: Api.list, params }, { isTransformResponse: false }); +}; + +/** + * 查询知识库 + * @param params + */ +export const queryKnowledgeBathById = (params) => { + return defHttp.get({ url: Api.queryBathById, params }, { isTransformResponse: false }); +}; + +/** + * 根据应用id查询应用 + * @param params + */ +export const queryById = (params) => { + return defHttp.get({ url: Api.queryById, params }, { isTransformResponse: false }); +}; + +/** + * 新增应用 + * @param params + */ +export const saveApp = (params) => { + return defHttp.put({ url: Api.save, params }); +}; + +/** + * 删除应用 + * @param params + * @param handleSuccess + */ +export const deleteApp = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除名称为'+params.name+'的应用吗?', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => { + handleSuccess(); + }); + }, + }); +}; + + +/** + * 根据应用id查询流程 + * @param params + */ +export const queryFlowById = (params) => { + return defHttp.get({ url: Api.queryFlowById, params }, { isTransformResponse: false }); +}; + +/** + * 应用编排 + * @param params + */ +export const promptGenerate = (params) => { + return defHttp.get({ url: Api.promptGenerate, params,timeout: 5 * 60 * 1000 }, { isTransformResponse: false }); +}; diff --git a/jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.data.ts b/jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.data.ts new file mode 100644 index 00000000..ef9c2532 --- /dev/null +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/AiApp.data.ts @@ -0,0 +1,88 @@ +import { FormSchema } from '@/components/Form'; + +/** + * 表单 + */ +export const formSchema: FormSchema[] = [ + { + label: 'id', + field: 'id', + component: 'Input', + show: false, + }, + { + label: '应用名称', + field: 'name', + required: true, + componentProps: { + //是否展示字数 + showCount: true, + maxlength: 64, + }, + component: 'Input', + }, + { + label: '应用描述', + field: 'descr', + component: 'InputTextArea', + componentProps: { + placeholder: '描述该应用的应用场景及用途', + rows: 4, + //是否展示字数 + showCount: true, + maxlength: 256, + }, + }, + { + label: '应用图标', + field: 'icon', + component: 'JImageUpload', + }, + { + label: '选择应用类型', + field: 'type', + component: 'Input', + ifShow:({ values })=>{ + return !values.id; + }, + slot: 'typeSlot', + }, +]; + +/** + * 快捷指令表单 + */ +export const quickCommandFormSchema: FormSchema[] = [ + { + label: 'key', + field: 'key', + component: 'Input', + show: false, + }, + { + label: '按钮名称', + field: 'name', + required: true, + component: 'Input', + componentProps: { + showCount: true, + maxLength: 10, + }, + }, + { + label: '按钮图标', + field: 'icon', + component: 'IconPicker', + }, + { + label: '指令内容', + field: 'descr', + required: true, + component: 'InputTextArea', + componentProps: { + autosize: { minRows: 4, maxRows: 4 }, + showCount: true, + maxLength: 100, + } + }, +]; diff --git a/jeecgboot-vue3/src/views/super/airag/aiapp/AiAppList.vue b/jeecgboot-vue3/src/views/super/airag/aiapp/AiAppList.vue new file mode 100644 index 00000000..84a9b96d --- /dev/null +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/AiAppList.vue @@ -0,0 +1,494 @@ + + + + + + + diff --git a/jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChat.vue b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChat.vue new file mode 100644 index 00000000..add5eb96 --- /dev/null +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChat.vue @@ -0,0 +1,372 @@ + + + + + diff --git a/jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChatIcon.vue b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChatIcon.vue new file mode 100644 index 00000000..54e31854 --- /dev/null +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/AiChatIcon.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chat.vue b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chat.vue new file mode 100644 index 00000000..045f9865 --- /dev/null +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chat.vue @@ -0,0 +1,919 @@ + + + + + + diff --git a/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chatMessage.vue b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chatMessage.vue new file mode 100644 index 00000000..478a20d0 --- /dev/null +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chatMessage.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/jeecgboot-vue3/src/components/jeecg/AiChat/components/chatText.vue b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chatText.vue similarity index 91% rename from jeecgboot-vue3/src/components/jeecg/AiChat/components/chatText.vue rename to jeecgboot-vue3/src/views/super/airag/aiapp/chat/chatText.vue index 6d49ace1..c7e5030c 100644 --- a/jeecgboot-vue3/src/components/jeecg/AiChat/components/chatText.vue +++ b/jeecgboot-vue3/src/views/super/airag/aiapp/chat/chatText.vue @@ -1,6 +1,6 @@