Skip to content

raymelon/ai6z-twitter-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo demonstrates how to use ai6z/agent-twitter-client in various agentic frameworks

The idea is to demonstrate how ai6z/agent-twitter-client, an unofficial Twitter client, can be used in different agentic frameworks (Composio, CrewAI, etc.)

Table of Contents

  1. Use Cases
  2. DO THIS FIRST ⚠️
  3. Agent Demos (with and w/o agentic frameworks)

Use Cases

DO THIS FIRST ⚠️:

We need to setup ai6z/agent-twitter-client first

agent-twitter-client setup

  1. Make sure the current working directory is on /twitter-clients/unfollower-client

  2. Install dependencies

npm i

Agent Demos (with and w/o agentic frameworks)

  1. Standalone + cron (no agentic framework)
  2. Composio
  3. CrewAI (🚧 WIP 🚧)

Running agent without agentic framework

Setup (skip this if you accomplished agent-twitter-client setup already)

  1. Make sure the current working directory is on /twitter-clients/unfollower-client

  2. Install dependencies

npm i
  1. Make sure /twitter-clients/unfollower-client/.env is populated
# /twitter-clients/unfollower-client/.env

TWITTER_USERNAME=    # Account username
TWITTER_PASSWORD=""    # Account password
TWITTER_EMAIL=       # Account email
PROXY_URL=           # HTTP(s) proxy for requests (necessary for browsers)

# Twitter API v2 credentials for tweet and poll functionality
TWITTER_API_KEY=               # Twitter API Key
TWITTER_API_SECRET_KEY=        # Twitter API Secret Key
TWITTER_ACCESS_TOKEN=          # Access Token for Twitter API v2
TWITTER_ACCESS_TOKEN_SECRET=   # Access Token Secret for Twitter API v2

TELEGRAM_BOT_NEWTWITTERFOLLOWERSBOT_TOKEN=
TELEGRAM_BOT_NEWTWITTERFOLLOWERSBOT_CHATID=
TELEGRAM_BOT_AUTOREPLIERTWITTERBOT_TOKEN=

BASE_PATH=../twitter-clients/unfollower-client/    # Base directory for storing data files

To run agent as standalone

node run-standalone.js

Using ai6z/agent-twitter-client in Composio

To set up Composio for this project:

  1. Make sure the current working directory is on /composio by running
cd composio
  1. Install dependencies
npm i
  1. Make sure /composio/.env is populated
# /composio/.env

COMPOSIO_API_KEY=XXX # required

GOOGLE_GENERATIVE_AI_API_KEY=XXX # populate when using Google Gemini via Vercel AI Toolset

OPENAI_API_KEY=sk-proj-XXX # populate applies when using OpenAI via Open AI Toolset / Langchain Toolset

TWITTER_ACCOUNT_TO_TRACK_UNFOLLOWERS=pseudokid # or your Twitter username

To run agents using Composio

  1. Agent demo using OpenAI (Open AI chat client and Open AI Toolset) - based on https://docs.composio.dev/patterns/tools/build-tools/custom-action-without-auth
node agent-openai.js
  1. Agent demo using Google Gemini and Vercel AI SDK (Google Gemini and Vercel AI Toolset)
node agent-gemini-vercel.js

To setup CrewAI for this project:

  1. Make sure the current working directory is on /crewai_agent by running
cd crewai_agent
  1. Make sure /crewai_agent/.env is populated
# /crewai_agent/.env
MODEL=gemini/gemini-1.5-pro
GEMINI_API_KEY=XXX
  1. Follow CrewAI installation guide

Skip setting up a new crew because we already have a crew in place for this project

To run agents using CrewAI

crewai run

or follow CrewAI's guide to running your crew

About

This repo demonstrates how to use https://github.com/ai16z/agent-twitter-client in different agentic frameworks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published