@@ -312,9 +312,9 @@ export class TwitterInteractionClient {
312
312
message : Memory ;
313
313
thread : Tweet [ ] ;
314
314
} ) {
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 ) ) {
318
318
return ;
319
319
}
320
320
@@ -331,7 +331,6 @@ export class TwitterInteractionClient {
331
331
} ;
332
332
const currentPost = formatTweet ( tweet ) ;
333
333
334
- elizaLogger . debug ( "Thread: " , thread ) ;
335
334
const formattedConversation = thread
336
335
. map (
337
336
( tweet ) => `@${ tweet . username } (${ new Date (
@@ -346,13 +345,9 @@ export class TwitterInteractionClient {
346
345
)
347
346
. join ( "\n\n" ) ;
348
347
349
- elizaLogger . debug ( "formattedConversation: " , formattedConversation ) ;
350
-
351
348
const imageDescriptionsArray = [ ] ;
352
349
try {
353
- elizaLogger . debug ( 'Getting images' ) ;
354
350
for ( const photo of tweet . photos ) {
355
- elizaLogger . debug ( photo . url ) ;
356
351
const description = await this . runtime
357
352
. getService < IImageDescriptionService > (
358
353
ServiceType . IMAGE_DESCRIPTION
@@ -435,14 +430,31 @@ export class TwitterInteractionClient {
435
430
}
436
431
437
432
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
+ } ,
439
452
template :
440
453
this . runtime . character . templates
441
454
?. twitterMessageHandlerTemplate ||
442
455
this . runtime . character ?. templates ?. messageHandlerTemplate ||
443
456
twitterMessageHandlerTemplate ,
444
457
} ) ;
445
- elizaLogger . debug ( "Interactions prompt:\n" + context ) ;
446
458
447
459
const response = await generateMessageResponse ( {
448
460
runtime : this . runtime ,
@@ -597,12 +609,6 @@ export class TwitterInteractionClient {
597
609
visited . add ( currentTweet . id ) ;
598
610
thread . unshift ( currentTweet ) ;
599
611
600
- elizaLogger . debug ( "Current thread state:" , {
601
- length : thread . length ,
602
- currentDepth : depth ,
603
- tweetId : currentTweet . id ,
604
- } ) ;
605
-
606
612
if ( currentTweet . inReplyToStatusId ) {
607
613
elizaLogger . log (
608
614
"Fetching parent tweet:" ,
@@ -642,14 +648,6 @@ export class TwitterInteractionClient {
642
648
// Need to bind this context for the inner function
643
649
await processThread . bind ( this ) ( tweet , 0 ) ;
644
650
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
-
653
651
return thread ;
654
652
}
655
653
}
0 commit comments