BoxRetriever
This will help you getting started with the Box retriever. For detailed documentation of all BoxRetriever features and configurations head to the API reference.
Overview
The 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"]
Box AI requires an Enterprise Plus license
Files without a text representation will be skipped.
Integration details
1: Bring-your-own data (i.e., index and search a custom corpus of documents):
Retriever | Self-host | Cloud offering | Package |
---|---|---|---|
BoxRetriever | ❌ | ✅ | langchain-box |
Setup
In order to use the Box package, you will need a few things:
- A Box account — If you are not a current Box customer or want to test outside of your production Box instance, you can use a free developer account.
- A Box app — This is configured in the developer console, and for Box AI, must have the
Manage AI
scope enabled. Here you will also select your authentication method - The app must be enabled by the administrator. For free developer accounts, this is whomever signed up for the account.
Credentials
For these examples, we will use token authentication. This can be used with any authentication method. Just get the token with whatever methodology. If you want to learn more about how to use other authentication types with langchain-box
, visit the Box provider document.
import getpass
import os
box_developer_token = getpass.getpass("Enter your Box Developer Token: ")
If you want to get automated tracing from individual queries, you can also set your LangSmith API key by uncommenting below:
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
# os.environ["LANGSMITH_TRACING"] = "true"