微调意图改写接口

This commit is contained in:
2025-07-22 11:35:05 +08:00
parent 75c7c19f53
commit 0a2d6c2020
2 changed files with 16 additions and 18 deletions
@@ -492,19 +492,23 @@ class AsyncIntentRecognizer:
wiki_result = query_expand_results[2] if query_expand_results[2] else []
multi_questions_result = query_expand_results[3] if query_expand_results[3] else MultiQuestions(original_query=query, sub_questions=[query])
all_questions = multi_questions_result.sub_questions
all_questions=[]
all_questions.append(query)
all_questions.append(rewrite.rewrite)
all_questions.extend(wiki_result)
all_questions.extend(step_back_result.step_back_query)
all_questions.append(follow_up_result.follow_up_query)
all_questions.extend(wiki_result)
all_questions.extend(multi_questions_result.sub_questions)
all_questions = list(set(all_questions))
query_expand = {
"all": all_questions,
"step_back": step_back_result.model_dump(),
"follow_up": follow_up_result.model_dump(),
"multi_questions": multi_questions_result.model_dump(),
"step_back": step_back_result.step_back_query,
"follow_up": [follow_up_result.follow_up_query],
"multi_questions": multi_questions_result.sub_questions,
"wiki_title": wiki_result,
"original_query":query,
"rewrite_query":rewrite.rewrite
}
# 返回所有结果