mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 22:42:05 +00:00
consolidate run functions (#126)
consolidating logic for when a chain is able to run with single input text, single output text open to feedback on naming, logic, usefulness
This commit is contained in:
@@ -5,5 +5,5 @@ from langchain.chains.serpapi import SerpAPIChain
|
||||
def test_call() -> None:
|
||||
"""Test that call gives the correct answer."""
|
||||
chain = SerpAPIChain()
|
||||
output = chain.search("What was Obama's first name?")
|
||||
output = chain.run("What was Obama's first name?")
|
||||
assert output == "Barack Hussein Obama II"
|
||||
|
@@ -25,6 +25,6 @@ def test_sql_database_run() -> None:
|
||||
conn.execute(stmt)
|
||||
db = SQLDatabase(engine)
|
||||
db_chain = SQLDatabaseChain(llm=OpenAI(temperature=0), database=db)
|
||||
output = db_chain.query("What company does Harrison work at?")
|
||||
output = db_chain.run("What company does Harrison work at?")
|
||||
expected_output = " Harrison works at Foo."
|
||||
assert output == expected_output
|
||||
|
Reference in New Issue
Block a user