error when using an asynchronous await with ChatGPT 
I tried the code from the documentation here on a Jupyter notebook from VScode : https://langchain.readthedocs.io/en/latest/modules/llms/async_llm.html?highlight=agenerate#async-api-for-llm


It worked but when I replaced:

`from langchain.llms import OpenAI`

with 
`
from langchain.chat_models import ChatOpenAI`

and 
`
OpenAI(temperature=0.9)`

with 
`
ChatOpenAI(temperature=0.9)`

I received an error "Got unknown type H" shown in the first error message below.  The H is the first letter of the prompt and it changes when the prompt changes so I suppose somewhere the string is split. 


I then tried to run it as a script changing the await outside of a function to asyncio.run( but I got the second error below.


--------------

# Error with a Jupyter VScode  notebook using `await`

## Code used

```
import time
import asyncio

def generate_serially():
    llm = ChatOpenAI(temperature=0)
    for _ in range(10):
        resp = llm.generate(["Hello, how are you?"])
        print(resp.generations[0][0].text)


async def async_generate(llm):
    resp = await llm.agenerate(["Hello, how are you?"])
    print(resp.generations[0][0].text)


async def generate_concurrently():
    llm = ChatOpenAI(temperature=0)
    tasks = [async_generate(llm) for _ in range(10)]
    await asyncio.gather(*tasks)


s = time.perf_counter()
# # If running this outside of Jupyter, use asyncio.run(generate_concurrently())
await generate_concurrently()
elapsed = time.perf_counter() - s
print("\n", f"Concurrent executed in {elapsed:0.2f} seconds.")

s = time.perf_counter()
generate_serially()
elapsed = time.perf_counter() - s
print("\n",f"Serial executed in {elapsed:0.2f} seconds.")
```

## Error obtained

```
ValueError                                Traceback (most recent call last)
/home/username/projects/Latex_Doc_Search.ipynb Cell 35 in ()
----> 1 await generate_concurrently()

/home/username/projects/Latex_Doc_Search.ipynb Cell 35 in generate_concurrently()
     17 llm = ChatOpenAI(temperature=0)
     18 tasks = [async_generate(llm) for _ in range(10)]
---> 19 await asyncio.gather(*tasks)

/home/username/projects/Latex_Doc_Search.ipynb Cell 35 in async_generate(llm)
     11 async def async_generate(llm):
---> 12     resp = await llm.agenerate(["Hello, how are you?"])
     13     print(resp.generations[0][0].text)

File ~/anaconda3/lib/python3.9/site-packages/langchain/chat_models/base.py:57, in BaseChatModel.agenerate(self, messages, stop)
     53 async def agenerate(
     54     self, messages: List[List[BaseMessage]], stop: Optional[List[str]] = None
     55 ) -> LLMResult:
     56     """Top Level call"""
---> 57     results = [await self._agenerate(m, stop=stop) for m in messages]
     58     return LLMResult(generations=[res.generations for res in results])

File ~/anaconda3/lib/python3.9/site-packages/langchain/chat_models/base.py:57, in (.0)
     53 async def agenerate(
...
---> 88     raise ValueError(f"Got unknown type {message}")
     89 if "name" in message.additional_kwargs:
     90     message_dict["name"] = message.additional_kwargs["name"]

ValueError: Got unknown type H

```

------------------

--------------------

# Error with a script using asyncio.run(

```

 ValueError                                Traceback (most recent call last)
[/home/username/projects/Latex_Doc_Search.ipynb](https://file+.vscode-resource.vscode-cdn.net/home/username/projects/Latex_Doc_Search.ipynb) Cell 39 in ()
      [1](vscode-notebook-cell:/home/username/projects/Latex_Doc_Search.ipynb#Y150sZmlsZQ%3D%3D?line=0) import nest_asyncio
      [2](vscode-notebook-cell:/home//projects/Latex_Doc_Search.ipynb#Y150sZmlsZQ%3D%3D?line=1) nest_asyncio.apply()
----> [4](vscode-notebook-cell:/home/username/projects/Latex_Doc_Search.ipynb#Y150sZmlsZQ%3D%3D?line=3) await generate_concurrently()

[/home/username/projects/Latex_Doc_Search.ipynb](https://file+.vscode-resource.vscode-cdn.net/home/username/projects/Latex_Doc_Search.ipynb) Cell 39 in generate_concurrently()
     [17](vscode-notebook-cell:/home/username/projects/Latex_Doc_Search.ipynb#Y150sZmlsZQ%3D%3D?line=16) llm = ChatOpenAI(temperature=0)
     [18](vscode-notebook-cell:/home/username/projects/Latex_Doc_Search.ipynb#Y150sZmlsZQ%3D%3D?line=17) tasks = [async_generate(llm) for _ in range(10)]
---> [19](vscode-notebook-cell:/home/username/projects/Latex_Doc_Search.ipynb#Y150sZmlsZQ%3D%3D?line=18) await asyncio.gather(*tasks)

File [~/anaconda3/lib/python3.9/asyncio/tasks.py:328](https://file+.vscode-resource.vscode-cdn.net/home/username/projects/~/anaconda3/lib/python3.9/asyncio/tasks.py:328), in Task.__wakeup(self, future)
    326 def __wakeup(self, future):
    327     try:
--> 328         future.result()
    329     except BaseException as exc:
    330         # This may also be a cancellation.
    331         self.__step(exc)

File [~/anaconda3/lib/python3.9/asyncio/tasks.py:256](https://file+.vscode-resource.vscode-cdn.net/home/username/projects/~/anaconda3/lib/python3.9/asyncio/tasks.py:256), in Task.__step(***failed resolving arguments***)
    252 try:
    253     if exc is None:
    254         # We use the `send` method directly, because coroutines
    255         # don't have `__iter__` and `__next__` methods.
...
---> 88     raise ValueError(f"Got unknown type {message}")
     89 if "name" in message.additional_kwargs:
     90     message_dict["name"] = message.additional_kwargs["name"]

ValueError: Got unknown type H
```