mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(improvement)(common|headless|chat|auth) 鉴权优化与召回优化
1 修复生成的用户token 一生成就失效的问题 2 如果用户设置的token ,需校验是否数据库存在,因为用户可设置一年的token 有泄露风险 3 结果解析优化, 去除不可以解析的情况,解析问题需要改写后的问, 4 召回样例,用相似度,保住至少有一个样例是高相似度的 5 数据集召回,填加完全匹配格式筛选逻辑
This commit is contained in:
@@ -47,7 +47,8 @@ public class DataInterpretProcessor implements ExecuteResultProcessor {
|
||||
Agent agent = executeContext.getAgent();
|
||||
ChatApp chatApp = agent.getChatAppConfig().get(APP_KEY);
|
||||
return Objects.nonNull(chatApp) && chatApp.isEnable()
|
||||
&& StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
|
||||
&& StringUtils.isNotBlank(executeContext.getResponse().getTextResult()) // 如果都没结果,则无法处理
|
||||
&& StringUtils.isBlank(executeContext.getResponse().getTextSummary()); // 如果已经有汇总的结果了,无法再次处理
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +58,15 @@ public class DataInterpretProcessor implements ExecuteResultProcessor {
|
||||
ChatApp chatApp = agent.getChatAppConfig().get(APP_KEY);
|
||||
|
||||
Map<String, Object> variable = new HashMap<>();
|
||||
variable.put("question", executeContext.getRequest().getQueryText());
|
||||
String question = executeContext.getResponse().getTextResult();// 结果解析应该用改写的问题,因为改写的内容信息量更大
|
||||
if(executeContext.getParseInfo().getProperties()!=null&&
|
||||
executeContext.getParseInfo().getProperties().containsKey("CONTEXT")){
|
||||
Map<String,Object> context = (Map<String, Object>) executeContext.getParseInfo().getProperties().get("CONTEXT");
|
||||
if(context.get("queryText")!=null&&"".equals(context.get("queryText"))){
|
||||
question = context.get("queryText").toString();
|
||||
}
|
||||
}
|
||||
variable.put("question", question);
|
||||
variable.put("data", queryResult.getTextResult());
|
||||
|
||||
Prompt prompt = PromptTemplate.from(chatApp.getPrompt()).apply(variable);
|
||||
|
||||
Reference in New Issue
Block a user