Issues: OpenAI functions Agent official example Error 
Labels: name: area: agent, name: auto:bug

### System Info

- LangChain - 0.0.344
- python version - 3.11.6
- platform - windows11

### Who can help?

https://python.langchain.com/docs/modules/agents/agent_types/openai_functions_agent 

When running the above example, the following error occurs.

-----------------------------------------------------------------
```shell
> Entering new AgentExecutor chain...
Invoking: `Search` with `Leo DiCaprio girlfriend`


Vittoria Ceretti
Invoking: `Calculator` with `age ^ 0.43`

> Entering new LLMMathChain chain...
age ^ 0.43```text
Traceback (most recent call last):
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\numexpr\necompiler.py", line 760, in getArguments
    a = local_dict[name]
        ~~~~~~~~~~^^^^^^
KeyError: 'age'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\llm_math\base.py", line 89, in _evaluate_expression
    numexpr.evaluate(
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\numexpr\necompiler.py", line 975, in evaluate
    raise e
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\numexpr\necompiler.py", line 874, in validate
    arguments = getArguments(names, local_dict, global_dict, _frame_depth=_frame_depth)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\numexpr\necompiler.py", line 762, in getArguments
    a = global_dict[name]
        ~~~~~~~~~~~^^^^^^
KeyError: 'age'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hyung\GitHubProjects\LangChainStudy\agent\openai_functions.py", line 76, in <module>
    agent_executor.invoke(
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\base.py", line 89, in invoke
    return self(
           ^^^^^
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\base.py", line 312, in __call__
    raise e
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\base.py", line 306, in __call__
    self._call(inputs, run_manager=run_manager)
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\agents\agent.py", line 1312, in _call
    next_step_output = self._take_next_step(
                       ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\agents\agent.py", line 1038, in _take_next_step
    [
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\agents\agent.py", line 1038, in <listcomp>
    [
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\agents\agent.py", line 1134, in _iter_next_step
    observation = tool.run(
                  ^^^^^^^^^
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain_core\tools.py", line 365, in run
    raise e
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain_core\tools.py", line 337, in run
    self._run(*tool_args, run_manager=run_manager, **tool_kwargs)
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain_core\tools.py", line 510, in _run
    self.func(
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\base.py", line 507, in run
age ** 0.43
'''
...numexpr.evaluate("age ** 0.43")...
    return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\base.py", line 312, in __call__
    raise e
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\base.py", line 306, in __call__
    self._call(inputs, run_manager=run_manager)
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\llm_math\base.py", line 158, in _call
    return self._process_llm_result(llm_output, _run_manager)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\llm_math\base.py", line 112, in _process_llm_result
    output = self._evaluate_expression(expression)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hyung\AppData\Local\pypoetry\Cache\virtualenvs\langchainstudy-esJm8fcP-py3.11\Lib\site-packages\langchain\chains\llm_math\base.py", line 96, in _evaluate_expression
    raise ValueError(
ValueError: LLMMathChain._evaluate("
age ** 0.43
") raised error: 'age'. Please try again with a valid numerical expression

Process finished with exit code 1
'''
```

### Information

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

### Related Components

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

### Reproduction

https://python.langchain.com/docs/modules/agents/agent_types/openai_functions_agent 

Run the example 

### Expected behavior


```shell
> Entering new AgentExecutor chain...

Invoking: `Search` with `Leo DiCaprio girlfriend`

Vittoria Ceretti
Invoking: `Calculator` with `25 ^ 0.43`

> Entering new LLMMathChain chain...
25 ^ 0.43'''text
/25 ** 0.43
'''
...numexpr.evaluate("25 ** 0.43")...

Answer: 3.991298452658078
> Finished chain.
Answer: 3.991298452658078Leo DiCaprio's girlfriend is Vittoria Ceretti. Her current age raised to the power of 0.43 is approximately 3.99.

> Finished chain.

```