How codewithnavy/liaplusai_assignment works
This is a Flask chatbot with per-message and conversation-level sentiment reporting. The main workflow is browser message submission, sentiment scoring and reply generation, session-backed conversation history, then an end-of-conversation report with aggregate sentiment and a mood trend. The graph also shows the documented settings and diagnostics pages and optional OpenAI integration. Source excerpts establish the route and module calls; template relationships are supported by the render calls in app.py. Other UI details are represented at the template level.
Main entry points: app.py Chat routes · style.css Page styling · sentiment.py Message scoring · index.html Chat page
Components 17
Web application
- Chat page
templates/index.html - Sentiment report
templates/result.html - Settings and validation
app.py - Settings page
templates/settings.html - Status and troubleshooting
app.py - Status page
templates/status.html - Troubleshoot page
templates/troubleshoot.html - Page styling
static/style.css
Chat workflow
- Chat routes
app.py - Session history
app.py - Fallback replies
app.py
Sentiment analysis
- Message scoring
sentiment.py - Conversation analysis
sentiment.py
Reply integrations
- LLM reply adapter
llm.py
Other components
- Browser user
- OpenAI API
- NLTK VADER
Connections 23
- Browser user → Chat routes: submits messages
app.py - Chat routes → Chat page: renders chat
app.py - Chat routes → Session history: reads and updates
app.py - Chat routes → Message scoring: scores message
app.py - Chat routes → LLM reply adapter: requests reply
app.py - Chat routes → Fallback replies: uses on failure
app.py - LLM reply adapter → OpenAI API: requests completion
llm.py - Message scoring → NLTK VADER: scores with
sentiment.py - Browser user → Chat routes: ends conversation
app.py - Chat routes → Conversation analysis: aggregates history
app.py - Conversation analysis → Message scoring: scores user messages
sentiment.py - Chat routes → Sentiment report: renders report
app.py - Browser user → Settings and validation: manages settings
app.py - Settings and validation → Settings page: renders settings
app.py - Browser user → Status and troubleshooting: checks status
app.py - Status and troubleshooting → Status page: renders status
app.py - Browser user → Status and troubleshooting: opens troubleshooting
app.py - Status and troubleshooting → Troubleshoot page: renders page
app.py - Chat page → Page styling: uses styling
- Sentiment report → Page styling: uses styling
- Settings page → Page styling: uses styling
- Status page → Page styling: uses styling
- Troubleshoot page → Page styling: uses styling