This PR allows educators to generate syllabi using different academic and strategic attributes. We based our research in this MIT Article about Syllabus Creation Moreover, educators can specify the course content with the extended file support implemented with the following file types for a better domain-specific adaptation:
PDF
CSV
TXT
MD
URL (Such as Wikipedia or other source with info.)
PPTX
DOCX
XLS / XLSX
XML
GOOGLE DOCS
GOOGLE SHEETS
GOOGLE SLIDES
GOOGLE PDF
IMAGES (PNG / JPG / JPEG)
Changes
Create a new tool called syllabus_generator with its appropriate metadata.json.
Reused the document loaders from Epic 7.2 #61.
Created a new tool.py for adding the new functionalities and Pydantic schemas for generating the syllabi.
Created a new core.py for extending the file support with the file_url and file_type attributes.
Reused the util file allowed_file_extensions_dynamo.py for a robust approach in the file type management from Epic 7.2 #61.
Created new Error Classes for improving the error mapping process.
Created new prompt templates for managing text, youtube videos and structured/tabular data in a personalized way.
Enabled a Computer Vision approach for generating syllabi from images as an innovative proposal for the project.
Testing
Each document loader was tested using pytest (Managing appropriate scenarios and edge cases).
Results
All document loaders are working appropriately with the optimal results.
Notes
For Google Docs, Slides, Sheets and PDF files:
Those files need to be shared as public in Google Drive.
They need to be uploaded to Google Drive. If a Google File is created in Google Drive, it needs to be downloaded and then uploaded to be detected. This was the most appropriate approach that we discovered as the GoogleDriver loader from LangChain works with OAuth2, which is not appropriate for production deployment.
How to Test
Clone the repo in your local
Create and activate virtual environment
Use pip install -r requirements.txt to install required libraries.
Create .env file with ENV_TYPE, GCP_PROJECT_ID and GOOGLE_API_KEY fields. Env type is dev, gcp_project_id is your project id from cloud console project, google_api_key is your api key from AI studio.
Then type ./local-start.sh to start the application.
Add sample requests and responses for each file type as mentioned above in screenshots and test it.
class CourseInformation(BaseModel):
course_title: str = Field(description="The course title")
grade_level: str = Field(description="The grade level")
description: str = Field(description="The course description")
class InstructorInformation(BaseModel):
name: str = Field(description="The instructor name")
title: str = Field(description="The instructor title")
description_title: str = Field(description="The description of the instructor title")
class CourseDescriptionObjectives(BaseModel):
objectives: List[str] = Field(description="The course objectives")
intended_learning_outcomes: List[str] = Field(description="The intended learning outcomes of the course")
class CourseContentItem(BaseModel):
unit_time: str = Field(description="The unit of time for the course content")
unit_time_value: int = Field(description="The unit of time value for the course content")
topic: str = Field(description="The topic per unit of time for the course content")
class PoliciesProcedures(BaseModel):
attendance_policy: str = Field(description="The attendance policy of the class")
late_submission_policy: str = Field(description="The late submission policy of the class")
academic_honesty: str = Field(description="The academic honesty policy of the class")
class AssessmentMethod(BaseModel):
type_assessment: str = Field(description="The type of assessment")
weight: int = Field(description="The weight of the assessment in the final grade")
class AssessmentGradingCriteria(BaseModel):
assessment_methods: List[AssessmentMethod] = Field(description="The assessment methods")
grading_scale: dict = Field(description="The grading scale")
class LearningResource(BaseModel):
title: str = Field(description="The book title of the learning resource")
author: str = Field(description="The book author of the learning resource")
year: int = Field(description="The year of creation of the book")
class CourseScheduleItem(BaseModel):
unit_time: str = Field(description="The unit of time for the course schedule item")
unit_time_value: int = Field(description="The unit of time value for the course schedule item")
date: str = Field(description="The date for the course schedule item")
topic: str = Field(description="The topic for the learning resource")
activity_desc: str = Field(description="The descrition of the activity for the learning resource")
class SyllabusSchema(BaseModel):
course_information: CourseInformation = Field(description="The course information")
instructor_information: InstructorInformation = Field(description="The instructor information")
course_description_objectives: CourseDescriptionObjectives = Field(description="The objectives of the course")
course_content: List[CourseContentItem] = Field(description="The content of the course")
policies_procedures: PoliciesProcedures = Field(description="The policies procedures of the course")
assessment_grading_criteria: AssessmentGradingCriteria = Field(description="The asssessment grading criteria of the course")
learning_resources: List[LearningResource] = Field(description="The learning resources of the course")
course_schedule: List[CourseScheduleItem] = Field(description="The course schedule")
Pull Request - Epic 7.7 - Syllabus Generator
By: Synthwave Sentinels
Summary
This PR allows educators to generate syllabi using different academic and strategic attributes. We based our research in this MIT Article about Syllabus Creation Moreover, educators can specify the course content with the extended file support implemented with the following file types for a better domain-specific adaptation:
Changes
syllabus_generator
with its appropriate metadata.json.file_url
andfile_type
attributes.allowed_file_extensions_dynamo.py
for a robust approach in the file type management from Epic 7.2 #61.Testing
Each document loader was tested using pytest (Managing appropriate scenarios and edge cases).
Results
All document loaders are working appropriately with the optimal results.
Notes
For Google Docs, Slides, Sheets and PDF files:
How to Test
Clone the repo in your local
Create and activate virtual environment
Use pip install -r requirements.txt to install required libraries.
Create .env file with ENV_TYPE, GCP_PROJECT_ID and GOOGLE_API_KEY fields. Env type is dev, gcp_project_id is your project id from cloud console project, google_api_key is your api key from AI studio.
Then type ./local-start.sh to start the application.
Add sample requests and responses for each file type as mentioned above in screenshots and test it.
Request interface
Schema:
Example:
Response interface
Schema:
Example:
References
Request Templates Docs Responses