Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_llm(vectorstore: ~langchain.schema.vectorstore.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¶
classmethod get_lc_namespace() → List[str]¶
Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
get_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = 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,