(improvement)(chat)多轮对话增加rewrittenQuery的MapInfo (#1599)

This commit is contained in:
yudong
2024-08-26 10:20:52 +08:00
committed by GitHub
parent 3d7fac7ca9
commit 3915d90eec
3 changed files with 7 additions and 4 deletions

View File

@@ -203,8 +203,10 @@ public class NL2SQLParser implements ChatQueryParser {
Response<AiMessage> response = chatLanguageModel.generate(prompt.toUserMessage());
String rewrittenQuery = response.content().text();
keyPipelineLog.info("NL2SQLParser modelResp:{}", rewrittenQuery);
parseContext.setQueryText(rewrittenQuery);
QueryNLReq rewrittenQueryNLReq = QueryReqConverter.buildText2SqlQueryReq(parseContext);
MapResp rewrittenQueryMapResult = chatLayerService.performMapping(rewrittenQueryNLReq);
parseContext.setMapInfo(rewrittenQueryMapResult.getMapInfo());
log.info("Last Query: {} Current Query: {}, Rewritten Query: {}",
lastQuery.getQueryText(), currentMapResult.getQueryText(), rewrittenQuery);
}