Please answer the following question based on the given documents.Think step by step.Provide your final answer in the format \boxed{YOUR_ANSWER}.Documents:{{documents}}Question: {{question}}
@app.prompt(output="q_ls,ret_psg,template->prompt_ls")def qa_rag_boxed( q_ls: List[str], ret_psg: List[str | Any], template: str | Path) -> list[PromptMessage]: template: Template = load_prompt_template(template) ret = [] for q, psg in zip(q_ls, ret_psg): passage_text = "\n".join(psg) p = template.render(question=q, documents=passage_text) ret.append(p) return ret@app.prompt(output="q_ls,ret_psg,gen_subq_template->prompt_ls")def gen_subq( q_ls: List[str], ret_psg: List[str | Any], template: str | Path,) -> List[PromptMessage]: template: Template = load_prompt_template(template) all_prompts = [] for q, psg in zip(q_ls, ret_psg): passage_text = "\n".join(psg) p = template.render(question=q, documents=passage_text) all_prompts.append(p) return all_prompts
随后,在 servers/prompt/parameter.yaml 中添加对应模板字段:
请确保在执行 build 命令前完成此修改。
servers/prompt/parameter.yaml
# servers/prompt/parameter.yaml# QAtemplate: prompt/qa_boxed.jinja# RankCoTkr_template: prompt/RankCoT_knowledge_refinement.jinjaqa_template: prompt/RankCoT_question_answering.jinja# Search-R1search_r1_gen_template: prompt/search_r1_append.jinja# R1-Searcherr1_searcher_gen_template: prompt/r1_searcher_append.jinja# For other prompts, please add parameters here as needed# Take webnote as an example:webnote_gen_plan_template: prompt/webnote_gen_plan.jinjawebnote_init_page_template: prompt/webnote_init_page.jinjawebnote_gen_subq_template: prompt/webnote_gen_subq.jinjawebnote_fill_page_template: prompt/webnote_fill_page.jinjawebnote_gen_answer_template: prompt/webnote_gen_answer.jinjagen_subq_template: prompt/gen_subq.jinja