Prerequisites
- Python 3.10+
- A Twexapi API key
- An LLM API key supported by Pydantic AI
Install
Full example
When to use schemas
Use a Pydantic output schema whenever another system will read the result. Good fields includetweet_id, user_id, route_used, has_more, next_cursor, and a normalized rows array.
Handoff checklist
Write actions
For posting, replying, following, blocking, or other side-effecting endpoints, add a schema field such asrequires_human_confirmation: bool and stop before calling read_only: false tools.
Environment variables
.env