update
This commit is contained in:
parent
29b67990d6
commit
751fd8d3b4
File diff suppressed because it is too large
Load Diff
@ -18,10 +18,7 @@ import {
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import pageBg from '../../assets/pageBg.png'
|
import pageBg from '../../assets/pageBg.png'
|
||||||
|
|
||||||
|
const userInput = ref('新桥服务区python营收');
|
||||||
|
|
||||||
|
|
||||||
const userInput = ref();
|
|
||||||
const loading = ref();
|
const loading = ref();
|
||||||
const error = ref();
|
const error = ref();
|
||||||
const response = ref();
|
const response = ref();
|
||||||
@ -40,16 +37,13 @@ const controllers = ref<AbortController[]>([]);
|
|||||||
const showController = ref<boolean>(false);
|
const showController = ref<boolean>(false);
|
||||||
// 当前的滚动条list
|
// 当前的滚动条list
|
||||||
const scrollList = reactive<any>([]);
|
const scrollList = reactive<any>([]);
|
||||||
|
|
||||||
const messageList = reactive<any>([]);
|
const messageList = reactive<any>([]);
|
||||||
const aliyunMessageList = reactive<any>([]);
|
const aliyunMessageList = reactive<any>([]);
|
||||||
let deepseekMessageList = reactive<any>([]);
|
let deepseekMessageList = reactive<any>([]);
|
||||||
|
|
||||||
// 是否开启自由定义
|
// 是否开启自由定义
|
||||||
const startFree = ref<boolean>(false);
|
const startFree = ref<boolean>(false);
|
||||||
// 自由定义的文本内容
|
// 自由定义的文本内容
|
||||||
const freeContent = ref<string>("");
|
const freeContent = ref<string>("");
|
||||||
|
|
||||||
const maxTokens = ref<number>(4096);
|
const maxTokens = ref<number>(4096);
|
||||||
const Temperature = ref<number>(0.4);
|
const Temperature = ref<number>(0.4);
|
||||||
const TopP = ref<number>(0.4);
|
const TopP = ref<number>(0.4);
|
||||||
@ -64,7 +58,7 @@ const showDeepseek = ref<boolean>(true);
|
|||||||
// 是否引入地图的数据
|
// 是否引入地图的数据
|
||||||
const useMapData = ref<boolean>(true);
|
const useMapData = ref<boolean>(true);
|
||||||
// 几个大模型种类的切换
|
// 几个大模型种类的切换
|
||||||
const modalTypeSelect = ref<number[]>([2, 4]);
|
const modalTypeSelect = ref<number[]>([5]);
|
||||||
// 几个模型的具体数据
|
// 几个模型的具体数据
|
||||||
let modalTypeDataList = reactive<any>([
|
let modalTypeDataList = reactive<any>([
|
||||||
{
|
{
|
||||||
@ -107,6 +101,16 @@ let modalTypeDataList = reactive<any>([
|
|||||||
showCopy: false,
|
showCopy: false,
|
||||||
showReload: false,
|
showReload: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Gemini",
|
||||||
|
value: 5,
|
||||||
|
messageList: [],
|
||||||
|
isShow: true,
|
||||||
|
responseText: "",
|
||||||
|
descResponseText: "",
|
||||||
|
showCopy: false,
|
||||||
|
showReload: false,
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
// 是否显示左侧
|
// 是否显示左侧
|
||||||
const hideLeft = ref<boolean>(true);
|
const hideLeft = ref<boolean>(true);
|
||||||
@ -148,12 +152,10 @@ let routerRole = ref<any>({
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
let param1: string = ""
|
let param1: string = ""
|
||||||
if (/Mobi|Android/i.test(navigator.userAgent)) {
|
if (/Mobi|Android/i.test(navigator.userAgent)) {
|
||||||
console.log("是手机");
|
|
||||||
isPhone.value = true;
|
isPhone.value = true;
|
||||||
// 只显示一个对话框
|
// 只显示一个对话框
|
||||||
modalTypeSelect.value = [4];
|
modalTypeSelect.value = [4];
|
||||||
}
|
}
|
||||||
console.log('modalTypeDataListmodalTypeDataList', modalTypeDataList);
|
|
||||||
|
|
||||||
if (modalTypeDataList && modalTypeDataList.length > 0) {
|
if (modalTypeDataList && modalTypeDataList.length > 0) {
|
||||||
modalTypeDataList.forEach((item: any) => {
|
modalTypeDataList.forEach((item: any) => {
|
||||||
@ -166,7 +168,6 @@ onMounted(async () => {
|
|||||||
} else {
|
} else {
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
param1 = urlParams.get('comeForm') || "";
|
param1 = urlParams.get('comeForm') || "";
|
||||||
console.log("comeForm", param1);
|
|
||||||
if (param1 === 'YNMap') {
|
if (param1 === 'YNMap') {
|
||||||
pageType.value = 1
|
pageType.value = 1
|
||||||
hideLeft.value = false
|
hideLeft.value = false
|
||||||
@ -223,8 +224,6 @@ onMounted(async () => {
|
|||||||
// routerRole.value.content = ""
|
// routerRole.value.content = ""
|
||||||
// }
|
// }
|
||||||
|
|
||||||
console.log("YSRole", YSRole);
|
|
||||||
console.log("routerRole", routerRole);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const showPhoneChange = ref<boolean>(false);
|
const showPhoneChange = ref<boolean>(false);
|
||||||
@ -277,14 +276,11 @@ const handleGetPrompt = async () => {
|
|||||||
sortstr: "OPERATE_DATE desc",
|
sortstr: "OPERATE_DATE desc",
|
||||||
};
|
};
|
||||||
const data = await handleGetPROMPTList(req);
|
const data = await handleGetPROMPTList(req);
|
||||||
console.log("data", data);
|
|
||||||
return data.List;
|
return data.List;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新提示词
|
// 更新提示词
|
||||||
const handleUpdatePrompt = async (id: number) => {
|
const handleUpdatePrompt = async (id: number) => {
|
||||||
console.log("id", id);
|
|
||||||
console.log("YSRole.value", YSRole.value);
|
|
||||||
|
|
||||||
let req: any = {};
|
let req: any = {};
|
||||||
if (id === 1000) {
|
if (id === 1000) {
|
||||||
@ -300,7 +296,6 @@ const handleUpdatePrompt = async (id: number) => {
|
|||||||
OPERATE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"),
|
OPERATE_DATE: moment().format("YYYY-MM-DD HH:mm:ss"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
console.log("req", req);
|
|
||||||
const data = await handleSynchroPROMPT(req);
|
const data = await handleSynchroPROMPT(req);
|
||||||
if (data.Result_Code === 100) {
|
if (data.Result_Code === 100) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
@ -402,7 +397,6 @@ const aLiYunGetDeepSeek = async (question: string) => {
|
|||||||
// messages: [{ role: "user", content: question }],
|
// messages: [{ role: "user", content: question }],
|
||||||
// stream: true,
|
// stream: true,
|
||||||
// });
|
// });
|
||||||
// console.log("data", data);
|
|
||||||
|
|
||||||
let oldMessage: any = [];
|
let oldMessage: any = [];
|
||||||
if (aliyunMessageList && aliyunMessageList.length > 0) {
|
if (aliyunMessageList && aliyunMessageList.length > 0) {
|
||||||
@ -508,7 +502,6 @@ const aliyunStreamChunk = async (chunk: any) => {
|
|||||||
|
|
||||||
// 直接提问deepseek 没有格式 不走语义
|
// 直接提问deepseek 没有格式 不走语义
|
||||||
const handleAskDirectlyDeepseek = async () => {
|
const handleAskDirectlyDeepseek = async () => {
|
||||||
console.log("modalTypeDataList", modalTypeDataList);
|
|
||||||
if (modalTypeDataList && modalTypeDataList.length > 0) {
|
if (modalTypeDataList && modalTypeDataList.length > 0) {
|
||||||
modalTypeDataList.forEach((item: any) => {
|
modalTypeDataList.forEach((item: any) => {
|
||||||
if (item.isShow) {
|
if (item.isShow) {
|
||||||
@ -538,7 +531,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
userInput.value = "";
|
userInput.value = "";
|
||||||
|
|
||||||
|
|
||||||
console.log('modalTypeDataList', modalTypeDataList);
|
|
||||||
// 找到当前选择的模型 添加问题的数据
|
// 找到当前选择的模型 添加问题的数据
|
||||||
modalTypeDataList.forEach((item: any) => {
|
modalTypeDataList.forEach((item: any) => {
|
||||||
if (item.isShow) {
|
if (item.isShow) {
|
||||||
@ -549,8 +541,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
index: list && list.length > 0 ? list.length : 0,
|
index: list && list.length > 0 ? list.length : 0,
|
||||||
});
|
});
|
||||||
item.messageList = list;
|
item.messageList = list;
|
||||||
console.log('listlistlistlist', JSON.parse(JSON.stringify(list)))
|
|
||||||
|
|
||||||
handleScrollToBottomID("gjldBox" + item.value);
|
handleScrollToBottomID("gjldBox" + item.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -560,7 +550,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
await handleAskDirectlyDeepseek();
|
await handleAskDirectlyDeepseek();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('pageType.valuepageType.value', pageType.value);
|
|
||||||
|
|
||||||
// 判断一下 是不是被内嵌到别人那边的 内嵌的话 就走这儿 不走下面的了
|
// 判断一下 是不是被内嵌到别人那边的 内嵌的话 就走这儿 不走下面的了
|
||||||
if (containsDaping(thisQuestion)) {
|
if (containsDaping(thisQuestion)) {
|
||||||
@ -575,7 +564,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
}
|
}
|
||||||
if (item.isShow) {
|
if (item.isShow) {
|
||||||
let list: any = item.messageList;
|
let list: any = item.messageList;
|
||||||
console.log("list", list);
|
|
||||||
list.push({
|
list.push({
|
||||||
role: "default",
|
role: "default",
|
||||||
content: "",
|
content: "",
|
||||||
@ -586,15 +574,8 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('newRuleTextnewRuleTextnewRuleText', newRuleText.value);
|
|
||||||
console.log('routerRolerouterRolerouterRolerouterRole', routerRole.value);
|
|
||||||
console.log('thisQuestionthisQuestionthisQuestionthisQuestion', thisQuestion);
|
|
||||||
|
|
||||||
|
|
||||||
let YNMapData: any = await handleGetYNMapData()
|
let YNMapData: any = await handleGetYNMapData()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 配置问题内容
|
// 配置问题内容
|
||||||
mapQuestion = `#云南大屏直接进行路由角色说明解析#<Br/>
|
mapQuestion = `#云南大屏直接进行路由角色说明解析#<Br/>
|
||||||
#路由角色解析#<Br/>
|
#路由角色解析#<Br/>
|
||||||
@ -605,15 +586,9 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
${YNMapData}
|
${YNMapData}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
console.log('mapQuestionmapQuestionmapQuestion', mapQuestion);
|
|
||||||
|
|
||||||
|
|
||||||
for (let i = 0; i < modalTypeDataList.length; i++) {
|
for (let i = 0; i < modalTypeDataList.length; i++) {
|
||||||
if (modalTypeDataList[i].isShow) {
|
if (modalTypeDataList[i].isShow) {
|
||||||
let list: any = modalTypeDataList[i].messageList;
|
let list: any = modalTypeDataList[i].messageList;
|
||||||
|
|
||||||
console.log('listlistlistlist', JSON.parse(JSON.stringify(list)));
|
|
||||||
|
|
||||||
list[list.length - 1] = {
|
list[list.length - 1] = {
|
||||||
...list[list.length - 1],
|
...list[list.length - 1],
|
||||||
content: mapQuestion,
|
content: mapQuestion,
|
||||||
@ -622,15 +597,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
modalTypeDataList[i].messageList = list;
|
modalTypeDataList[i].messageList = list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('modalTypeDataListmodalTypeDataListmodalTypeDataList', JSON.parse(JSON.stringify(modalTypeDataList)));
|
|
||||||
|
|
||||||
// let nowShowIdList: any = [];
|
|
||||||
// for (let i = 0; i < modalTypeDataList.length; i++) {
|
|
||||||
// if (modalTypeDataList[i].isShow) {
|
|
||||||
// nowShowIdList.push(modalTypeDataList[i].value)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// handleOnceMoreModal(nowShowIdList);
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,7 +611,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
}
|
}
|
||||||
if (item.isShow) {
|
if (item.isShow) {
|
||||||
let list: any = item.messageList;
|
let list: any = item.messageList;
|
||||||
console.log("list", list);
|
|
||||||
list.push({
|
list.push({
|
||||||
role: "default",
|
role: "default",
|
||||||
content: "",
|
content: "",
|
||||||
@ -661,27 +626,13 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
// 确保每次问问题都可以拿到最新的规则文本
|
// 确保每次问问题都可以拿到最新的规则文本
|
||||||
await handleNewRuleList();
|
await handleNewRuleList();
|
||||||
|
|
||||||
// 拿到这一次问问题的哪个模型 不一样的模型 他们的自己语义对话框的id不同
|
|
||||||
// let nowValueList: any = []
|
|
||||||
// if(bigObj.value){
|
|
||||||
// nowValueList= [bigObj.value]
|
|
||||||
// }else{
|
|
||||||
// modalTypeDataList.forEach((item: any) => {
|
|
||||||
// nowValueList.push(item.value)
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
for (let i = 0; i < modalTypeDataList.length; i++) {
|
for (let i = 0; i < modalTypeDataList.length; i++) {
|
||||||
console.log("modalTypeDataList[i].isShow", modalTypeDataList[i].isShow);
|
|
||||||
|
|
||||||
if (modalTypeDataList[i].isShow) {
|
if (modalTypeDataList[i].isShow) {
|
||||||
// 调用自己的语义
|
// 调用自己的语义
|
||||||
const mapData: any = await RobotDialogueBoxRef.value.handleSubmit(
|
const mapData: any = await RobotDialogueBoxRef.value.handleSubmit(
|
||||||
thisQuestion,
|
thisQuestion,
|
||||||
modalTypeDataList[i].value
|
modalTypeDataList[i].value
|
||||||
);
|
);
|
||||||
console.log('atatatat', mapData);
|
|
||||||
|
|
||||||
// 判断自己的语义是否成功
|
// 判断自己的语义是否成功
|
||||||
let userSemanticsIsSuccess: boolean = true;
|
let userSemanticsIsSuccess: boolean = true;
|
||||||
|
|
||||||
@ -752,6 +703,10 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
let obj: any = JSON.parse(JSON.stringify(subItem));
|
let obj: any = JSON.parse(JSON.stringify(subItem));
|
||||||
obj = handleChangObjType(obj);
|
obj = handleChangObjType(obj);
|
||||||
|
|
||||||
|
console.log("obj", obj);
|
||||||
|
console.log("showColumnsListshowColumnsList", showColumnsList);
|
||||||
|
console.log("itemitem", item);
|
||||||
|
|
||||||
if (obj) {
|
if (obj) {
|
||||||
let text: string = handleTableDataToStr(
|
let text: string = handleTableDataToStr(
|
||||||
obj,
|
obj,
|
||||||
@ -770,7 +725,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
if (item.VHtml && item.VHtml !== "暂无数据") {
|
if (item.VHtml && item.VHtml !== "暂无数据") {
|
||||||
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${item.VHtml}<Br/>`;
|
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${item.VHtml}<Br/>`;
|
||||||
} else {
|
} else {
|
||||||
console.log("dataStrdataStrdataStr", dataStr);
|
|
||||||
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${dataStr}<Br/>`;
|
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${dataStr}<Br/>`;
|
||||||
}
|
}
|
||||||
let desc: string = `接口意图:${item.ruleDetail.USER_INTENT};接口备注:${item.ruleDetail.ANALYSISRULE_DESC}。`;
|
let desc: string = `接口意图:${item.ruleDetail.USER_INTENT};接口备注:${item.ruleDetail.ANALYSISRULE_DESC}。`;
|
||||||
@ -809,9 +763,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
userSemanticsIsSuccess = false;
|
userSemanticsIsSuccess = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('mapQuestionmapQuestionmapQuestion', mapQuestion);
|
|
||||||
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
bigObj.value
|
bigObj.value
|
||||||
? modalTypeDataList[i].value === bigObj.value
|
? modalTypeDataList[i].value === bigObj.value
|
||||||
@ -890,8 +841,6 @@ const handleSendRequest = async (bigObj?: any) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('nowShowIdListnowShowIdListnowShowIdList', nowShowIdList);
|
|
||||||
|
|
||||||
// 判断一下 是不是开启了 省略过程 那就是直接去调用ai深度分析
|
// 判断一下 是不是开启了 省略过程 那就是直接去调用ai深度分析
|
||||||
if (omitProcess.value) {
|
if (omitProcess.value) {
|
||||||
handleOnceMoreModal(nowShowIdList);
|
handleOnceMoreModal(nowShowIdList);
|
||||||
@ -992,11 +941,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log('bigObj3232', bigObj);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 最后显示的文字
|
// 最后显示的文字
|
||||||
let mapQuestion: string = "";
|
let mapQuestion: string = "";
|
||||||
let thisQuestion: string = "";
|
let thisQuestion: string = "";
|
||||||
@ -1017,13 +961,11 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
|
|
||||||
let lastUserObj: any = userList[userList.length - 1];
|
let lastUserObj: any = userList[userList.length - 1];
|
||||||
|
|
||||||
console.log("lastUserObj", lastUserObj);
|
|
||||||
let showBtn: string = "";
|
let showBtn: string = "";
|
||||||
|
|
||||||
// 判断这一次deepseek是否成功分析出来了
|
// 判断这一次deepseek是否成功分析出来了
|
||||||
let userSemanticsIsSuccess: boolean = true;
|
let userSemanticsIsSuccess: boolean = true;
|
||||||
const data = await handleGetInterfaceID(lastUserObj.content, bigObj);
|
const data = await handleGetInterfaceID(lastUserObj.content, bigObj);
|
||||||
console.log("dsadasdasdasdsgas", data);
|
|
||||||
if (bigObj.messageList && bigObj.messageList.length > 0) {
|
if (bigObj.messageList && bigObj.messageList.length > 0) {
|
||||||
bigObj.messageList.forEach((item: any) => {
|
bigObj.messageList.forEach((item: any) => {
|
||||||
if (item.role === "user") {
|
if (item.role === "user") {
|
||||||
@ -1044,7 +986,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
data.question,
|
data.question,
|
||||||
bigObj.value
|
bigObj.value
|
||||||
);
|
);
|
||||||
console.log("newData3232", newData);
|
|
||||||
if (newData && newData.length > 0) {
|
if (newData && newData.length > 0) {
|
||||||
userSemanticsIsSuccess = true;
|
userSemanticsIsSuccess = true;
|
||||||
let allStr: string = "";
|
let allStr: string = "";
|
||||||
@ -1082,8 +1023,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
tabHeader += `<Br/>`;
|
tabHeader += `<Br/>`;
|
||||||
dataStr += `${tabHeader}`;
|
dataStr += `${tabHeader}`;
|
||||||
}
|
}
|
||||||
console.log("tabHeader", tabHeader);
|
|
||||||
console.log("item.RESPONSE_FIELD", obj);
|
|
||||||
} else if (item.columns && item.columns.length > 0) {
|
} else if (item.columns && item.columns.length > 0) {
|
||||||
item.columns.forEach((subItem: any) => {
|
item.columns.forEach((subItem: any) => {
|
||||||
if (subItem.prop) {
|
if (subItem.prop) {
|
||||||
@ -1104,7 +1043,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
}
|
}
|
||||||
dataStr += str;
|
dataStr += str;
|
||||||
}
|
}
|
||||||
console.log("showColumnsList", showColumnsList);
|
|
||||||
dataStr += `<Br/>`;
|
dataStr += `<Br/>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1113,8 +1051,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
let str: string = "";
|
let str: string = "";
|
||||||
let obj: any = JSON.parse(JSON.stringify(subItem));
|
let obj: any = JSON.parse(JSON.stringify(subItem));
|
||||||
obj = handleChangObjType(obj);
|
obj = handleChangObjType(obj);
|
||||||
console.log("handleChangObjType", obj);
|
|
||||||
|
|
||||||
if (obj) {
|
if (obj) {
|
||||||
let text: string = handleTableDataToStr(
|
let text: string = handleTableDataToStr(
|
||||||
obj,
|
obj,
|
||||||
@ -1133,7 +1069,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
if (item.VHtml && item.VHtml !== "暂无数据") {
|
if (item.VHtml && item.VHtml !== "暂无数据") {
|
||||||
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${item.VHtml}<Br/>`;
|
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${item.VHtml}<Br/>`;
|
||||||
} else {
|
} else {
|
||||||
console.log("dataStrdataStrdataStr", dataStr);
|
|
||||||
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${dataStr}<Br/>`;
|
allStr += `#id【${item.ruleDetail.ANALYSISRULE_ID}】接口数据如下#:<Br/>${dataStr}<Br/>`;
|
||||||
}
|
}
|
||||||
let desc: string = `接口意图:${item.ruleDetail.USER_INTENT};接口备注:${item.ruleDetail.ANALYSISRULE_DESC}。`;
|
let desc: string = `接口意图:${item.ruleDetail.USER_INTENT};接口备注:${item.ruleDetail.ANALYSISRULE_DESC}。`;
|
||||||
@ -1142,7 +1077,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
});
|
});
|
||||||
// 驿商语义解析 的替换 如果规则id只有一个 且这个的id配置了大模型输出规范字段 那么就替换
|
// 驿商语义解析 的替换 如果规则id只有一个 且这个的id配置了大模型输出规范字段 那么就替换
|
||||||
let newContent: string = "";
|
let newContent: string = "";
|
||||||
console.log("allStr", allStr);
|
|
||||||
if (
|
if (
|
||||||
newData &&
|
newData &&
|
||||||
newData.length === 1 &&
|
newData.length === 1 &&
|
||||||
@ -1331,26 +1265,6 @@ const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
|
|||||||
};
|
};
|
||||||
bigObj.messageList = list;
|
bigObj.messageList = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// modalTypeDataList.forEach((item: any) => {
|
|
||||||
// if (item.isShow) {
|
|
||||||
// let list: any = item.messageList;
|
|
||||||
// list[list.length - 1] = {
|
|
||||||
// ...list[list.length - 1],
|
|
||||||
// content: mapQuestion,
|
|
||||||
// loading: false,
|
|
||||||
// loadingContent: null,
|
|
||||||
// userSemanticsIsSuccess: userSemanticsIsSuccess,
|
|
||||||
// };
|
|
||||||
// item.messageList = list;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
console.log("mapQuestionmapQuestionmapQuestionmapQuestion", mapQuestion);
|
|
||||||
console.log(
|
|
||||||
"mapQuestionmapQuestionmapQuestionmapQuestion",
|
|
||||||
bigObj.messageList
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 一次性执行多个模型的问问题方法
|
// 一次性执行多个模型的问问题方法
|
||||||
@ -1371,8 +1285,6 @@ const handleOnceMoreModal = async (typeList: number[]) => {
|
|||||||
const handleGetAnswerID = async (obj: any) => {
|
const handleGetAnswerID = async (obj: any) => {
|
||||||
// 最新的相应文本
|
// 最新的相应文本
|
||||||
// let responseText: string = "";
|
// let responseText: string = "";
|
||||||
console.log("obj2222", obj);
|
|
||||||
|
|
||||||
let oldMessage: any = [];
|
let oldMessage: any = [];
|
||||||
// 当对话列表小于3时 说明是第一次问问题 那么就直接找user就好了
|
// 当对话列表小于3时 说明是第一次问问题 那么就直接找user就好了
|
||||||
if (
|
if (
|
||||||
@ -1402,8 +1314,6 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
});
|
});
|
||||||
} else if (obj.messageList && obj.messageList.length >= 2) {
|
} else if (obj.messageList && obj.messageList.length >= 2) {
|
||||||
// 区分之前的问题记录 和 最新的问题记录
|
// 区分之前的问题记录 和 最新的问题记录
|
||||||
console.log("obj.messageList", obj.messageList);
|
|
||||||
|
|
||||||
obj.messageList.forEach((item: any, index: number) => {
|
obj.messageList.forEach((item: any, index: number) => {
|
||||||
// if (startFree.value ? item.role === "user" : item.role === "default") {
|
// if (startFree.value ? item.role === "user" : item.role === "default") {
|
||||||
if (item.role === "default" || item.role === "user") {
|
if (item.role === "default" || item.role === "user") {
|
||||||
@ -1445,8 +1355,6 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
console.log("oldMessage", oldMessage);
|
|
||||||
|
|
||||||
obj.messageList.push({
|
obj.messageList.push({
|
||||||
role: "assistant",
|
role: "assistant",
|
||||||
content: "",
|
content: "",
|
||||||
@ -1455,7 +1363,6 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
loadingContent: "深度分析中...",
|
loadingContent: "深度分析中...",
|
||||||
});
|
});
|
||||||
handleScrollToBottomID("gjldBox" + obj.value);
|
handleScrollToBottomID("gjldBox" + obj.value);
|
||||||
console.log("modalTypeDataList", modalTypeDataList);
|
|
||||||
|
|
||||||
// 记录是否有数据流
|
// 记录是否有数据流
|
||||||
let hasStreamData: boolean = false;
|
let hasStreamData: boolean = false;
|
||||||
@ -1463,7 +1370,6 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
controllers.value.push(controller); // 存入全局数组
|
controllers.value.push(controller); // 存入全局数组
|
||||||
showController.value = true;
|
showController.value = true;
|
||||||
console.log("controller", controller);
|
|
||||||
let timeoutId: any = null; // 记录超时 ID
|
let timeoutId: any = null; // 记录超时 ID
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1510,19 +1416,22 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
: ""
|
: ""
|
||||||
: obj.value === 4
|
: obj.value === 4
|
||||||
? "qwen-plus"
|
? "qwen-plus"
|
||||||
: "",
|
: obj.value === 5
|
||||||
|
? 'claude-sonnet-4-5'
|
||||||
|
: '',
|
||||||
messages: [...oldMessage],
|
messages: [...oldMessage],
|
||||||
stream: true,
|
stream: true,
|
||||||
max_tokens: maxTokens.value,
|
// max_tokens: 200000,
|
||||||
stop: ["null"],
|
// max_tokens: obj.value === 5 ? 200000 : maxTokens.value,
|
||||||
temperature: Temperature.value,
|
// stop: ["null"],
|
||||||
top_p: TopP.value,
|
// temperature: Temperature.value,
|
||||||
top_k: TopK.value,
|
// top_p: TopP.value,
|
||||||
frequency_penalty: FrequencyPenalty.value,
|
// top_k: TopK.value,
|
||||||
n: 1,
|
// frequency_penalty: FrequencyPenalty.value,
|
||||||
response_format: {
|
// n: 1,
|
||||||
type: "text",
|
// response_format: {
|
||||||
},
|
// type: "text",
|
||||||
|
// },
|
||||||
};
|
};
|
||||||
const options = {
|
const options = {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@ -1536,12 +1445,30 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
? "Bearer sk-1aa2c1c672034c6d826ce62d3aebcb47"
|
? "Bearer sk-1aa2c1c672034c6d826ce62d3aebcb47"
|
||||||
: obj.value === 4
|
: obj.value === 4
|
||||||
? "Bearer sk-1aa2c1c672034c6d826ce62d3aebcb47"
|
? "Bearer sk-1aa2c1c672034c6d826ce62d3aebcb47"
|
||||||
: "",
|
: obj.value === 5
|
||||||
|
? "Bearer sk-f67d5aae13e14efc8a01e8cd0e665d15"
|
||||||
|
: "",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify(modal),
|
body: JSON.stringify(modal),
|
||||||
signal: controller.signal, // 关键:绑定控制器信号
|
signal: controller.signal, // 关键:绑定控制器信号
|
||||||
};
|
};
|
||||||
|
let geminiContent: any = []
|
||||||
|
if (modal.messages && modal.messages.length > 0) {
|
||||||
|
modal.messages.forEach((item: any, index: number) => {
|
||||||
|
if (item.role === "user") {
|
||||||
|
if (index + 1 === modal.messages.length) {
|
||||||
|
geminiContent.push({
|
||||||
|
parts: [
|
||||||
|
{
|
||||||
|
text: item.content,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 判断是否成功
|
// 判断是否成功
|
||||||
let isSuccess: boolean = false;
|
let isSuccess: boolean = false;
|
||||||
const response: any = await fetch(
|
const response: any = await fetch(
|
||||||
@ -1553,55 +1480,111 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
? "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
|
? "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
|
||||||
: obj.value === 4
|
: obj.value === 4
|
||||||
? "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
|
? "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
|
||||||
: "",
|
: obj.value === 5
|
||||||
options
|
? "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent"
|
||||||
|
: "",
|
||||||
|
obj.value === 5 ? {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"x-goog-api-key": "AIzaSyAg1lJ8oZL_jMAefrRswIhx5xA8JTOZUTs",
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
contents: geminiContent
|
||||||
|
}),
|
||||||
|
} : options
|
||||||
);
|
);
|
||||||
console.log("response", response);
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
isSuccess = true;
|
isSuccess = true;
|
||||||
}
|
}
|
||||||
// 创建流式读取器
|
if (obj.value === 5) {
|
||||||
const reader = response.body.getReader();
|
// 非流式返回
|
||||||
const decoder = new TextDecoder("utf-8");
|
// const data = await response.json();
|
||||||
while (isStreaming) {
|
const reader = response.body.getReader();
|
||||||
const { done, value } = await reader.read();
|
const decoder = new TextDecoder("utf-8");
|
||||||
if (done) break;
|
while (isStreaming) {
|
||||||
// 解码并处理数据
|
const { done, value } = await reader.read();
|
||||||
const chunk = decoder.decode(value);
|
if (done) break;
|
||||||
handleStreamChunkID(chunk, obj);
|
const chunk = decoder.decode(value);
|
||||||
|
let JSONChunk = trimFirstChar(chunk)
|
||||||
// 判断当前的这个框 是滚动数组里面的第几个 对他进行判断是不是在底部
|
JSONChunk = JSONChunk ? JSON.parse(JSONChunk) : ""
|
||||||
let nowShowList: any = [];
|
handleStreamChunkIDGemini(JSONChunk ? [JSONChunk] : [], obj)
|
||||||
if (modalTypeDataList && modalTypeDataList.length > 0) {
|
// 判断当前的这个框 是滚动数组里面的第几个 对他进行判断是不是在底部
|
||||||
modalTypeDataList.forEach((item: any) => {
|
let nowShowList: any = [];
|
||||||
if (item.isShow) {
|
if (modalTypeDataList && modalTypeDataList.length > 0) {
|
||||||
nowShowList.push(item);
|
modalTypeDataList.forEach((item: any) => {
|
||||||
}
|
if (item.isShow) {
|
||||||
});
|
nowShowList.push(item);
|
||||||
}
|
|
||||||
let index: number = 99999;
|
|
||||||
let isBottom: any = "default";
|
|
||||||
if (nowShowList && nowShowList.length > 0) {
|
|
||||||
nowShowList.forEach((item: any, itemIndex: number) => {
|
|
||||||
if (item.value === obj.value) {
|
|
||||||
index = itemIndex;
|
|
||||||
if (scrollList.value && scrollList.value.length > 0) {
|
|
||||||
isBottom = scrollList.value[itemIndex].isBottom;
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
let index: number = 99999;
|
||||||
|
let isBottom: any = "default";
|
||||||
|
if (nowShowList && nowShowList.length > 0) {
|
||||||
|
nowShowList.forEach((item: any, itemIndex: number) => {
|
||||||
|
if (item.value === obj.value) {
|
||||||
|
index = itemIndex;
|
||||||
|
if (scrollList.value && scrollList.value.length > 0) {
|
||||||
|
isBottom = scrollList.value[itemIndex].isBottom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
index === 99999 ||
|
index === 99999 ||
|
||||||
isBottom === "default" ||
|
isBottom === "default" ||
|
||||||
isBottom === true
|
isBottom === true
|
||||||
) {
|
) {
|
||||||
handleScrollToBottomID("gjldBox" + obj.value);
|
handleScrollToBottomID("gjldBox" + obj.value);
|
||||||
|
}
|
||||||
|
resolve(true)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 创建流式读取器
|
||||||
|
const reader = response.body.getReader();
|
||||||
|
const decoder = new TextDecoder("utf-8");
|
||||||
|
while (isStreaming) {
|
||||||
|
const { done, value } = await reader.read();
|
||||||
|
if (done) break;
|
||||||
|
// 解码并处理数据
|
||||||
|
const chunk = decoder.decode(value);
|
||||||
|
handleStreamChunkID(chunk, obj);
|
||||||
|
|
||||||
resolve(true); // 完成流处理后resolve
|
// 判断当前的这个框 是滚动数组里面的第几个 对他进行判断是不是在底部
|
||||||
|
let nowShowList: any = [];
|
||||||
|
if (modalTypeDataList && modalTypeDataList.length > 0) {
|
||||||
|
modalTypeDataList.forEach((item: any) => {
|
||||||
|
if (item.isShow) {
|
||||||
|
nowShowList.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let index: number = 99999;
|
||||||
|
let isBottom: any = "default";
|
||||||
|
if (nowShowList && nowShowList.length > 0) {
|
||||||
|
nowShowList.forEach((item: any, itemIndex: number) => {
|
||||||
|
if (item.value === obj.value) {
|
||||||
|
index = itemIndex;
|
||||||
|
if (scrollList.value && scrollList.value.length > 0) {
|
||||||
|
isBottom = scrollList.value[itemIndex].isBottom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
index === 99999 ||
|
||||||
|
isBottom === "default" ||
|
||||||
|
isBottom === true
|
||||||
|
) {
|
||||||
|
handleScrollToBottomID("gjldBox" + obj.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(true); // 完成流处理后resolve
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// messageList.push({
|
// messageList.push({
|
||||||
// role: "assistant",
|
// role: "assistant",
|
||||||
// content: responseText.value,
|
// content: responseText.value,
|
||||||
@ -1619,14 +1602,11 @@ const handleGetAnswerID = async (obj: any) => {
|
|||||||
} finally {
|
} finally {
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log("res", res);
|
|
||||||
hasStreamData = true; // 这里标记数据流出现了
|
hasStreamData = true; // 这里标记数据流出现了
|
||||||
clearTimeout(timeoutId); // 取消超时逻辑
|
clearTimeout(timeoutId); // 取消超时逻辑
|
||||||
}),
|
}),
|
||||||
// handleAiDeepThinking(obj, oldMessage, controller).then((res) => {
|
// handleAiDeepThinking(obj, oldMessage, controller).then((res) => {
|
||||||
// if (res) {
|
// if (res) {
|
||||||
// console.log("标记数据流", res);
|
|
||||||
|
|
||||||
// hasStreamData = true; // 这里标记数据流出现了
|
// hasStreamData = true; // 这里标记数据流出现了
|
||||||
// clearTimeout(timeoutId); // 取消超时逻辑
|
// clearTimeout(timeoutId); // 取消超时逻辑
|
||||||
// }
|
// }
|
||||||
@ -1739,7 +1719,6 @@ const handleAiDeepThinking = async (
|
|||||||
options
|
options
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log("response", response);
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
isSuccess = true;
|
isSuccess = true;
|
||||||
}
|
}
|
||||||
@ -1916,7 +1895,6 @@ const handleAnswerText = async (question: string) => {
|
|||||||
responseText.value = "";
|
responseText.value = "";
|
||||||
descResponseText.value = "";
|
descResponseText.value = "";
|
||||||
showController.value = false;
|
showController.value = false;
|
||||||
console.log("messageList", messageList);
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error.name !== "AbortError") {
|
if (error.name !== "AbortError") {
|
||||||
console.error("流式请求失败:", error);
|
console.error("流式请求失败:", error);
|
||||||
@ -1927,7 +1905,6 @@ const handleAnswerText = async (question: string) => {
|
|||||||
|
|
||||||
// .then((response) => response.json())
|
// .then((response) => response.json())
|
||||||
// .then((response) => {
|
// .then((response) => {
|
||||||
// console.log("response", response);
|
|
||||||
// let textAnswer = response.choices[0].message.content || "";
|
// let textAnswer = response.choices[0].message.content || "";
|
||||||
// textData.value = textAnswer;
|
// textData.value = textAnswer;
|
||||||
// })
|
// })
|
||||||
@ -1973,6 +1950,53 @@ const handleStreamChunkID = async (chunk: any, obj: any) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// gemini移除多余字符的方法
|
||||||
|
const trimFirstChar = (str: string) => {
|
||||||
|
if (typeof str !== 'string' || str.length === 0) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
const firstChar = str[0];
|
||||||
|
|
||||||
|
if (firstChar === '[' || firstChar === ',' || firstChar === ']') {
|
||||||
|
return str.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
// gemini 的流式返回
|
||||||
|
const handleStreamChunkIDGemini = async (chunk: any, obj: any) => {
|
||||||
|
if (!(chunk && chunk.length > 0)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
chunk.forEach((line: any) => {
|
||||||
|
try {
|
||||||
|
// const parsed = JSON.parse(line);
|
||||||
|
const parsed = line;
|
||||||
|
let text = "";
|
||||||
|
let descText = "";
|
||||||
|
if (parsed.candidates[0].content.parts[0].text) {
|
||||||
|
text = parsed.candidates[0].content.parts[0].text || "";
|
||||||
|
obj.responseText += text; // 实时更新响应文本
|
||||||
|
}
|
||||||
|
|
||||||
|
obj.messageList[obj.messageList.length - 1] = {
|
||||||
|
...obj.messageList[obj.messageList.length - 1],
|
||||||
|
content: marked(obj.responseText),
|
||||||
|
realContent: obj.responseText,
|
||||||
|
loading: false,
|
||||||
|
loadingContent: null,
|
||||||
|
index:
|
||||||
|
obj.messageList && obj.messageList.length > 0
|
||||||
|
? obj.messageList.length
|
||||||
|
: 0,
|
||||||
|
};
|
||||||
|
} catch (err) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 拿到云南大屏的数据
|
// 拿到云南大屏的数据
|
||||||
const handleGetYNMapData = async () => {
|
const handleGetYNMapData = async () => {
|
||||||
let obj: any = {
|
let obj: any = {
|
||||||
@ -2078,7 +2102,6 @@ const handleGetDeepseek = async (question: string) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log("oldMessage", oldMessage);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let modal = {
|
let modal = {
|
||||||
@ -2128,7 +2151,6 @@ const handleGetDeepseek = async (question: string) => {
|
|||||||
// messages: [...oldMessage],
|
// messages: [...oldMessage],
|
||||||
// model: "deepseek-reasoner",
|
// model: "deepseek-reasoner",
|
||||||
// });
|
// });
|
||||||
// console.log("completion", completion);
|
|
||||||
while (isStreaming) {
|
while (isStreaming) {
|
||||||
const { done, value } = await reader.read();
|
const { done, value } = await reader.read();
|
||||||
if (done) break;
|
if (done) break;
|
||||||
@ -2211,13 +2233,8 @@ const handleDeepseekScrollToBottom = () => {
|
|||||||
|
|
||||||
// 模型种类切换
|
// 模型种类切换
|
||||||
const handleChangeModalType = (e: any) => {
|
const handleChangeModalType = (e: any) => {
|
||||||
console.log("e1", e);
|
|
||||||
console.log("pageType", pageType.value);
|
|
||||||
console.log("isPhone", isPhone);
|
|
||||||
let newList: number[] = [];
|
let newList: number[] = [];
|
||||||
if (pageType.value === 1 || isPhone.value) {
|
if (pageType.value === 1 || isPhone.value) {
|
||||||
console.log('1');
|
|
||||||
|
|
||||||
if (e && e.length > 1) {
|
if (e && e.length > 1) {
|
||||||
newList = [e[e.length - 1]]
|
newList = [e[e.length - 1]]
|
||||||
}
|
}
|
||||||
@ -2231,7 +2248,6 @@ const handleChangeModalType = (e: any) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('2');
|
|
||||||
if (e && e.length > 2) {
|
if (e && e.length > 2) {
|
||||||
e.forEach((item: number, index: number) => {
|
e.forEach((item: number, index: number) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
@ -2244,7 +2260,6 @@ const handleChangeModalType = (e: any) => {
|
|||||||
if (!(newList && newList.length > 1)) {
|
if (!(newList && newList.length > 1)) {
|
||||||
newList = e;
|
newList = e;
|
||||||
}
|
}
|
||||||
console.log('newList', newList);
|
|
||||||
|
|
||||||
modalTypeDataList.forEach((item: any) => {
|
modalTypeDataList.forEach((item: any) => {
|
||||||
if (newList.indexOf(item.value) !== -1) {
|
if (newList.indexOf(item.value) !== -1) {
|
||||||
@ -2253,7 +2268,6 @@ const handleChangeModalType = (e: any) => {
|
|||||||
item.isShow = false;
|
item.isShow = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log("modalTypeDataList", modalTypeDataList);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2276,8 +2290,6 @@ const handleStop = () => {
|
|||||||
item.descResponseText = "";
|
item.descResponseText = "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log("modalTypeDataList", modalTypeDataList);
|
|
||||||
|
|
||||||
showController.value = false;
|
showController.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2295,8 +2307,6 @@ const handleChangeVersion = () => {
|
|||||||
watch(
|
watch(
|
||||||
() => controllers,
|
() => controllers,
|
||||||
(newVal, oldVal) => {
|
(newVal, oldVal) => {
|
||||||
console.log("newVal", newVal);
|
|
||||||
console.log("oldVal", oldVal);
|
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
@ -2340,8 +2350,6 @@ watch(
|
|||||||
|
|
||||||
// 点击深度分析
|
// 点击深度分析
|
||||||
const handleDepthAnalysis = async (bigObj: any, obj: any) => {
|
const handleDepthAnalysis = async (bigObj: any, obj: any) => {
|
||||||
console.log("bigObj", bigObj);
|
|
||||||
console.log("obj", obj);
|
|
||||||
handleOnceMoreModal([bigObj.value]);
|
handleOnceMoreModal([bigObj.value]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2380,7 +2388,6 @@ const handleGetInterfaceID = async (questionText: string, bigObj: any) => {
|
|||||||
// for (let i = 0; i < modalTypeDataList.length; i++) {
|
// for (let i = 0; i < modalTypeDataList.length; i++) {
|
||||||
// let item: any = modalTypeDataList[i];
|
// let item: any = modalTypeDataList[i];
|
||||||
// if (item.isShow) {
|
// if (item.isShow) {
|
||||||
// console.log("handleGetDeepseekAnswer", item);
|
|
||||||
// // 取最新一条的用户提问
|
// // 取最新一条的用户提问
|
||||||
// let userQuestion: any = [];
|
// let userQuestion: any = [];
|
||||||
// if (item.messageList && item.messageList.length > 0) {
|
// if (item.messageList && item.messageList.length > 0) {
|
||||||
@ -2393,8 +2400,6 @@ const handleGetInterfaceID = async (questionText: string, bigObj: any) => {
|
|||||||
|
|
||||||
// // 最新的问题对象
|
// // 最新的问题对象
|
||||||
// let lastObj: any = userQuestion[userQuestion.length - 1];
|
// let lastObj: any = userQuestion[userQuestion.length - 1];
|
||||||
// console.log("lastObj", lastObj);
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
@ -2468,14 +2473,11 @@ const handleGetDeepseekAnswer = async (questionText: string, obj: any) => {
|
|||||||
const data = await axios(config);
|
const data = await axios(config);
|
||||||
let id = data.data.choices[0].message.content;
|
let id = data.data.choices[0].message.content;
|
||||||
id = fixToJson(id);
|
id = fixToJson(id);
|
||||||
console.log("id", id);
|
|
||||||
|
|
||||||
let idObj: any = handleChangeJSON(id);
|
let idObj: any = handleChangeJSON(id);
|
||||||
console.log("idObj", idObj);
|
|
||||||
idObj.idList = idObj.idList.toString();
|
idObj.idList = idObj.idList.toString();
|
||||||
idObj.idList = handleParseToArray(idObj.idList);
|
idObj.idList = handleParseToArray(idObj.idList);
|
||||||
// const arr = handleParseToArray(id);
|
// const arr = handleParseToArray(id);
|
||||||
// console.log("handleGetDeepseekAnswer", arr);
|
|
||||||
|
|
||||||
return idObj;
|
return idObj;
|
||||||
};
|
};
|
||||||
@ -2519,7 +2521,6 @@ const fixToJson = (input: any): string | null => {
|
|||||||
const handleChangeJSON = (jsonStr: any) => {
|
const handleChangeJSON = (jsonStr: any) => {
|
||||||
try {
|
try {
|
||||||
jsonStr = jsonStr.replace(/\s+/g, "");
|
jsonStr = jsonStr.replace(/\s+/g, "");
|
||||||
console.log("jsonStr", jsonStr);
|
|
||||||
|
|
||||||
let openBraces = (jsonStr.match(/{/g) || []).length;
|
let openBraces = (jsonStr.match(/{/g) || []).length;
|
||||||
let closeBraces = (jsonStr.match(/}/g) || []).length;
|
let closeBraces = (jsonStr.match(/}/g) || []).length;
|
||||||
@ -2567,7 +2568,6 @@ const handleQuestionReload = (obj: any, bigObj: any) => {
|
|||||||
if (showController.value || isLoading) {
|
if (showController.value || isLoading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("obj", obj);
|
|
||||||
userInput.value = obj.content;
|
userInput.value = obj.content;
|
||||||
handleSendRequest(bigObj);
|
handleSendRequest(bigObj);
|
||||||
};
|
};
|
||||||
@ -2609,7 +2609,6 @@ const handleScroll = (e: any) => {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// // el.forEach((item: any) => {
|
// // el.forEach((item: any) => {
|
||||||
// // console.log("item", item);
|
|
||||||
// // });
|
// // });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@ -2667,7 +2666,6 @@ const handleNewRuleList = async () => {
|
|||||||
pagesize: 999999,
|
pagesize: 999999,
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
});
|
});
|
||||||
console.log("handleNewRuleList", data);
|
|
||||||
let str: string = "";
|
let str: string = "";
|
||||||
|
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
@ -2686,8 +2684,6 @@ const handleNewRuleList = async () => {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
newRuleText.value = res;
|
newRuleText.value = res;
|
||||||
|
|
||||||
console.log("res", res);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 隐藏左侧
|
// 隐藏左侧
|
||||||
@ -2742,7 +2738,6 @@ const handleCopyContent = (bigObj: any) => {
|
|||||||
|
|
||||||
// 改变工作模式的方法
|
// 改变工作模式的方法
|
||||||
const handleChangeProcess = (e: any) => {
|
const handleChangeProcess = (e: any) => {
|
||||||
console.log("e", e);
|
|
||||||
modalTypeDataList.forEach((item: any) => {
|
modalTypeDataList.forEach((item: any) => {
|
||||||
let nowLength = item.messageList.length;
|
let nowLength = item.messageList.length;
|
||||||
if (item.messageList && item.messageList.length > 0) {
|
if (item.messageList && item.messageList.length > 0) {
|
||||||
@ -3001,6 +2996,9 @@ const handleChangeProcess = (e: any) => {
|
|||||||
<div class="contentTitle" v-if="item.value === 4 && item.isShow" @click="handleShowPhoneChangeBox">
|
<div class="contentTitle" v-if="item.value === 4 && item.isShow" @click="handleShowPhoneChangeBox">
|
||||||
通义千问
|
通义千问
|
||||||
</div>
|
</div>
|
||||||
|
<div class="contentTitle" v-if="item.value === 5 && item.isShow" @click="handleShowPhoneChangeBox">
|
||||||
|
Gemini
|
||||||
|
</div>
|
||||||
<div class="phoneModalSelectBox" v-if="item.isShow && showPhoneChange">
|
<div class="phoneModalSelectBox" v-if="item.isShow && showPhoneChange">
|
||||||
<div class="phoneModal" v-for="(item, index) in modalTypeDataList" :key="index"
|
<div class="phoneModal" v-for="(item, index) in modalTypeDataList" :key="index"
|
||||||
@click="handlePhoneChangeModal(item.value)">
|
@click="handlePhoneChangeModal(item.value)">
|
||||||
@ -3096,7 +3094,8 @@ const handleChangeProcess = (e: any) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="toolBox">
|
<div class="toolBox"
|
||||||
|
:style="{ justifyContent: modalTypeSelect && modalTypeSelect.length === 1 ? 'center' : 'flex-end' }">
|
||||||
<div class="deleteBox" v-if="item.showReload && !showController" style="margin-right: 16px">
|
<div class="deleteBox" v-if="item.showReload && !showController" style="margin-right: 16px">
|
||||||
<img class="deleteIcon" src="@/assets/ai/reloadSmallIcon.svg" @click="handleBottomReload(item)" />
|
<img class="deleteIcon" src="@/assets/ai/reloadSmallIcon.svg" @click="handleBottomReload(item)" />
|
||||||
<span class="deleteText" @click="handleBottomReload(item)">刷新</span>
|
<span class="deleteText" @click="handleBottomReload(item)">刷新</span>
|
||||||
|
|||||||
@ -21,5 +21,11 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
proxy: {
|
||||||
|
'/v1': {
|
||||||
|
target: 'http://localhost:8045',
|
||||||
|
changeOrigin: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user