How yashasvi1914/ai-chatbot works
This repository implements a browser-based AI chatbot with a FastAPI backend. The main workflow sends a user message from the frontend to the chat endpoint, generates a Gemini response, converts it to HTML, and displays it. The backend also exposes separate YouTube transcript retrieval and transcript summarization endpoints; the README does not document these capabilities, but they are explicit in the sampled API source. No transcript or summary UI is shown. The graph follows visible calls and routes; external Gemini and YouTube service details are limited to what the source demonstrates.
Main entry points: index.py Chat endpoint · app.js Chat interface · gemini_service.py Gemini generation service
Components 12
Chat client
- Chat interface
frontend/app.js
Backend API
- FastAPI application
backend/index.py - Chat endpoint
backend/index.py - Markdown conversion
backend/index.py - Transcript endpoint
backend/index.py - Summarization endpoint
backend/index.py - Study prompt
backend/index.py - Structured result parsing
backend/index.py
AI services
- Gemini generation service
backend/gemini_service.py
Other components
- User
- YouTube transcript API
- Google Gemini
Connections 13
- User → Chat interface: enters messages
frontend/app.js - Chat interface → Chat endpoint: posts message
frontend/app.js - FastAPI application → Chat endpoint: registers route
backend/index.py - Chat endpoint → Gemini generation service: generates reply
backend/index.py - Gemini generation service → Google Gemini: requests generation
backend/gemini_service.py - Chat endpoint → Markdown conversion: converts reply
backend/index.py - Chat endpoint → Chat interface: returns HTML reply
frontend/app.js - FastAPI application → Transcript endpoint: registers route
backend/index.py - Transcript endpoint → YouTube transcript API: fetches transcript
backend/index.py - FastAPI application → Summarization endpoint: registers route
backend/index.py - Summarization endpoint → Study prompt: builds prompt
backend/index.py - Summarization endpoint → Gemini generation service: generates study material
backend/index.py - Summarization endpoint → Structured result parsing: parses model output
backend/index.py