Skip to content

Commit

Permalink
1.rename pluging name, 2.add deps for agent
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 19, 2024
1 parent b32a546 commit b6bad94
Show file tree
Hide file tree
Showing 10 changed files with 9,223 additions and 20 deletions.
9,105 changes: 9,105 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"node": ">=22"
},
"dependencies": {
"@0glabs/0g-ts-sdk": "^0.2.1",
"ollama-ai-provider": "^0.16.1",
"optional": "^0.1.4",
"sharp": "^0.33.5"
Expand Down
1 change: 1 addition & 0 deletions packages/agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@ai16z/plugin-image-generation": "workspace:*",
"@ai16z/plugin-node": "workspace:*",
"@ai16z/plugin-solana": "workspace:*",
"@ai16z/plugin-0g": "workspace:*",
"readline": "^1.3.0",
"ws": "^8.18.0",
"yargs": "17.7.2"
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from "@ai16z/eliza";
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
import { solanaPlugin } from "@ai16z/plugin-solana";
import { zgPlugin } from "@ai16z/plugin-0g";
import { nodePlugin } from "@ai16z/plugin-node";
import Database from "better-sqlite3";
import fs from "fs";
Expand Down Expand Up @@ -234,6 +235,7 @@ export async function createAgent(
bootstrapPlugin,
nodePlugin,
character.settings.secrets?.WALLET_PUBLIC_KEY ? solanaPlugin : null,
zgPlugin,
].filter(Boolean),
providers: [],
actions: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"types": "dist/index.d.ts",
"dependencies": {
"@ai16z/eliza": "workspace:*",
"tsup": "^8.3.5"
"tsup": "^8.3.5",
"@0glabs/0g-ts-sdk": "0.2.1",
"ethers": "^6.0.0"
},
"scripts": {
"build": "tsup --format esm --dts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
HandlerCallback,
IAgentRuntime,
Memory,
Plugin,
State,
ModelClass,
Content,
Expand Down Expand Up @@ -125,7 +124,6 @@ export const zgUpload: Action = {
console.log("Error getting file root hash: ", err);
return false;
}
await file.close();

const provider = new ethers.JsonRpcProvider(zgEvmRpc);
const signer = new ethers.Wallet(zgPrivateKey, provider);
Expand All @@ -140,6 +138,8 @@ export const zgUpload: Action = {
return false;
}

await file.close();

} catch (error) {
console.error("Error getting settings for zg upload:", error);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Plugin } from "@ai16z/eliza";
import { zgUpload } from "./actions/uoload";

export const zgUploadPlugin: Plugin = {
name: "zgUpload",
description: "Upload data using 0G protocol",
export const zgPlugin: Plugin = {
name: "ZG",
description: "Store data using 0G protocol",
actions: [zgUpload],
evaluators: [],
providers: [],
};
};
File renamed without changes.
File renamed without changes.
118 changes: 105 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b6bad94

Please sign in to comment.