#9Assemble the Critic's audit inputEasy

Assemble the Critic's audit input

Background

To review an answer, the Critic needs three things in one user message: the original question, the findings that were actually retrieved, and the synthesised answer to audit. The findings are formatted one block per sub-question.

Problem statement

Implement build_critic_message(query, findings, answer) returning the audit user message.

Input

  • query — the original research question.
  • findings — dict {sub_question: finding}.
  • answer — the synthesised answer to review.

Output

Returns a string:

Original question: <query>

Findings:
Sub-question: <sq1>
Finding: <f1>

Sub-question: <sq2>
Finding: <f2>

Synthesised answer:
<answer>

(Findings blocks are joined by a blank line.)

Examples

Input:  query="Q", findings={"q1": "f1"}, answer="ANS"
Output: "Original question: Q\n\nFindings:\nSub-question: q1\nFinding: f1\n\nSynthesised answer:\nANS"

Constraints

  • Each findings block is f"Sub-question: {sq}\nFinding: {finding}".
  • Blocks joined by "\n\n".
  • Include the Original question:, Findings:, and Synthesised answer: sections in order.

Notes

  • Giving the Critic the findings and the answer is what lets it check each claim against real evidence.
Python
Loading...

▶ Run executes the 3 visible sample tests below in your browser. Submit runs the full suite — including hidden tests — on the server for an official verdict.

  • Reference example: single finding
  • Sample: two findings joined by a blank line
  • Reference: answer appears under its label