mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(fix)(chat) 修复插件功能,无法调用/插件结果被NL2SQL结果覆盖的问题 (#2277)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user