Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsayo authored Jan 15, 2025
2 parents 557051c + 89b6a19 commit a857353
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/client-farcaster/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function sendCast({
cast,
memory: createCastMemory({
roomId,
senderId: runtime.agentId,
runtime,
cast,
}),
Expand Down
5 changes: 4 additions & 1 deletion packages/client-farcaster/src/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +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,
Expand Down Expand Up @@ -190,6 +192,7 @@ export class FarcasterInteractionManager {
await this.runtime.messageManager.createMemory(
createCastMemory({
roomId: memory.roomId,
senderId,
runtime: this.runtime,
cast,
})
Expand Down Expand Up @@ -266,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 [];
}
};
Expand Down
7 changes: 5 additions & 2 deletions packages/client-farcaster/src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ import { FarcasterClient } from "./client";

export function createCastMemory({
roomId,
senderId,
runtime,
cast,
}: {
roomId: UUID;
senderId: UUID;
runtime: IAgentRuntime;
cast: Cast;
}): Memory {
Expand All @@ -33,7 +35,7 @@ export function createCastMemory({
agentId: runtime.agentId,
}),
agentId: runtime.agentId,
userId: runtime.agentId,
userId: senderId,
content: {
text: cast.text,
source: "farcaster",
Expand Down Expand Up @@ -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,
Expand All @@ -88,6 +90,7 @@ export async function buildConversationThread({
await runtime.messageManager.createMemory(
createCastMemory({
roomId,
senderId: userId,
runtime,
cast: currentCast,
})
Expand Down
1 change: 1 addition & 0 deletions packages/client-farcaster/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export class FarcasterPostManager {
await this.runtime.messageManager.createMemory(
createCastMemory({
roomId,
senderId: this.runtime.agentId,
runtime: this.runtime,
cast,
})
Expand Down

0 comments on commit a857353

Please sign in to comment.