Web Research Retriever error, code run in free Colab
Labels: name: area: doc loader, name: area: vector store, name: auto:bug

### System Info

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
google-colab 1.0.0 requires requests==2.27.1, but you have requests 2.31.0 which is incompatible.

Successfully installed backoff-2.2.1 chroma-hnswlib-0.7.1 chromadb-0.4.3 coloredlogs-15.0.1 dataclasses-json-0.5.13 fastapi-0.99.1 h11-0.14.0 httptools-0.6.0 humanfriendly-10.0 langchain-0.0.247 langsmith-0.0.15 marshmallow-3.20.1 monotonic-1.6 mypy-extensions-1.0.0 onnxruntime-1.15.1 openai-0.27.8 openapi-schema-pydantic-1.2.4 overrides-7.3.1 posthog-3.0.1 pulsar-client-3.2.0 pypika-0.48.9 python-dotenv-1.0.0 requests-2.31.0 starlette-0.27.0 tokenizers-0.13.3 typing-inspect-0.9.0 uvicorn-0.23.1 uvloop-0.17.0 watchfiles-0.19.0 websockets-11.0.3

### Who can help?

@agola11 
Trying to run Web Research Retriever code available in [Langchain docs](https://python.langchain.com/docs/modules/data_connection/retrievers/web_research)
in free Google Colab,
after running code block:
```
user_input = "How do LLM Powered Autonomous Agents work?"
qa_chain = RetrievalQAWithSourcesChain.from_chain_type(llm,retriever=web_research_retriever)
result = qa_chain({"question": user_input})
result
```
I got the following info log and error:
```
INFO:langchain.retrievers.web_research:Generating questions for Google Search ...
INFO:langchain.retrievers.web_research:Questions for Google Search (raw): {'question': 'What is Task Decomposition in LLM Powered Autonomous Agents?', 'text': LineList(lines=['1. How do LLM powered autonomous agents utilize task decomposition?\n', '2. Can you explain the concept of task decomposition in LLM powered autonomous agents?\n'])}
INFO:langchain.retrievers.web_research:Questions for Google Search: ['1. How do LLM powered autonomous agents utilize task decomposition?\n', '2. Can you explain the concept of task decomposition in LLM powered autonomous agents?\n']
INFO:langchain.retrievers.web_research:Searching for relevat urls ...
INFO:langchain.retrievers.web_research:Searching for relevat urls ...
INFO:langchain.retrievers.web_research:Search results: [{'title': "LLM Powered Autonomous Agents | Lil'Log", 'link': 'https://lilianweng.github.io/posts/2023-06-23-agent/', 'snippet': 'Jun 23, 2023 ... Agent System Overview In a LLM-powered autonomous agent system, ... Task decomposition can be done (1) by LLM with simple prompting like\xa0...'}]
INFO:langchain.retrievers.web_research:Searching for relevat urls ...
INFO:langchain.retrievers.web_research:Search results: [{'title': "LLM Powered Autonomous Agents | Lil'Log", 'link': 'https://lilianweng.github.io/posts/2023-06-23-agent/', 'snippet': 'Jun 23, 2023 ... Task decomposition can be done (1) by LLM with simple prompting like "Steps for XYZ.\\n1." , "What are the subgoals for achieving XYZ?" , (2)\xa0...'}]
INFO:langchain.retrievers.web_research:New URLs to load: ['https://lilianweng.github.io/posts/2023-06-23-agent/']
INFO:langchain.retrievers.web_research:Indexing new urls...
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-13-efc9ad25b93a>](https://localhost:8080/#) in <cell line: 5>()
      3 logging.getLogger("langchain.retrievers.web_research").setLevel(logging.INFO)
      4 user_input = "What is Task Decomposition in LLM Powered Autonomous Agents?"
----> 5 docs = web_research_retriever.get_relevant_documents(user_input)

4 frames
[/usr/local/lib/python3.10/dist-packages/langchain/schema/retriever.py](https://localhost:8080/#) in get_relevant_documents(self, query, callbacks, tags, metadata, **kwargs)
    191         except Exception as e:
    192             run_manager.on_retriever_error(e)
--> 193             raise e
    194         else:
    195             run_manager.on_retriever_end(

[/usr/local/lib/python3.10/dist-packages/langchain/schema/retriever.py](https://localhost:8080/#) in get_relevant_documents(self, query, callbacks, tags, metadata, **kwargs)
    184             _kwargs = kwargs if self._expects_other_args else {}
    185             if self._new_arg_supported:
--> 186                 result = self._get_relevant_documents(
    187                     query, run_manager=run_manager, **_kwargs
    188                 )

[/usr/local/lib/python3.10/dist-packages/langchain/retrievers/web_research.py](https://localhost:8080/#) in _get_relevant_documents(self, query, run_manager)
    202             html2text = Html2TextTransformer()
    203             logger.info("Indexing new urls...")
--> 204             docs = loader.load()
    205             docs = list(html2text.transform_documents(docs))
    206             docs = self.text_splitter.split_documents(docs)

[/usr/local/lib/python3.10/dist-packages/langchain/document_loaders/async_html.py](https://localhost:8080/#) in load(self)
    134         """Load text from the url(s) in web_path."""
    135 
--> 136         results = asyncio.run(self.fetch_all(self.web_paths))
    137         docs = []
    138         for i, text in enumerate(results):

[/usr/lib/python3.10/asyncio/runners.py](https://localhost:8080/#) in run(main, debug)
     31     """
     32     if events._get_running_loop() is not None:
---> 33         raise RuntimeError(
     34             "asyncio.run() cannot be called from a running event loop")
     35 

RuntimeError: asyncio.run() cannot be called from a running event loop
```


### Information

- [X] 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
- [X] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [X] Async

### Reproduction

```
! pip install langchain openai chromadb google-api-python-client
import os
import logging
from langchain.vectorstores import Chroma
from langchain.embeddings import OpenAIEmbeddings
from langchain.chat_models.openai import ChatOpenAI
from langchain.retrievers.web_research import WebResearchRetriever
from langchain.utilities import GoogleSearchAPIWrapper
os.environ["OPENAI_API_KEY"] = "****"
os.environ["GOOGLE_CSE_ID"] = "*****"
os.environ["GOOGLE_API_KEY"] = "******"
# Vectorstore
vectorstore = Chroma(embedding_function=OpenAIEmbeddings(),persist_directory="./chroma_db_oai")
# LLM
llm = ChatOpenAI(temperature=0)
# Search 
search = GoogleSearchAPIWrapper()
from langchain.chains import RetrievalQAWithSourcesChain
user_input = "How do LLM Powered Autonomous Agents work?"
qa_chain = RetrievalQAWithSourcesChain.from_chain_type(llm,retriever=web_research_retriever)
result = qa_chain({"question": user_input})
result
```

### Expected behavior

It works as shown in docs' page.