How k31ner/asistente-de-ficha-tecnica works
Main Components
• Frontend/UI:
• The HTML templates (found in the templates folder: index.html, form.html, chatbot.html) form the user interface.
• The static directory (with images and potentially CSS/JS files) serves the frontend assets.
• Backend/API Layer:
• The FastAPI application is likely initialized in main.py.
• chatbot.py and prompt.py appear to handle the chatbot interactions and prompt handling, encapsulating the business logic.
• Database / Data Store:
• The db directory contains a sqlite3 database (chroma.sqlite3) and additional binary files inside a subfolder (likely used for managing vector data or related assets for the LLM).
• LLM Integration:
• Although the specific LLM details are “por definir”, the chatbot and prompt modules suggest a dedicated module for integrating the LLM functionality.
• Configuration & Dependency Management:
• The requirements.txt file will list the Python package dependencies for FastAPI and other libraries.
• Version Control & Miscellaneous:
• The .gitignore is used for managing source control exclusions.
Understand Component Relationships and Data Flow
• Users interact with the system via a web browser that loads the frontend (templates and static assets).
• When a user engages with the chatbot or submits a query (through the form), the request is sent via HTTP to the FastAPI backend.
• The FastAPI endpoints (likely defined or routed in main.py and associated modules) handle the requests and delegate to:
• The chatbot.py module for LLM-driven interactions.
• The prompt.py module for preparing or managing prompts.
• The backend may query the local database in the db folder (using the sqlite3 database and binary vector data) to retrieve or store context data, which supports the LLM’s operation.
• Finally, after processing the information (possibly calling an external LLM service or internal module), the response is rendered back on the frontend.