langchain.tools.retriever
.create_retriever_toolΒΆ
- langchain.tools.retriever.create_retriever_tool(retriever: BaseRetriever, name: str, description: str, *, document_prompt: Optional[BasePromptTemplate] = None, document_separator: str = '\n\n') Tool [source]ΒΆ
Create a tool to do retrieval of documents.
- Parameters
retriever (BaseRetriever) β The retriever to use for the retrieval
name (str) β The name for the tool. This will be passed to the language model, so should be unique and somewhat descriptive.
description (str) β The description for the tool. This will be passed to the language model, so should be descriptive.
document_prompt (Optional[BasePromptTemplate]) β
document_separator (str) β
- Returns
Tool class to pass to an agent
- Return type