A travel planning agent powered by OpenAI and Pydantic AI that helps you plan your trips and answer travel-related questions.
pip install git+https://github.com/yourusername/travel-agent.gitgit clone https://github.com/yourusername/travel-agent.git
cd travel-agent
pip install -e .Create a .env file in the project root directory with your API keys:
cp .env.example .envThen edit the .env file with your actual API keys:
# OpenAI API Configuration
OPENAI_API_KEY=your-openai-api-key-here
# Google API Configuration (optional)
GOOGLE_CLIENT_API_KEY=your-google-client-api-key-here
GOOGLE_CSE_ID=your-google-cse-id-here
GOOGLE_API_KEY=your-google-api-key-herepython run_agent.py --query "what is my current location" --model openai:gpt-4o --env .envfrom agent import TravelAgent
from load_dotenv import load_dotenv
# Create a travel agent instance
load_dotenv() # Load environment variables from .env file
agent = TravelAgent()
# Ask a travel question
response, trace = agent.run("Plan a 3-day trip to Paris")
print(response)- "Plan a 5-day trip to Tokyo for a family of 4"
- "What's the best time to visit Greece?"
- "Suggest budget-friendly accommodations in Barcelona"
- "Create an itinerary for a weekend in New York City"
- AI-powered travel planning
- Comprehensive trip recommendations
- Message tracing for debugging
- Synchronous API for easy integration
- Python 3.8+
- OpenAI API key
- Internet connection
openai>=1.0.0pydantic-aipython-dotenv