Harrison/update docstore (#47)

change docstore interface
This commit is contained in:
Harrison Chase
2022-10-31 21:18:52 -07:00
committed by GitHub
parent b45b126d9b
commit e982cf4b2e
6 changed files with 34 additions and 30 deletions

View File

@@ -1,13 +1,18 @@
"""Integration test for self ask with search."""
from langchain.chains.react.base import ReActChain
from langchain.docstore.wikipedia import Wikipedia
from langchain.llms.openai import OpenAI
def test_react() -> None:
"""Test functionality on a prompt."""
llm = OpenAI(temperature=0)
react = ReActChain(llm=llm)
question = "Were Scott Derrickson and Ed Wood of the same nationality?"
react = ReActChain(llm=llm, docstore=Wikipedia())
question = (
"Author David Chanoff has collaborated with a U.S. Navy admiral "
"who served as the ambassador to the United Kingdom under "
"which President?"
)
output = react.run(question)
assert output == "yes"
assert output == "Bill Clinton"