diff --git a/src/apis/index.ts b/src/apis/index.ts index 19a573e034895d973d36b35b987cdff891879f3a..19d9c0f65349bde01d8923209bac0615ee66d511 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -7,7 +7,7 @@ // IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // PURPOSE. // See the Mulan PSL v2 for more details. -import { accountApi, sessionApi, externalApi, apiKeyApi, knowledgeApi } from './paths'; +import { accountApi, sessionApi, externalApi, apiKeyApi, knowledgeApi, appApi, apiApi } from './paths'; export const api = { ...accountApi, @@ -15,4 +15,6 @@ export const api = { ...externalApi, ...apiKeyApi, ...knowledgeApi, + ...appApi, + ...apiApi }; diff --git a/src/apis/paths/api.ts b/src/apis/paths/api.ts new file mode 100644 index 0000000000000000000000000000000000000000..18d1d8d047007e6af6c13a0ca87bc39807e598fa --- /dev/null +++ b/src/apis/paths/api.ts @@ -0,0 +1,164 @@ +// Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved. +// licensed under the Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN 'AS IS' BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +// PURPOSE. +// See the Mulan PSL v2 for more details. +import { get, post, del, put } from 'src/apis/server'; +import type { FcResponse } from 'src/apis/server'; +import { ApiMessage, Service } from './type'; + +/** + * 查询服务下接口信息 + * @returns + */ +export const getApiMessageByServiceId = ( + serviceId: string, + page: number, + pageSize: number, +): Promise< + [ + any, + ( + | FcResponse<{ + serviceId: string; + name: string; + apis: ApiMessage[]; + }> + | undefined + ) + ] +> => { + return get(`/api/service/${serviceId}/key`,{page, pageSize}); +}; + +/** + * 查询语义服务列表 + * @returns + */ +export const getApiMessageList = (params: { + createdByMe?: string; + favorited?: string; + searchType?: string; + keyword?: string; + page?: number; + pageSize?: number; +} + ): Promise< + [ + any, + ( + | FcResponse<{ + services: Service[]; + }> + | undefined + ) + ] + > => { + return get('/api/auth/key',{ + ...params + }); + }; + +/** + * 通过上传 YAML 文本创建/编辑服务 + * @returns + */ +export const uploadYAML = (params: { + serviceId?: string; + yaml: string; + } + ): Promise< + [ + any, + ( + | FcResponse<{ + serviceId: string; + name: string; + apis: ApiMessage[]; + }> + | undefined + ) + ] + > => { + return post('/api/service',{ + ...params + }); + }; + +/** + * 获取指定服务的详细信息及 YAML 内容 + * @returns + */ +export const getYAMLByServiceId = (params: { + serviceId: string; + } + ): Promise< + [ + any, + ( + | FcResponse<{ + serviceId: string; + name: string; + yaml: string; + }> + | undefined + ) + ] + > => { + return get(`/api/service/${params.serviceId}`) + }; + +/** + * 删除指定服务 + * @returns + */ +export const deleteYAMLByServiceId = (params: { + serviceId: string; + } + ): Promise< + [ + any, + ( + | FcResponse<{ + serviceId: string; + }> + | undefined + ) + ] + > => { + return del(`/api/service/${params.serviceId}`); + }; + +/** + * 更改服务收藏状态 + * @returns + */ +export const likeServiceByServiceId = (params: { + serviceId: string; + } + ): Promise< + [ + any, + ( + | FcResponse<{ + serviceId: string; + }> + | undefined + ) + ] + > => { + return put(`/api/service/${params.serviceId}`); + }; + +export const apiApi = { + getApiMessageByServiceId, + getApiMessageList, + uploadYAML, + getYAMLByServiceId, + deleteYAMLByServiceId, + likeServiceByServiceId, +}; diff --git a/src/apis/paths/app.ts b/src/apis/paths/app.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc903f65a3de622406636c75fcd161e16a3d67dd --- /dev/null +++ b/src/apis/paths/app.ts @@ -0,0 +1,35 @@ +// Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved. +// licensed under the Mulan PSL v2. +// You can use this software according to the terms and conditions of the Mulan PSL v2. +// You may obtain a copy of Mulan PSL v2 at: +// http://license.coscl.org.cn/MulanPSL2 +// THIS SOFTWARE IS PROVIDED ON AN 'AS IS' BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +// PURPOSE. +// See the Mulan PSL v2 for more details. +import { get } from 'src/apis/server'; +import type { FcResponse } from 'src/apis/server'; +import { Application } from './type'; + +type App = { + applications: Application[]; +} +/** + * 获取最近 top5 应用 + * @returns + */ +export const getTopFiveApp = (count: number): Promise< + [ + any, + ( + | FcResponse + | undefined + ) + ] +> => { + return get('/api/app/recent',{count}); +}; + +export const appApi = { + getTopFiveApp, +}; diff --git a/src/apis/paths/index.ts b/src/apis/paths/index.ts index 191ea5850e339b1aff339f92e0092d6a30b7c781..0b0570c84404cfd979f757dc946b1c32acc95c45 100644 --- a/src/apis/paths/index.ts +++ b/src/apis/paths/index.ts @@ -12,4 +12,5 @@ export * from './conversation'; export * from './external'; export * from './apikey'; export * from './knowledge'; - +export * from './app'; +export * from './api'; \ No newline at end of file diff --git a/src/apis/paths/type.ts b/src/apis/paths/type.ts index 443fc2937c67d8f511008bc5f400badc938f2053..d25c76ed4f1e63ab557bd1ac8ec4753466fa6838 100644 --- a/src/apis/paths/type.ts +++ b/src/apis/paths/type.ts @@ -22,8 +22,8 @@ export interface Step { // 定义流程信息的接口 export interface Flow { - plugin_id: string; - flow_id: string; + appId: string; + flowId: string; steps: Step[]; } @@ -44,7 +44,7 @@ export interface Metadata { // 定义问答对数据结构 export interface ConversationRecord { id: string; - group_id: string; + groupId: string; conversation_id: string; task_id: string; files: File[]; @@ -59,14 +59,14 @@ export interface ConversationRecordList { } /* 推荐问题的格式 - * "plugin_id": "aops-apollo", //推荐项关联的插件ID,若不关联则为空 - * "flow_id": "query_cve_info", //推荐项关联的工作流ID,若不关联则为空 + * "appId": "aops-apollo", //推荐项关联的插件ID,若不关联则为空 + * "flowId": "query_cve_info", //推荐项关联的工作流ID,若不关联则为空 * "flow_description": "查询机器192.168.10.1的CVE信息", //推荐项关联的工作流描述,若不关联则为空 * "question": "查询机器192.168.10.1的CVE信息", //推荐问题的内容 */ export interface Suggest { - plugin_id: string, - flow_id: string, + appId: string, + flowId: string, flow_description: string, question: string, } @@ -87,3 +87,34 @@ export interface ConversationListItem { export interface ConversationList { conversations: Array; } + +/* + * 应用数据结构 + */ +export interface Application { + appId: string, + name: string, +} + +/* + * 语意接口数据结构 + */ +export interface ApiMessage { + apiId: string, + name: string, + type: string, + path: string, + description: string, +} + +/* + * 语意接口数据结构 + */ +export interface Service { + serviceId: string, + name: string, + icon: string, + author: string, + description: string, + favorite: boolean, +} \ No newline at end of file diff --git a/src/components/dialoguePanel/DialoguePanel.vue b/src/components/dialoguePanel/DialoguePanel.vue index 5d955b6ac188fecb4466990e3d8bd0c196f652fc..1d684336cc8cf41fe6f07bc6cf6d35d29a747941 100644 --- a/src/components/dialoguePanel/DialoguePanel.vue +++ b/src/components/dialoguePanel/DialoguePanel.vue @@ -17,7 +17,7 @@ import { Linetooltip , Circlelegend } from './chartsCss' import i18n from 'src/i18n'; import { storeToRefs } from 'pinia'; import { useLangStore } from 'src/store' -const { user_selected_plugins } = storeToRefs(useHistorySessionStore()); +const { user_selected_app } = storeToRefs(useHistorySessionStore()); import { Suggest } from 'src/apis/paths/type'; const { params } = storeToRefs(useHistorySessionStore()); @@ -48,7 +48,7 @@ export interface DialoguePanelProps { // 是否需要重新生成 needRegernerate?: boolean; // 是否选择插件 - userSelectedPlugins?: any; + userSelectedApp?: any; // recordList?: string[] | undefined; // @@ -131,7 +131,7 @@ const handlePauseAndReGenerate = (cid?: number) => { emits("clearSuggestion", props.key); if (props.isFinish) { // 重新生成 - reGenerateAnswer(cid, user_selected_plugins.value); + reGenerateAnswer(cid, user_selected_app.value); } else { // 停止生成 pausedStream(cid); @@ -371,7 +371,7 @@ const zoom_out = () => { const selectQuestion = (item:Suggest) => { let question = item.question; - let user_selected_flow = item.flow_id; + let user_selected_flow = item.flowId; if(user_selected_flow){ emits('handleSendMessage',undefined,question,user_selected_flow); }else{ @@ -400,27 +400,27 @@ const { sendQuestion } = useSessionStore(); const chatWithParams = async () => { visible.value = false; - // handleSendMessage(undefined,undefined,user_selected_plugins.value); - // reGenerateAnswer(props.cid, user_selected_plugins.value,"params"); + // handleSendMessage(undefined,undefined,user_selected_app.value); + // reGenerateAnswer(props.cid, user_selected_app.value,"params"); const language = localStorage.getItem('localeLang') === 'CN' ? 'zh' : 'en'; const len = conversationList.value.length; const question = (conversationList.value[props.cid - 1]).message; - const flow_id = (conversationList.value[props.cid]).flowdata.flow_id; - await sendQuestion(undefined,question, user_selected_plugins.value, undefined, undefined, flow_id,params.value); + const flowId = (conversationList.value[props.cid]).flowdata.flowId; + await sendQuestion(undefined,question, user_selected_app.value, undefined, undefined, flowId,params.value); } -const searchPluginName = (plugin_id) => { +const searchAppName = (appId) => { for(let item in props.modeOptions){ - if(props.modeOptions[item].value == plugin_id){ + if(props.modeOptions[item].value == appId){ return props.modeOptions[item].label } } return '' } -const handleSendMessage = async (question, user_selected_flow, user_selected_plugins) => { +const handleSendMessage = async (question, user_selected_flow, user_selected_app) => { visible.value = false; - // handleSendMessage(undefined,undefined,user_selected_plugins.value); + // handleSendMessage(undefined,undefined,user_selected_app.value); } @@ -580,7 +580,7 @@ const handleSendMessage = async (question, user_selected_flow, user_selected_plu diff --git a/src/components/dialoguePanel/data.ts b/src/components/dialoguePanel/data.ts index 17a34c4dc42eff97fa86acb8de96f82381ef1339..76f7dcde63b056a9328121d5bb658e6adc9f3787 100644 --- a/src/components/dialoguePanel/data.ts +++ b/src/components/dialoguePanel/data.ts @@ -1,12 +1,12 @@ export const input = { "event": "flow.start", "id": "0f9d3e6b-7845-44ab-b247-35c522d38f13", - "group_id": "09125776-ba69-4832-86c9-c5035f9343fd", + "groupId": "09125776-ba69-4832-86c9-c5035f9343fd", "conversation_id": "eccb08c3-0621-4602-a4d2-4eaada892557", "task_id": "eb717bc7-3435-4172-82d1-6b69e62f3fd6", "flow": { - "plugin_id": "aops-cve", - "flow_id": "query_cve_info", + "appId": "aops-cve", + "flowId": "query_cve_info", "step_name": "开始", "step_status": "finished", "step_progress": "1/4" @@ -26,12 +26,12 @@ export const input = { export const output = { "event": "flow.stop", "id": "0f9d3e6b-7845-44ab-b247-35c522d38f13", - "group_id": "09125776-ba69-4832-86c9-c5035f9343fd", + "groupId": "09125776-ba69-4832-86c9-c5035f9343fd", "conversation_id": "eccb08c3-0621-4602-a4d2-4eaada892557", "task_id": "eb717bc7-3435-4172-82d1-6b69e62f3fd6", "flow": { - "plugin_id": "aops-cve", - "flow_id": "query_cve_info", + "appId": "aops-cve", + "flowId": "query_cve_info", "step_name": "开始", "step_status": "finished", "step_progress": "1/4" diff --git a/src/store/conversation.ts b/src/store/conversation.ts index aec2ae63fb5a636cfa5e5bb28d889024f499b0b4..2dd5b22230caeaaad6f43d863322939f07da23cd 100644 --- a/src/store/conversation.ts +++ b/src/store/conversation.ts @@ -23,6 +23,7 @@ import i18n from 'src/i18n'; import { ElMessageBox } from 'element-plus'; import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'; import { storeToRefs } from 'pinia'; +import { Application } from 'src/apis/paths/type'; const STREAM_URL = '/api/chat'; let controller = new AbortController(); @@ -70,7 +71,7 @@ export const useSessionStore = defineStore('conversation', () => { // 会话列表 const conversationList = ref([]); const app = ref({}); - const appList = ref([]); + const appList = ref(); // ai回复是否还在生成中 const isAnswerGenerating = ref(false); /** @@ -81,11 +82,11 @@ export const useSessionStore = defineStore('conversation', () => { const getStream = async ( params: { question: string; - user_selected_plugins?: any, + user_selected_app?: any, conversation_id?: string; qaRecordId?: string; user_selected_flow?: string; - group_id?: string; + groupId?: string; params?: any; }, ind?: number @@ -123,11 +124,11 @@ export const useSessionStore = defineStore('conversation', () => { question: params.question, language, conversation_id: params.conversation_id, - group_id: params.group_id, + groupId: params.groupId, // record_id: params.qaRecordId, - plugins:[{ - plugin_id:params.user_selected_plugins[0], - flow_id: params.user_selected_flow, + app:[{ + appId:params.user_selected_app[0], + flowId: params.user_selected_flow, params: pp, auth:{}, }], @@ -135,7 +136,7 @@ export const useSessionStore = defineStore('conversation', () => { }), }); } - else if (params.user_selected_plugins) { + else if (params.user_selected_app) { resp = await fetch(STREAM_URL, { signal: controller.signal, method: 'POST', @@ -146,11 +147,11 @@ export const useSessionStore = defineStore('conversation', () => { conversation_id: params.conversation_id, record_id: params.qaRecordId, language, - group_id: params.group_id, + groupId: params.groupId, // record_id: params.qaRecordId, - plugins:[{ - plugin_id:params.user_selected_plugins[0], - flow_id: "", + app:[{ + appId:params.user_selected_app[0], + flowId: "", params: pp, auth:{}, }], @@ -170,11 +171,11 @@ export const useSessionStore = defineStore('conversation', () => { conversation_id: params.conversation_id, record_id: params.qaRecordId, language, - group_id: params.group_id, + groupId: params.groupId, // record_id: params.qaRecordId, - plugins:[{ - plugin_id:"", - flow_id: "", + app:[{ + appId:"", + flowId: "", params: {}, auth:{}, }], @@ -254,7 +255,7 @@ export const useSessionStore = defineStore('conversation', () => { //初始化获取 metadata conversationItem.metadata = message.metadata; conversationItem.createdAt = message.content.created_at; - conversationItem.groupId = message.group_id; + conversationItem.groupId = message.groupId; } else if(message["event"] === "flow.start") { //事件流开始 @@ -270,7 +271,7 @@ export const useSessionStore = defineStore('conversation', () => { progress: flow?.step_progresss||"", status:'running', display:true, - flow_id:flow?.flow_id||"", + flowId:flow?.flowId||"", data:[[]], } } @@ -450,15 +451,15 @@ export const useSessionStore = defineStore('conversation', () => { * @param regenerateInd 重新生成的回答索引 */ const sendQuestion = async ( - group_id:string|undefined, + groupId:string|undefined, question: string, - user_selected_plugins?: string[], + user_selected_app?: string[], regenerateInd?: number, qaRecordId?: string, user_selected_flow?: string, params?: any, ): Promise => { - const groupId = group_id?group_id:""; + const groupId = groupId?groupId:""; const { updateSessionTitle, currentSelectedSession } = useHistorySessionStore(); if (conversationList.value.length === 0) { // 如果当前还没有对话记录,将第一个问题的questtion作为对话标题 @@ -497,25 +498,25 @@ export const useSessionStore = defineStore('conversation', () => { } isAnswerGenerating.value = true; scrollBottom(); - if (user_selected_flow&&user_selected_plugins) { + if (user_selected_flow&&user_selected_app) { await getStream( { question, qaRecordId, - user_selected_plugins:[...user_selected_plugins], + user_selected_app:[...user_selected_app], user_selected_flow, - group_id:groupId, + groupId:groupId, params:params||undefined, }, regenerateInd ?? undefined ) - } else if (user_selected_plugins?.length) { + } else if (user_selected_app?.length) { await getStream( { question, qaRecordId, - user_selected_plugins: [...user_selected_plugins], - group_id:groupId, + user_selected_app: [...user_selected_app], + groupId:groupId, params:params||undefined, }, regenerateInd ?? undefined @@ -525,7 +526,7 @@ export const useSessionStore = defineStore('conversation', () => { { question, qaRecordId, - group_id:groupId, + groupId:groupId, }, regenerateInd ?? undefined ); @@ -545,7 +546,7 @@ export const useSessionStore = defineStore('conversation', () => { * 重新生成回答 * @param cid */ - const reGenerateAnswer = (cid: number, user_selected_plugins: any[],type?:string): void => { + const reGenerateAnswer = (cid: number, user_selected_app: any[],type?:string): void => { const answerInd = conversationList.value.findIndex((val) => val.cid === cid); const question = (conversationList.value[answerInd - 1] as UserConversationItem).message; const recordId = (conversationList.value[answerInd] as RobotConversationItem).recordId; @@ -559,7 +560,7 @@ export const useSessionStore = defineStore('conversation', () => { if (!question) { return; } - sendQuestion(groupId, question, user_selected_plugins, answerInd, recordId,""); + sendQuestion(groupId, question, user_selected_app, answerInd, recordId,""); }; // #region ----------------------------------------< pagenation >-------------------------------------- @@ -608,11 +609,11 @@ export const useSessionStore = defineStore('conversation', () => { res.result.records.forEach((record) => { if ( (conversationList.value as RobotConversationItem[]).find( - (i) => i.groupId === record.group_id + (i) => i.groupId === record.groupId ) ) { const re = (conversationList.value as RobotConversationItem[]).find( - (i) => i.groupId === record.group_id + (i) => i.groupId === record.groupId ); re?.message.push(record.content.answer); if (typeof (re?.message) !== 'string') { @@ -643,7 +644,7 @@ export const useSessionStore = defineStore('conversation', () => { isFinish: true, recordId: record.id, conversation_id: record.conversation_id, - groupId: record.group_id, + groupId: record.groupId, metadata: record.metadata, } ); diff --git a/src/store/historySession.ts b/src/store/historySession.ts index 0e96d6520854c8105299191205b982da759776e1..5d4addecdc1b56e414e4e9f00596997313b3df57 100644 --- a/src/store/historySession.ts +++ b/src/store/historySession.ts @@ -27,7 +27,7 @@ export const useHistorySessionStore = defineStore('sessionStore', () => { // 历史会话列表 const historySession = ref([]); const params = ref(); - const user_selected_plugins = ref([]); + const user_selected_app = ref([]); const selectMode = ref([]) const currentSelectedSession = ref(''); /** @@ -195,7 +195,7 @@ export const useHistorySessionStore = defineStore('sessionStore', () => { createNewSession, initSessionList, generateSession, - user_selected_plugins, + user_selected_app, selectMode, }; }); diff --git a/src/views/dialogue/Copilot.vue b/src/views/dialogue/Copilot.vue index c16169706e0b7f7c49f7be75e59c1c6d2852a149..68073e6844b9094c37b9c34edfeccc7219dece09 100644 --- a/src/views/dialogue/Copilot.vue +++ b/src/views/dialogue/Copilot.vue @@ -28,10 +28,10 @@ const modeOptions = reactive([ }, ]); -const setPlugins = async () => { +const setApps = async () => { const [_, res] = await api.getRecognitionMode(); if (!_ && res) { - res.result.plugins.forEach(item => { + res.result.app.forEach(item => { const opt = { label: item.name, value: item.id, @@ -57,7 +57,7 @@ const initCopilot = async (): Promise => { await api.getRecognitionMode(); await api.stopGeneration(); await getHistorySession(); - setPlugins(); + setApps(); } return; } else if (currRoute.value.query.id) { @@ -106,12 +106,16 @@ const handleSubmit = async () => { dialogVisible.value = false; }; -onMounted(() => { +onMounted(async() => { window.scrollTo({ top: 0, left: 0, }); - //获取 top5 list + //获取 top5 list + const [_, res] = await api.getTopFiveApp(5); + if(_ && res){ + appList.value = res.result.applications; + } }); watch( diff --git a/src/views/dialogue/components/DialogueAside.vue b/src/views/dialogue/components/DialogueAside.vue index 25bbb1bab04f1a9f94ae6c0771c8061285bc1d22..b562f3bea271a59798bb17a11ec6a1aeb0e77810 100644 --- a/src/views/dialogue/components/DialogueAside.vue +++ b/src/views/dialogue/components/DialogueAside.vue @@ -20,6 +20,7 @@ import { successMsg } from 'src/components/Message'; import i18n from 'src/i18n'; import appIcon from '@/assets/images/app.png' import { IconChevronUp } from '@computing/opendesign-icons'; +import { onMounted } from 'vue'; interface HistorySession { conversation_id: string; @@ -48,11 +49,11 @@ const isCollapsed = ref(false); const selectedAppId = ref(null); // const apps = ref([ - { id: 1, name: '应用 1' }, - { id: 2, name: '应用 2' }, - { id: 3, name: '应用 3' }, - { id: 4, name: '应用 4' }, - { id: 5, name: '应用 5' }, + { appId: "1", name: '应用 1' }, + { appId: "2", name: '应用 2' }, + { appId: "3", name: '应用 3' }, + { appId: "4", name: '应用 4' }, + { appId: "5", name: '应用 5' }, ]); const filteredHistorySessions = computed(() => { @@ -238,6 +239,17 @@ function ensureAppAtFirstPosition() { } } +onMounted(async() => { + //获取 top5 list + const [_, res] = await api.getTopFiveApp(5); + if(_ && res){ + appList.value = res.result.applications; + } + else { + appList.value = apps.value; + } +}); + watch( () => app, () => { diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index e76aced33bcc036467e4f1ab9d827cbb60d26443..598bff97ce2d0a55d13c152ae4e1b72adb1bd7d9 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -19,7 +19,7 @@ import { AttachAddon } from 'xterm-addon-attach'; import { Terminal } from 'xterm'; import 'xterm/css/xterm.css'; import i18n from 'src/i18n'; -const { user_selected_plugins, selectMode } = storeToRefs(useHistorySessionStore()); +const { user_selected_app, selectMode } = storeToRefs(useHistorySessionStore()); const { getHistorySession } = useHistorySessionStore(); const session = useSessionStore(); @@ -183,7 +183,7 @@ const handleSendMessage = async (groupId: string | undefined, question: string, if (user_selected_flow) { await sendQuestion(groupId, question, undefined, undefined, undefined, user_selected_flow, undefined); } else { - await sendQuestion(groupId, question, user_selected_plugins.value, undefined, undefined, undefined, undefined); + await sendQuestion(groupId, question, user_selected_app.value, undefined, undefined, undefined, undefined); } }; @@ -711,17 +711,17 @@ watch( watch(selectMode, (newValue, oldValue) => { setOptionDisabled(); - user_selected_plugins.value = []; + user_selected_app.value = []; let first = true; if (selectMode.value.length !== 0) { if (selectMode.value[0] === 'auto') { - user_selected_plugins.value.push('auto'); + user_selected_app.value.push('auto'); } else { selectMode.value.forEach(item => { const plugin = { plugin_name: item, }; - user_selected_plugins.value.push(plugin.plugin_name); + user_selected_app.value.push(plugin.plugin_name); }); } } @@ -800,7 +800,7 @@ const handlePauseAndReGenerate = (cid?: number) => { :created-at="item.createdAt" :current-selected="item.currentInd" :need-regernerate="item.cid === conversationList.slice(-1)[0].cid" - :user-selected-plugins="user_selected_plugins" + :user-selected-app="user_selected_app" :search_suggestions="getItem(item, 'search_suggestions')" :paramsList="getItem(item, 'paramsList')" :modeOptions="modeOptions" diff --git a/src/views/dialogue/types.ts b/src/views/dialogue/types.ts index 4034e3efbdb61876fcd9c65c2ed48810870ea0fb..99d4162f661437192931a25f58689bc6ac2788ba 100644 --- a/src/views/dialogue/types.ts +++ b/src/views/dialogue/types.ts @@ -67,7 +67,7 @@ export interface FlowType { data:any, display:boolean, progress:string, - flow_id?:string, + flowId?:string, } export interface FlowDataType {