How gustavodesousalima/api-climaia works
Project type and purpose
• This is a full-stack API service (back-end only) for “Intelligent Weather Forecasting” using Flask and AI.
• Purpose: receive natural-language weather queries (in Portuguese), interpret them via GPT-3.5 (LangChain), fetch real-time data from OpenWeatherMap, and return a conversational response.
File structure
• Top-level files:
• app.py – Flask app entrypoint and routing
• requirements.txt / .env.example – dependencies and configuration
• src/config/settings.py – environment and API keys loader
• src/controllers/weather_controller.py – Flask endpoint logic
• src/services/agent_service.py – LangChain/OpenAI orchestration
• src/services/weather_service.py – OpenWeatherMap API wrapper
README for additional insights
• Stack: Python 3.8+, Flask for HTTP API, LangChain + OpenAI GPT-3.5 for NLU, OpenWeatherMap for data.
• Exposes endpoint POST /api/chat, expects JSON { "message": "..." }.