This commit is contained in:
guilinlewis
2025-05-25 22:48:49 +08:00
committed by GitHub
4 changed files with 19 additions and 11 deletions

View File

@@ -46,7 +46,8 @@ public class DataInterpretProcessor implements ExecuteResultProcessor {
public boolean accept(ExecuteContext executeContext) {
Agent agent = executeContext.getAgent();
ChatApp chatApp = agent.getChatAppConfig().get(APP_KEY);
return Objects.nonNull(chatApp) && chatApp.isEnable();
return Objects.nonNull(chatApp) && chatApp.isEnable()&&
StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
}
@Override

View File

@@ -179,13 +179,15 @@ public class NatureHelper {
}
public static Long parseIdFromNature(String nature, int index) {
try {
String[] split = nature.split(DictWordType.NATURE_SPILT);
if (split.length > index) {
return Long.valueOf(split[index]);
if(nature.startsWith("_")){ // 框架的字典都是以_开头的
try {
String[] split = nature.split(DictWordType.NATURE_SPILT);
if (split.length > index) {
return Long.valueOf(split[index]);
}
} catch (NumberFormatException e) {
log.error("Error parsing long from nature: {}", nature, e);
}
} catch (NumberFormatException e) {
log.error("Error parsing long from nature: {}", nature, e);
}
return null;
}

View File

@@ -102,7 +102,6 @@ const ChatItem: React.FC<Props> = ({
{}
);
const [isParserError, setIsParseError] = useState<boolean>(false);
const resetState = () => {
setParseLoading(false);
setParseTimeCost(undefined);
@@ -441,6 +440,8 @@ const ChatItem: React.FC<Props> = ({
const { register, call } = useMethodRegister(() => message.error('该条消息暂不支持该操作'));
let actualQueryText=parseInfo?.properties.CONTEXT.queryText // lance修改 结果显示多轮对话转义的内容
actualQueryText=actualQueryText==null?msg:actualQueryText
return (
<ChartItemContext.Provider value={{ register, call }}>
<div className={prefixCls}>
@@ -509,7 +510,7 @@ const ChatItem: React.FC<Props> = ({
<SqlItem
agentId={agentId}
queryId={parseInfo.queryId}
question={msg}
question={actualQueryText}
llmReq={llmReq}
llmResp={llmResp}
integrateSystem={integrateSystem}
@@ -522,7 +523,7 @@ const ChatItem: React.FC<Props> = ({
<ExecuteItem
isSimpleMode={isSimpleMode}
queryId={parseInfo?.queryId}
question={msg}
question={actualQueryText}
queryMode={parseInfo?.queryMode}
executeLoading={executeLoading}
executeTip={executeTip}

View File

@@ -82,7 +82,11 @@
background-color: #fafafa !important;
}
.ant-table-cell {
.ant-table-cell { // 更新修改,解决表格内容太长导致显示的问题
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 250px;
text-align: center !important;
}