Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add YouTube connection #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chefron
Copy link
Contributor

@chefron chefron commented Jan 8, 2025

YouTube Connection

This PR adds a YouTube connection that allows agents to monitor and respond to comments across their YouTube channel.

Key Features

  • Fetches recent comments on all videos
  • Parses video captions for context
  • Generates personalized responses using the agent's system prompt
  • Filters out comments already replied to
  • Supports both automatic monitoring and single-comment responses

Commands

  • get-recent-comments: List recent comments from channel
  • reply-to-comment [comment_id]: Generate and post a reply to a specific comment
  • start-bot: Begin autonomous comment monitoring and responding
  • stop-bot: Stop autonomous monitoring

Architecture Tweaks

Due to the bot operating outside the main agent loop, traditional action registration (like Twitter uses) wasn't viable. The solution was to create a connection->manager->agent chain to allow access to the agent personality's. Core bot logic lives in youtube_connection.py, which handles API interactions, caption processing, and response generation. (I should note that I'm totally open to changing this if there's a cleaner way to do it. Suggestions welcome!)

Testing

Verified with multiple agents, comment types, and caption integration. (Please note that while the bot detects both top-level comments and replies to existing comments, YouTube's API currently only supports responding to top-level comments.)

Future Development

  • Add capability to comment on other channels' videos, with consideration for rate limiting and spam prevention
  • Give the bot the ability to evaluate the sentiment and content of each comment to determine if a reply is warranted, rather than automatically replying to every comment

@chefron
Copy link
Contributor Author

chefron commented Jan 19, 2025

Hi! I'm sure you guys are busy, but I just wanted to quickly check in on this PR. Happy to make any adjustments needed if you think the plugin would be a useful addition to the framework. Or if you don't want it at this time, that's completely fine too.

Also, for future reference, are there any contribution guidelines or preferred communication channels (like Discord or Telegram) I should know about? Thank you!

@rux-eth
Copy link
Collaborator

rux-eth commented Feb 21, 2025

adding to roadmap, closing for now

@rux-eth rux-eth closed this Feb 21, 2025
@rux-eth rux-eth reopened this Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants