feat: TwitterInteractionClient response handling and boredom provider
Relates to:
https://x.com/shawmakesmagic/status/1858248520060567911
Risks
Low
What does this PR do?
- Added boredom score if conversation is too long or between same people
- Added error handling to the interaction loop using try-catch blocks to ensure the system keeps running smoothly even if an error occurs.
- Improved tweet processing by introducing methods to filter out duplicates (filterValidTweets) and group tweets by conversation (groupTweetsByConversation) for more context-aware responses.
- Made the code more modular by moving timeline formatting (getFormattedTimeline) and response evaluation (evaluateShouldRespond) into their own dedicated methods, making the logic easier to read and reuse.
- Enhanced conversation handling by grouping tweets by conversation ID, enabling the bot to respond with better context for multi-tweet threads.
- Cleaned up logging for better visibility into what the bot is doing and easier tracking of errors.
- Refactored large, complex methods into smaller, single-purpose functions, making the code easier to maintain, debug, and extend in the future.
Please update the PR to pass the PR Title Check thank you!
LGTM need some minor clean up please address then will approve!
Everything commited and issue #408 created! Thank you
Amazing - thank you so much!
@monilpat you sure? we have conflicts in packages/client-twitter/src/interactions.ts
I can't see the conflicts somehow. That is so weird. Yes - please resolve the conflicts first. Sending back to reviewer.
@DanielHighETH would you fix the merge conflict in packages/client-twitter/src/interactions.ts so we can finish the review and merge this in?
@DanielHighETH would you fix the merge conflict in
packages/client-twitter/src/interactions.tsso we can finish the review and merge this in?
@jkbrooks @monilpat a new code was merged 3 hours ago from https://github.com/ai16z/eliza/pull/383 I'm not really sure if we should use my refractored code in this new code
@DanielHighETH looks like there is still some value in your PR, even though we also have #383
Please let us know if you think you can get to the merge conflict, we are still happy to merge. Otherwise, no worries, we can close this PR.
Thanks for doing this and addressing all comments. Sorry to bother you again, but can we add any tests or screengrabs confirming that this does in fact improve the conversation and address? https://x.com/shawmakesmagic/status/1858248520060567911
Thanks for doing this and addressing all comments. Sorry to bother you again, but can we add any tests or screengrabs confirming that this does in fact improve the conversation and address? https://x.com/shawmakesmagic/status/1858248520060567911
Hey, I have no idea how to do it actually