lsc 1 年間 前
コミット
ce09d056bb

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.469843b5eb604f601ed39fe65a5ec8ff.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.85f22e7b4ab99591785c.js></script><script type=text/javascript src=./static/js/app.31551616c3e72ff639dd.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.a5b045391e4deb56b4233e881b53a863.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.85f22e7b4ab99591785c.js></script><script type=text/javascript src=./static/js/app.873fbcbc18e26ea9501b.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/css/app.a5b045391e4deb56b4233e881b53a863.css


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/css/app.a5b045391e4deb56b4233e881b53a863.css.map


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/app.873fbcbc18e26ea9501b.js


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/app.873fbcbc18e26ea9501b.js.map


ファイルの差分が大きいため隠しています
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 548 - 548
src/components/pages/aiAddCourse/addCourse.vue

@@ -5215,7 +5215,7 @@
     </aiDialog>
     <tipsDialog :dialogVisibleTips.sync="dialogVisibleTips" :tipsJson.sync="tipsJson" :aiJson="aiJson" :userid="userid"
       @retrunCourse="retrunCourse" :templateid="templateid"></tipsDialog>
-    <aiCreateDialog :dialogVisibleAiCreate.sync="dialogVisibleAiCreate" :courseName="courseName" @createAiPpt="createAiPpt"></aiCreateDialog>
+    <aiCreateDialog :dialogVisibleAiCreate.sync="dialogVisibleAiCreate" :courseName="courseName" @createAiPpt="createAiPpt" :infoData="infoData"></aiCreateDialog>
   </div>
 </template>
 
@@ -13429,177 +13429,177 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
         }
       }
       console.log('fileid=========',fileid)
-      let params = JSON.stringify({
-        // "model": "Chat",
-        model: 'gpt-3.5-turbo',
-        temperature: 0,
-        max_tokens: 4096,
-        top_p: 1,
-        frequency_penalty: 0,
-        presence_penalty: 0,
-        messages: [{
-          content: messages,
-          role: 'user'
-        }],
-        stream: false,
-        uid: this.userid,
-        mind_map_question: "",
-      })
       // let params = JSON.stringify({
-      //     message: {
-      //         anthropic_version: "bedrock-2023-05-31",
-      //         max_tokens: 4096,
-      //         temperature: 0,
-      //         top_p: 1,
-      //         messages: [{
-      //           content: messages,
-      //           role: 'user'
-      //         }], // 
-      //     },
-      //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      //   // "model": "Chat",
+      //   model: 'gpt-3.5-turbo',
+      //   temperature: 0,
+      //   max_tokens: 4096,
+      //   top_p: 1,
+      //   frequency_penalty: 0,
+      //   presence_penalty: 0,
+      //   messages: [{
+      //     content: messages,
+      //     role: 'user'
+      //   }],
+      //   stream: false,
+      //   uid: this.userid,
+      //   mind_map_question: "",
+      // })
+      // // let params = JSON.stringify({
+      // //     message: {
+      // //         anthropic_version: "bedrock-2023-05-31",
+      // //         max_tokens: 4096,
+      // //         temperature: 0,
+      // //         top_p: 1,
+      // //         messages: [{
+      // //           content: messages,
+      // //           role: 'user'
+      // //         }], // 
+      // //     },
+      // //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      // // });
+
+      // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
+      //   // _this.ajax.post('https://claude3.cocorobo.cn/claude3Chat', params).then(function (response) {
+      //   console.log(response);
+      //   let data = response.data.FunctionResponse
+      //   if (data.choices && data.choices.length && data.choices[0].message) {
+      //     console.log(data.choices[0].message.content);
+      //     let dArray = JSON.parse(data.choices[0].message.content)
+      //     _this.dArray = dArray
+      //     _this.unitJson[0].chapterInfo[0].taskJson = []
+
+      //     for (var i = 0; i < dArray.length; i++) {
+      //       let _task = dArray[i]
+      //       _this.unitJson[0].chapterInfo[0].taskJson.push({
+      //         task: _task.task,
+      //         taskDetail: "",
+      //         taskDetail2: _task.detail,
+      //         taskDetail3: "",
+      //         chapterData: [],
+      //         toolText: "",
+      //         toolChoose: [
+      //           {
+      //             tool: [],
+      //             toolDetail: "",
+      //             toolType: 0,
+      //             askCount: 1,
+      //             askTitle: "",
+      //             askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //           },
+      //         ],
+      //         isShowTools: false,
+      //         askCount: 1,
+      //         isFold: 2,
+      //         askTitle: "",
+      //         askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //         checkJson: [{ checkCount: [], checkPerent: [] }],
+      //         homeworkList: [],
+      //       })
+      //     }
+      //       _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
+      //           _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+      //     _this.$forceUpdate();
+      //   }
+      //   // if (data.result) {
+      //   //   console.log(data.result);
+      //   //   let dArray = JSON.parse(data.result)
+      //   //   _this.dArray = dArray
+      //   //   _this.unitJson[0].chapterInfo[0].taskJson = []
+
+      //   //   for (var i = 0; i < dArray.length; i++) {
+      //   //     let _task = dArray[i]
+      //   //     _this.unitJson[0].chapterInfo[0].taskJson.push({
+      //   //       task: _task.task,
+      //   //       taskDetail: "",
+      //   //       taskDetail2: _task.detail,
+      //   //       taskDetail3: "",
+      //   //       chapterData: [],
+      //   //       toolText: "",
+      //   //       toolChoose: [
+      //   //         {
+      //   //           tool: [],
+      //   //           toolDetail: "",
+      //   //           toolType: 0,
+      //   //           askCount: 1,
+      //   //           askTitle: "",
+      //   //           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //   //         },
+      //   //       ],
+      //   //       isShowTools: false,
+      //   //       askCount: 1,
+      //   //       isFold: 1,
+      //   //       askTitle: "",
+      //   //       askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //   //       checkJson: [{ checkCount: [], checkPerent: [] }],
+      //   //       homeworkList: [],
+      //   //     })
+      //   //   }
+      //   //   _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+      //   //   _this.$forceUpdate();
+      //   // }
+      //   callback ? callback() : ''
+      // }).catch(function (error) {
+      //   _this.loading = false
+      //   console.log(error);
       // });
 
-      _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
-        // _this.ajax.post('https://claude3.cocorobo.cn/claude3Chat', params).then(function (response) {
-        console.log(response);
-        let data = response.data.FunctionResponse
-        if (data.choices && data.choices.length && data.choices[0].message) {
-          console.log(data.choices[0].message.content);
-          let dArray = JSON.parse(data.choices[0].message.content)
-          _this.dArray = dArray
-          _this.unitJson[0].chapterInfo[0].taskJson = []
-
-          for (var i = 0; i < dArray.length; i++) {
-            let _task = dArray[i]
-            _this.unitJson[0].chapterInfo[0].taskJson.push({
-              task: _task.task,
-              taskDetail: "",
-              taskDetail2: _task.detail,
-              taskDetail3: "",
-              chapterData: [],
-              toolText: "",
-              toolChoose: [
-                {
-                  tool: [],
-                  toolDetail: "",
-                  toolType: 0,
-                  askCount: 1,
-                  askTitle: "",
-                  askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-                },
-              ],
-              isShowTools: false,
-              askCount: 1,
-              isFold: 2,
-              askTitle: "",
-              askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-              checkJson: [{ checkCount: [], checkPerent: [] }],
-              homeworkList: [],
-            })
-          }
-            _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
-                _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-          _this.$forceUpdate();
-        }
-        // if (data.result) {
-        //   console.log(data.result);
-        //   let dArray = JSON.parse(data.result)
-        //   _this.dArray = dArray
-        //   _this.unitJson[0].chapterInfo[0].taskJson = []
-
-        //   for (var i = 0; i < dArray.length; i++) {
-        //     let _task = dArray[i]
-        //     _this.unitJson[0].chapterInfo[0].taskJson.push({
-        //       task: _task.task,
-        //       taskDetail: "",
-        //       taskDetail2: _task.detail,
-        //       taskDetail3: "",
-        //       chapterData: [],
-        //       toolText: "",
-        //       toolChoose: [
-        //         {
-        //           tool: [],
-        //           toolDetail: "",
-        //           toolType: 0,
-        //           askCount: 1,
-        //           askTitle: "",
-        //           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-        //         },
-        //       ],
-        //       isShowTools: false,
-        //       askCount: 1,
-        //       isFold: 1,
-        //       askTitle: "",
-        //       askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-        //       checkJson: [{ checkCount: [], checkPerent: [] }],
-        //       homeworkList: [],
-        //     })
-        //   }
-        //   _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-        //   _this.$forceUpdate();
-        // }
-        callback ? callback() : ''
-      }).catch(function (error) {
-        _this.loading = false
-        console.log(error);
-      });
-
-      // let parm = {
-      //   assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
-      //   message: messages,
-      //   session_name: uuidv4(),
-      //   userId: this.userid,
-      //   file_ids: fileid.length ? [...fileid] : '',
-      // }
-      // this.ajax
-      //   .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
-      //   .then((response) => {
-      //     console.log(response);
-      //     let data = response.data.FunctionResponse
-      //     if (data.message) {
-      //       console.log(data.message);
-      //       let dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
-      //       _this.dArray = dArray
-      //       _this.unitJson[0].chapterInfo[0].taskJson = []
+      let parm = {
+        assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
+        message: [{"type":"text", "text":messages}],
+        session_name: uuidv4(),
+        userId: this.userid,
+        file_ids: fileid.length ? [...fileid] : '',
+      }
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
+        .then((response) => {
+          console.log(response);
+          let data = response.data.FunctionResponse
+          if (data.message) {
+            console.log(data.message);
+            let dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
+            _this.dArray = dArray
+            _this.unitJson[0].chapterInfo[0].taskJson = []
 
-      //       for (var i = 0; i < dArray.length; i++) {
-      //         let _task = dArray[i]
-      //         _this.unitJson[0].chapterInfo[0].taskJson.push({
-      //           task: _task.task,
-      //           taskDetail: "",
-      //           taskDetail2: _task.detail,
-      //           taskDetail3: "",
-      //           chapterData: [],
-      //           toolText: "",
-      //           toolChoose: [
-      //             {
-      //               tool: [],
-      //               toolDetail: "",
-      //               toolType: 0,
-      //               askCount: 1,
-      //               askTitle: "",
-      //               askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //             },
-      //           ],
-      //           isShowTools: false,
-      //           askCount: 1,
-      //           isFold: 2,
-      //           askTitle: "",
-      //           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //           checkJson: [{ checkCount: [], checkPerent: [] }],
-      //           homeworkList: [],
-      //         })
-      //       }
-      //       _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
-      //       _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-      //       _this.$forceUpdate();
-      //     }
-      //     callback ? callback() : ''
-      //   })
-      //   .catch((error) => {
-      //     _this.loading = false
-      //     console.log(error);
-      //   });
+            for (var i = 0; i < dArray.length; i++) {
+              let _task = dArray[i]
+              _this.unitJson[0].chapterInfo[0].taskJson.push({
+                task: _task.task,
+                taskDetail: "",
+                taskDetail2: _task.detail,
+                taskDetail3: "",
+                chapterData: [],
+                toolText: "",
+                toolChoose: [
+                  {
+                    tool: [],
+                    toolDetail: "",
+                    toolType: 0,
+                    askCount: 1,
+                    askTitle: "",
+                    askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+                  },
+                ],
+                isShowTools: false,
+                askCount: 1,
+                isFold: 2,
+                askTitle: "",
+                askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+                checkJson: [{ checkCount: [], checkPerent: [] }],
+                homeworkList: [],
+              })
+            }
+            _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
+            _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+            _this.$forceUpdate();
+          }
+          callback ? callback() : ''
+        })
+        .catch((error) => {
+          _this.loading = false
+          console.log(error);
+        });
     },
     async aiGet3(messages, callback) {
       let _this = this
@@ -13622,207 +13622,207 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
         }
       }
 
-      let params = JSON.stringify({
-        // "model": "Chat",
-        model: 'gpt-3.5-turbo',
-        temperature: 0,
-        max_tokens: 4096,
-        top_p: 1,
-        frequency_penalty: 0,
-        presence_penalty: 0,
-        messages: [{
-          content: messages,
-          role: 'user'
-        }],
-        stream: false,
-        uid: this.userid,
-        mind_map_question: "",
-      })
       // let params = JSON.stringify({
-      //     message: {
-      //         anthropic_version: "bedrock-2023-05-31",
-      //         max_tokens: 4096,
-      //         temperature: 0,
-      //         top_p: 1,
-      //         messages: [{
-      //           content: messages,
-      //           role: 'user'
-      //         }], // 
-      //     },
-      //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      //   // "model": "Chat",
+      //   model: 'gpt-3.5-turbo',
+      //   temperature: 0,
+      //   max_tokens: 4096,
+      //   top_p: 1,
+      //   frequency_penalty: 0,
+      //   presence_penalty: 0,
+      //   messages: [{
+      //     content: messages,
+      //     role: 'user'
+      //   }],
+      //   stream: false,
+      //   uid: this.userid,
+      //   mind_map_question: "",
+      // })
+      // // let params = JSON.stringify({
+      // //     message: {
+      // //         anthropic_version: "bedrock-2023-05-31",
+      // //         max_tokens: 4096,
+      // //         temperature: 0,
+      // //         top_p: 1,
+      // //         messages: [{
+      // //           content: messages,
+      // //           role: 'user'
+      // //         }], // 
+      // //     },
+      // //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      // // });
+      // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
+      // // _this.ajax.post('https://claude3.cocorobo.cn/claude3Chat', params).then(function (response) {
+      //   console.log(response);
+      //   let data = response.data.FunctionResponse
+      //   if (data.choices && data.choices.length && data.choices[0].message) {
+      //     console.log(data.choices[0].message.content);
+      //     let tArray = JSON.parse(data.choices[0].message.content)
+      //     // _this.unitJson[0].chapterInfo[0].task = []
+
+      //     let toolsJson = {
+      //       "电子白板": { tool: 1, type: 1 },
+      //       "文档": { tool: 52, type: 1 },
+      //       "思维导图": { tool: 3, type: 1 },
+      //       "表格": { tool: 48, type: 1 },
+      //       "作业提交": { tool: 16, type: 2 }
+      //     }
+      //     for (var i = 0; i < tArray.length; i++) {
+      //       let _task = tArray[i]
+      //       _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail = _task.detail
+      //       _this.unitJson[0].chapterInfo[0].taskJson[i].eList = _task.elist
+      //       _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose = []
+      //       if (_task.toolChoose.length) {
+      //         for (var j = 0; j < _task.toolChoose.length; j++) {
+      //           _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
+      //             {
+      //               tool: toolsJson[_task.toolChoose[j].tool] ? [toolsJson[_task.toolChoose[j].tool].tool] : [],
+      //               toolDetail: _task.toolChoose[j].detail,
+      //               toolType: toolsJson[_task.toolChoose[j].tool] ? toolsJson[_task.toolChoose[j].tool].type : 0,
+      //               askCount: 1,
+      //               askTitle: "",
+      //               askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //             },
+      //           )
+      //         }
+      //       } else {
+      //         _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
+      //           {
+      //             tool: [],
+      //             toolDetail: "",
+      //             toolType: 0,
+      //             askCount: 1,
+      //             askTitle: "",
+      //             askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //           },
+      //         )
+      //       }
+      //     }
+      //     // if (_this.infoData.length) {
+      //     //   _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = JSON.parse(JSON.stringify(_this.infoData))
+      //     // }
+      //     _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+      //     _this.$forceUpdate();
+      //   }
+      //   // if (data.result) {
+      //   //   console.log(data.result);
+      //   //   let tArray = JSON.parse(data.result)
+      //   //   // _this.unitJson[0].chapterInfo[0].task = []
+
+      //   //   let toolsJson = {
+      //   //     "电子白板": { tool: 1, type: 1 },
+      //   //     "文档": { tool: 52, type: 1 },
+      //   //     "思维导图": { tool: 3, type: 1 },
+      //   //     "表格": { tool: 48, type: 1 },
+      //   //     "作业提交": { tool: 16, type: 2 }
+      //   //   }
+      //   //   for (var i = 0; i < tArray.length; i++) {
+      //   //     let _task = tArray[i]
+      //   //     _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail = _task.detail
+      //   //     _this.unitJson[0].chapterInfo[0].taskJson[i].eList = _task.elist
+      //   //     _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose = []
+      //   //     if (_task.toolChoose.length) {
+      //   //       for (var j = 0; j < _task.toolChoose.length; j++) {
+      //   //         _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
+      //   //           {
+      //   //             tool: toolsJson[_task.toolChoose[j].tool] ? [toolsJson[_task.toolChoose[j].tool].tool] : [],
+      //   //             toolDetail: _task.toolChoose[j].detail,
+      //   //             toolType: toolsJson[_task.toolChoose[j].tool] ? toolsJson[_task.toolChoose[j].tool].type : 0,
+      //   //             askCount: 1,
+      //   //             askTitle: "",
+      //   //             askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //   //           },
+      //   //         )
+      //   //       }
+      //   //     } else {
+      //   //       _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
+      //   //         {
+      //   //           tool: [],
+      //   //           toolDetail: "",
+      //   //           toolType: 0,
+      //   //           askCount: 1,
+      //   //           askTitle: "",
+      //   //           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //   //         },
+      //   //       )
+      //   //     }
+      //   //   }
+      //   //   _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+      //   //   _this.$forceUpdate();
+      //   // }
+      //   callback ? callback() : ''
+      // }).catch(function (error) {
+      //   _this.loading = false
+      //   console.log(error);
       // });
-      _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
-      // _this.ajax.post('https://claude3.cocorobo.cn/claude3Chat', params).then(function (response) {
-        console.log(response);
-        let data = response.data.FunctionResponse
-        if (data.choices && data.choices.length && data.choices[0].message) {
-          console.log(data.choices[0].message.content);
-          let tArray = JSON.parse(data.choices[0].message.content)
-          // _this.unitJson[0].chapterInfo[0].task = []
-
-          let toolsJson = {
-            "电子白板": { tool: 1, type: 1 },
-            "文档": { tool: 52, type: 1 },
-            "思维导图": { tool: 3, type: 1 },
-            "表格": { tool: 48, type: 1 },
-            "作业提交": { tool: 16, type: 2 }
-          }
-          for (var i = 0; i < tArray.length; i++) {
-            let _task = tArray[i]
-            _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail = _task.detail
-            _this.unitJson[0].chapterInfo[0].taskJson[i].eList = _task.elist
-            _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose = []
-            if (_task.toolChoose.length) {
-              for (var j = 0; j < _task.toolChoose.length; j++) {
+
+
+
+      let parm = {
+        assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
+        message: [{"type":"text", "text":messages}],
+        session_name: uuidv4(),
+        userId: this.userid,
+        file_ids: fileid.length ? [...fileid] : '',
+      }
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
+        .then((response) => {
+          console.log(response);
+          let data = response.data.FunctionResponse
+          if (data.message) {
+            console.log(data.message);
+            let tArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
+
+            let toolsJson = {
+              "电子白板": { tool: 1, type: 1 },
+              "文档": { tool: 52, type: 1 },
+              "思维导图": { tool: 3, type: 1 },
+              "表格": { tool: 48, type: 1 },
+              "作业提交": { tool: 16, type: 2 }
+            }
+            for (var i = 0; i < tArray.length; i++) {
+              let _task = tArray[i]
+              _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail = _task.detail
+              _this.unitJson[0].chapterInfo[0].taskJson[i].eList = _task.elist
+              _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose = []
+              if (_task.toolChoose.length) {
+                for (var j = 0; j < _task.toolChoose.length; j++) {
+                  _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
+                    {
+                      tool: toolsJson[_task.toolChoose[j].tool] ? [toolsJson[_task.toolChoose[j].tool].tool] : [],
+                      toolDetail: _task.toolChoose[j].detail,
+                      toolType: toolsJson[_task.toolChoose[j].tool] ? toolsJson[_task.toolChoose[j].tool].type : 0,
+                      askCount: 1,
+                      askTitle: "",
+                      askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+                    },
+                  )
+                }
+              } else {
                 _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
                   {
-                    tool: toolsJson[_task.toolChoose[j].tool] ? [toolsJson[_task.toolChoose[j].tool].tool] : [],
-                    toolDetail: _task.toolChoose[j].detail,
-                    toolType: toolsJson[_task.toolChoose[j].tool] ? toolsJson[_task.toolChoose[j].tool].type : 0,
+                    tool: [],
+                    toolDetail: "",
+                    toolType: 0,
                     askCount: 1,
                     askTitle: "",
                     askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
                   },
                 )
               }
-            } else {
-              _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
-                {
-                  tool: [],
-                  toolDetail: "",
-                  toolType: 0,
-                  askCount: 1,
-                  askTitle: "",
-                  askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-                },
-              )
             }
-          }
-          // if (_this.infoData.length) {
-          //   _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = JSON.parse(JSON.stringify(_this.infoData))
-          // }
-          _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-          _this.$forceUpdate();
-        }
-        // if (data.result) {
-        //   console.log(data.result);
-        //   let tArray = JSON.parse(data.result)
-        //   // _this.unitJson[0].chapterInfo[0].task = []
-
-        //   let toolsJson = {
-        //     "电子白板": { tool: 1, type: 1 },
-        //     "文档": { tool: 52, type: 1 },
-        //     "思维导图": { tool: 3, type: 1 },
-        //     "表格": { tool: 48, type: 1 },
-        //     "作业提交": { tool: 16, type: 2 }
-        //   }
-        //   for (var i = 0; i < tArray.length; i++) {
-        //     let _task = tArray[i]
-        //     _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail = _task.detail
-        //     _this.unitJson[0].chapterInfo[0].taskJson[i].eList = _task.elist
-        //     _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose = []
-        //     if (_task.toolChoose.length) {
-        //       for (var j = 0; j < _task.toolChoose.length; j++) {
-        //         _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
-        //           {
-        //             tool: toolsJson[_task.toolChoose[j].tool] ? [toolsJson[_task.toolChoose[j].tool].tool] : [],
-        //             toolDetail: _task.toolChoose[j].detail,
-        //             toolType: toolsJson[_task.toolChoose[j].tool] ? toolsJson[_task.toolChoose[j].tool].type : 0,
-        //             askCount: 1,
-        //             askTitle: "",
-        //             askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-        //           },
-        //         )
-        //       }
-        //     } else {
-        //       _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
-        //         {
-        //           tool: [],
-        //           toolDetail: "",
-        //           toolType: 0,
-        //           askCount: 1,
-        //           askTitle: "",
-        //           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-        //         },
-        //       )
-        //     }
-        //   }
-        //   _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-        //   _this.$forceUpdate();
-        // }
-        callback ? callback() : ''
-      }).catch(function (error) {
-        _this.loading = false
-        console.log(error);
-      });
-
-
-
-      // let parm = {
-      //   assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
-      //   message: messages,
-      //   session_name: uuidv4(),
-      //   userId: this.userid,
-      //   file_ids: fileid.length ? [...fileid] : '',
-      // }
-      // this.ajax
-      //   .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
-      //   .then((response) => {
-      //     console.log(response);
-      //     let data = response.data.FunctionResponse
-      //     if (data.message) {
-      //       console.log(data.message);
-      //       let tArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
-
-      //       let toolsJson = {
-      //         "电子白板": { tool: 1, type: 1 },
-      //         "文档": { tool: 52, type: 1 },
-      //         "思维导图": { tool: 3, type: 1 },
-      //         "表格": { tool: 48, type: 1 },
-      //         "作业提交": { tool: 16, type: 2 }
-      //       }
-      //       for (var i = 0; i < tArray.length; i++) {
-      //         let _task = tArray[i]
-      //         _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail = _task.detail
-      //         _this.unitJson[0].chapterInfo[0].taskJson[i].eList = _task.elist
-      //         _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose = []
-      //         if (_task.toolChoose.length) {
-      //           for (var j = 0; j < _task.toolChoose.length; j++) {
-      //             _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
-      //               {
-      //                 tool: toolsJson[_task.toolChoose[j].tool] ? [toolsJson[_task.toolChoose[j].tool].tool] : [],
-      //                 toolDetail: _task.toolChoose[j].detail,
-      //                 toolType: toolsJson[_task.toolChoose[j].tool] ? toolsJson[_task.toolChoose[j].tool].type : 0,
-      //                 askCount: 1,
-      //                 askTitle: "",
-      //                 askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //               },
-      //             )
-      //           }
-      //         } else {
-      //           _this.unitJson[0].chapterInfo[0].taskJson[i].toolChoose.push(
-      //             {
-      //               tool: [],
-      //               toolDetail: "",
-      //               toolType: 0,
-      //               askCount: 1,
-      //               askTitle: "",
-      //               askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //             },
-      //           )
-      //         }
-      //       }
 
-      //       _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-      //       _this.$forceUpdate();
-      //     }
+            _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+            _this.$forceUpdate();
+          }
           
-      //     callback ? callback() : ''
-      //   })
-      //   .catch((error) => {
-      //     _this.loading = false
-      //     console.log(error);
-      //   });
+          callback ? callback() : ''
+        })
+        .catch((error) => {
+          _this.loading = false
+          console.log(error);
+        });
     },
     async aiGet4(messages, callback, clickType) {
       let _this = this
@@ -13845,83 +13845,156 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
 
 
 
-      let params = JSON.stringify({
-        // "model": "Chat",
-        model: 'gpt-3.5-turbo',
-        temperature: 0,
-        max_tokens: 4096,
-        top_p: 1,
-        frequency_penalty: 0,
-        presence_penalty: 0,
-        messages: [{
-          content: messages,
-          role: 'user'
-        }],
-        stream: false,
-        uid: this.userid,
-        mind_map_question: "",
-      })
       // let params = JSON.stringify({
-      //     message: {
-      //         anthropic_version: "bedrock-2023-05-31",
-      //         max_tokens: 4096,
-      //         temperature: 0,
-      //         top_p: 1,
-      //         messages: [{
-      //           content: messages,
-      //           role: 'user'
-      //         }], // 
-      //     },
-      //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      //   // "model": "Chat",
+      //   model: 'gpt-3.5-turbo',
+      //   temperature: 0,
+      //   max_tokens: 4096,
+      //   top_p: 1,
+      //   frequency_penalty: 0,
+      //   presence_penalty: 0,
+      //   messages: [{
+      //     content: messages,
+      //     role: 'user'
+      //   }],
+      //   stream: false,
+      //   uid: this.userid,
+      //   mind_map_question: "",
+      // })
+      // // let params = JSON.stringify({
+      // //     message: {
+      // //         anthropic_version: "bedrock-2023-05-31",
+      // //         max_tokens: 4096,
+      // //         temperature: 0,
+      // //         top_p: 1,
+      // //         messages: [{
+      // //           content: messages,
+      // //           role: 'user'
+      // //         }], // 
+      // //     },
+      // //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      // // });
+      // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
+      // // _this.ajax.post('https://claude3.cocorobo.cn/claude3Chat', params).then(function (response) {
+      //   console.log(response);
+      //   let data = response.data.FunctionResponse
+      //   if (data.choices && data.choices.length && data.choices[0].message) {
+      //     console.log(data.choices[0].message.content);
+      //     let dArray = JSON.parse(data.choices[0].message.content)
+      //     _this.teacherText = JSON.parse(data.choices[0].message.content)
+      //     if (_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5") {
+      //       _this.unitJson[0].chapterInfo[0].taskJson = []
+      //       for (var i = 0; i < dArray.length; i++) {
+      //         let _task = dArray[i]
+      //         _this.unitJson[0].chapterInfo[0].taskJson.push({
+      //           task: _task.task,
+      //           taskDetail: "",
+      //           taskDetail2: "",
+      //           taskDetail3: _task.detail,
+      //           chapterData: [],
+      //           toolText: "",
+      //           toolChoose: [
+      //             {
+      //               tool: [],
+      //               toolDetail: "",
+      //               toolType: 0,
+      //               askCount: 1,
+      //               askTitle: "",
+      //               askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //             },
+      //           ],
+      //           isShowTools: false,
+      //           askCount: 1,
+      //           isFold: 2,
+      //           askTitle: "",
+      //           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //           checkJson: [{ checkCount: [], checkPerent: [] }],
+      //           homeworkList: [],
+      //         })
+      //       }
+      //       _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
+      //       _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+      //       _this.$forceUpdate();
+      //     } else {
+      //       for (var i = 0; i < dArray.length; i++) {
+      //         let _task = dArray[i]
+      //         if(_this.unitJson[0].chapterInfo[0].taskJson[i]){
+      //           _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail3 = _task.detail
+      //         }else {
+      //           _this.unitJson[0].chapterInfo[0].taskJson[i] = {
+      //             task: _task.task,
+      //             taskDetail: "",
+      //             taskDetail2: "",
+      //             taskDetail3: _task.detail,
+      //             chapterData: [],
+      //             toolText: "",
+      //             toolChoose: [
+      //               {
+      //                 tool: [],
+      //                 toolDetail: "",
+      //                 toolType: 0,
+      //                 askCount: 1,
+      //                 askTitle: "",
+      //                 askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //               },
+      //             ],
+      //             isShowTools: false,
+      //             askCount: 1,
+      //             isFold: 2,
+      //             askTitle: "",
+      //             askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //             checkJson: [{ checkCount: [], checkPerent: [] }],
+      //             homeworkList: [],
+      //           }
+      //         }
+      //       }
+      //       _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+      //       _this.$forceUpdate();
+      //     }
+      //   }
+      //   // if (data.result) {
+      //   //   console.log(data.result);
+      //   //   let dArray = JSON.parse(data.result)
+      //   //   _this.teacherText =  JSON.parse(data.result)
+
+      //   //   for (var i = 0; i < dArray.length; i++) {
+      //   //     let _task = dArray[i]
+      //   //     _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail3 = _task.detail
+      //   //   }
+      //   //   _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+      //   //   _this.$forceUpdate();
+      //   // }
+      //   callback ? callback() : ''
+      //   _this.loading = false
+      // }).catch(function (error) {
+      //   _this.loading = false
+      //   console.log(error);
       // });
-      _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
-      // _this.ajax.post('https://claude3.cocorobo.cn/claude3Chat', params).then(function (response) {
-        console.log(response);
-        let data = response.data.FunctionResponse
-        if (data.choices && data.choices.length && data.choices[0].message) {
-          console.log(data.choices[0].message.content);
-          let dArray = JSON.parse(data.choices[0].message.content)
-          _this.teacherText = JSON.parse(data.choices[0].message.content)
-          if (_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5") {
-            _this.unitJson[0].chapterInfo[0].taskJson = []
-            for (var i = 0; i < dArray.length; i++) {
-              let _task = dArray[i]
-              _this.unitJson[0].chapterInfo[0].taskJson.push({
-                task: _task.task,
-                taskDetail: "",
-                taskDetail2: "",
-                taskDetail3: _task.detail,
-                chapterData: [],
-                toolText: "",
-                toolChoose: [
-                  {
-                    tool: [],
-                    toolDetail: "",
-                    toolType: 0,
-                    askCount: 1,
-                    askTitle: "",
-                    askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-                  },
-                ],
-                isShowTools: false,
-                askCount: 1,
-                isFold: 2,
-                askTitle: "",
-                askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-                checkJson: [{ checkCount: [], checkPerent: [] }],
-                homeworkList: [],
-              })
-            }
-            _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
-            _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-            _this.$forceUpdate();
-          } else {
-            for (var i = 0; i < dArray.length; i++) {
-              let _task = dArray[i]
-              if(_this.unitJson[0].chapterInfo[0].taskJson[i]){
-                _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail3 = _task.detail
-              }else {
-                _this.unitJson[0].chapterInfo[0].taskJson[i] = {
+
+
+
+      let parm = {
+        assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
+        message: [{"type":"text", "text":messages}],
+        session_name: uuidv4(),
+        userId: this.userid,
+        file_ids: fileid.length ? [...fileid] : '',
+      }
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
+        .then((response) => {
+          console.log(response);
+          let data = response.data.FunctionResponse
+          if (data.message) {
+            console.log(data.message);
+            let dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
+
+            _this.teacherText = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
+            if (_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5") {
+              _this.unitJson[0].chapterInfo[0].taskJson = []
+              for (var i = 0; i < dArray.length; i++) {
+                let _task = dArray[i]
+                _this.unitJson[0].chapterInfo[0].taskJson.push({
                   task: _task.task,
                   taskDetail: "",
                   taskDetail2: "",
@@ -13945,127 +14018,54 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
                   askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
                   checkJson: [{ checkCount: [], checkPerent: [] }],
                   homeworkList: [],
+                })
+              }
+              _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
+              _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+              _this.$forceUpdate();
+            } else {
+              for (var i = 0; i < dArray.length; i++) {
+                let _task = dArray[i]
+                if(_this.unitJson[0].chapterInfo[0].taskJson[i]){
+                  _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail3 = _task.detail
+                }else {
+                  _this.unitJson[0].chapterInfo[0].taskJson[i] = {
+                    task: _task.task,
+                    taskDetail: "",
+                    taskDetail2: "",
+                    taskDetail3: _task.detail,
+                    chapterData: [],
+                    toolText: "",
+                    toolChoose: [
+                      {
+                        tool: [],
+                        toolDetail: "",
+                        toolType: 0,
+                        askCount: 1,
+                        askTitle: "",
+                        askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+                      },
+                    ],
+                    isShowTools: false,
+                    askCount: 1,
+                    isFold: 2,
+                    askTitle: "",
+                    askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+                    checkJson: [{ checkCount: [], checkPerent: [] }],
+                    homeworkList: [],
+                  }
                 }
               }
+              _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
+              _this.$forceUpdate();
             }
-            _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-            _this.$forceUpdate();
           }
-        }
-        // if (data.result) {
-        //   console.log(data.result);
-        //   let dArray = JSON.parse(data.result)
-        //   _this.teacherText =  JSON.parse(data.result)
-
-        //   for (var i = 0; i < dArray.length; i++) {
-        //     let _task = dArray[i]
-        //     _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail3 = _task.detail
-        //   }
-        //   _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-        //   _this.$forceUpdate();
-        // }
-        callback ? callback() : ''
-        _this.loading = false
-      }).catch(function (error) {
-        _this.loading = false
-        console.log(error);
-      });
-
-
-
-      // let parm = {
-      //   assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
-      //   message: messages,
-      //   session_name: uuidv4(),
-      //   userId: this.userid,
-      //   file_ids: fileid.length ? [...fileid] : '',
-      // }
-      // this.ajax
-      //   .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
-      //   .then((response) => {
-      //     console.log(response);
-      //     let data = response.data.FunctionResponse
-      //     if (data.message) {
-      //       console.log(data.message);
-      //       let dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
-
-      //       _this.teacherText = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
-      //       if (_this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5") {
-      //         _this.unitJson[0].chapterInfo[0].taskJson = []
-      //         for (var i = 0; i < dArray.length; i++) {
-      //           let _task = dArray[i]
-      //           _this.unitJson[0].chapterInfo[0].taskJson.push({
-      //             task: _task.task,
-      //             taskDetail: "",
-      //             taskDetail2: "",
-      //             taskDetail3: _task.detail,
-      //             chapterData: [],
-      //             toolText: "",
-      //             toolChoose: [
-      //               {
-      //                 tool: [],
-      //                 toolDetail: "",
-      //                 toolType: 0,
-      //                 askCount: 1,
-      //                 askTitle: "",
-      //                 askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //               },
-      //             ],
-      //             isShowTools: false,
-      //             askCount: 1,
-      //             isFold: 2,
-      //             askTitle: "",
-      //             askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //             checkJson: [{ checkCount: [], checkPerent: [] }],
-      //             homeworkList: [],
-      //           })
-      //         }
-      //         _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData = _this.infoData
-      //         _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-      //         _this.$forceUpdate();
-      //       } else {
-      //         for (var i = 0; i < dArray.length; i++) {
-      //           let _task = dArray[i]
-      //           if(_this.unitJson[0].chapterInfo[0].taskJson[i]){
-      //             _this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail3 = _task.detail
-      //           }else {
-      //             _this.unitJson[0].chapterInfo[0].taskJson[i] = {
-      //               task: _task.task,
-      //               taskDetail: "",
-      //               taskDetail2: "",
-      //               taskDetail3: _task.detail,
-      //               chapterData: [],
-      //               toolText: "",
-      //               toolChoose: [
-      //                 {
-      //                   tool: [],
-      //                   toolDetail: "",
-      //                   toolType: 0,
-      //                   askCount: 1,
-      //                   askTitle: "",
-      //                   askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //                 },
-      //               ],
-      //               isShowTools: false,
-      //               askCount: 1,
-      //               isFold: 2,
-      //               askTitle: "",
-      //               askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-      //               checkJson: [{ checkCount: [], checkPerent: [] }],
-      //               homeworkList: [],
-      //             }
-      //           }
-      //         }
-      //         _this.unitJson2 = JSON.parse(JSON.stringify(_this.unitJson))
-      //         _this.$forceUpdate();
-      //       }
-      //     }
-      //     callback ? callback() : ''
-      //   })
-      //   .catch((error) => {
-      //     _this.loading = false
-      //     console.log(error);
-      //   });
+          callback ? callback() : ''
+        })
+        .catch((error) => {
+          _this.loading = false
+          console.log(error);
+        });
     },
     aiDetail(msg, index) {
       let _this = this

+ 125 - 29
src/components/pages/aiAddCourse/aiCreateDialog.vue

@@ -28,6 +28,7 @@
 <script>
 import Pptxgen from "pptxgenjs"
 import wOffice from '../components/wOffice.vue'
+import { v4 as uuidv4 } from "uuid";
 
 export default {
     components: {
@@ -41,6 +42,10 @@ export default {
         courseName: {
             type: String,
             default: ""
+        },
+        infoData: {
+            type: Array,
+            default: ""
         }
     },
     // 根据用户给你的参考资料
@@ -78,7 +83,17 @@ export default {
         dialogVisibleAiCreate(newValue, oldValue) {
             if (newValue) {
                 // if (this.radio == 0) {
-                    this.detail = this.aiJson.ppt
+                    this.detail =  `## 任务
+请根据用户给你的参考资料,生成关于${this.courseName},为教师生成这节课的教学ppt,页数在20页左右。PPT的内容主要是讲解该课程中所有可能涉及到的知识点。
+
+## 工作流
+1. 从用户提供的参考资料中提取10个最重要的知识点(知识点水平限制在小学和初中),并输出。
+2. 针对10个知识点中的每个,你使用1~3页ppt详细的对知识点进行讲解。你的讲解词应该在100token左右
+3. 讲解完所有知识点后,再根据知识点出5道单选题(放在5页ppt中)
+
+## 限制
+- 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
+- 你不能输出违反伦理的内容`
                 // }
                 // if (this.radio == 1) {
                 //     this.detail = this.aiJson.word
@@ -117,7 +132,29 @@ export default {
                 this.detail = this.aiJson.video
             }
         },
-        aiGet() {
+        createFileid(url) {
+            let _this = this
+            return new Promise((resolve, reject) => {
+                try {
+                _this.ajax
+                .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
+                    url: url,
+                })
+                .then((res) => {
+                    let _data = res.data.FunctionResponse;
+                    if (_data.result && _data.result.id) {
+                    resolve(_data.result.id)
+                    }
+                }).catch(function (error) {
+                    resolve('')
+                });
+                }catch (e){
+                resolve()
+                }
+                
+            });
+        },
+        async aiGet() {
             if(this.loading){
                 this.$message.error('正在生成中,请稍后');
                 return;
@@ -125,59 +162,118 @@ export default {
             this.url = ''
             this.uJson = {}
             let _this = this
+
+            let fileid = []
+            if (_this.infoData.length) {
+                for (var i = 0; i < _this.infoData.length; i++) {
+                if(_this.infoData[i].fileid){
+                    fileid.push(_this.infoData[i].fileid)
+                }else {
+                    let _fileid = await _this.createFileid(_this.infoData[i].url)
+                    if(_fileid){
+                    _this.infoData[i].fileid = _fileid
+                    _this.$forceUpdate();
+                    fileid.push(_fileid)
+                    }
+                }
+                }
+            }
+            console.log('fileid=========',fileid)  
+
+
             let message = ''
             if (_this.radio == 0) {
-                message = `ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
-
+                message = `NOTICE
+Role: 使用file_search的方式完整的去分析文件内容(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容),并请完全按照要求输出。.
+Output: Provide your output in json format.
+User: Please generate a recipe for chocolate chip cookies in JSON format.
+Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
+ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
+Instruction: Based on the context, follow "Format example", write content.
+
+# Context 
 ${this.detail}
 
 ## 要求
 根据Format example的要求返回要以数组的格式
 
-## Format example
+# Format example
 [{"page": "页码(数字)","title": "标题","task": "对应教学任务:依据用户输入的参考资料而定,如果用户未提供则不输出","points": "知识点讲解:针对知识点的详细讲解,你的语气应该让小学或初中的学生清晰易懂的讲解。你的讲解词在100 token左右。请尽可能的详细,这对我很重要。"}]`
             } else if (_this.radio == 1) {
 
             } else if (_this.radio == 2) {
 
             }
-            let params = JSON.stringify({
-                // "model": "Chat",
-                model: 'gpt-3.5-turbo',
-                temperature: 0,
-                max_tokens: 4096,
-                top_p: 1,
-                frequency_penalty: 0,
-                presence_penalty: 0,
-                messages: [{
-                    content: message,
-                    role: 'user'
-                }],
-                stream: false,
-                uid: this.userid,
-                mind_map_question: "",
-            })
 
+
+            // let params = JSON.stringify({
+            //     // "model": "Chat",
+            //     model: 'gpt-3.5-turbo',
+            //     temperature: 0,
+            //     max_tokens: 4096,
+            //     top_p: 1,
+            //     frequency_penalty: 0,
+            //     presence_penalty: 0,
+            //     messages: [{
+            //         content: message,
+            //         role: 'user'
+            //     }],
+            //     stream: false,
+            //     uid: this.userid,
+            //     mind_map_question: "",
+            // })
+
+            // _this.loading = true
+            // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
+            //     console.log(response);
+            //     let data = response.data.FunctionResponse
+            //     if (data.choices && data.choices.length && data.choices[0].message) {
+            //         console.log(data.choices[0].message.content);
+            //         try {
+            //             let _data = JSON.parse(data.choices[0].message.content)
+            //             _this.createPpt(_data)
+            //         } catch (e) {
+            //             console.log('error_________________'+e);
+            //             _this.$message.error(data.choices[0].message.content)
+            //             _this.loading = false
+            //         }
+
+            //     }
+            // }).catch(function (error) {
+            //     _this.loading = false
+            //     console.log(error);
+            // });
+
+
+            let parm = {
+                assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
+                message: [{"type":"text", "text":message}],
+                session_name: uuidv4(),
+                userId: this.userid,
+                file_ids: fileid.length ? [...fileid] : '',
+            }
             _this.loading = true
-            _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
+            this.ajax
+                .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
+                .then((response) => {
                 console.log(response);
                 let data = response.data.FunctionResponse
-                if (data.choices && data.choices.length && data.choices[0].message) {
-                    console.log(data.choices[0].message.content);
+                if (data.message) {
+                    console.log(data.message);
                     try {
-                        let _data = JSON.parse(data.choices[0].message.content)
+                        let _data = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
                         _this.createPpt(_data)
                     } catch (e) {
                         console.log('error_________________'+e);
-                        _this.$message.error(data.choices[0].message.content)
+                        _this.$message.error(data.message)
                         _this.loading = false
                     }
-
                 }
-            }).catch(function (error) {
+                })
+                .catch((error) => {
                 _this.loading = false
                 console.log(error);
-            });
+                });
         },
         createPpt(array) {
             // 1. 创建PPT

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません