|
|
@@ -4,7 +4,7 @@ import generateClientUniqueId from '../../utils/generate-client-unique-id';
|
|
|
|
|
|
import { formatCodePython, formatCodeSql } from './format-code-string';
|
|
|
import formatAnwserString from './format-anwser-string';
|
|
|
-import { formatFileDownloadStr } from './format-dialog-answer-custom-markdown-str';
|
|
|
+// import { formatFileDownloadStr } from './format-dialog-answer-custom-markdown-str';
|
|
|
import { getIcon4Answer } from './get-icon-4-dialog';
|
|
|
|
|
|
import {
|
|
|
@@ -182,6 +182,7 @@ export default function formatDialogAnswerFromWebsocketReceiveMessage(message_st
|
|
|
// 智能数据可能存在此字段
|
|
|
// 代码数据不能使用markdown解析器进行解析,否则会乱码
|
|
|
const sql_formated = formatCodeSql(resSQL);
|
|
|
+ // const sql_formated = resSQL;
|
|
|
|
|
|
currentMsg.client_custom_linked_sql = sql_formated;
|
|
|
}
|
|
|
@@ -294,30 +295,30 @@ export default function formatDialogAnswerFromWebsocketReceiveMessage(message_st
|
|
|
*/
|
|
|
currentMsg.client_custom_unique_id = generateClientUniqueId(currentMsg.answer);
|
|
|
|
|
|
- if (currentMsg.answer) {
|
|
|
- // 将markdown转换为html文件
|
|
|
- currentMsg.answer = formatAnwserString(currentMsg.answer);
|
|
|
-
|
|
|
- if (currentMsg.client_custom_linked_code) {
|
|
|
- currentMsg.answer = currentMsg.answer + currentMsg.client_custom_linked_code;
|
|
|
- }
|
|
|
-
|
|
|
- // 由于SQL和代码不能通过markdown解析,所以此处进行字符串的拼接
|
|
|
- if (currentMsg.client_custom_linked_sql) {
|
|
|
- currentMsg.answer = currentMsg.answer + currentMsg.client_custom_linked_sql;
|
|
|
- }
|
|
|
-
|
|
|
- if (currentMsg.client_custom_linked_image) {
|
|
|
- currentMsg.answer = currentMsg.answer + `<img src="${currentMsg.client_custom_linked_image}" />`;
|
|
|
- }
|
|
|
- // 拼接文件的下载链接
|
|
|
- if (answer.client_custom_linked_download_files) {
|
|
|
- const file_name = answer.client_custom_linked_download_files.file_name;
|
|
|
- const file_url = answer.client_custom_linked_download_files.file_url;
|
|
|
- const download_file_str = formatFileDownloadStr(file_name, file_url);
|
|
|
- answer_string = answer_string + download_file_str;
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (currentMsg.answer) {
|
|
|
+ // // 将markdown转换为html文件
|
|
|
+ // currentMsg.answer = formatAnwserString(currentMsg.answer);
|
|
|
+
|
|
|
+ // if (currentMsg.client_custom_linked_code) {
|
|
|
+ // currentMsg.answer = currentMsg.answer + currentMsg.client_custom_linked_code;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // // 由于SQL和代码不能通过markdown解析,所以此处进行字符串的拼接
|
|
|
+ // if (currentMsg.client_custom_linked_sql) {
|
|
|
+ // currentMsg.answer = currentMsg.answer + currentMsg.client_custom_linked_sql;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (currentMsg.client_custom_linked_image) {
|
|
|
+ // currentMsg.answer = currentMsg.answer + `<img src="${currentMsg.client_custom_linked_image}" />`;
|
|
|
+ // }
|
|
|
+ // // 拼接文件的下载链接
|
|
|
+ // if (currentMsg.client_custom_linked_download_files) {
|
|
|
+ // const file_name = currentMsg.client_custom_linked_download_files.file_name;
|
|
|
+ // const file_url = currentMsg.client_custom_linked_download_files.file_url;
|
|
|
+ // const download_file_str = formatFileDownloadStr(file_name, file_url);
|
|
|
+ // currentMsg.answer = currentMsg.answer + download_file_str;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
return {
|
|
|
status: chat_status, // 本轮会话的状态:0 未开始 1 进行中 2 已结束 3 错误
|