Encounter Error (KeyError: {'format_instructions'})while using StructuredOutputParser
Labels: name: auto:bug, name: area: models

### System Info

langchain==0.0.350
python==3.9.2rc1

### Who can help?

@agola11

Sample code
```
from langchain.output_parsers import ResponseSchema, StructuredOutputParser
from langchain.prompts import PromptTemplate

response_schemas = [
    ResponseSchema(name="result", description="answer to the user's question"),
    ResponseSchema(
        name="source_documents",
        description="source used to answer the user's question",
    ),
]
output_parser = StructuredOutputParser.from_response_schemas(response_schemas)
#
format_instructions = output_parser.get_format_instructions()
#
llms = LlamaCpp(streaming=True,
            model_path=r"C:\Users\PLNAYAK\Documents\Local_LLM_Inference\zephyr-7b-alpha.Q4_K_M.gguf",
            max_tokens = 500,
            temperature=0.75,
            top_p=1,
            model_kwargs={"gpu_layers":0,"stream":True},
            verbose=True,n_threads = int(os.cpu_count()/2),
            n_ctx=4096)
#
prompt = PromptTemplate(
    template="Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.\n\n{context}\n\nQuestion: {question}\nHelpful Answer:",
    input_variables=["context","question"],
    partial_variables={"format_instructions": format_instructions},
    output_parser=output_parser
)
#
chain = prompt | llms | output_parser
chain.invoke({"question":query,"context":complete_context})
```

Error Log
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[41], [line 1](vscode-notebook-cell:?execution_count=41&line=1)
----> [1](vscode-notebook-cell:?execution_count=41&line=1) chain.invoke({"question":query,"context":complete_context})

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\runnables\base.py:1514](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1514), in RunnableSequence.invoke(self, input, config)
   [1512](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1512) try:
   [1513](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1513)     for i, step in enumerate(self.steps):
-> [1514](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1514)         input = step.invoke(
   [1515](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1515)             input,
   [1516](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1516)             # mark each step as a child run
   [1517](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1517)             patch_config(
   [1518](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1518)                 config, callbacks=run_manager.get_child(f"seq:step:{i+1}")
   [1519](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1519)             ),
   [1520](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1520)         )
   [1521](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1521) # finish the root run
   [1522](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:1522) except BaseException as e:

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\prompts\base.py:94](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:94), in BasePromptTemplate.invoke(self, input, config)
     [91](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:91) def invoke(
     [92](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:92)     self, input: Dict, config: Optional[RunnableConfig] = None
     [93](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:93) ) -> PromptValue:
---> [94](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:94)     return self._call_with_config(
     [95](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:95)         self._format_prompt_with_error_handling,
     [96](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:96)         input,
     [97](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:97)         config,
     [98](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:98)         run_type="prompt",
     [99](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:99)     )

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\runnables\base.py:886](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:886), in Runnable._call_with_config(self, func, input, config, run_type, **kwargs)
    [879](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:879) run_manager = callback_manager.on_chain_start(
    [880](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:880)     dumpd(self),
    [881](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:881)     input,
    [882](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:882)     run_type=run_type,
    [883](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:883)     name=config.get("run_name"),
    [884](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:884) )
    [885](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:885) try:
--> [886](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:886)     output = call_func_with_variable_args(
    [887](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:887)         func, input, config, run_manager, **kwargs
    [888](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:888)     )
    [889](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:889) except BaseException as e:
    [890](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/base.py:890)     run_manager.on_chain_error(e)

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\runnables\config.py:308](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/config.py:308), in call_func_with_variable_args(func, input, config, run_manager, **kwargs)
    [306](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/config.py:306) if run_manager is not None and accepts_run_manager(func):
    [307](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/config.py:307)     kwargs["run_manager"] = run_manager
--> [308](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/runnables/config.py:308) return func(input, **kwargs)

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\prompts\base.py:89](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:89), in BasePromptTemplate._format_prompt_with_error_handling(self, inner_input)
     [83](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:83) except KeyError as e:
     [84](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:84)     raise KeyError(
     [85](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:85)         f"Input to {self.__class__.__name__} is missing variable {e}. "
     [86](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:86)         f" Expected: {self.input_variables}"
     [87](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:87)         f" Received: {list(inner_input.keys())}"
     [88](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:88)     ) from e
---> [89](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/base.py:89) return self.format_prompt(**input_dict)

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\prompts\string.py:161](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/string.py:161), in StringPromptTemplate.format_prompt(self, **kwargs)
    [159](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/string.py:159) def format_prompt(self, **kwargs: Any) -> PromptValue:
    [160](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/string.py:160)     """Create Chat Messages."""
--> [161](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/string.py:161)     return StringPromptValue(text=self.format(**kwargs))

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\prompts\prompt.py:132](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:132), in PromptTemplate.format(self, **kwargs)
    [117](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:117) """Format the prompt with the inputs.
    [118](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:118) 
    [119](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:119) Args:
   (...)
    [129](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:129)         prompt.format(variable1="foo")
    [130](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:130) """
    [131](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:131) kwargs = self._merge_partial_and_user_variables(**kwargs)
--> [132](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/prompts/prompt.py:132) return DEFAULT_FORMATTER_MAPPING[self.template_format](self.template, **kwargs)

File [C:\Program](file:///C:/Program) Files\Python39\lib\string.py:161, in Formatter.format(self, format_string, *args, **kwargs)
    [160](file:///C:/Program%20Files/Python39/lib/string.py:160) def format(self, format_string, /, *args, **kwargs):
--> [161](file:///C:/Program%20Files/Python39/lib/string.py:161)     return self.vformat(format_string, args, kwargs)

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\utils\formatting.py:29](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:29), in StrictFormatter.vformat(self, format_string, args, kwargs)
     [24](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:24) if len(args) > 0:
     [25](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:25)     raise ValueError(
     [26](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:26)         "No arguments should be provided, "
     [27](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:27)         "everything should be passed as keyword arguments."
     [28](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:28)     )
---> [29](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:29) return super().vformat(format_string, args, kwargs)

File [C:\Program](file:///C:/Program) Files\Python39\lib\string.py:166, in Formatter.vformat(self, format_string, args, kwargs)
    [164](file:///C:/Program%20Files/Python39/lib/string.py:164) used_args = set()
    [165](file:///C:/Program%20Files/Python39/lib/string.py:165) result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
--> [166](file:///C:/Program%20Files/Python39/lib/string.py:166) self.check_unused_args(used_args, args, kwargs)
    [167](file:///C:/Program%20Files/Python39/lib/string.py:167) return result

File [c:\Users\PLNAYAK\Documents\Local_LLM_Inference\llms\lib\site-packages\langchain_core\utils\formatting.py:18](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:18), in StrictFormatter.check_unused_args(self, used_args, args, kwargs)
     [16](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:16) extra = set(kwargs).difference(used_args)
     [17](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:17) if extra:
---> [18](file:///C:/Users/PLNAYAK/Documents/Local_LLM_Inference/llms/lib/site-packages/langchain_core/utils/formatting.py:18)     raise KeyError(extra)

KeyError: {'format_instructions'}

### Information

- [ ] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Sample code
```
from langchain.output_parsers import ResponseSchema, StructuredOutputParser
from langchain.prompts import PromptTemplate

response_schemas = [
    ResponseSchema(name="result", description="answer to the user's question"),
    ResponseSchema(
        name="source_documents",
        description="source used to answer the user's question",
    ),
]
output_parser = StructuredOutputParser.from_response_schemas(response_schemas)
#
format_instructions = output_parser.get_format_instructions()
#
llms = LlamaCpp(streaming=True,
            model_path=r"C:\Users\PLNAYAK\Documents\Local_LLM_Inference\zephyr-7b-alpha.Q4_K_M.gguf",
            max_tokens = 500,
            temperature=0.75,
            top_p=1,
            model_kwargs={"gpu_layers":0,"stream":True},
            verbose=True,n_threads = int(os.cpu_count()/2),
            n_ctx=4096)
#
prompt = PromptTemplate(
    template="Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.\n\n{context}\n\nQuestion: {question}\nHelpful Answer:",
    input_variables=["context","question"],
    partial_variables={"format_instructions": format_instructions},
    output_parser=output_parser
)
#
chain = prompt | llms | output_parser
chain.invoke({"question":query,"context":complete_context})
```

### Expected behavior

It should return output in a structured format