This example demonstrates an agent setup as a terminal style chatbot with access to Twitter (X) API actions.
- "What are my account details?"
- "Please post a message for me to Twitter"
- "Please get my mentions"
- "Please post responses to my mentions"
- Node.js 18+
- OpenAI API Key
- Twitter (X) API Keys
- Visit the Twitter (X) Developer Portal
- Navigate to your project
- Navigate to your application
- Edit "User authentication settings"
- Set "App permissions" to "Read and write and Direct message"
- Set "Type of App" to "Web App, Automated app or Bot"
- Set "App info" urls
- Save
- Navigate to "Keys and tokens"
- Regenerate all keys and tokens
Before using the example, ensure that you have the correct version of Node.js installed. The example requires Node.js 18 or higher. You can check your Node version by running:
node --version
npm --version
npm install
Ensure the following vars are set in .env:
- "OPENAI_API_KEY"
- "TWITTER_ACCESS_TOKEN"
- "TWITTER_ACCESS_TOKEN_SECRET"
- "TWITTER_API_KEY"
- "TWITTER_API_SECRET"
npm start