From 0ed69394efbd91c2cec7b0b031c0fe0a7830cbf7 Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 18 Dec 2024 17:31:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/adjust-dialog.vue | 31 ++++++++++- .../template-study/container/right.vue | 4 +- .../container/adjust-dialog.vue | 51 +++++++++++++++---- .../views/teachingDesign/container/right.vue | 26 +++++++--- 4 files changed, 91 insertions(+), 21 deletions(-) diff --git a/src/renderer/src/components/template-study/container/adjust-dialog.vue b/src/renderer/src/components/template-study/container/adjust-dialog.vue index a5fa027..000f8e2 100644 --- a/src/renderer/src/components/template-study/container/adjust-dialog.vue +++ b/src/renderer/src/components/template-study/container/adjust-dialog.vue @@ -59,6 +59,7 @@ import { completion, docList } from '@/api/mode/index' import { sessionStore } from '@/utils/store' import { dataSetJson } from '@/utils/comm.js' import useUserStore from '@/store/modules/user' +import { sendChart } from '@/api/ai/index' import emitter from '@/utils/mitt'; const userInfo = useUserStore().user @@ -77,6 +78,14 @@ const props = defineProps({ type: { type: Number, default: 1 + }, + curMode:{ + type: Number, + default: 1 + }, + conversation_id: { + type: [Number, String], + default: '' } }) @@ -100,7 +109,8 @@ const curNode = reactive({}) const params = reactive( { prompt: '', - dataset_id: '' + dataset_id: '', + template: '' } ) @@ -108,7 +118,24 @@ const params = reactive( const getCompletion = async (val) => { try { params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析` - const { data } = await completion(params) + params.template = props.item.prompt + + let data = null; + // 教学大模型 + if(props.curMode == 1){ + const res = await sendChart({ + content: params.prompt, + conversationId: props.conversation_id, + stream: false + }) + data = res.data + } + else{ + // 知识库模型 + const res = await completion(params) + data = res.data + } + let answer = data.answer msgList.value.push({ type: 'robot', diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 74a87c3..2f4b93c 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -81,7 +81,7 @@ - + @@ -323,7 +323,7 @@ const againResult = async (index, item) => { let data = null; // 教学大模型 - if (mode.value == 1) { + if (curMode.value == 1) { const res = await sendChart({ content: params.prompt, conversationId: conversation_id.value, diff --git a/src/renderer/src/views/teachingDesign/container/adjust-dialog.vue b/src/renderer/src/views/teachingDesign/container/adjust-dialog.vue index fd887a2..a58bbd8 100644 --- a/src/renderer/src/views/teachingDesign/container/adjust-dialog.vue +++ b/src/renderer/src/views/teachingDesign/container/adjust-dialog.vue @@ -42,9 +42,10 @@