How thifreal/chatbotapi works
This repository exposes a FastAPI chatbot: a client submits a message, the chat route validates it, calls the chat service, and returns a typed reply. The service reads cached settings and calls Azure OpenAI; separate routes render a small HTML interface and save an API key to .env. The README describes a RAG pipeline with ingestion and FAISS, but those implementation files are absent from the supplied tree. That documented capability is shown as unimplemented here; the sampled runtime instead calls Azure chat directly.
Main entry points: routes.py Routes · chat_service.py Chat service · config.py Settings · main.py FastAPI app
Components 14
API and UI
- FastAPI app
ChatbotAPI/app/main.py - Routes
ChatbotAPI/app/api/routes.py - Chat template
ChatbotAPI/app/templates/index.html
Chat runtime
- Chat request
ChatbotAPI/app/schemas/chat.py - Chat response
ChatbotAPI/app/schemas/chat.py - Chat service
ChatbotAPI/app/services/chat_service.py
Configuration
- Settings
ChatbotAPI/app/config.py - .env settings
Documented RAG
- RAG pipeline
- Document ingestion
- FAISS index
- OpenAI embeddings
Other components
- Chat client
- Azure OpenAI
Connections 16
- Chat client → FastAPI app: sends requests
README.md - FastAPI app → Routes: includes router
ChatbotAPI/app/main.py - Routes → Chat request: validates payload
ChatbotAPI/app/api/routes.py - Routes → Chat service: calls
ChatbotAPI/app/api/routes.py - Chat service → Settings: loads settings
ChatbotAPI/app/services/chat_service.py - Settings → .env settings: reads settings
ChatbotAPI/app/config.py - Chat service → Azure OpenAI: requests completion
ChatbotAPI/app/services/chat_service.py - Routes → Chat response: builds response
ChatbotAPI/app/api/routes.py - Routes → Chat template: renders template
ChatbotAPI/app/api/routes.py - Routes → Settings: loads settings
ChatbotAPI/app/api/routes.py - Routes → .env settings: writes API key
ChatbotAPI/app/api/routes.py - Chat client → RAG pipeline: asks questions
README.md - RAG pipeline → Document ingestion: uses indexed documents
README.md - Document ingestion → OpenAI embeddings: generates embeddings
README.md - Document ingestion → FAISS index: saves index
README.md - RAG pipeline → FAISS index: searches index
README.md