This agent demo uses Operator, Reservoir, and Langchain Agents to create an NFT assistant that is capable of retrieving information about any NFT project.
The chat agent uses two primary tools, Operator and Reservoir. Operator is used to find the contract address of NFT's, and Reservoir is used to retrieve associated metadata.
To run the demo locally, you will need to install the following dependencies:
pip install -r requirements.txt
Now, load the endpoint data into Chroma. Navigate to the scripts directory and run the following command:
python loader.py
This command will embed and organize the endpoint related data into the Chroma database, which is used by the Reservoir tool to retrieve the right endpoint.
Finally, you can navigate to the agent directory and run the following command:
streamlit run agent_with_ui.py
To modify this repo to work with other API's:
- download the openapi.json spec associated with the API
- add the spec to the schemas directory
- run the loader.py script in the scripts folder
- copy/paste the reservoir.py tool, then modify the name and description of the tool
- add the tool to the agent you are using, whether that is the agent_with_ui.py or the agent.py file.
import your_tool
tools = [OperatorTool(), ReservoirTool(), # add your tool here]
- run the agent depending on which agent you are using.