From bcd1a07ef6b22f08f0842ad66b32715cea4e67f9 Mon Sep 17 00:00:00 2001 From: graffe Date: Tue, 14 Jan 2025 15:03:08 -0800 Subject: [PATCH 1/3] fix farcaster memory --- packages/client-farcaster/src/actions.ts | 1 + packages/client-farcaster/src/interactions.ts | 5 +++++ packages/client-farcaster/src/memory.ts | 7 +++++-- packages/client-farcaster/src/post.ts | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/client-farcaster/src/actions.ts b/packages/client-farcaster/src/actions.ts index f63171a5ea..ac3d5b1c01 100644 --- a/packages/client-farcaster/src/actions.ts +++ b/packages/client-farcaster/src/actions.ts @@ -50,6 +50,7 @@ export async function sendCast({ cast, memory: createCastMemory({ roomId, + senderId: runtime.agentId, runtime, cast, }), diff --git a/packages/client-farcaster/src/interactions.ts b/packages/client-farcaster/src/interactions.ts index 2363df69f5..ce86ee9d35 100644 --- a/packages/client-farcaster/src/interactions.ts +++ b/packages/client-farcaster/src/interactions.ts @@ -138,6 +138,10 @@ export class FarcasterInteractionManager { const currentPost = formatCast(cast); + + const senderId = stringToUuid(cast.authorFid.toString()); + + const { timeline } = await this.client.getTimeline({ fid: agent.fid, pageSize: 10, @@ -190,6 +194,7 @@ export class FarcasterInteractionManager { await this.runtime.messageManager.createMemory( createCastMemory({ roomId: memory.roomId, + senderId, runtime: this.runtime, cast, }) diff --git a/packages/client-farcaster/src/memory.ts b/packages/client-farcaster/src/memory.ts index 94ea8eae95..f12d408a50 100644 --- a/packages/client-farcaster/src/memory.ts +++ b/packages/client-farcaster/src/memory.ts @@ -13,10 +13,12 @@ import { FarcasterClient } from "./client"; export function createCastMemory({ roomId, + senderId, runtime, cast, }: { roomId: UUID; + senderId: UUID; runtime: IAgentRuntime; cast: Cast; }): Memory { @@ -33,7 +35,7 @@ export function createCastMemory({ agentId: runtime.agentId, }), agentId: runtime.agentId, - userId: runtime.agentId, + userId: senderId, content: { text: cast.text, source: "farcaster", @@ -75,7 +77,7 @@ export async function buildConversationThread({ if (!memory) { elizaLogger.log("Creating memory for cast", currentCast.hash); - const userId = stringToUuid(currentCast.profile.username); + const userId = stringToUuid(currentCast.authorFid.toString()); await runtime.ensureConnection( userId, @@ -88,6 +90,7 @@ export async function buildConversationThread({ await runtime.messageManager.createMemory( createCastMemory({ roomId, + senderId: userId, runtime, cast: currentCast, }) diff --git a/packages/client-farcaster/src/post.ts b/packages/client-farcaster/src/post.ts index 6733ce1af1..438038ba5c 100644 --- a/packages/client-farcaster/src/post.ts +++ b/packages/client-farcaster/src/post.ts @@ -151,6 +151,7 @@ export class FarcasterPostManager { await this.runtime.messageManager.createMemory( createCastMemory({ roomId, + senderId: this.runtime.agentId, runtime: this.runtime, cast, }) From c6f4bde8fb47027212f1db4c2e0b4238cd59a61e Mon Sep 17 00:00:00 2001 From: Shakker Nerd Date: Wed, 15 Jan 2025 02:45:59 +0000 Subject: [PATCH 2/3] chore: console -> elizaLogger --- packages/client-farcaster/src/interactions.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/client-farcaster/src/interactions.ts b/packages/client-farcaster/src/interactions.ts index ce86ee9d35..02d1941afe 100644 --- a/packages/client-farcaster/src/interactions.ts +++ b/packages/client-farcaster/src/interactions.ts @@ -138,10 +138,8 @@ export class FarcasterInteractionManager { const currentPost = formatCast(cast); - const senderId = stringToUuid(cast.authorFid.toString()); - const { timeline } = await this.client.getTimeline({ fid: agent.fid, pageSize: 10, @@ -271,7 +269,7 @@ export class FarcasterInteractionManager { } return results.map((result) => result.memory); } catch (error) { - console.error("Error sending response cast:", error); + elizaLogger.error("Error sending response cast:", error); return []; } }; From d91e1651d8808f435fa56fa34827739714a38bc5 Mon Sep 17 00:00:00 2001 From: Shaw Date: Wed, 15 Jan 2025 11:46:07 +0900 Subject: [PATCH 3/3] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d23a71651..3a35bf6241 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,11 @@ ## ✨ Features - 🛠️ Full-featured Discord, Twitter and Telegram connectors -- 🔗 Support for every model (Llama, Grok, OpenAI, Anthropic, etc.) +- 🔗 Support for every model (Llama, Grok, OpenAI, Anthropic, Gemini, etc.) - 👥 Multi-agent and room support - 📚 Easily ingest and interact with your documents - 💾 Retrievable memory and document store - 🚀 Highly extensible - create your own actions and clients -- ☁️ Supports many models (local Llama, OpenAI, Anthropic, Groq, etc.) - 📦 Just works! ## Video Tutorials