AsyncChromiumLoader not working with FastAPI
Labels: name: area: doc loader, name: auto:bug

### System Info

```
@router.post('/web-page')
def web_page_embedding(model: WebPageEmbedding):
    try:
        data = download_page(model.page)
        return {'success': True}
    except Exception as e:
        return Response(str(e))

 def download_page(url: str):
    loader = AsyncChromiumLoader(urls=[url])
    docs = loader.load()
    return docs 
```
I am trying to download the page content using the above FastAPI code. But I am facing this `NotImplementedError` error
```
Task exception was never retrieved
future: <Task finished name='Task-6' coro=<Connection.run() done, defined at E:\Projects\abcd\venv\Lib\site-packages\playwright\_impl\_connection.py:264> exception=NotImplementedError()>
Traceback (most recent call last):
  File "E:\Projects\abcd\venv\Lib\site-packages\playwright\_impl\_connection.py", line 271, in run
    await self._transport.connect()
  File "E:\Projects\abcd\venv\Lib\site-packages\playwright\_impl\_transport.py", line 135, in connect
    raise exc
  File "E:\Projects\abcd\venv\Lib\site-packages\playwright\_impl\_transport.py", line 123, in connect
    self._proc = await asyncio.create_subprocess_exec(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hasan\AppData\Local\Programs\Python\Python311\Lib\asyncio\subprocess.py", line 218, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hasan\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1694, in subprocess_exec
    transport = await self._make_subprocess_transport(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\hasan\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 502, in _make_subprocess_transport
    raise NotImplementedError
NotImplementedError
```

I have also tried with with async await which directly call the async method of the loader and this also not working
```
@router.post('/web-page-1')
async def web_page_embedding_async(model: WebPageEmbedding):
    try:
        data = await download_page_async(model.page)
        return {'success': True}
    except Exception as e:
        return Response(str(e))
        
 async def download_page_async(url: str):
    loader = AsyncChromiumLoader(urls=[url])
    # docs = loader.load()
    docs = await loader.ascrape_playwright(url)
    return docs
```

But If I try to download the page in a python script it working as expected (both async and non-async)

```
if __name__ == '__main__':
    try:
        url = 'https://python.langchain.com/docs/integrations/document_loaders/async_chromium'
        # d = download_page(url) # working
        d = asyncio.run(download_page_async(url))  # also working

        print(len(d))
    except Exception as e:
        print(e)
```
Packages:

- langchain==0.0.284
- playwright==1.37.0
- fastapi==0.103.1
- uvicorn==0.23.2

### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [X] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [X] Async

### Reproduction

Please run the code

### Expected behavior

Loader should work in FastAPI environment