mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-29 04:14:20 +08:00
Compare commits
8 Commits
a4ceed1f1a
...
608b675759
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
608b675759 | ||
|
|
df70a3cf15 | ||
|
|
fa65b6eff7 | ||
|
|
0ab44c0866 | ||
|
|
449fdf180f | ||
|
|
d275a145d5 | ||
|
|
c8f690c1c2 | ||
|
|
38af6e3a28 |
@@ -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());
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -46,8 +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()&&
|
||||
StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
|
||||
return Objects.nonNull(chatApp) && chatApp.isEnable()
|
||||
&& StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -179,7 +179,7 @@ public class NatureHelper {
|
||||
}
|
||||
|
||||
public static Long parseIdFromNature(String nature, int index) {
|
||||
if(nature.startsWith("_")){ // 框架的字典都是以_开头的
|
||||
if (nature.startsWith("_")) { // 框架的字典都是以_开头的
|
||||
try {
|
||||
String[] split = nature.split(DictWordType.NATURE_SPILT);
|
||||
if (split.length > index) {
|
||||
|
||||
@@ -335,13 +335,17 @@ public class S2DataPermissionAspect {
|
||||
if (StringUtils.isNotEmpty(filter.getDescription())) {
|
||||
descList.add(filter.getDescription());
|
||||
}
|
||||
exprList.add(filter.getExpressions().toString());
|
||||
if (!"[]".equals(filter.getExpressions().toString())) {
|
||||
exprList.add(filter.getExpressions().toString());
|
||||
}
|
||||
});
|
||||
String promptInfo = "当前结果已经过行权限过滤,详细过滤条件如下:%s, 申请权限请联系管理员%s";
|
||||
String message = String.format(promptInfo,
|
||||
CollectionUtils.isEmpty(descList) ? exprList : descList, admins);
|
||||
queryResultWithColumns.setQueryAuthorization(
|
||||
new QueryAuthorization(modelResp.getName(), exprList, descList, message));
|
||||
if (!CollectionUtils.isEmpty(exprList)) {
|
||||
String promptInfo = "当前结果已经过行权限过滤,详细过滤条件如下:%s, 申请权限请联系管理员%s";
|
||||
String message = String.format(promptInfo,
|
||||
CollectionUtils.isEmpty(descList) ? exprList : descList, admins);
|
||||
queryResultWithColumns.setQueryAuthorization(
|
||||
new QueryAuthorization(modelResp.getName(), exprList, descList, message));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user