mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 13:07:32 +00:00
This commit is contained in:
@@ -62,8 +62,10 @@ public class OnePassSCSqlGenStrategy extends SqlGenStrategy {
|
||||
ChatLanguageModel chatLanguageModel = getChatLanguageModel(llmReq.getModelConfig());
|
||||
Response<AiMessage> response = chatLanguageModel.generate(prompt.toUserMessage());
|
||||
String sqlOutput = StringUtils.normalizeSpace(response.content().text());
|
||||
output2Prompt.put(sqlOutput, prompt);
|
||||
keyPipelineLog.info("OnePassSCSqlGenStrategy modelResp:\n{}", sqlOutput);
|
||||
// replace ```
|
||||
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