mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 21:17:08 +00:00
This commit is contained in:
@@ -62,8 +62,10 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
|
|||||||
ChatLanguageModel chatLanguageModel = getChatLanguageModel(llmReq.getModelConfig());
|
ChatLanguageModel chatLanguageModel = getChatLanguageModel(llmReq.getModelConfig());
|
||||||
Response<AiMessage> response = chatLanguageModel.generate(prompt.toUserMessage());
|
Response<AiMessage> response = chatLanguageModel.generate(prompt.toUserMessage());
|
||||||
String sqlOutput = StringUtils.normalizeSpace(response.content().text());
|
String sqlOutput = StringUtils.normalizeSpace(response.content().text());
|
||||||
output2Prompt.put(sqlOutput, prompt);
|
// replace ```
|
||||||
keyPipelineLog.info("OnePassSCSqlGenStrategy modelResp:\n{}", sqlOutput);
|
String sqlOutputFormat = sqlOutput.replaceAll("(?s)```sql\\s*(.*?)\\s*```", "$1").trim();
|
||||||
|
output2Prompt.put(sqlOutputFormat, prompt);
|
||||||
|
keyPipelineLog.info("OnePassSCSqlGenStrategy modelResp:\n{}", sqlOutputFormat);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user