Create a tool to do retrieval of documents.
create_retriever_tool(
retriever: BaseRetriever,
name: str,
description: str,
*,
document_prompt: BasePromptTemplate | None = None,
document_separator: str = '\n\n',
response_format: Literal['content', 'content_and_artifact'] = 'content'
) -> StructuredTool| Name | Type | Description |
|---|---|---|
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 | BasePromptTemplate | None | Default: NoneThe prompt to use for the document. |
document_separator | str | Default: '\n\n'The separator to use between documents. |
response_format | Literal['content', 'content_and_artifact'] | Default: 'content'The tool response format. If |