OpenGradientToolkit
This notebook shows how to build tools using the OpenGradient toolkit. This toolkit gives users the ability to create custom tools based on models and workflows on the OpenGradient network.
Setup
Ensure that you have an OpenGradient API key in order to access the OpenGradient network. If you already have an API key, simply set the environment variable:
!export OPENGRADIENT_PRIVATE_KEY="your-api-key"
If you need to set up a new API key, download the opengradient SDK and follow the instructions to initialize a new configuration.
!pip install opengradient
!opengradient config init
Installation
This toolkit lives in the langchain-opengradient
package:
%pip install -qU langchain-opengradient
Instantiation
Now we can instantiate our toolkit with the API key from before.
from langchain_opengradient import OpenGradientToolkit
toolkit = OpenGradientToolkit(
# Not required if you have already set the environment variable OPENGRADIENT_PRIVATE_KEY
private_key="your-api-key"
)