ValueError: Missing some input keys: {'chat_history'} when adding memory to GraphCypherQAChain
Labels: name: area: memory, name: auto:bug, name: area: models

### System Info

Langchain version: v0.0.316

I am following the langchain documentation to add memory to the chat with LLMChain: https://python.langchain.com/docs/modules/memory/adding_memory

```py
memory = ConversationBufferMemory(memory_key="chat_history",  return_messages=True)


CYPHER_GENERATION_TEMPLATE = """Task: Generate Cypher statement to query a graph database.
Instructions: ...
Schema:
{schema}

The question is:
{question}

Chat History:
{chat_history}
"""

CYPHER_GENERATION_PROMPT = PromptTemplate(
    input_variables=["schema", "question", "chat_history"],
    template=CYPHER_GENERATION_TEMPLATE,
)



  chain = GraphCypherQAChain.from_llm(
      AzureChatOpenAI(
          deployment_name=OPENAI_DEPLOYMENT_NAME,
          model_name=OPENAI_MODEL_NAME,
          openai_api_base=OPENAI_API_BASE,
          openai_api_version=OPENAI_API_VERSION,
          openai_api_key=OPENAI_API_KEY,
          openai_api_type=OPENAI_API_TYPE,
          temperature=0
      ),
      graph=graph, verbose=True,
      return_intermediate_steps=False,
      cypher_prompt=CYPHER_GENERATION_PROMPT,
      include_types=property_include_list,
      memory=memory,
  )

  return chain.run(question)

```
So, when I call the `chain.run()` I get the error:

```bash
> Entering new GraphCypherQAChain chain...
Traceback (most recent call last):
  File "/home/sudobhat/workspaces/llm/openai-chatgpt-sample-code/neo4j-use-case/neo4j_query_filtered_schema.py", line 171, in <module>
    answer = get_openai_answer(question)
  File "/home/sudobhat/workspaces/llm/openai-chatgpt-sample-code/neo4j-use-case/neo4j_query_filtered_schema.py", line 162, in get_openai_answer
    return chain.run(question)
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 501, in run
    return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 306, in __call__
    raise e
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 300, in __call__
    self._call(inputs, run_manager=run_manager)
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/graph_qa/cypher.py", line 185, in _call
    generated_cypher = self.cypher_generation_chain.run(
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 501, in run
    return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 282, in __call__
    inputs = self.prep_inputs(inputs)
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 439, in prep_inputs
    self._validate_inputs(inputs)
  File "/home/sudobhat/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 191, in _validate_inputs
    raise ValueError(f"Missing some input keys: {missing_keys}")
ValueError: Missing some input keys: {'chat_history'}
```
This is being done almost exactly as in the documentation. Is this a bug or am I missing something?

I also tried an approach with partial variables like this, by looking at the answer in this issue https://github.com/langchain-ai/langchain/issues/8746:
```
CYPHER_GENERATION_PROMPT = PromptTemplate(
    input_variables=["schema", "question"],
    template=CYPHER_GENERATION_TEMPLATE,
    partial_variables={"chat_history": chat_history}
)
```
this does not throw any error, but when I print the final prompt, there is nothing in the chat history.

Also, it seems to work for normal LLmChain, but not GraphCypherQAChain

### Who can help?

_No response_

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [X] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [X] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Steps to reproduce:

1. Run the code provided in the documentation: https://python.langchain.com/docs/modules/memory/adding_memory, but for GraphCypherQAChain

### Expected behavior

The expected behavior is no error thrown like: ValueError: Missing some input keys: {'chat_history'} when chat_history is passed in the prompt template.