mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-20 13:44:19 +08:00
(improvement)(Chat) Format the results of the parse and query phases into text (#1045)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -39,6 +39,7 @@ public class SemanticParseInfo {
|
||||
private SqlInfo sqlInfo = new SqlInfo();
|
||||
private QueryType queryType = QueryType.ID;
|
||||
private EntityInfo entityInfo;
|
||||
private String textInfo;
|
||||
private static class SchemaNameLengthComparator implements Comparator<SchemaElement> {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,7 @@ public class QueryResult {
|
||||
private SemanticParseInfo chatContext;
|
||||
private Object response;
|
||||
private List<Map<String, Object>> queryResults;
|
||||
private String textResult;
|
||||
private Long queryTimeCost;
|
||||
private EntityInfo entityInfo;
|
||||
private List<SchemaElement> recommendedDimensions;
|
||||
|
||||
@@ -115,8 +115,8 @@ public class PromptGenerator {
|
||||
String currentDataStr = "当前的日期是" + currentDate;
|
||||
String linkingListStr = String.join(",", priorLinkingList);
|
||||
String termStr = getTermStr(llmReq);
|
||||
String questionAugmented = String.format("%s (补充信息:%s . %s . %s) (备注: %s)", llmReq.getQueryText(), linkingListStr,
|
||||
currentDataStr, termStr, priorExts);
|
||||
String questionAugmented = String.format("%s (补充信息:%s . %s . %s) (备注: %s)", llmReq.getQueryText(),
|
||||
linkingListStr, currentDataStr, termStr, priorExts);
|
||||
return Pair.of(dbSchema, questionAugmented);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class PromptGenerator {
|
||||
StringBuilder termsDesc = new StringBuilder();
|
||||
if (!CollectionUtils.isEmpty(terms)) {
|
||||
termsDesc.append("相关业务术语:");
|
||||
for (int idx = 0 ; idx < terms.size() ; idx++) {
|
||||
for (int idx = 0; idx < terms.size(); idx++) {
|
||||
LLMReq.Term term = terms.get(idx);
|
||||
String name = term.getName();
|
||||
String description = term.getDescription();
|
||||
|
||||
Reference in New Issue
Block a user