|
@@ -52,6 +52,10 @@
|
|
|
@click="onCopy(item.aiContent)"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <div class="ai_tips_btn_box" v-if="item.promptArray && item.promptArray.length">
|
|
|
+ <span v-for="(pr, pindex) in item.promptArray" :key="pindex">{{ pr.name }}</span>
|
|
|
+ <span>更多</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -435,6 +439,10 @@ export default {
|
|
|
return {};
|
|
|
}
|
|
|
},
|
|
|
+ fileids: {
|
|
|
+ type: Array,
|
|
|
+ default: []
|
|
|
+ },
|
|
|
languageSetting: {
|
|
|
type: Number,
|
|
|
default: 0
|
|
@@ -621,6 +629,115 @@ export default {
|
|
|
this.showjList = false;
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ jArray: {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ handler(newValue, oldValue) {
|
|
|
+ if (newValue.length > oldValue.length) {
|
|
|
+ return
|
|
|
+ let addedData = newValue.filter((item, index) => {
|
|
|
+ return !oldValue.some((oldItem, oldIndex) => {
|
|
|
+ return JSON.stringify(oldItem) === JSON.stringify(item);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (addedData[0].string.includes('aiDetail') ||
|
|
|
+ addedData[0].string.includes('aitargetTextDetail2') ||
|
|
|
+ addedData[0].string.includes('aiDetail1') ||
|
|
|
+ addedData[0].string.includes('teacherDetail2')) {
|
|
|
+ let promptJson = {
|
|
|
+ aiDetail: [
|
|
|
+ {
|
|
|
+ name: '更换驱动性问题',
|
|
|
+ prompt: '请重新生成该课程的驱动性问题,并确保它更加贴合实际课堂环境。确保问题能激发学生的好奇心和批判性思维。你仅需要重新输出新的驱动性问题。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '更换最终作品',
|
|
|
+ prompt: '请重新生成该课程的最终作品(区分个人和团队作品),并确保它们更加贴合实际校园环境,更加具备可操作性,且更加丰富。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '生成更有创意的课程概述',
|
|
|
+ prompt: '请优化该课程概述,使其更加创意十足,吸引学生的兴趣,但仍遵循原有结构。'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ aitargetTextDetail2: [
|
|
|
+ {
|
|
|
+ name: '重新匹配课程标准',
|
|
|
+ prompt: '请重新匹配适合该课程的具体学习目标,确保目标清晰、可衡量,并与国家标准接轨。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '整合课程目标',
|
|
|
+ prompt: '将【课程目标】的分科课程目标进行整合,重新生成跨学科的综合课程目标描述,并确保目标在整个课程体系中相互关联。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '优化课程目标的可衡量性',
|
|
|
+ prompt: '请重新设计课程目标,确保每个目标都具有可衡量性,能够有效评估学生的学习成果。'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ aiDetail1: [
|
|
|
+ {
|
|
|
+ name: '优化子教学目标',
|
|
|
+ prompt: '请根据该任务的内容,优化其子教学目标,使其更加具体且具有挑战性,帮助学生更好理解学习内容。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '改进过程性成果',
|
|
|
+ prompt: '请重新设计该任务的过程性成果,并确保学生能够通过该过程成果展示出他们的学习进展。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '优化的子评价标准',
|
|
|
+ prompt: '请重新设计该任务的评价标准,使其涵盖更多方面,综合评估学生的知识应用和技能发展。'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ teacherDetail2: [
|
|
|
+ {
|
|
|
+ name: '优化教学过程',
|
|
|
+ prompt: '请根据该任务的教学目标,优化教师活动和学生活动,确保两者有效互动,并加强教学设计意图的表达。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '改进评价量规',
|
|
|
+ prompt: '请重新设计该任务的评价量规,确保其能够有效评估学生的学习成果,并指导改进学生的学习行为。'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '扩展知识点讲解',
|
|
|
+ prompt: '请扩展该任务中的相关知识点讲解,确保学生能够深刻理解核心概念,并通过课堂活动加以应用。'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ let _uid = uuidv4();
|
|
|
+ const md = new MarkdownIt();
|
|
|
+ let content = `根据您引用的内容, 猜您想让小可...
|
|
|
+ \`\`\`
|
|
|
+ ${addedData[0].area + ':' + (addedData[0].value.length > 200 ? addedData[0].value.slice(0, 200) + '...' : addedData[0].value)}
|
|
|
+ \`\`\`
|
|
|
+ `
|
|
|
+ this.array.push({
|
|
|
+ loading: false,
|
|
|
+ role: "",
|
|
|
+ content: "",
|
|
|
+ uid: _uid,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent: md.render(content),
|
|
|
+ oldContent: "",
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: "",
|
|
|
+ index: 0,
|
|
|
+ is_mind_map: false,
|
|
|
+ fileid: "",
|
|
|
+ createtime: new Date().toLocaleString().replaceAll("/", "-"),
|
|
|
+ addedData: addedData[0],
|
|
|
+ promptArray: promptJson[Object.keys(promptJson).find(item => addedData[0].string.includes(item))] || []
|
|
|
+ });
|
|
|
+ console.log('新增数据:', addedData);
|
|
|
+ console.log(Object.values(promptJson).find(arr => arr.some(item => addedData[0].string.includes(item.name))))
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ console.log('没有新增数据');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -843,9 +960,9 @@ ${message}`;
|
|
|
message: _replaceText,
|
|
|
session_name: `${this.courseId}-addCourseA`,
|
|
|
uid: _uid,
|
|
|
- file_ids: [],
|
|
|
+ file_ids: [...this.fileids],
|
|
|
// model: "gpt-4o-mini"
|
|
|
- model: "qwen-plus"
|
|
|
+ // model: "qwen-plus"
|
|
|
};
|
|
|
|
|
|
this.ajax
|
|
@@ -884,58 +1001,58 @@ ${message}`;
|
|
|
});
|
|
|
|
|
|
let history = [];
|
|
|
- if (this.continuous) {
|
|
|
- this.array.forEach((i, index) => {
|
|
|
- if (i.content)
|
|
|
- history.push({
|
|
|
- role: "user",
|
|
|
- content: index == this.array.length - 1 ? `NOTICE
|
|
|
-Language: ${this.getLang()}
|
|
|
-
|
|
|
-${message}` : `NOTICE
|
|
|
-Language: ${this.getLang()}
|
|
|
-
|
|
|
-${i.content}`
|
|
|
- });
|
|
|
- if (i.aiContent)
|
|
|
- history.push({ role: "assistant", content: i.aiContent });
|
|
|
- });
|
|
|
- } else {
|
|
|
- history.push({ role: "user", content: message });
|
|
|
- }
|
|
|
- history = history.filter(
|
|
|
- i =>
|
|
|
- i.content !=
|
|
|
- "您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的"
|
|
|
- );
|
|
|
-
|
|
|
- history = history.map(i => ({
|
|
|
- role: i.role,
|
|
|
- content: `NOTICE
|
|
|
-Language: ${this.getLang()}
|
|
|
+// if (this.continuous) {
|
|
|
+// this.array.forEach((i, index) => {
|
|
|
+// if (i.content)
|
|
|
+// history.push({
|
|
|
+// role: "user",
|
|
|
+// content: index == this.array.length - 1 ? `NOTICE
|
|
|
+// Language: ${this.getLang()}
|
|
|
+
|
|
|
+// ${message}` : `NOTICE
|
|
|
+// Language: ${this.getLang()}
|
|
|
+
|
|
|
+// ${i.content}`
|
|
|
+// });
|
|
|
+// if (i.aiContent)
|
|
|
+// history.push({ role: "assistant", content: i.aiContent });
|
|
|
+// });
|
|
|
+// } else {
|
|
|
+// history.push({ role: "user", content: message });
|
|
|
+// }
|
|
|
+// history = history.filter(
|
|
|
+// i =>
|
|
|
+// i.content !=
|
|
|
+// "您好,我是您的创课助手小可,在创课中遇到什么问题,都可以与我对话~,我会尽量帮助您的"
|
|
|
+// );
|
|
|
+
|
|
|
+// history = history.map(i => ({
|
|
|
+// role: i.role,
|
|
|
+// content: `NOTICE
|
|
|
+// Language: ${this.getLang()}
|
|
|
+
|
|
|
+// ${i.content}`
|
|
|
+// }));
|
|
|
+ let _replaceText = `NOTICE
|
|
|
+ Language: ${this.getLang()}
|
|
|
|
|
|
-${i.content}`
|
|
|
- }));
|
|
|
+ ${message}`;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
});
|
|
|
- let params = JSON.stringify({
|
|
|
- // model: "gpt-3.5-turbo",
|
|
|
- // model: "gpt-4o-mini",
|
|
|
- model: "qwen-plus",
|
|
|
- temperature: 0,
|
|
|
- max_tokens: 4096,
|
|
|
- top_p: 1,
|
|
|
- frequency_penalty: 0,
|
|
|
- presence_penalty: 0,
|
|
|
- messages: history,
|
|
|
+ let params = {
|
|
|
+ assistant_id: 'b19f1a1a-7586-11ef-8ce0-12e77c4cb76b',
|
|
|
+ userId: this.userid,
|
|
|
+ message: _replaceText,
|
|
|
+ session_name: this.continuous ? `${this.courseId}-addCourseA` : uuidv4(),
|
|
|
uid: _uuid,
|
|
|
- mind_map_question: ""
|
|
|
- });
|
|
|
- this.courseText = "";
|
|
|
+ file_ids: [...this.fileids],
|
|
|
+ // model: "gpt-4o-mini"
|
|
|
+ // model: "qwen-plus"
|
|
|
+ };
|
|
|
|
|
|
this.ajax
|
|
|
- .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
+ .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
|
|
|
.then(res => {
|
|
|
if (
|
|
|
converter(res.data.FunctionResponse.result) ==
|
|
@@ -945,11 +1062,43 @@ ${i.content}`
|
|
|
this.$message.warning(res.data.FunctionResponse.result);
|
|
|
}
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
});
|
|
|
- this.getAiContent(_uuid);
|
|
|
+ this.getAtAuContent(_uuid);
|
|
|
this.saveUid = _uuid;
|
|
|
+ this.courseText = "";
|
|
|
+ // let params = JSON.stringify({
|
|
|
+ // // model: "gpt-3.5-turbo",
|
|
|
+ // // model: "gpt-4o-mini",
|
|
|
+ // model: "qwen-plus",
|
|
|
+ // temperature: 0,
|
|
|
+ // max_tokens: 4096,
|
|
|
+ // top_p: 1,
|
|
|
+ // frequency_penalty: 0,
|
|
|
+ // presence_penalty: 0,
|
|
|
+ // messages: history,
|
|
|
+ // uid: _uuid,
|
|
|
+ // mind_map_question: ""
|
|
|
+ // });
|
|
|
+ // this.courseText = "";
|
|
|
+
|
|
|
+ // this.ajax
|
|
|
+ // .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
+ // .then(res => {
|
|
|
+ // if (
|
|
|
+ // converter(res.data.FunctionResponse.result) ==
|
|
|
+ // converter("发送成功")
|
|
|
+ // ) {
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.data.FunctionResponse.result);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // console.log(e);
|
|
|
+ // });
|
|
|
+ // this.getAiContent(_uuid);
|
|
|
+ // this.saveUid = _uuid;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -1874,6 +2023,7 @@ ${i.content}`
|
|
|
display: flex;
|
|
|
align-items: flex-start;
|
|
|
width: 100%;
|
|
|
+ flex-wrap: wrap;
|
|
|
}
|
|
|
|
|
|
.dialog_content + .dialog_content {
|
|
@@ -2157,4 +2307,26 @@ ${i.content}`
|
|
|
cursor: pointer;
|
|
|
width: 15px;
|
|
|
}
|
|
|
+
|
|
|
+.ai_tips_btn_box{
|
|
|
+ width: 100%;
|
|
|
+ padding: 0 20px 0 50px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ margin-top: 27px;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_tips_btn_box > span{
|
|
|
+ cursor: pointer;
|
|
|
+ background: #9bc1ff;
|
|
|
+ color: #ffffff;
|
|
|
+ width: fit-content;
|
|
|
+ padding: 8px;
|
|
|
+ border-radius: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_tips_btn_box > span + span{
|
|
|
+ margin-top: 6px;
|
|
|
+}
|
|
|
</style>
|