[improvement](chat) fix SqlGeneration format issues (#538)

This commit is contained in:
lexluo09
2023-12-18 22:04:40 +08:00
committed by GitHub
parent b44fa2bf3c
commit e08435902a
3 changed files with 3 additions and 5 deletions

View File

@@ -63,8 +63,7 @@ public class OnePassSCSqlGeneration implements SqlGeneration, InitializingBean {
Pair<String, Map<String, Double>> linkingMap = OutputFormat.selfConsistencyVote(candidateSortedList);
List<String> sqlList = llmResults.stream()
.map(llmResult -> OutputFormat.getSql(llmResult)).collect(Collectors.toList());
List<String> sqlListSortedList = OutputFormat.formatList(sqlList);
Pair<String, Map<String, Double>> sqlMap = OutputFormat.selfConsistencyVote(sqlListSortedList);
Pair<String, Map<String, Double>> sqlMap = OutputFormat.selfConsistencyVote(sqlList);
log.info("linkingMap result:{},sqlMap:{}", linkingMap, sqlMap);
return sqlMap.getRight();
}

View File

@@ -68,8 +68,7 @@ public class TwoPassSCSqlGeneration implements SqlGeneration, InitializingBean {
sqlTaskPool.add(result);
});
//4.format response.
List<String> sqlTaskSortedList = OutputFormat.formatList(sqlTaskPool);
Pair<String, Map<String, Double>> sqlMap = OutputFormat.selfConsistencyVote(sqlTaskSortedList);
Pair<String, Map<String, Double>> sqlMap = OutputFormat.selfConsistencyVote(sqlTaskPool);
log.info("linkingMap result:{},sqlMap:{}", linkingMap, sqlMap);
return sqlMap.getRight();
}

View File

@@ -49,7 +49,7 @@ s2:
chat-model:
provider: open_ai
openai:
api-key: api_key
api-key: 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
model-name: gpt-3.5-turbo-16k
temperature: 0.0
timeout: PT60S