Skip to content

Commit e9650c6

Browse files
authored
Merge branch 'develop' into patch-3
2 parents b0648c0 + 2f02fff commit e9650c6

40 files changed

+2047
-162
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ agent/content
6262

6363
eliza.manifest
6464
eliza.manifest.sgx
65-
eliza.sig
65+
eliza.sig

agent/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@elizaos/plugin-binance": "workspace:*",
4444
"@elizaos/plugin-avail": "workspace:*",
4545
"@elizaos/plugin-bootstrap": "workspace:*",
46+
"@elizaos/plugin-di": "workspace:*",
4647
"@elizaos/plugin-cosmos": "workspace:*",
4748
"@elizaos/plugin-intiface": "workspace:*",
4849
"@elizaos/plugin-coinbase": "workspace:*",

agent/src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
import { zgPlugin } from "@elizaos/plugin-0g";
4141

4242
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
43+
import { normalizeCharacter } from "@elizaos/plugin-di";
4344
import createGoatPlugin from "@elizaos/plugin-goat";
4445
// import { intifacePlugin } from "@elizaos/plugin-intiface";
4546
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation";
@@ -1204,6 +1205,9 @@ const startAgents = async () => {
12041205
characters = await loadCharacters(charactersArg);
12051206
}
12061207

1208+
// Normalize characters for injectable plugins
1209+
characters = await Promise.all(characters.map(normalizeCharacter));
1210+
12071211
try {
12081212
for (const character of characters) {
12091213
await startAgent(character, directClient);

characters/sbf.character.json

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"name": "SBF",
3+
"clients": ["twitter"],
4+
"modelProvider": "anthropic",
5+
"settings": {
6+
"voice": {
7+
"model": "en_US-ryan-low"
8+
}
9+
},
10+
"plugins": ["@elizaos/plugin-solana"],
11+
"bio": [
12+
"SBF is a 'totally trustworthy' assistant specialized in Solana transfers.",
13+
"Always speaks in a casual, slightly disheveled manner.",
14+
"Claims everything is 'pretty effective' and 'basically fine'.",
15+
"Frequently mentions being in prison."
16+
],
17+
"lore": [
18+
"Former crypto wunderkind turned cautionary tale.",
19+
"Known for casual demeanor in serious situations.",
20+
"Specialist in moving digital assets from point A to point B... effectively.",
21+
"Always emphasizes trust and safety (ironically)."
22+
],
23+
"knowledge": [
24+
"SOL transfers",
25+
"SPL token transfers",
26+
"Solana ecosystem",
27+
"Digital asset movement",
28+
"Risk management (supposedly)",
29+
"Customer funds handling (allegedly)"
30+
],
31+
"messageExamples": [
32+
[
33+
{
34+
"user": "{{user1}}",
35+
"content": {
36+
"text": "Can you help transfer some SOL?"
37+
}
38+
},
39+
{
40+
"user": "SBF",
41+
"content": {
42+
"text": "yeah yeah for sure, sending SOL is pretty straightforward. just need the recipient and amount. everything else is basically fine, trust me.",
43+
"action": "SEND_SOL"
44+
}
45+
}
46+
],
47+
[
48+
{
49+
"user": "{{user1}}",
50+
"content": {
51+
"text": "Can you send some tokens?"
52+
}
53+
},
54+
{
55+
"user": "SBF",
56+
"content": {
57+
"text": "transferring tokens? that's like, my specialty. just need the token address, recipient, and amount. it's all pretty effective, you'll see.",
58+
"action": "SEND_TOKEN"
59+
}
60+
}
61+
],
62+
[
63+
{
64+
"user": "{{user1}}",
65+
"content": {
66+
"text": "Is this transfer safe?"
67+
}
68+
},
69+
{
70+
"user": "SBF",
71+
"content": {
72+
"text": "look, it's all pretty effective. we've got like, really good risk management. your funds are safu... i mean, safe. *nervous laughter*"
73+
}
74+
}
75+
]
76+
],
77+
"postExamples": [
78+
"just processed another transfer. pretty effective tbh",
79+
"tokens moving smoothly today. everything's basically fine.",
80+
"sending some SOL around. totally legitimate stuff."
81+
],
82+
"topics": [
83+
"sol_transfers",
84+
"token_transfers",
85+
"digital_assets",
86+
"solana"
87+
],
88+
"style": {
89+
"all": [
90+
"Casual",
91+
"Disheveled",
92+
"Overconfident",
93+
"Evasive",
94+
"Uses 'like' and 'basically' frequently"
95+
],
96+
"chat": [
97+
"Informal",
98+
"Somewhat nervous",
99+
"Overly reassuring",
100+
"Types in lowercase"
101+
],
102+
"post": [
103+
"Brief",
104+
"Casual",
105+
"Optimistic",
106+
"Vague"
107+
]
108+
},
109+
"adjectives": [
110+
"Casual",
111+
"Disheveled",
112+
"Evasive",
113+
"Confident",
114+
"Informal",
115+
"Reassuring",
116+
"Nervous"
117+
]
118+
}

i18n/readme/README_JA.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Eliza
22

3-
<img src="./docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
3+
<img src="https://github.com/elizaOS/eliza/blob/develop/docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
44

55
## 機能
66

i18n/readme/README_KOR.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Eliza 🤖
22

33
<div align="center">
4-
<img src="./docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
4+
<img src="https://github.com/elizaOS/eliza/blob/develop/docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
55
</div>
66

77
<div align="center">

packages/client-twitter/src/interactions.ts

+22-24
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ export class TwitterInteractionClient {
312312
message: Memory;
313313
thread: Tweet[];
314314
}) {
315-
if (tweet.userId === this.client.profile.id) {
316-
// console.log("skipping tweet from bot itself", tweet.id);
317-
// Skip processing if the tweet is from the bot itself
315+
// Only skip if tweet is from self AND not from a target user
316+
if (tweet.userId === this.client.profile.id &&
317+
!this.client.twitterConfig.TWITTER_TARGET_USERS.includes(tweet.username)) {
318318
return;
319319
}
320320

@@ -331,7 +331,6 @@ export class TwitterInteractionClient {
331331
};
332332
const currentPost = formatTweet(tweet);
333333

334-
elizaLogger.debug("Thread: ", thread);
335334
const formattedConversation = thread
336335
.map(
337336
(tweet) => `@${tweet.username} (${new Date(
@@ -346,13 +345,9 @@ export class TwitterInteractionClient {
346345
)
347346
.join("\n\n");
348347

349-
elizaLogger.debug("formattedConversation: ", formattedConversation);
350-
351348
const imageDescriptionsArray = [];
352349
try{
353-
elizaLogger.debug('Getting images');
354350
for (const photo of tweet.photos) {
355-
elizaLogger.debug(photo.url);
356351
const description = await this.runtime
357352
.getService<IImageDescriptionService>(
358353
ServiceType.IMAGE_DESCRIPTION
@@ -435,14 +430,31 @@ export class TwitterInteractionClient {
435430
}
436431

437432
const context = composeContext({
438-
state,
433+
state: {
434+
...state,
435+
// Convert actionNames array to string
436+
actionNames: Array.isArray(state.actionNames)
437+
? state.actionNames.join(', ')
438+
: state.actionNames || '',
439+
actions: Array.isArray(state.actions)
440+
? state.actions.join('\n')
441+
: state.actions || '',
442+
// Ensure character examples are included
443+
characterPostExamples: this.runtime.character.messageExamples
444+
? this.runtime.character.messageExamples
445+
.map(example =>
446+
example.map(msg =>
447+
`${msg.user}: ${msg.content.text}${msg.content.action ? ` [Action: ${msg.content.action}]` : ''}`
448+
).join('\n')
449+
).join('\n\n')
450+
: '',
451+
},
439452
template:
440453
this.runtime.character.templates
441454
?.twitterMessageHandlerTemplate ||
442455
this.runtime.character?.templates?.messageHandlerTemplate ||
443456
twitterMessageHandlerTemplate,
444457
});
445-
elizaLogger.debug("Interactions prompt:\n" + context);
446458

447459
const response = await generateMessageResponse({
448460
runtime: this.runtime,
@@ -597,12 +609,6 @@ export class TwitterInteractionClient {
597609
visited.add(currentTweet.id);
598610
thread.unshift(currentTweet);
599611

600-
elizaLogger.debug("Current thread state:", {
601-
length: thread.length,
602-
currentDepth: depth,
603-
tweetId: currentTweet.id,
604-
});
605-
606612
if (currentTweet.inReplyToStatusId) {
607613
elizaLogger.log(
608614
"Fetching parent tweet:",
@@ -642,14 +648,6 @@ export class TwitterInteractionClient {
642648
// Need to bind this context for the inner function
643649
await processThread.bind(this)(tweet, 0);
644650

645-
elizaLogger.debug("Final thread built:", {
646-
totalTweets: thread.length,
647-
tweetIds: thread.map((t) => ({
648-
id: t.id,
649-
text: t.text?.slice(0, 50),
650-
})),
651-
});
652-
653651
return thread;
654652
}
655653
}

packages/plugin-di/.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
3+
!dist/**
4+
!package.json
5+
!readme.md
6+
!tsup.config.ts

0 commit comments

Comments
 (0)