Installation and setup
langchain-box
This package contains the LangChain integration with Box. For more information about Box, check out our developer documentation.Pre-requisites
In order to integrate with Box, you need a few things:- A Box instance — if you are not a current Box customer, sign up for a free dev account.
- A Box app — more on how to create an app
- Your app approved in your Box instance — This is done by your admin. The good news is if you are using a free developer account, you are the admin. Authorize your app
Authentication
Thebox-langchain
package offers some flexibility to authentication. The
most basic authentication method is by using a developer token. This can be
found in the Box developer console
on the configuration screen. This token is purposely short-lived (1 hour) and is
intended for development. With this token, you can add it to your environment as
BOX_DEVELOPER_TOKEN
, you can pass it directly to the loader, or you can use the
BoxAuth
authentication helper class.
We will cover passing it directly to the loader in the section below.
BoxAuth helper class
BoxAuth
supports the following authentication methods:
- Token — either a developer token or any token generated through the Box SDK
- JWT with a service account
- JWT with a specified user
- CCG with a service account
- CCG with a specified user
If using JWT authentication, you will need to download the configuration from the Boxdeveloper console after generating your public/private key pair. Place this file in your
application directory structure somewhere. You will use the path to this file when using
the
BoxAuth
helper class.BoxAuthType.TOKEN
with the token you have acquired.