mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 03:59:42 +00:00
move search to not be a chain (#226)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Integration test for self ask with search."""
|
||||
from langchain.agents.self_ask_with_search.base import SelfAskWithSearchChain
|
||||
from langchain.chains.serpapi import SerpAPIChain
|
||||
from langchain.llms.openai import OpenAI
|
||||
from langchain.serpapi import SerpAPIWrapper
|
||||
|
||||
|
||||
def test_self_ask_with_search() -> None:
|
||||
@@ -9,7 +9,7 @@ def test_self_ask_with_search() -> None:
|
||||
question = "What is the hometown of the reigning men's U.S. Open champion?"
|
||||
chain = SelfAskWithSearchChain(
|
||||
llm=OpenAI(temperature=0),
|
||||
search_chain=SerpAPIChain(),
|
||||
search_chain=SerpAPIWrapper(),
|
||||
input_key="q",
|
||||
output_key="a",
|
||||
)
|
||||
|
@@ -1,9 +1,9 @@
|
||||
"""Integration test for SerpAPI."""
|
||||
from langchain.chains.serpapi import SerpAPIChain
|
||||
from langchain.serpapi import SerpAPIWrapper
|
||||
|
||||
|
||||
def test_call() -> None:
|
||||
"""Test that call gives the correct answer."""
|
||||
chain = SerpAPIChain()
|
||||
chain = SerpAPIWrapper()
|
||||
output = chain.run("What was Obama's first name?")
|
||||
assert output == "Barack Hussein Obama II"
|
Reference in New Issue
Block a user