langchain-box
package provides two methods to index your files from Box: BoxLoader
and BoxBlobLoader
. BoxLoader
allows you to ingest text representations of files that have a text representation in Box. The BoxBlobLoader
allows you download the blob for any document or image file for processing with the blob parser of your choice.
This notebook details getting started with both of these. For detailed documentation of all BoxLoader features and configurations head to the API Reference pages for BoxLoader and BoxBlobLoader.
BoxLoader
class helps you get your unstructured content from Box in Langchain’s Document
format. You can do this with either a List[str]
containing Box file IDs, or with a str
containing a Box folder ID.
The BoxBlobLoader
class helps you get your unstructured content from Box in Langchain’s Blob
format. You can do this with a List[str]
containing Box file IDs, a str
containing a Box folder ID, a search query, or a BoxMetadataQuery
.
If getting files from a folder with folder ID, you can also set a Bool
to tell the loader to get all sub-folders in that folder, as well.
BoxLoader
will skip files without a text representation, while the BoxBlobLoader
will return blobs for all document and image files.
Class | Package | Local | Serializable | JS support |
---|---|---|---|---|
BoxLoader | langchain_box | ✅ | ❌ | ❌ |
BoxBlobLoader | langchain_box | ✅ | ❌ | ❌ |
Source | Document Lazy Loading | Async Support |
---|---|---|
BoxLoader | ✅ | ❌ |
BoxBlobLoader | ✅ | ❌ |
Manage AI
scope enabled. Here you will also select your authentication methodlangchain-box
, visit the Box provider document.
List
of file ids at instantiation time.
This requires 1 piece of information:
List[str]
)- A list of Box file IDs.str
with the Box folder ID at instantiation time.
This requires 1 piece of information:
str
)- A string containing a Box folder ID.BoxBlobLoader
offers two methods. First you can perform a full text search with optional search options to narrow down that search.
This requires 1 piece of information:
str
)- A string containing the search query to perform.BoxSearchOptions
object to narrow down that search
BoxSearchOptions
)str
)- A string containing the search query to perform.BoxSearchOptions
object to narrow down that search
BoxSearchOptions
)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" : ""
.