Conversation
…ctor database with the 3 most recent user questions
…commit-config.yaml
…e user level selection on click
…estions into a module
There was a problem hiding this comment.
Pull request overview
This PR modernizes the UI, refactors code organization, and fixes various spelling errors across the codebase. It introduces a centralized messages module, updates datetime handling to use UTC, improves user level data management, and enhances the Streamlit UI with better logo handling and level change callbacks.
Changes:
- Extracted message constants to a centralized
src/messages.pymodule for better maintainability - Updated datetime usage to include UTC timezone awareness
- Added level change callback with conversation reset functionality
- Enhanced UI with improved logo display and sidebar spacing adjustments
- Fixed multiple French spelling errors in chapter titles and user-facing messages
- Improved query formatting to limit context to recent questions
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/messages.py | New file centralizing chatbot message constants (out-of-scope, unrelated queries, suggestions) |
| src/streamlit_app.py | UI improvements including logo handling, level change callbacks, query formatting updates, and parameter renaming for clarity |
| src/query_chatbot.py | Import updates, UTC datetime usage, function signature changes, and code simplifications |
| src/logger.py | Added ui_logger parameter documentation for append mode logging |
| prompt_templates/common.txt | Added user level placeholder and formal address ("vouvoiement") instruction |
| environment.yml | Fixed spelling: "formaters" → "formatters" |
| data/chapters_and_levels.yaml | Fixed French translations and spelling in chapter titles |
| config_app.toml | Removed trailing newline |
| assets/style.css | Formatting cleanup (trailing whitespace) |
| .pre-commit-config.yaml | Updated tool versions and expanded typos exclusion pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 12 changed files in this pull request and generated 9 comments.
Comments suppressed due to low confidence (1)
src/streamlit_app.py:348
generate_responsedocuments/typescontextasstr, but it is used as a list of retrievedDocumentchunks (compared to[]and passed asrelevant_chunks). Update the type hints/docstring tolist[Document](or similar) to match actual usage and avoid confusing callers/tools.
def generate_response(
user_query: str,
context: str,
model_name: str,
provider_llm_name: str,
prompt_path: str,
student_level: str | None,
level_relevant_chapters: list[str],
course_level_infos: dict[str, CourseLevel],
) -> tuple[str, int, int]:
"""Generate a response to the user question.
Parameters
----------
user_query : str
The user question.
context : str
The relevant context retrieved from the vector database.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.