Commit 46eb12ab by chenjinjing

no message

parent 7273ec44
......@@ -9,7 +9,8 @@ export enum AIANSWERTYPE {
折线图 = 2,
柱状图 = 3,
饼图 = 4,
表格 = 5
表格 = 5,
文本 = 6,
}
......@@ -75,18 +75,18 @@ export async function getAIAnswerInterface(question, sceneUuids, threadId) {
if (!sample) {
let aiAnswerStr = replacePlaceholders(content, params);
// 1. 找到最后一个 "为" 的位置
let lastWeiIndex = aiAnswerStr.lastIndexOf("为");
let beforeWei = "";
let afterWei = "";
if (lastWeiIndex !== -1) {
// 2. 截取 "为" 前面的部分(不包含"为")
beforeWei = aiAnswerStr.slice(0, lastWeiIndex);
// 3. 截取 "为" 后面的部分(不包含"为")
afterWei = aiAnswerStr.slice(lastWeiIndex + 1); // +1 跳过 "为" 字
}
aiAnswerType = AIANSWERTYPE.键值对;
aiAnswerData = [{key:beforeWei, value:afterWei}];
// // 1. 找到最后一个 "为" 的位置
// let lastWeiIndex = aiAnswerStr.lastIndexOf("为");
// let beforeWei = "";
// let afterWei = "";
// if (lastWeiIndex !== -1) {
// // 2. 截取 "为" 前面的部分(不包含"为")
// beforeWei = aiAnswerStr.slice(0, lastWeiIndex);
// // 3. 截取 "为" 后面的部分(不包含"为")
// afterWei = aiAnswerStr.slice(lastWeiIndex + 1); // +1 跳过 "为" 字
// }
aiAnswerType = AIANSWERTYPE.文本;
aiAnswerData = aiAnswerStr;
} else if (!Object.keys(sample).length) {
throw new SysError(SYSTEMERRORENUM.未按接口协议返回, interfaceName, "sample 为空", sample);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment