lsc 9 月之前
父節點
當前提交
265ba49833

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.3647ac6b3e5e9bf822ca0edc0770d223.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.bba3ed5aca95350eeef8.js></script><script type=text/javascript src=./static/js/app.8f4c6a223223b9cb81e1.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.9b4d29662ddaa85215eec54dd6df689e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.bba3ed5aca95350eeef8.js></script><script type=text/javascript src=./static/js/app.e72c7f7cbbc357c47ca6.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.3647ac6b3e5e9bf822ca0edc0770d223.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.3647ac6b3e5e9bf822ca0edc0770d223.css.map


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.9b4d29662ddaa85215eec54dd6df689e.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.9b4d29662ddaa85215eec54dd6df689e.css.map


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.e72c7f7cbbc357c47ca6.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.e72c7f7cbbc357c47ca6.js.map


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 1 - 1
src/common/axios.config.js

@@ -28,7 +28,7 @@ axios.interceptors.request.use((config) => {
     // }
     if (config.url === 'https://gpt.cocorobo.cn/search_image' || config.url === 'https://gpt.cocorobo.cn/chat' || config.url === 'https://gpt4.cocorobo.cn/create_free_assistants' || config.url === 'https://gpt4.cocorobo.cn/assistants_completion_response') {
         config.data = config.data//序列化post 参数
-    } else if (config.url.indexOf('https://gpt4.cocorobo.cn/') != -1 || config.url.indexOf('https://claude3.cocorobo.cn/') != -1 || config.url.indexOf('https://llm.cocorobo.cn/') != -1) {
+    } else if (config.url.indexOf('https://gpt4.cocorobo.cn/') != -1 || config.url.indexOf('https://claude3.cocorobo.cn/') != -1 || config.url.indexOf('llm.cocorobo.cn/') != -1) {
         config.headers = {
             'Content-Type': 'application/json',
         }

+ 65 - 12
src/components/pages/aiAddCourse/addCourse.vue

@@ -1247,20 +1247,31 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="textLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(isuseT === 2)">
+            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="textLoading" element-loading-text="小可正在努力生成中,请稍等..." v-show="(isuseT === 2)">
                 <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
                 <div class="c_info_title" style="margin: 0 20px 0 20px;position:relative;">
-                  课程概况<span class="inter_setting" @click="openInterPanSetting"></span>
+                  课程概况<span class="inter_setting" @click="openInterPanSetting2"></span>
                   <div class="inter_setting_panel" v-show="interSetting">
                     <div class="panel_title">配置工作流</div>
                     <div class="panel_tips">您可在创作者中心中创建工作流后,复制工作流链接并贴入</div>
                     <div class="panel_input">
-                      <input type="text" :placeholder="this.aiJson.agentid ? this.aiJson.agentid : '请输入agentid'" class="binfo_input" v-model="agentid"/>
+                      <input type="text" :placeholder="'请输入agentid'" class="binfo_input" v-model="r_agentid"/>
+                      <div class="panel_input_record">
+                        <span>议程和问题引导</span>
+                        <textarea rows="5" class="binfo_input binfo_textarea" cols v-model="courseText" placeholder="议程和问题引导"></textarea>
+                      </div>
+                      <div class="panel_input_record">
+                        <span>查看进度</span>
+                        <textarea rows="5" class="binfo_input binfo_textarea" cols v-model="courseText" placeholder="议程和问题引导"></textarea>
+                      </div>
+                      <div class="panel_input_record">
+                        <span>总结并生成课程概况</span>
+                        <textarea rows="5" class="binfo_input binfo_textarea" cols v-model="courseText" placeholder="议程和问题引导"></textarea>
+                      </div>
                     </div>
-                    <div class="panel_button">
-                      <button class="c_pub_button_confirm" @click="setAgentid">确认</button>
-                      <button class="c_pub_button_confirm" @click="rebuildAgentid" v-if="istemplate != 1">复原</button>
-                      <button class="c_pub_button_return" @click="cancelInterSetting">取消</button>
+                    <div class="panel_button" style="justify-content: flex-end;">
+                      <button class="c_pub_button_confirm" @click="setAgentid2" style="margin-right: 10px;">确认</button>
+                      <button class="c_pub_button_return" @click="cancelInterSetting2">取消</button>
                     </div>
                   </div>
                   <button class="c_pub_button_confirm" style="margin: 0 0 0 auto;" @click="interPan = !interPan,forceUpdate2()">{{ interPan ? '折叠' : '展开'}}</button>
@@ -1271,11 +1282,14 @@
                     :videoText2.sync="recordVideoText"
                     :audioUrl2.sync="recordAudioUrl"></recordV>
                   </div>
-                  <div class="inter_box" v-show="interPan" style="margin: 0 0 0 10px">
-                    <aiBoxCourseDetail  
+                  <div class="inter_box" v-show="interPan" style="margin: 0 0 0 10px;max-width: 50%;max-height:500px;">
+                    <aiBoxCourseDetail
+                      v-if="aiJson.recordAgentid && chatid"
                       :languageSetting="languageSetting"
                       :courseId="chatid" 
-                      :courseText2="courseText"
+                      :courseText2.sync="courseText"
+                      :viedoText="recordVideoText"
+                      :agentid="aiJson.recordAgentid"
                       :fileids='[...knowFileids, ...knowFileids2]'></aiBoxCourseDetail>
                   </div>
                 </div>
@@ -7722,6 +7736,7 @@ export default {
       isDialog: 0,
       recordVideoText: "",
       recordAudioUrl: "",
+      r_agentid: ""
     };
   },
   directives: {
@@ -7945,7 +7960,7 @@ export default {
       let sagentid = this.aiJson.sagentid
       let url = ''
       if(sagentid){
-        url = `https://beta.cloud.cocorobo.cn/aigpt/#/js?muti_agent_id=${agentid}&isPbl=true&session_id=${this.chatid}`//+'&muti_agent_id2='+agentid
+        url = `https://beta.cloud.cocorobo.cn/aigpt/#/js?muti_agent_id=${sagentid}&isPbl=true&session_id=${this.chatid}`//+'&muti_agent_id2='+agentid
       }else{
         url = `https://beta.cloud.cocorobo.cn/aigpt/#/js?muti_agent_id=${agentid}&isPbl=true&session_id=${this.chatid}`//+'&muti_agent_id2='+agentid
       }
@@ -12727,6 +12742,9 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
 
             this.aiJson.agentid = this.aiJson.agentid ? this.aiJson.agentid : '8e71322c-6c2a-11ef-8ce0-12e77c4cb76b'
             this.aiJson.sagentid = this.aiJson.sagentid ? this.aiJson.sagentid : ''
+            this.aiJson.recordAgentid = this.aiJson.recordAgentid ? this.aiJson.recordAgentid : 'eb6c7ca4-9684-11ef-a04e-12e77c4cb76b'
+
+            
 
             // if(this.templateid == '4480d65a-1e48-11ef-bee5-005056b86db5'){
             //   this.aiJson.aiCpoteTask = this.aiJson.aiCpoteTask ? this.aiJson.aiCpoteTask : '请根据<任务簇>,帮我取出里面对应的任务名'
@@ -14737,6 +14755,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
 
                 this.aiJson.agentid = this.aiJson.agentid ? this.aiJson.agentid : '8e71322c-6c2a-11ef-8ce0-12e77c4cb76b'
                 this.aiJson.sagentid = this.aiJson.sagentid ? this.aiJson.sagentid : ''
+                this.aiJson.recordAgentid = this.aiJson.recordAgentid ? this.aiJson.recordAgentid : 'eb6c7ca4-9684-11ef-a04e-12e77c4cb76b'
                 this.templateid = res.data[3][0].template;
                 this.getTipsTemplateIsDialog()
               }catch(error){
@@ -14901,6 +14920,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
 
             this.aiJson.agentid = this.aiJson.agentid ? this.aiJson.agentid : '8e71322c-6c2a-11ef-8ce0-12e77c4cb76b'
             this.aiJson.sagentid = this.aiJson.sagentid ? this.aiJson.sagentid : ''
+            this.aiJson.recordAgentid = this.aiJson.recordAgentid ? this.aiJson.recordAgentid : 'eb6c7ca4-9684-11ef-a04e-12e77c4cb76b'
             if(res.data[0][0].cpote){
               try {
                 this.cpote = JSON.parse(res.data[0][0].cpote);
@@ -17288,6 +17308,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
         }
       }
       this.interSetting = false
+      this.interPan = true
     },
     changeLang(){
       window.course_lang = this.languageSetting
@@ -17304,6 +17325,14 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
         this.agentid = ''
       }
     },
+    openInterPanSetting2(){
+      this.interSetting = !this.interSetting
+      if(this.interSetting){
+        this.r_agentid = this.aiJson.recordAgentid
+      }else {
+        this.r_agentid = ''
+      }
+    },
     setAgentid(){
       if(!this.agentid.trim()){
         this.$message.error('请输入工作流链接')
@@ -17320,6 +17349,14 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       }, 100);
       this.interSetting = false
     },
+    setAgentid2(){
+      if(!this.r_agentid.trim()){
+        this.$message.error('请输入工作流链接')
+        return;
+      }
+      this.aiJson.recordAgentid = this.r_agentid.trim()
+      this.interSetting = false
+    },
     rebuildAgentid(){
       this.aiJson.sagentid = ''
       this.interFlash = false
@@ -17332,6 +17369,10 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       this.agentid = ''
       this.interSetting = false
     },
+    cancelInterSetting2(){
+      this.r_agentid = ''
+      this.interSetting = false
+    },
     openAiDialog2(clickType, type, callback, index, tindex){
       if (this.taskLoading.length) {
         let _pan = 1
@@ -24736,6 +24777,7 @@ ${msg}
 
       this.aiJson.agentid = this.aiJson.agentid ? this.aiJson.agentid : '8e71322c-6c2a-11ef-8ce0-12e77c4cb76b'
       this.aiJson.sagentid = this.aiJson.sagentid ? this.aiJson.sagentid : ''
+      this.aiJson.recordAgentid = this.aiJson.recordAgentid ? this.aiJson.recordAgentid : 'eb6c7ca4-9684-11ef-a04e-12e77c4cb76b'
     }
     this.loading = false;
     // this.timer2 = setInterval(() => {
@@ -26523,7 +26565,7 @@ ol {
 }
 
 .whiteBIcon {
-  width: 80px;
+  width: 60px;
   cursor: pointer;
   display: flex;
   flex-direction: column;
@@ -26552,6 +26594,7 @@ ol {
 .whiteBIcon>div:nth-child(2) {
   height: 20px;
   line-height: 20px;
+  text-align: center;
 }
 
 .check {
@@ -29279,11 +29322,21 @@ ol {
 .panel_input{
   margin-bottom: 10px;
 }
+
 .panel_button{
   display: flex;
   justify-content: space-between;
 }
 
+.panel_input_record {
+  margin-top: 10px;
+}
+
+.panel_input_record > span{
+  margin-bottom: 5px;
+  display: block;
+}
+
 .custom-switch >>> .el-switch__label.is-active {
   color: #0061FF;
 }

+ 159 - 21
src/components/pages/aiAddCourse/aiBoxCourseDetail.vue

@@ -52,9 +52,9 @@
               @click="onCopy(item.aiContent)"
             />
           </div>
-          <div class="ai_tips_btn_box" v-if="item.promptArray && item.promptArray.length">
-            <span v-for="(pr, pindex) in item.promptArray" :key="pindex" @click="quickAdd(item.addedData, pr)">{{ pr.name }}</span>
-            <span @click="moreClick(item.uid, item.addedData)" v-loading="item.moreloading && !item.moreDisplay2" v-if="item.moreDisplay">更多</span>
+          <div class="ai_tips_btn_box" v-if="chatTypeArray.includes(item.chatType)">
+            <!-- @click="quickAdd(item.addedData, pr)" -->
+            <span v-if="item.chatType == 'start'" @click="quickAdd('start')">追加议题</span>
           </div>
         </div>
       </div>
@@ -160,6 +160,12 @@
           </svg>
           <span>清屏</span>
         </span>
+        <span class="clear" @click.stop="quickAdd('more')">
+          <span>更多课程灵感</span>
+        </span>
+        <span class="clear" @click.stop="quickAdd('summary')">
+          <span>总结并生成课程概况</span>
+        </span>
         <!-- <div style="margin-left: auto;">
           <el-switch v-model="continuous"></el-switch>
           <span @click.stop="continuous = !continuous">连续对话</span>
@@ -228,7 +234,6 @@
 
       <textarea
         class="ai_body_input_textarea"
-        @input="inputChange"
         @keydown="textareaKeydown"
         :disabled="isVoice"
         ref="textareaRef"
@@ -413,6 +418,13 @@ export default {
       type: Number,
       default: 0
     },
+    viedoText: {
+      type: String,
+      default: ''
+    },
+    agentid: {
+      type: String,
+    }
   },
   data() {
     return {
@@ -508,6 +520,12 @@ export default {
       isVoice: false,
       isTalk: false,
       username: "",
+      chatTypeArray: ['start'],
+      agentJSON:{
+        model: '',
+        url: '',
+        start: ''
+      }
     };
   },
   watch: {
@@ -525,6 +543,15 @@ export default {
         }
       }
     },
+    agentid: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        if (newValue) {
+          this.getAgent()
+        }
+      }
+    },
   },
   methods: {
     removeMarkdownSymbols(text) {
@@ -578,6 +605,77 @@ export default {
         });
       }
     },
+    quickAdd(type){
+      if(this.faloading){
+        this.$message.error('请等待回答完毕在发送')
+        return
+      }
+      this.$emit('addCourseBehavior', 'courseBehavior', '点击对话框-推荐按钮发送')
+      this.faloading = true;
+      let content = ''
+      if(type == 'start'){
+        content = '追加议题'
+      }
+      let string = `## 引用内容
+${this.viedoText}
+        
+## 要求
+根据<引用内容>中的内容实现以下要求:${content}`
+
+      let _uuid = uuidv4();
+      this.array.push({
+        role: "user",
+        content: `${content}`,
+        uid: _uuid,
+        AI: "AI",
+        aiContent: "",
+        oldContent: "",
+        isShowSynchronization: false,
+        filename: "",
+        index: this.array.length,
+        is_mind_map: false,
+        createtime: new Date().toLocaleString().replaceAll("/", "-"),
+        loading: true
+      });
+      // 注意:输出语言为${this.getLang2()}
+
+      let _replaceText = `NOTICE
+      Language: ${this.getLang()}
+      ${string}`;
+      this.$nextTick(() => {
+        this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
+      });
+      let params = {
+        id: this.agentid,
+        userId: this.userid,
+        message: _replaceText,
+        session_name: this.continuous ? `${this.courseId}-courseDetail` : uuidv4(),
+        uid: _uuid,
+        model: this.agentJSON.model,
+        sound_url: "",
+        file_ids: this.agentJSON.model.includes('qwen') ? [] : [...this.fileids],//...this.fileids
+        // model: "gpt-4o-mini"
+        // model: "qwen-plus"
+      };
+
+      this.ajax
+        .post(`${this.agentJSON.url.includes("llm") ? this.agentJSON.url+'/agent' : this.agentJSON.url}/ai_agent_chat_new`, params)
+        .then(res => {
+          if (
+            converter(res.data.FunctionResponse.result) ==
+            converter("发送成功")
+          ) {
+          } else {
+            this.$message.warning(res.data.FunctionResponse.result);
+          }
+        })
+        .catch(err => {
+          console.log(err);
+        });
+      this.getAtAuContent2(_uuid);
+      this.saveUid = _uuid;
+      this.courseText = "";
+    },
     addContent() {
       if (this.courseText.trim().length == 0)
         return this.$message.error("请输入内容");
@@ -622,7 +720,19 @@ ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully reference
           `;
           message = msg;
         }
+        if(this.viedoText){
+          let msg = ``;
+          msg += `
+          ## 引用内容
+          ${this.viedoText}
+          `;
 
+          msg += `
+          ## 要求
+          ${this.courseText}
+          `;
+          message = msg;
+        }
         // 这里处理@的角色
         let _atRoleList = [];
         let _roleList = [...this.roleList, ...this.publicRoleList];
@@ -755,7 +865,7 @@ ${message}`;
 //           history = history.filter(
 //             i =>
 //               i.content !=
-//               "您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的"
+//               this.agentJSON.start
 //           );
 
 //           history = history.map(i => ({
@@ -773,20 +883,19 @@ ${message}`;
             this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
           });
           let params = {
-            id: '957e191f-92a6-11ef-a04e-12e77c4cb76b',
+            id: this.agentid,
             userId: this.userid,
             message: _replaceText,
             session_name: this.continuous ? `${this.courseId}-courseDetail` : uuidv4(),
-            model: "qwen-plus-own",
+            model: this.agentJSON.model,
             sound_url: "",
             uid: _uuid,
-            file_ids: [],//...this.fileids
+            file_ids: this.agentJSON.model.includes('qwen') ? [] : [...this.fileids],//...this.fileids
             // model: "gpt-4o-mini"
             // model: "qwen-plus"
           };
-
           this.ajax
-            .post("https://llm.cocorobo.cn/agent/ai_agent_chat_new", params)
+            .post(`${this.agentJSON.url.includes("llm") ? this.agentJSON.url+'/agent' : this.agentJSON.url}/ai_agent_chat_new`, params)
             .then(res => {
               if (
                 converter(res.data.FunctionResponse.result) ==
@@ -939,7 +1048,7 @@ ${message}`;
     },
     getAtAuContent2(_uid) {
       this.fasource = new EventSource(
-        `https://llm.cocorobo.cn/question/${_uid}`
+        `${this.agentJSON.url}/question/${_uid}`
       ); //http://gpt4.cocorobo.cn:8011/question/   https://gpt4.cocorobo.cn/question/
       let _allText = "";
       let _mdText = "";
@@ -1026,9 +1135,36 @@ ${message}`;
         .post("https://gpt4.cocorobo.cn/insert_chat", params)
         .then(res => {});
     },
+    getAgent(){
+      return new Promise((resolve, reject) => {
+        let params = {
+          id: this.agentid
+        };
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_ai_agent_assistant_id", params)
+          .then(res => {
+            let _data = JSON.parse(res.data.FunctionResponse.result);
+            console.log(res);
+            
+            if (_data.length > 0) {
+              this.agentJSON = {
+                model: _data[0].modelType == 'GPT' ? "gpt-4o-2024-08-06" : _data[0].modelType,
+                url: _data[0].modelType.includes('qwen') ? 'https://llm.cocorobo.cn' : 'https://gpt4.cocorobo.cn',
+                start: _data[0].prologue ? _data[0].prologue : '您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的'
+              }
+            }
+            resolve();
+          })
+          .catch(err => {
+            console.log(err);
+            resolve();
+          });
+      });
+    },
     // 获取对应的聊天记录
     getChatList() {
-      return new Promise((resolve, reject) => {
+      return new Promise(async (resolve, reject) => {
+        if(!this.agentJSON.model){ await this.getAgent() }
         if (this.loading) return;
         this.array = [];
         this.loading = true;
@@ -1072,15 +1208,15 @@ ${message}`;
                 content: "",
                 uid: _uid,
                 AI: "AI",
-                aiContent:
-                  "您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的",
-                oldContent:
-                  "您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的",
+                aiContent: this.agentJSON.start,
+                oldContent: this.agentJSON.start,
                 isShowSynchronization: false,
                 filename: "",
                 index: 0,
                 is_mind_map: false,
-                fileid: ""
+                fileid: "",
+                createtime: new Date().toLocaleString().replaceAll("/", "-"),
+                chatType: 'start'
               });
               this.array = _chatList;
               if (this.courseId) {
@@ -1198,6 +1334,7 @@ ${message}`;
               this.array = [];
               this.$message.success("清除聊天记录成功");
               this.loading = false;
+              this.getChatList()
             })
             .catch(err => {
               this.loading = false;
@@ -1401,9 +1538,9 @@ ${message}`;
     //     this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
     //   });
     // });
-    this.getRoleList();
-    this.getPublicRoleList();
-    this.jArray = this.getString();
+    // this.getRoleList();
+    // this.getPublicRoleList();
+    // this.jArray = this.getString();
   }
 };
 </script>
@@ -2101,7 +2238,7 @@ ${message}`;
   width: 100%;
   padding: 0 20px 0 50px;
   display: flex;
-  flex-direction: column;
+  flex-wrap: wrap;
   margin-top: 27px;
   box-sizing: border-box;
 }
@@ -2114,6 +2251,7 @@ ${message}`;
   padding: 8px;
   border-radius: 5px;
   transition: all .3s;
+  margin-right: 5px;
 }
 
 .ai_tips_btn_box > span + span{

+ 2 - 1
src/components/pages/aiAddCourse/aiBoxRight.vue

@@ -1568,7 +1568,8 @@ ${message}`;
                 filename: "",
                 index: 0,
                 is_mind_map: false,
-                fileid: ""
+                fileid: "",
+                createtime: new Date().toLocaleString().replaceAll("/", "-"),
               });
               this.array = _chatList;
               if (this.courseId) {

部分文件因文件數量過多而無法顯示