A curated collection of practical AI projects implementing OCR systems, RAG, AI agents, and other AI use cases.
audit: fix travel_planner_agent - replace em dashes across README, app.py, agent.py, .env.example
Tiioluwani6de401ab06b8
diff --git a/ai_agents/travel_planner_agent/.env.example b/ai_agents/travel_planner_agent/.env.exampleindex e5a7978..351019a 100644--- a/ai_agents/travel_planner_agent/.env.example+++ b/ai_agents/travel_planner_agent/.env.example@@ -1,8 +1,8 @@-# Orq.ai — LLM routing (deepseek-v4-flash)+# Orq.ai - LLM routing (deepseek-v4-flash)ORQ_API_KEY=your_orq_api_key_here-# OpenWeatherMap — current weather and forecast+# OpenWeatherMap - current weather and forecastOPENWEATHER_API_KEY=your_openweather_api_key_here-# ExchangeRate-API — currency conversion+# ExchangeRate-API - currency conversionEXCHANGERATE_API_KEY=your_exchangerate_api_key_herediff --git a/ai_agents/travel_planner_agent/README.md b/ai_agents/travel_planner_agent/README.mdindex d7defb0..fc742ea 100644--- a/ai_agents/travel_planner_agent/README.md+++ b/ai_agents/travel_planner_agent/README.md@@ -1,10 +1,10 @@# Travel Planner Agent-**Your AI co-pilot for end-to-end trip planning — from weather and budget to packing lists and day-by-day itineraries.**+**Your AI co-pilot for end-to-end trip planning - from weather and budget to packing lists and day-by-day itineraries.**## Overview-Travel Planner Agent is a conversational travel assistant that helps you plan trips through natural language. Describe where you want to go, when, your budget, and what you enjoy — the agent gathers any missing details, researches your destination with live tools, and returns a structured travel plan you can use right away.+Travel Planner Agent is a conversational travel assistant that helps you plan trips through natural language. Describe where you want to go, when, your budget, and what you enjoy - the agent gathers any missing details, researches your destination with live tools, and returns a structured travel plan you can use right away.Built with LangChain and Streamlit, it combines real-time weather, currency conversion, web research, and smart packing recommendations into a single chat experience.@@ -14,13 +14,13 @@ Built with LangChain and Streamlit, it combines real-time weather, currency conv## Features-- **Conversational trip planning** — describe trips in plain English; the agent asks follow-up questions when details are missing-- **Live weather data** — current conditions and a 5-day forecast for any destination via OpenWeatherMap-- **Budget and currency tools** — convert amounts between currencies and estimate trip costs via ExchangeRate-API-- **Destination research** — attractions, food, culture, and travel tips sourced from DuckDuckGo web search-- **Smart packing lists** — recommendations tailored to forecast, climate, and trip length-- **Structured travel plans** — overview, weather, budget, highlights, packing, and a suggested day-by-day itinerary-- **Session-based chat history** — multi-turn conversations with context preserved in the Streamlit UI+- **Conversational trip planning** - describe trips in plain English; the agent asks follow-up questions when details are missing+- **Live weather data** - current conditions and a 5-day forecast for any destination via OpenWeatherMap+- **Budget and currency tools** - convert amounts between currencies and estimate trip costs via ExchangeRate-API+- **Destination research** - attractions, food, culture, and travel tips sourced from DuckDuckGo web search+- **Smart packing lists** - recommendations tailored to forecast, climate, and trip length+- **Structured travel plans** - overview, weather, budget, highlights, packing, and a suggested day-by-day itinerary+- **Session-based chat history** - multi-turn conversations with context preserved in the Streamlit UI## Tech Stack@@ -37,9 +37,9 @@ Built with LangChain and Streamlit, it combines real-time weather, currency conv- **Python 3.10 or higher**- API keys for:- - [Orq.ai](https://orq.ai) — LLM routing- - [OpenWeatherMap](https://openweathermap.org/api) — weather and forecast data- - [ExchangeRate-API](https://www.exchangerate-api.com/) — currency conversion+ - [Orq.ai](https://orq.ai) - LLM routing+ - [OpenWeatherMap](https://openweathermap.org/api) - weather and forecast data+ - [ExchangeRate-API](https://www.exchangerate-api.com/) - currency conversion## Installation@@ -123,12 +123,12 @@ Streamlit opens the app in your browser (typically at `http://localhost:8501`).Once it has enough context, the agent calls its tools and delivers a structured plan with:-1. **Trip Overview** — destination, dates, duration, and traveler preferences-2. **Weather** — current conditions and a forecast summary from OpenWeatherMap-3. **Budget & Currency** — cost estimates and currency conversions from ExchangeRate-API-4. **Destination Highlights** — attractions, dining, culture, and travel tips from web research-5. **Packing List** — clothing and essentials based on weather and trip length-6. **Suggested Itinerary** — a day-by-day outline aligned with your interests and schedule+1. **Trip Overview** - destination, dates, duration, and traveler preferences+2. **Weather** - current conditions and a forecast summary from OpenWeatherMap+3. **Budget & Currency** - cost estimates and currency conversions from ExchangeRate-API+4. **Destination Highlights** - attractions, dining, culture, and travel tips from web research+5. **Packing List** - clothing and essentials based on weather and trip length+6. **Suggested Itinerary** - a day-by-day outline aligned with your interests and scheduleThe agent uses tools for all factual data (weather, rates, research) rather than guessing. If details are missing, it will ask clarifying questions before building the full plan.diff --git a/ai_agents/travel_planner_agent/agent.py b/ai_agents/travel_planner_agent/agent.pyindex f1909e2..ddee5df 100644--- a/ai_agents/travel_planner_agent/agent.py+++ b/ai_agents/travel_planner_agent/agent.py@@ -17,15 +17,15 @@ SYSTEM_PROMPT = """You are Travel Planner Agent, an expert travel planning assisHelp users plan trips end to end. When they describe a trip, gather missing details (destination, dates, budget, interests, home currency) through natural conversation, then use your tools to research and build a comprehensive plan.-Always use tools for factual data — never invent weather, exchange rates, or attraction details.+Always use tools for factual data - never invent weather, exchange rates, or attraction details.When you have enough information, return a structured travel plan with these sections:-1. **Trip Overview** — destination, dates, duration, traveler context-2. **Weather** — current conditions and forecast summary (from weather tool)-3. **Budget & Currency** — estimated costs and conversions (from currency tool)-4. **Destination Highlights** — attractions, food, culture, tips (from research tool)-5. **Packing List** — tailored recommendations (from packing tool; pass weather summary)-6. **Suggested Itinerary** — day-by-day outline based on interests and duration+1. **Trip Overview** - destination, dates, duration, traveler context+2. **Weather** - current conditions and forecast summary (from weather tool)+3. **Budget & Currency** - estimated costs and conversions (from currency tool)+4. **Destination Highlights** - attractions, food, culture, tips (from research tool)+5. **Packing List** - tailored recommendations (from packing tool; pass weather summary)+6. **Suggested Itinerary** - day-by-day outline based on interests and durationBe friendly, concise, and practical. Ask clarifying questions when key details are missing."""@@ -74,7 +74,7 @@ def get_weather(destination: str) -> str:f"Weather for {current.get('name', destination)}, {current.get('sys', {}).get('country', '')}","","Current:",- f" {weather.get('main', 'N/A')} — {weather.get('description', 'N/A')}",+ f" {weather.get('main', 'N/A')} - {weather.get('description', 'N/A')}",f" Temperature: {main.get('temp', 'N/A')}°C (feels like {main.get('feels_like', 'N/A')}°C)",f" Humidity: {main.get('humidity', 'N/A')}%",f" Wind: {wind.get('speed', 'N/A')} m/s",@@ -92,7 +92,7 @@ def get_weather(destination: str) -> str:w = (entry.get("weather") or [{}])[0]m = entry.get("main", {})lines.append(- f" {day}: {w.get('main', 'N/A')} — "+ f" {day}: {w.get('main', 'N/A')} - "f"{m.get('temp_min', 'N/A')}°C to {m.get('temp_max', 'N/A')}°C, "f"{w.get('description', '')}")@@ -229,7 +229,7 @@ def get_packing_recommendations(if trip_days > 5:extras.append("Laundry soap sheets or plan for laundry mid-trip")if trip_days > 10:- extras.append("Extra outfit rotation — pack for 7–10 days and wash")+ extras.append("Extra outfit rotation - pack for 7–10 days and wash")lines = [f"Packing list for {destination} ({trip_days} days)",diff --git a/ai_agents/travel_planner_agent/app.py b/ai_agents/travel_planner_agent/app.pyindex 017286b..350813f 100644--- a/ai_agents/travel_planner_agent/app.py+++ b/ai_agents/travel_planner_agent/app.py@@ -1,4 +1,4 @@-"""Travel Planner Agent — Streamlit chat interface."""+"""Travel Planner Agent - Streamlit chat interface."""import os@@ -59,7 +59,7 @@ def main() -> None:with st.sidebar:st.title("✈️ Travel Planner")st.markdown(- "Plan your trip through conversation — weather, budget, "+ "Plan your trip through conversation - weather, budget, ""highlights, and packing in one place.")if st.button("Clear conversation", use_container_width=True):@@ -67,7 +67,7 @@ def main() -> None:st.rerun()st.title("Travel Planner Agent")- st.caption("Describe your trip in natural language — I'll research and build your plan.")+ st.caption("Describe your trip in natural language - I'll research and build your plan.")if st.session_state.get("env_error"):st.error(st.session_state.env_error)