10 Commits

Author SHA1 Message Date
QJ_wonder
86651a2b10 Merge fa65b6eff7 into 62b9db6791 2025-07-15 11:25:51 +08:00
WDEP
62b9db6791 (fix)(webapp) 修改页面不显示推荐下钻维度问题 (#2332)
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled
2025-07-15 10:17:22 +08:00
wangyong
6d907b6adf (fix)(headless-chat) 修复EmbeddingMatchStrategy.detectByBatch() NPE异常,当chatQueryContext.getRequest().getChatAppConfig()为null (#2333) 2025-07-15 10:17:03 +08:00
wangyong
da172a030e (fix)(headless-chat) 修复FileHandlerImpl.convert2Resp() 纬度值数据行首字符为空格时异常 (#2336) 2025-07-15 10:16:46 +08:00
QJ_wonder
fa65b6eff7 Update NL2PluginParser.java 去除多数据集条件判断 2025-05-28 15:47:58 +08:00
QJ_wonder
0ab44c0866 Merge branch 'tencentmusic:master' into master_fixplugin 2025-05-27 14:54:49 +08:00
QJ_wonder
449fdf180f (fix)(chat)多个数据集也只保留召回的第一个结果
这里的多数据集其实对召回的结果没有影响,取第一个就好了
2025-05-27 14:42:34 +08:00
QJ_wonder
d275a145d5 Update WebServiceQuery.java 2025-05-27 14:07:32 +08:00
QJ_wonder
c8f690c1c2 (fix)(chat) 修改判断是否需要NL2SQL的条件判断
修改判断是否需要NL2SQL的条件判断,如果respone里已经有返回体,则不需要NL2SQL的执行,直接返回。避免插件返回体被NL2SQL返回体覆盖的问题
2025-05-27 13:39:48 +08:00
QJ_wonder
38af6e3a28 (fix)(chat) 修复插件调用问题
修复插件调用问题,将原有的Json解析替换成fastjson的json解析,并按String解析返回体,否则会报:Error while extracting response for type [class java.lang.Object] and content type [application/xml;charset=UTF-8]
2025-05-27 13:34:34 +08:00
5 changed files with 13 additions and 7 deletions

View File

@@ -88,10 +88,10 @@ public class WebServiceQuery extends PluginSemanticQuery {
restTemplate = ContextUtils.getBean(RestTemplate.class);
try {
responseEntity =
restTemplate.exchange(requestUrl, HttpMethod.POST, entity, Object.class);
restTemplate.exchange(requestUrl, HttpMethod.POST, entity, String.class);
objectResponse = responseEntity.getBody();
log.info("objectResponse:{}", objectResponse);
Map<String, Object> response = JsonUtil.objectToMap(objectResponse);
Map<String, Object> response = JSON.parseObject(objectResponse.toString());
webServiceResponse.setResult(response);
} catch (Exception e) {
log.info("Exception:{}", e.getMessage());

View File

@@ -19,7 +19,7 @@ public class ParseContext {
}
public boolean enableNL2SQL() {
return Objects.nonNull(agent) && agent.containsDatasetTool();
return Objects.nonNull(agent) && agent.containsDatasetTool()&&response.getSelectedParses().size() == 0;
}
public boolean enableLLM() {

View File

@@ -175,6 +175,7 @@ public class FileHandlerImpl implements FileHandler {
private DictValueResp convert2Resp(String lineStr) {
DictValueResp dictValueResp = new DictValueResp();
if (StringUtils.isNotEmpty(lineStr)) {
lineStr=StringUtils.stripStart(lineStr,null);
String[] itemArray = lineStr.split("\\s+");
if (Objects.nonNull(itemArray) && itemArray.length >= 3) {
dictValueResp.setValue(itemArray[0].replace("#", " "));

View File

@@ -3,6 +3,7 @@ package com.tencent.supersonic.headless.chat.mapper;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.hankcs.hanlp.seg.common.Term;
import com.tencent.supersonic.common.pojo.ChatModelConfig;
import com.tencent.supersonic.headless.api.pojo.response.S2Term;
import com.tencent.supersonic.headless.chat.ChatQueryContext;
import com.tencent.supersonic.headless.chat.knowledge.EmbeddingResult;
@@ -167,9 +168,13 @@ public class EmbeddingMatchStrategy extends BatchMatchStrategy<EmbeddingResult>
variable.put("retrievedInfo", JSONObject.toJSONString(results));
Prompt prompt = PromptTemplate.from(LLM_FILTER_PROMPT).apply(variable);
ChatLanguageModel chatLanguageModel =
ModelProvider.getChatModel(chatQueryContext.getRequest().getChatAppConfig()
.get("REWRITE_MULTI_TURN").getChatModelConfig());
ChatModelConfig chatModelConfig=null;
if(chatQueryContext.getRequest().getChatAppConfig()!=null
&& chatQueryContext.getRequest().getChatAppConfig().containsKey("REWRITE_MULTI_TURN")){
chatModelConfig=chatQueryContext.getRequest().getChatAppConfig().get("REWRITE_MULTI_TURN").getChatModelConfig();
}
ChatLanguageModel chatLanguageModel = ModelProvider.getChatModel(chatModelConfig);
String response = chatLanguageModel.generate(prompt.toUserMessage().singleText());
if (StringUtils.isBlank(response)) {

View File

@@ -367,7 +367,7 @@ const ChatMsg: React.FC<Props> = ({
entityName !== undefined;
const existDrillDownDimension =
queryMode.includes('METRIC') &&
(queryMode.includes('METRIC') || queryMode === 'LLM_S2SQL')&&
getMsgContentType() !== MsgContentTypeEnum.TEXT &&
!isEntityMode;