mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(improvement)(headless | chat |webapp) (#2266)
1 在使用多轮对话改写时,内容上面的问题,替换成改写的内容,可以让用户知道该回答原来什么问题 2 解决表格内容太长导致显示的问题 3 框架的字典都是以_开头的, 添加判断,如果配置了非 _ 开头的字典而引起的报错 4 大模型分析结果时,因为textResult 是必填的参数,所以如果发现 textResult 未null 就不做分析了
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user