<code id='CFFE9F290D'></code><style id='CFFE9F290D'></style>
    • <acronym id='CFFE9F290D'></acronym>
      <center id='CFFE9F290D'><center id='CFFE9F290D'><tfoot id='CFFE9F290D'></tfoot></center><abbr id='CFFE9F290D'><dir id='CFFE9F290D'><tfoot id='CFFE9F290D'></tfoot><noframes id='CFFE9F290D'>

    • <optgroup id='CFFE9F290D'><strike id='CFFE9F290D'><sup id='CFFE9F290D'></sup></strike><code id='CFFE9F290D'></code></optgroup>
        1. <b id='CFFE9F290D'><label id='CFFE9F290D'><select id='CFFE9F290D'><dt id='CFFE9F290D'><span id='CFFE9F290D'></span></dt></select></label></b><u id='CFFE9F290D'></u>
          <i id='CFFE9F290D'><strike id='CFFE9F290D'><tt id='CFFE9F290D'><pre id='CFFE9F290D'></pre></tt></strike></i>

          數字不算特別亮眼,

          一 、, sources: [], retrieved_docs: [] } # 2. 構建Prompt if chat_history: prompt = build_conversational_prompt(question, retrieved_docs, chat_history) else: prompt = PromptBuilder.build(question, retrieved_docs, question_type=auto) # 3. 調用LLM生成回答 response = self.llm_client.chat.completions.create( model=self.llm_model, messages=[{ role: user, content: prompt}], temperature=0.3, # 知識庫問答用較低的temperature max_tokens=2000 ) answer = response.choices[0].message.content # 4. 提取引用的來源 sources = list(set([doc.get('context_path', '未知來源') for doc in retrieved_docs])) return { answer: answer, sources: sources, retrieved_docs: retrieved_docs } def evaluate_response(self, question: str, answer: str, ground_truth: str = None) -> Dict: 回答質量評估(可選) 用LLM評估回答的質量,要求標注來源 # 格式化上下文  ,