LangChain · Function
create_retriever_tool
Creates a StructuredTool that retrieves documents through a BaseRetriever. The tool exposes a model-facing name and description and can format the retrieved documents.
Last updated
- Since
- v1.7
Syntax
create_retriever_tool(retriever: BaseRetriever, name: str, description: str, *, document_prompt: BasePromptTemplate | str | None = None, document_separator: str = '\n\n', response_format: Literal['content', 'content_and_artifact'] = 'content')In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
BaseRetrieverStructuredToolBasePromptTemplateDocumentformat_documentaformat_document