Skip to content

Commit 47d5dc0

Browse files
committed
NO HALLUCINATING
1 parent cceff88 commit 47d5dc0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_paperqa.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@ def test_bad_context():
117117
# get wiki page about politician
118118
r = requests.get("https://en.wikipedia.org/wiki/Frederick_Bates_(politician)")
119119
f.write(r.text)
120-
docs = paperqa.Docs(llm=OpenAI(temperature=0.1, model_name="text-davinci-003"))
120+
docs = paperqa.Docs(
121+
llm=OpenAI(temperature=0.1, model_name="text-davinci-003", max_tokens=100)
122+
)
121123
docs.add(doc_path, "WikiMedia Foundation, 2023, Accessed now")
122-
answer = docs.query("What year was Barack Obama born greatest accomplishment?")
124+
answer = docs.query(
125+
"What year was Barack Obama born greatest accomplishment?",
126+
length_prompt="about 20 words",
127+
)
123128
assert "cannot answer" in answer.answer
124129
os.remove(doc_path)
125130

0 commit comments

Comments
 (0)