-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
feat: Add 0G plugin for file storage #416
Conversation
Hey @Wilbert957 Great work! There are conflicts that needs to be resolved before a merge could happen, could you fix that? In the package.json for 0g-plugin, kind add dev command ( |
Thanks for your notification. Sure, I'll fix it ASAP.
Shakker Nerd ***@***.***> 于2024年11月19日周二 23:09写道:
… Hey @Wilbert957 <https://github.com/Wilbert957> Great work!
There are conflicts that needs fixing, could you fix that?
In the package.json for 0g-plugin, kind add dev command ("dev": "tsup
--watch").
—
Reply to this email directly, view it on GitHub
<#416 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGT4B6HYQLKT3KSBOW3CFJT2BNICXAVCNFSM6AAAAABSBTEVX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBVHE4DCNJSGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I've fixed it. Could you please check? |
Kindly attach a screengrab of the upload/file storage interaction. @Wilbert957 This has been updated. |
import { promises as fs } from 'fs'; | ||
|
||
|
||
const uploadTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. |
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.
Can we move this to a templates file for maintainability
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.
Sure, thanks, I've fixed.
}); | ||
|
||
// Generate upload content | ||
const content = await generateObject({ |
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.
Can we consider using generateObjectV2 which actually uses z objects to be more type safe.
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.
Sure, thanks, I've fixed.
const zgPrivateKey = runtime.getSetting("ZEROG_PRIVATE_KEY"); | ||
const flowAddr = runtime.getSetting("ZEROG_FLOW_ADDRESS"); | ||
const filePath = content.filePath; | ||
if (!filePath) { |
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.
Can we add escape clauses if those settings aren't there? Or will validate ensure this cannot happen
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.
Sorry, maybe I didn't get you, but I checked settings-exsitance using the validator of the action.
Please resolve conflicts and add a test and / or screen grab of working plugin functionality thanks so much! Amazing work with this plugin you are the GOAT! |
if (err === null) { | ||
console.log("File uploaded successfully, tx: ", tx); | ||
} else { | ||
console.log("Error uploading file: ", err); |
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.
console.error please thanks
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.
Sure, thanks, I've fixed.
…e type safe generateObjectV2
Sure, thanks. I've attached a screengrab. |
Sure, thanks. I've attached a screengrab. |
I've resolved conflicts~ |
I've resolved conflicts~ |
Hi @shakkernerd I hope you're doing well! I wanted to kindly remind you that my pull request (#PR-416) is awaiting your review and approval. Your feedback would be greatly appreciated. |
Hi, @monilpat. Conflicts resolved. Would know if can merge? Your feedback would be greatly appreciated. |
This PR adds a new plugin for 0G.
Risks
Low. This change involves adding a new plugin, which is isolated and should not affect existing functionality.
Background
What does this PR do?
This PR adds a new plugin for 0G, which includes an action that allows users to upload local files to 0G Storage.
Future work will include extending 0G support for model serving, state persistence via KV store, and enhanced file management capabilities.
What kind of change is this?
Features (non-breaking change which adds functionality).
Why are we doing this? Any context or related work?
To extend the functionality of Eliza.
Documentation changes needed?
Require a change to the project documentation.
Testing
Where should a reviewer start?
The review can start with the new 0G plugin code, focusing on the action that uploads files to ensure it handles files correctly and integrates well with 0G Storage.
Detailed testing steps
Ensure the
@ai16z/plugin-0g
is properly added and configured in the character file.Send a message to the agent: Upload the file at /path/to/your/file.txt to zg storage.
Screenshots
Before
After
Database changes
Deployment instructions