diff --git a/libs/community/langchain_community/chains/graph_qa/cypher.py b/libs/community/langchain_community/chains/graph_qa/cypher.py index e4168cccef972..2d6263cf8b058 100644 --- a/libs/community/langchain_community/chains/graph_qa/cypher.py +++ b/libs/community/langchain_community/chains/graph_qa/cypher.py @@ -311,12 +311,15 @@ def _call( _run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager() callbacks = _run_manager.get_child() question = inputs[self.input_key] + args = { + "question": question, + "schema": self.graph_schema, + } + args.update(inputs) intermediate_steps: List = [] - generated_cypher = self.cypher_generation_chain.run( - {"question": question, "schema": self.graph_schema}, callbacks=callbacks - ) + generated_cypher = self.cypher_generation_chain.run(args, callbacks=callbacks) # Extract Cypher code if it is wrapped in backticks generated_cypher = extract_cypher(generated_cypher)