Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
metakai1 committed Dec 31, 2024
1 parent 6618a50 commit afdf27e
Show file tree
Hide file tree
Showing 5 changed files with 346 additions and 54 deletions.
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@ai16z/plugin-starknet": "workspace:*",
"@ai16z/plugin-ton": "workspace:*",
"@ai16z/plugin-sui": "workspace:*",
"@ai16z/plugin-save-this": "workspace:*",
"@ai16z/plugin-tee": "workspace:*",
"@ai16z/plugin-multiversx": "workspace:*",
"@ai16z/plugin-near": "workspace:*",
Expand Down
2 changes: 2 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { solanaPlugin } from "@ai16z/plugin-solana";
import { suiPlugin } from "@ai16z/plugin-sui";
import { TEEMode, teePlugin } from "@ai16z/plugin-tee";
import { tonPlugin } from "@ai16z/plugin-ton";
import { saveThisPlugin } from "@ai16z/plugin-save-this";
import { zksyncEraPlugin } from "@ai16z/plugin-zksync-era";
import Database from "better-sqlite3";
import fs from "fs";
Expand Down Expand Up @@ -562,6 +563,7 @@ export async function createAgent(
getSecret(character, "TON_PRIVATE_KEY") ? tonPlugin : null,
getSecret(character, "SUI_PRIVATE_KEY") ? suiPlugin : null,
getSecret(character, "STORY_PRIVATE_KEY") ? storyPlugin : null,
saveThisPlugin
].filter(Boolean),
providers: [],
actions: [],
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-image-generation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ const imageGeneration: Action = {
},
callback: HandlerCallback
) => {
elizaLogger.info("state messages", state.recentMessages);

elizaLogger.log("Composing state for message:", message);
state = (await runtime.composeState(message)) as State;
const userId = runtime.agentId;
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-save-this/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const saveThisAction: Action = {
) => {
try {

elizaLogger.info(state);
elizaLogger.info(state.recentMessages);

// Only proceed if explicitly requested via state
if (!state?.shouldSave) {
Expand Down Expand Up @@ -128,14 +128,14 @@ export const saveThisProvider: Provider = {
// Trigger if message starts with "save this"
if (text.trim().startsWith('save this')) {
// Modify state in place first
if (state) {
/* if (state) {
state.shouldSave = true;
}
if(!state.shouldSave) {
elizaLogger.error('saveThisProvider: state.shouldSave is faised');
}

*/
// Then trigger the SAVE_THIS action
await runtime.processActions(message, [{
id: stringToUuid(`save_this_response_${Date.now()}`),
Expand Down
Loading

0 comments on commit afdf27e

Please sign in to comment.