A conversational AI agent built with Pydantic AI that helps users reach gambling addiction support resources by composing and sending a support request email on their behalf.
Reply-To set to the user so support can respond directlypip install pydantic-ai pydantic
Set the following environment variables before running:
| Variable | Description | Default |
|---|---|---|
SMTP_HOST |
SMTP server hostname | smtp.gmail.com |
SMTP_PORT |
SMTP server port | 587 |
SMTP_USER |
Your sending email address | — |
SMTP_PASS |
Your SMTP password or App Password | — |
OPENAI_API_KEY |
OpenAI API key (if using GPT-4o) | — |
ANTHROPIC_API_KEY |
Anthropic API key (if using Claude) | — |
If using Gmail, you must generate an App Password (standard passwords won’t work with SMTP).
# Set credentials
export SMTP_USER="you@gmail.com"
export SMTP_PASS="your_16char_app_password"
export OPENAI_API_KEY="sk-..."
# Run
python agent.py
The agent will start an interactive session in your terminal. Type quit or exit to end the session.
In agent.py, replace the model line:
# Before (OpenAI)
from pydantic_ai.models.openai import OpenAIModel
model = OpenAIModel("gpt-4o")
# After (Anthropic)
from pydantic_ai.models.anthropic import AnthropicModel
model = AnthropicModel("claude-sonnet-4-20250514")
Then set your Anthropic API key:
export ANTHROPIC_API_KEY="sk-ant-..."
If you or someone you know needs help right now:
HOME to 741741MIT