SPB Git

spb/wp30_uqo

Public
2.8 KB · 35 lines latex
1% auto-generated from src/wp30/prompts.py2\begin{footnotesize}\begin{verbatim}3"""Prompt templates (frozen at Phase 7). Receiver prompts are identical across methods except for the message slot."""4SYSTEM_RECEIVER = ("You are a careful assistant. Answer the question using ONLY the provided material. "5                   "If the material does not contain the answer, reply exactly: unknown.")6SYSTEM_RECEIVER_NOMSG = ("You are a careful assistant. Answer the question. If you do not know, reply exactly: unknown.")78def receiver_user_text(material_label: str, material: str, question: str, family: str) -> str:9    if family == "exec":10        return f"{material_label}:\\n{material}\\n\\nTask: {question}"11    fmt = "Give a short answer (a few words or a number), with no explanation."12    return f"{material_label}:\\n{material}\\n\\nQuestion: {question}\\n{fmt}"1314def receiver_question_only(question: str, family: str) -> str:15    if family == "exec":16        return f"Task: {question}"17    return f"Question: {question}\\nGive a short answer (a few words or a number), with no explanation."1819# Sender prompts (question-blind: no question shown; question-aware: question appended)20SUMMARY_SYSTEM = "You are a precise note-taker. You write faithful summaries that preserve exact names, identifiers, numbers, units, dates, statuses and negations."21def summary_user(doc: str, budget_tokens: int, question: str | None) -> str:22    q = f"\\nThe reader will need to answer this question: {question}\\n" if question else "\\nThe reader's future questions are unknown; preserve every concrete fact (who, what, where, when, how much, status).\\n"23    return (f"Summarize the following document in at most {budget_tokens} tokens (about {int(budget_tokens*0.75)} words). Copy identifiers, "24            f"numbers, dates and names exactly as written. Mark explicitly what is NOT stated if relevant.{q}\\nDocument:\\n{doc}\\n\\nSummary:")2526EVIDENCE_SYSTEM = ("You extract structured evidence. Output ONLY a JSON object with a key \\"facts\\": a list of objects "27                   "{\\"entity\\": str, \\"attribute\\": str, \\"value\\": str, \\"quote\\": str} where quote is a short EXACT substring of the document "28                   "supporting the fact, and optionally a key \\"notes\\": a short string for anything important that does not fit the schema, "29                   "and a key \\"unknowns\\": list of things the document explicitly leaves unstated. Copy values verbatim.")30def evidence_user(doc: str, budget_tokens: int, question: str | None) -> str:31    q = f"\\nThe reader will need to answer this question: {question}\\n" if question else "\\nThe reader's future questions are unknown; capture every concrete fact.\\n"32    return f"Extract structured evidence from the document. Keep the JSON under {budget_tokens} tokens.{q}\\nDocument:\\n{doc}\\n\\nJSON:"3334\end{verbatim}\end{footnotesize}35
Files · e6d9a3b2e6aad04d133df41f962eaa0b3171272e
Menu

Theme