Skip to content

Commit f3a7ada

Browse files
committed
Having best evidence include the question, to make it clear
1 parent a7a0fae commit f3a7ada

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/paperqa/agents/tools.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,12 @@ async def gather_evidence(self, question: str, state: EnvironmentState) -> str:
269269
for sc in sorted_relevant_contexts[: self.settings.agent.agent_evidence_n]
270270
)
271271

272-
best_evidence = f" Best evidence(s):\n\n{top_contexts}" if top_contexts else ""
272+
# Include question because different questions will lead to different top contexts
273+
best_evidence = (
274+
f" Best evidence(s) for question {question!r}:\n\n{top_contexts}"
275+
if top_contexts
276+
else ""
277+
)
273278

274279
if f"{self.TOOL_FN_NAME}_completed" in self.settings.agent.callbacks:
275280
await asyncio.gather(

0 commit comments

Comments
 (0)