How nnd-dev/aicourse-group7 works
Project type and purpose
• From the README (“AI Travel Planner”) and file tree, this is a Python-based CLI application that guides the user through planning a trip by chatting with an AI, checking weather, suggesting destinations, and building an itinerary. It is not a web or microservices system, but a single‐process CLI tool that orchestrates interactions with an external AI/HTTP API.
File structure
• Top-level files:
• main.py – application entrypoint
• requirements.txt – dependencies
• README.md – documentation
• src/
• src/presentation/cli/ai_travel_cli.py – CLI module implementing user prompts and menu
• No explicit “domain” or “data” directories—business logic and API calls are likely embedded in the CLI or imported by it.
README for additional insights
• Dependencies: openai, httpx, colorama
• Runtime flow:
1. User runs python main.py
2. CLI prompts for API key
3. “Start Planning” menu => interactive chat
4. Behind the scenes, HTTP requests to the AI portal, weather calls, itinerary assembly.
a. Main components:
• User (Terminal)
• CLI Layer (ai_travel_cli.py + main.py)
• Application Logic/Service Layer (modules or functions that handle chat state, preference extraction, weather lookup, itinerary generation)
• External AI API (openai or custom endpoint)
• External Weather Service (if separate)
• Configuration store (local env or config file for API key)
b. Relationships & data flow:
• User → CLI Layer: keyboard input
• CLI Layer → Service Layer: method calls with user messages
• Service Layer → External AI API (via httpx/openai client) → returns AI response
• Service Layer → External Weather Service (optional) → returns weather data
• Service Layer → CLI Layer: formatted response strings
• CLI Layer → User: console output (with colorama styling)
c. Architectural patterns/principles:
• Layered/Onion or Hexagonal architecture: the CLI is an adapter, business logic is core, external services are ports
• Single responsibility: each module handles one aspect (presentation vs. API integration)
d. Key technologies/frameworks:
• Python 3.8+
• openai SDK for chat
• httpx for HTTP requests
• colorama for terminal UI
Detailed, essential elements
• Do not clutter with trivial file names; instead, focus on logical modules
• Sequence: user input → CLI → business logic → external API → response → CLI → user
• Configuration retrieval (API key) as a separate step or component