mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-07-19 13:26:32 -04:00
for https://github.com/hwchase17/langchain/issues/1582 I simply added the `return_intermediate_steps` and changed the `output_keys` function. I added 2 simple tests, 1 for SQLDatabaseSequentialChain without the intermediate steps and 1 with Co-authored-by: brad-nemetski <115185478+brad-nemetski@users.noreply.github.com>
This commit is contained in:
@@ -117,6 +117,8 @@ class SQLDatabaseSequentialChain(Chain, BaseModel):
|
||||
This is useful in cases where the number of tables in the database is large.
|
||||
"""
|
||||
|
||||
return_intermediate_steps: bool = False
|
||||
|
||||
@classmethod
|
||||
def from_llm(
|
||||
cls,
|
||||
@@ -154,7 +156,10 @@ class SQLDatabaseSequentialChain(Chain, BaseModel):
|
||||
|
||||
:meta private:
|
||||
"""
|
||||
return [self.output_key]
|
||||
if not self.return_intermediate_steps:
|
||||
return [self.output_key]
|
||||
else:
|
||||
return [self.output_key, "intermediate_steps"]
|
||||
|
||||
def _call(self, inputs: Dict[str, str]) -> Dict[str, str]:
|
||||
_table_names = self.sql_chain.database.get_table_names()
|
||||
|
||||
Reference in New Issue
Block a user