Skip to content

Commit 6a51327

Browse files
authored
Improved Agent Speed/Prompts (#118)
1 parent a0f39f7 commit 6a51327

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

paperqa/agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class AnswerTool(BaseTool):
8282
description = "Ask a researcher to propose an answer using evidence from papers. The input is the question to be answered."
8383
docs: Docs = None
8484
answer: Answer = None
85+
return_direct = True
8586

8687
def __init__(self, docs, answer):
8788
# call the parent class constructor
@@ -129,7 +130,7 @@ def _run(self, query: str) -> str:
129130
)
130131

131132
papers = paperscraper.search_papers(
132-
query, limit=20, verbose=False, pdir=self.docs.index_path
133+
query, limit=5, _limit=20, verbose=False, pdir=self.docs.index_path
133134
)
134135
for path, data in papers.items():
135136
try:

paperqa/qaprompts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
template="We want to answer the following question: {question} \n"
4949
"Provide three keyword searches (one search per line) "
5050
"that will find papers to help answer the question. Do not use boolean operators. "
51+
"Provide some broad and some specific searches. "
5152
"Recent years are 2021, 2022, 2023.\n\n"
5253
"1.",
5354
)

paperqa/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.6.3"
1+
__version__ = "1.8.0"

tests/test_paperqa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async def test_token_count(self):
7272
get_callbacks=lambda x: [TestHandler()],
7373
)
7474
assert answer.tokens > 100
75-
assert answer.cost > 0.01
75+
assert answer.cost > 0.001
7676

7777

7878
def test_evidence():

0 commit comments

Comments
 (0)