Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_llm(vectorstore: ~langchain.vectorstores.base.VectorStore, llm: ~langchain.llms.base.BaseLLM, search: ~langchain.utilities.google_search.GoogleSearchAPIWrapper, prompt: ~typing.Optional[~langchain.schema.prompt_template.BasePromptTemplate] = None, num_search_results: int = 1, text_splitter: ~langchain.text_splitter.RecursiveCharacterTextSplitter = <langchain.text_splitter.RecursiveCharacterTextSplitter object>) → WebResearchRetriever[source]¶
Initialize from llm using default template.
Parameters
vectorstore – Vector store for storing web pages
llm – llm for search question generation
search – GoogleSearchAPIWrapper
prompt – prompt to generating search questions
num_search_results – Number of pages per Google search
text_splitter – Text splitter for splitting web pages into chunks
Returns
WebResearchRetriever
classmethod from_orm(obj: Any) → Model¶
get_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document]¶
Retrieve documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
:param tags: Optional list of tags associated with the retriever. Defaults to None
These tags will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Parameters
metadata – Optional metadata associated with the retriever. Defaults to None
This metadata will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents