Skip to content

Add Pinata Tool #8047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add Pinata Tool #8047

wants to merge 4 commits into from

Conversation

Zhixuan0318
Copy link

@Zhixuan0318 Zhixuan0318 commented Apr 21, 2025

Summary

This tool adds integration support to the Pinata SDK so that agents have the ability to manage files (upload, query, and delete) on the IPFS Web3.0 Storage via Pinata and manage groups (create, delete, get, list, and update) for your files in your Pinata account.

Notes

  • There are a total of 8 tool classes for this Pinata Tool integration:
  1. PinataUploadFileTool
  2. PinataQueryFileTool
  3. PinataDeleteFileTool
  4. PinataCreateGroupTool
  5. PinataDeleteGroupTool
  6. PinataGetGroupTool
  7. PinataListGroupTool
  8. PinataUpdateGroupTool
  • In order to use the tool, you need to create an API key on Pinata to obtain a JWT, which need to be include into the .env (had included into the env example)
  • The API key needs to have admin mode turned on to provide read and write access to all the files and group-related tools.
  • Integration test is added and all passed:
PASS  src/tools/tests/pinata.int.test.ts (5.979 s)
  Pinata Integration Test
    ✓ should create a group named - Example Group successfully (1002 ms)
    ✓ should retrieve the created group by ID (729 ms)
    ✓ should update the group name to Latest Example Group successfully (364 ms)
    ✓ should list the group with the updated name - Latest Example Group (251 ms)
    ✓ should upload a file (Astronaut Emoji) successfully to the group (1279 ms)
    ✓ should query and return the uploaded file (Astronaut Emoji) with the same parameters (259 ms)
    ✓ should delete the uploaded file (cleanup) (904 ms)
    ✓ should delete the group created (cleanup) (553 ms)

Test Suites: 1 passed, 1 total
Tests:       8 passed, 8 total
Snapshots:   0 total
Time:        6.51 s
Ran all test suites matching /pinata.int.test.ts/i.
  • An example is added.
  • Doc notebook is added, but some of the links to the API references are not added yet as I'm having trouble building the docs locally. Hopefully it can be added by any maintainers during edits.

Todo

  • Adding support to private IPFS, as currently this integration is only for public IPFS.
  • Once this JS tool integration is merged and released, I will start working on the Python version.
  • Adding more examples for each tool and coming out with a comprehensive tutorial (maybe a simple use case) on it.
  • Consider adding a Pinata toolkit

Twitter Handle

@tzx0318

Copy link

vercel bot commented Apr 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ❌ Failed (Inspect) Apr 21, 2025 4:30pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Apr 21, 2025 4:30pm

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant