Prerequisites
Install the dependencies:Tweepy is a Python library for interacting with the X API.
Setup
-
Create X Developer Account
- Visit developer.x.com and apply for developer access
- Create a new project and app in your developer portal
-
Configure App Permissions
- Select Read and write to create posts and replies
- Select Read, write, and DMs if the agent will send direct messages
- Regenerate the access token and secret after changing app permissions
-
Generate API Credentials
- Navigate to your app’s “Keys and tokens” section
- Generate and copy these credentials:
- API Key & Secret
- Bearer Token
- Access Token & Secret
-
Configure Environment
Example
Replace@AgnoAgi with the X username associated with your access token.
cookbook/91_tools/x_tools.py
See the full XTools cookbook example.
Toolkit Params
Toolkit Functions
You can use
include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.