-
Notifications
You must be signed in to change notification settings - Fork 5
add initial Storage implementation #18
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces an initial implementation for IPFS storage integration using tools.
- Adds a Storage service class with methods to fetch content and upload both JSON data and files to IPFS.
- Updates the project dependencies by including aiohttp and ipython in the configuration.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
python/thirdweb-ai/src/thirdweb_ai/services/storage.py | Added IPFS storage service with fetch and upload methods. |
python/thirdweb-ai/pyproject.toml | Added new dependencies: aiohttp for async HTTP requests and ipython for development tooling. |
Comments suppressed due to low confidence (1)
python/thirdweb-ai/src/thirdweb_ai/services/storage.py:63
- Use the file_path object's open() method instead of calling Path.open(file_path, ...) to properly read the file. Replace with: 'with file_path.open("rb") as file_content:'
with Path.open(file_path, "rb") as file_content:
|
||
raise ValueError(f"Path exists but is neither a file nor a directory: {data}") | ||
|
||
raise ValueError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think in the else
case, we can just encode it as bytes and upload it.
so that we can instruct the agent to "write the answer of 2+2 to ipfs", then it'd pass "4" to this function, and we'd just upload it as plain text.
Can we include some tests for the testing through the behavior and correctness of the upload function? |
Had a go at implementing IPFS storage as tools. Haven't been able to test it, so unsure if this is works.
Ref NEB-154