Adam Cseresznye commited on
Commit ·
953ec91
1
Parent(s): db68741
Update timeouts, PDF count, synthesis template, and reload flag
Browse files- agents/acquisition_agent.py +3 -3
- agents/synthesis_agent.py +7 -4
- main.py +1 -1
agents/acquisition_agent.py
CHANGED
|
@@ -26,12 +26,12 @@ class AcquisitionAgent:
|
|
| 26 |
Notes:
|
| 27 |
- Downloads are performed in parallel (up to 10 concurrent tasks).
|
| 28 |
- Each download+extraction is wrapped in a per-PDF timeout (class attr
|
| 29 |
-
`PER_PDF_TIMEOUT`, default
|
| 30 |
- Failures are logged via `logger.warning()` and skipped. Only if *all*
|
| 31 |
PDFs fail the State will receive a critical error via `append_error()`.
|
| 32 |
"""
|
| 33 |
|
| 34 |
-
PER_PDF_TIMEOUT =
|
| 35 |
_CHUNK_SIZE = 32 * 1024
|
| 36 |
|
| 37 |
async def process(self, state: State) -> State:
|
|
@@ -53,7 +53,7 @@ class AcquisitionAgent:
|
|
| 53 |
state.append_error("No finalists available for acquisition")
|
| 54 |
return state
|
| 55 |
|
| 56 |
-
TARGET_PDF_COUNT =
|
| 57 |
acquired_pdfs = 0
|
| 58 |
final_passages = []
|
| 59 |
|
|
|
|
| 26 |
Notes:
|
| 27 |
- Downloads are performed in parallel (up to 10 concurrent tasks).
|
| 28 |
- Each download+extraction is wrapped in a per-PDF timeout (class attr
|
| 29 |
+
`PER_PDF_TIMEOUT`, default 3s).
|
| 30 |
- Failures are logged via `logger.warning()` and skipped. Only if *all*
|
| 31 |
PDFs fail the State will receive a critical error via `append_error()`.
|
| 32 |
"""
|
| 33 |
|
| 34 |
+
PER_PDF_TIMEOUT = 3.0
|
| 35 |
_CHUNK_SIZE = 32 * 1024
|
| 36 |
|
| 37 |
async def process(self, state: State) -> State:
|
|
|
|
| 53 |
state.append_error("No finalists available for acquisition")
|
| 54 |
return state
|
| 55 |
|
| 56 |
+
TARGET_PDF_COUNT = 5
|
| 57 |
acquired_pdfs = 0
|
| 58 |
final_passages = []
|
| 59 |
|
agents/synthesis_agent.py
CHANGED
|
@@ -51,6 +51,7 @@ CITATION_QA_TEMPLATE = (
|
|
| 51 |
"4. **Contextual Nuance & Contradictions**: \n"
|
| 52 |
" - If a finding contradicts general consensus, you MUST add the condition (e.g., '...in short 5-minute tasks' or '...after caffeine intake').\n"
|
| 53 |
" - **Highlight Disagreements**: If [1] says 'Positive' and [2] says 'Negative', explicitly state: 'Evidence is mixed: [1] found positive effects, whereas [2] observed no change.'\n\n"
|
|
|
|
| 54 |
"### REQUIRED OUTPUT FORMAT:\n"
|
| 55 |
"You must use standard Markdown headers (###) and bullet points.\n\n"
|
| 56 |
"### Executive Summary\n"
|
|
@@ -59,10 +60,12 @@ CITATION_QA_TEMPLATE = (
|
|
| 59 |
"* **Domain (e.g., Memory):** Synthesis of findings. Quantitative impact (e.g., 'reduced by 20%') [2].\n"
|
| 60 |
"* **Domain (e.g., Attention):** Synthesis of findings. Nuance regarding task type or population [3].\n\n"
|
| 61 |
"### Detailed Comparison (or Mechanism)\n"
|
| 62 |
-
"
|
| 63 |
-
"
|
| 64 |
-
"
|
| 65 |
-
"
|
|
|
|
|
|
|
| 66 |
"### Limitations & Quality of Evidence\n"
|
| 67 |
"Critique the quality of the data (e.g., 'Most studies were short-term', 'Small sample sizes', 'Lack of control group'). [4]\n\n"
|
| 68 |
"---------------------\n"
|
|
|
|
| 51 |
"4. **Contextual Nuance & Contradictions**: \n"
|
| 52 |
" - If a finding contradicts general consensus, you MUST add the condition (e.g., '...in short 5-minute tasks' or '...after caffeine intake').\n"
|
| 53 |
" - **Highlight Disagreements**: If [1] says 'Positive' and [2] says 'Negative', explicitly state: 'Evidence is mixed: [1] found positive effects, whereas [2] observed no change.'\n\n"
|
| 54 |
+
"5. **NO TABLES**: Do not use Markdown tables. They do not render well on mobile devices. Use structured bulleted lists instead.\n\n"
|
| 55 |
"### REQUIRED OUTPUT FORMAT:\n"
|
| 56 |
"You must use standard Markdown headers (###) and bullet points.\n\n"
|
| 57 |
"### Executive Summary\n"
|
|
|
|
| 60 |
"* **Domain (e.g., Memory):** Synthesis of findings. Quantitative impact (e.g., 'reduced by 20%') [2].\n"
|
| 61 |
"* **Domain (e.g., Attention):** Synthesis of findings. Nuance regarding task type or population [3].\n\n"
|
| 62 |
"### Detailed Comparison (or Mechanism)\n"
|
| 63 |
+
"**DO NOT USE TABLES.** Use structured bullet lists to compare specific outcomes, dosages, or protocols.\n"
|
| 64 |
+
"* **Outcome/Variable 1:**\n"
|
| 65 |
+
" * **Study [1]:** Result (e.g., 50mg dose) [1]\n"
|
| 66 |
+
" * **Study [2]:** Result (e.g., 100mg dose) [2]\n"
|
| 67 |
+
"* **Outcome/Variable 2:**\n"
|
| 68 |
+
" * **Study [1]:** Result [1]\n\n"
|
| 69 |
"### Limitations & Quality of Evidence\n"
|
| 70 |
"Critique the quality of the data (e.g., 'Most studies were short-term', 'Small sample sizes', 'Lack of control group'). [4]\n\n"
|
| 71 |
"---------------------\n"
|
main.py
CHANGED
|
@@ -132,4 +132,4 @@ ui.run_with(
|
|
| 132 |
if __name__ == "__main__":
|
| 133 |
import uvicorn
|
| 134 |
|
| 135 |
-
uvicorn.run("main:app", host="0.0.0.0", port=7860, log_level="info", reload=
|
|
|
|
| 132 |
if __name__ == "__main__":
|
| 133 |
import uvicorn
|
| 134 |
|
| 135 |
+
uvicorn.run("main:app", host="0.0.0.0", port=7860, log_level="info", reload=False)
|