BoxRetriever
class helps you get your unstructured content from Box in Langchain’s Document
format. You can do this by searching for files based on a full-text search or using Box AI to retrieve a Document
containing the result of an AI query against files. This requires including a List[str]
containing Box file ids, i.e. ["12345","67890"]
Retriever | Self-host | Cloud offering | Package |
---|---|---|---|
BoxRetriever | ❌ | ✅ | langchain-box |
Manage AI
scope enabled. Here you will also select your authentication methodlangchain-box
, visit the Box provider document.
langchain-box
package:
langchain_box.utilities.SearchOptions
in conjunction with the langchain_box.utilities.SearchTypeFilter
and langchain_box.utilities.DocumentFiles
enums to filter on things like created date, which part of the file to search, and even to limit the search scope to a specific folder.
For more information, check out the API reference.
BoxRetriever
, you can return the answer to your prompt, return the citations used by Box to get that answer, or both. No matter how you choose to use Box AI, the retriever returns a List[Document]
object. We offer this flexibility with two bool
arguments, answer
and citations
. Answer defaults to True
and citations defaults to False
, do you can omit both if you just want the answer. If you want both, you can just include citations=True
and if you only want citations, you would include answer=False
and citations=True
FileFull
object to return as custom LangChain metadata. Each object accepts an optional List[str]
called extra_fields
containing the json key from the return object, like extra_fields=["shared_link"]
.
The connector will add this field to the list of fields the integration needs to function and then add the results to the metadata returned in the Document
or Blob
, like "metadata" : { "source" : "source, "shared_link" : "shared_link" }
. If the field is unavailable for that file, it will be returned as an empty string, like "shared_link" : ""
.