AutoGPT: Send_tweet gives an error
⚠️ Search for existing issues first ⚠️
- I have searched the existing issues, and there is no existing issue for my problem
GPT-3 or GPT-4
- I am using Auto-GPT with GPT-3 (GPT-3.5)
Steps to reproduce 🕹
I get the following error while the send_tweet command using the stable version. The API keys should be correct.
NEXT ACTION: COMMAND = send_tweet ARGUMENTS = {‘text’: ‘Test’} SYSTEM: Command send_tweet returned: Error: ‘Forbidden’ object has no attribute ‘reason’
Current behavior 😯
No response
Expected behavior 🤔
No response
Your prompt 📝
# Paste your prompt here
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 28 (2 by maintainers)
I’ve figured it out using Bing! You need to update the code as @Kendhal7 mentioned, but V2 requires a bearer token and will need to setup OAuth 2.0 in your dev portal. Here’s the solution step-by-step (for free twitter API)
That should work 😃
Update: See @mossy426 solution below.
The problem is: for Free Twitter API account, it can only use Twitter API v2 for tweet creation. https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api
You can use
tweepy.Client
instead oftweepy.API
, which supports Twitter API v2.However, after I change to
tweepy.Client
, the following error occurs:I am not able to set the write permission for Access Token and Secret in Developer Portal. The official docs tell me only paid account can set permissions. https://developer.twitter.com/en/docs/apps/app-permissions https://stackoverflow.com/a/74495869
@mossy426 @Kendhal7 Thanks for your help! Can I make a pull request to wrap all the code changes and update readme document?
Try modifying the twitter.py file in /autogpt/commands/ folder with this:
What’s in the callback URI?