可信代码库-AI大模型bug修复及相关功能修改(暂时不升级,需还原)
This commit is contained in:
@@ -345,8 +345,8 @@ const getAIAnswer = async (content) => {
|
||||
|
||||
debugger
|
||||
|
||||
if(response.data.type) {
|
||||
const {text,type,id,table_name=[], states={}} = response.data;
|
||||
if(response.data.data.type) {
|
||||
const {text,type,id,table_name=[], states={}} = response.data.data;
|
||||
messages.value[messages.value.length - 1].id = id;
|
||||
// 处理思考过程
|
||||
const thinkProcess = processThinkStates(states);
|
||||
@@ -358,13 +358,13 @@ const getAIAnswer = async (content) => {
|
||||
messages.value[messages.value.length - 1].loading = false;
|
||||
messages.value[messages.value.length - 1].type = 'text';
|
||||
} else if(type==='df') {
|
||||
messages.value[messages.value.length - 1].content = response.data[type];
|
||||
messages.value[messages.value.length - 1].content = response.data.data[type];
|
||||
messages.value[messages.value.length - 1].loading = false;
|
||||
messages.value[messages.value.length - 1].type = 'df';
|
||||
|
||||
// 判断是否软件详情
|
||||
if(table_name.length===1&&table_name[0]==='critical_software_info') {
|
||||
let arr = JSON.parse(response.data[type]);
|
||||
let arr = JSON.parse(response.data.data[type]);
|
||||
if(arr&&arr.length===1) {
|
||||
messages.value[messages.value.length - 1].type = 'critical_software_info';
|
||||
messages.value[messages.value.length - 1].id = arr[0]?.id || arr[0]?.ID;
|
||||
@@ -372,7 +372,7 @@ const getAIAnswer = async (content) => {
|
||||
}
|
||||
}
|
||||
} else if(type==='sql_error') {
|
||||
messages.value[messages.value.length - 1].content = response.data.error;
|
||||
messages.value[messages.value.length - 1].content = response.data.data.error;
|
||||
messages.value[messages.value.length - 1].loading = false;
|
||||
messages.value[messages.value.length - 1].type = 'error';
|
||||
}
|
||||
@@ -433,8 +433,8 @@ const createConversation = async () => {
|
||||
const response = await axios.post(`${VITE_AI_API_HOST}/api/createConversation`, {
|
||||
userId: username,
|
||||
});
|
||||
const createRes = response.data;
|
||||
|
||||
const createRes = response.data.data;
|
||||
debugger
|
||||
if (createRes&&createRes.conversationId) {
|
||||
debugger
|
||||
CONV_ID.value = createRes.conversationId;
|
||||
@@ -513,7 +513,7 @@ const getConversationDetail = async (convId: string) => {
|
||||
conversationId: convId,
|
||||
},
|
||||
});
|
||||
const detail = response.data.messages;
|
||||
const detail = response.data.data;
|
||||
// 处理详情数据(如回显消息列表)
|
||||
handleDetailResponse(detail);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user