|
@@ -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
|