Merge branch 'tencentmusic:master' into master_fixdatasetchoose

This commit is contained in:
QJ_wonder
2025-05-27 10:10:44 +08:00
committed by GitHub
14 changed files with 60 additions and 24 deletions

View File

@@ -179,13 +179,15 @@ public class NatureHelper {
}
public static Long parseIdFromNature(String nature, int index) {
try {
String[] split = nature.split(DictWordType.NATURE_SPILT);
if (split.length > index) {
return Long.valueOf(split[index]);
if(nature.startsWith("_")){ // 框架的字典都是以_开头的
try {
String[] split = nature.split(DictWordType.NATURE_SPILT);
if (split.length > index) {
return Long.valueOf(split[index]);
}
} catch (NumberFormatException e) {
log.error("Error parsing long from nature: {}", nature, e);
}
} catch (NumberFormatException e) {
log.error("Error parsing long from nature: {}", nature, e);
}
return null;
}

View File

@@ -167,7 +167,9 @@ public class EmbeddingMatchStrategy extends BatchMatchStrategy<EmbeddingResult>
variable.put("retrievedInfo", JSONObject.toJSONString(results));
Prompt prompt = PromptTemplate.from(LLM_FILTER_PROMPT).apply(variable);
ChatLanguageModel chatLanguageModel = ModelProvider.getChatModel(chatQueryContext.getRequest().getChatAppConfig().get("REWRITE_MULTI_TURN").getChatModelConfig());
ChatLanguageModel chatLanguageModel =
ModelProvider.getChatModel(chatQueryContext.getRequest().getChatAppConfig()
.get("REWRITE_MULTI_TURN").getChatModelConfig());
String response = chatLanguageModel.generate(prompt.toUserMessage().singleText());
if (StringUtils.isBlank(response)) {