Zapier Toolkit and Function Agents not compatible
Labels: name: auto:bug

### System Info

Langchain version: v0.0.225
Python Version: 3.10
Deployed and running on AWS Lambda deployed with x86_64 architecture.

### Who can help?

@jacoblee93 

### Information

- [x] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [X] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction


def callChatModel(input, token):

    print('Executing with input:', input)

    llm = ChatOpenAI(model="gpt-3.5-turbo-0613",
                     temperature=0)`

    history = DynamoDBChatMessageHistory(table_name="MemoryPy",
                                         session_id=token)
    memory = ConversationBufferWindowMemory(
        k=20, memory_key='chat_history', chat_memory=history, input_key="input", return_messages=True)

    zapier = ZapierNLAWrapper(zapier_nla_oauth_access_token=token)
    zapier_toolkit = ZapierToolkit.from_zapier_nla_wrapper(zapier)

    tools = load_tools(["serpapi"], llm=llm) + zapier_toolkit.tools

    print(tools)

    agent = initialize_agent(
        tools, llm,
        agent=AgentType.OPENAI_FUNCTIONS,
        memory=memory,
        verbose=True,
        handle_parsing_errors=True,
    )
    resp = agent.run(input=input)
    return resp



Input to the chat model is
`Executing with input: Look up a basic fact about the sun, no more than one sentence. Send this fact to <email>@gmail.com `

Execution logs from CloudWatch:

```
[1m> Entering new  chain...[0m

[ERROR] InvalidRequestError: 'Gmail: Send Email' does not match '^[a-zA-Z0-9_-]{1,64}<!--EndFragment-->
</body>
</html> - 'functions.1.name'Traceback (most recent call last):  File "/var/task/handler.py", line 152, in handle_chat    chatResp = callChatModel(message, token)  File "/var/task/handler.py", line 92, in callChatModel    resp = agent.run(input=input)  File "/var/task/langchain/chains/base.py", line 320, in run    return self(kwargs, callbacks=callbacks, tags=tags, metadata=metadata)[  File "/var/task/langchain/chains/base.py", line 181, in __call__    raise e  File "/var/task/langchain/chains/base.py", line 175, in __call__    self._call(inputs, run_manager=run_manager)  File "/var/task/langchain/agents/agent.py", line 987, in _call    next_step_output = self._take_next_step(  File "/var/task/langchain/agents/agent.py", line 792, in _take_next_step    output = self.agent.plan(  File "/var/task/langchain/agents/openai_functions_agent/base.py", line 210, in plan    predicted_message = self.llm.predict_messages(  File "/var/task/langchain/chat_models/base.py", line 398, in predict_messages    return self(messages, stop=_stop, **kwargs)  File "/var/task/langchain/chat_models/base.py", line 348, in __call__    generation = self.generate(  File "/var/task/langchain/chat_models/base.py", line 124, in generate    raise e  File "/var/task/langchain/chat_models/base.py", line 114, in generate    self._generate_with_cache(  File "/var/task/langchain/chat_models/base.py", line 261, in _generate_with_cache    return self._generate(  File "/var/task/langchain/chat_models/openai.py", line 371, in _generate    response = self.completion_with_retry(messages=message_dicts, **params)  File "/var/task/langchain/chat_models/openai.py", line 319, in completion_with_retry    return _completion_with_retry(**kwargs)  File "/var/task/tenacity/__init__.py", line 289, in wrapped_f    return self(f, *args, **kw)  File "/var/task/tenacity/__init__.py", line 379, in __call__    do = self.iter(retry_state=retry_state)  File "/var/task/tenacity/__init__.py", line 314, in iter    return fut.result()  File "/var/lang/lib/python3.10/concurrent/futures/_base.py", line 451, in result    return self.__get_result()  File "/var/lang/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result    raise self._exception  File "/var/task/tenacity/__init__.py", line 382, in __call__    result = fn(*args, **kwargs)  File "/var/task/langchain/chat_models/openai.py", line 317, in _completion_with_retry    return self.client.create(**kwargs)  File "/var/task/openai/api_resources/chat_completion.py", line 25, in create    return super().create(*args, **kwargs)  File "/var/task/openai/api_resources/abstract/engine_api_resource.py", line 153, in create    response, _, api_key = requestor.request(  File "/var/task/openai/api_requestor.py", line 298, in request    resp, got_stream = self._interpret_response(result, stream)  File "/var/task/openai/api_requestor.py", line 700, in _interpret_response    self._interpret_response_line(  File "/var/task/openai/api_requestor.py", line 763, in _interpret_response_line    raise self.handle_error_response( | [ERROR] InvalidRequestError: 'Gmail: Send Email' does not match '^[a-zA-Z0-9_-]{1,64}<!--EndFragment-->
</body>
</html> - 'functions.1.name' Traceback (most recent call last):   File "/var/task/handler.py", line 152, in handle_chat     chatResp = callChatModel(message, token)   File "/var/task/handler.py", line 92, in callChatModel     resp = agent.run(input=input)   File "/var/task/langchain/chains/base.py", line 320, in run     return self(kwargs, callbacks=callbacks, tags=tags, metadata=metadata)[   File "/var/task/langchain/chains/base.py", line 181, in __call__     raise e   File "/var/task/langchain/chains/base.py", line 175, in __call__     self._call(inputs, run_manager=run_manager)   File "/var/task/langchain/agents/agent.py", line 987, in _call     next_step_output = self._take_next_step(   File "/var/task/langchain/agents/agent.py", line 792, in _take_next_step     output = self.agent.plan(   File "/var/task/langchain/agents/openai_functions_agent/base.py", line 210, in plan     predicted_message = self.llm.predict_messages(   File "/var/task/langchain/chat_models/base.py", line 398, in predict_messages     return self(messages, stop=_stop, **kwargs)   File "/var/task/langchain/chat_models/base.py", line 348, in __call__     generation = self.generate(   File "/var/task/langchain/chat_models/base.py", line 124, in generate     raise e   File "/var/task/langchain/chat_models/base.py", line 114, in generate     self._generate_with_cache(   File "/var/task/langchain/chat_models/base.py", line 261, in _generate_with_cache     return self._generate(   File "/var/task/langchain/chat_models/openai.py", line 371, in _generate     response = self.completion_with_retry(messages=message_dicts, **params)   File "/var/task/langchain/chat_models/openai.py", line 319, in completion_with_retry     return _completion_with_retry(**kwargs)   File "/var/task/tenacity/__init__.py", line 289, in wrapped_f     return self(f, *args, **kw)   File "/var/task/tenacity/__init__.py", line 379, in __call__     do = self.iter(retry_state=retry_state)   File "/var/task/tenacity/__init__.py", line 314, in iter     return fut.result()   File "/var/lang/lib/python3.10/concurrent/futures/_base.py", line 451, in result     return self.__get_result()   File "/var/lang/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result     raise self._exception   File "/var/task/tenacity/__init__.py", line 382, in __call__     result = fn(*args, **kwargs)   File "/var/task/langchain/chat_models/openai.py", line 317, in _completion_with_retry     return self.client.create(**kwargs)   File "/var/task/openai/api_resources/chat_completion.py", line 25, in create     return super().create(*args, **kwargs)   File "/var/task/openai/api_resources/abstract/engine_api_resource.py", line 153, in create     response, _, api_key = requestor.request(   File "/var/task/openai/api_requestor.py", line 298, in request     resp, got_stream = self._interpret_response(result, stream)   File "/var/task/openai/api_requestor.py", line 700, in _interpret_response     self._interpret_response_line(   File "/var/task/openai/api_requestor.py", line 763, in _interpret_response_line     raise self.handle_error_response(
-- | --
```




### Expected behavior

I'd expect the agent chain to just execute