This pull request introduces major enhancements to the syllabus generator feature in the Kai backend project. The updated functionality enables educators to create comprehensive syllabi tailored to specific classes by providing details such as grade level, subject, syllabus type, and instructions. This AI-driven tool now supports downloadable PDF and Word formats and integrates a meme generator to add relevant visuals, making the process more engaging and enjoyable for educators and students.
Changes
Sorting Parameter Enhancement: Added sorting by grade level, subject, and context-keyword section to ensure the generated syllabi are highly relevant and organized.
PDF/Word Downloadable Feature: Enabled the option to download syllabi in PDF and Word formats for easier distribution.
Meme Scraper Integration: Integrated a meme generator using the Reddit API to incorporate relevant memes, enhancing the visual appeal of the syllabi.
Prompting Structure & Context: Developed six distinct prompts for various syllabus components, improving the coherence and accuracy of the generated outputs.
OOP Design: Refactored the code by introducing a SyllabusGenerator class to encapsulate all functions, resulting in cleaner and more reusable code.
Testing Enhancements: Added a search class for external answer verification and improved schema consistency by manually extracting JSON objects when necessary.
Additional Parameters: Introduced Syllabus_type and keywords parameters, later replaced with an instructions field for greater flexibility.
Testing
Unit Tests: Conducted extensive unit tests to ensure that returned strings from the LLM are in the intended format, focusing on flexibility and quality.
Integration Testing: Verified the overall functionality of the syllabus generation process, ensuring it meets the specified requirements.
Meme Generator Testing: Tested the meme generator integration using the Reddit API to ensure relevant and appropriate images are retrieved.
Results
The enhancements introduced in this pull request significantly improve the dynamic, personalized, and aligned nature of the syllabus generation process. The final output is a detailed syllabus that covers all necessary components, tailored to the specific needs of educators based on grade, subject, syllabus type, and instructions.
Notes
Model Hallucination Risk: The LLM model has a probability of generating responses that may not conform to the expected format. The structured outputs feature in the OpenAI ChatGPT model can be used to mitigate this risk.
Retrieval-Augmented Generation (RAG): Future improvements could include integrating a RAG approach, which would involve searching a dedicated database of syllabi to enhance the relevance and accuracy of the generated content.
How to Test
Environment Variables:
Create a programmable search engine and a Reddit account.
Set the following variables in the .env file:
SEARCH_ENGINE_ID
API_KEY
NAME
PASSWORD
CLIENT_ID
CLIENT_SECRET
USER_AGENT
Pull Request - Epic 7.71 Syllabus Generator
Summary
This pull request introduces major enhancements to the syllabus generator feature in the Kai backend project. The updated functionality enables educators to create comprehensive syllabi tailored to specific classes by providing details such as grade level, subject, syllabus type, and instructions. This AI-driven tool now supports downloadable PDF and Word formats and integrates a meme generator to add relevant visuals, making the process more engaging and enjoyable for educators and students.
Changes
SyllabusGenerator
class to encapsulate all functions, resulting in cleaner and more reusable code.Syllabus_type
andkeywords
parameters, later replaced with aninstructions
field for greater flexibility.Testing
Results
The enhancements introduced in this pull request significantly improve the dynamic, personalized, and aligned nature of the syllabus generation process. The final output is a detailed syllabus that covers all necessary components, tailored to the specific needs of educators based on grade, subject, syllabus type, and instructions.
Notes
How to Test
.env
file:Screenshots