marvelai-org / marvel-ai-backend

This is the Marvel Teaching Assistant ai repo.
MIT License
17 stars 85 forks source link

Epic 7.7.1: Syllabus Generator - Machine Masters #82

Open TahaKoleilat opened 3 months ago

TahaKoleilat commented 3 months ago

Syllabus Generator

This feature provides a tool to generate course syllabi based on input data provided in JSON format. The system allows users to specify various course-related details and outputs a structured syllabus.

Features

Request Interface

Schema

class SyllabusRequestArgs(BaseModel):
    subject_topic: str
    grade_level: str
    subject: str
    course_description: str
    course_objectives: str
    required_materials: str
    grading_policy: str
    course_outline: str
    class_policies: str
    instructor_name: str
    instructor_title: str
    important_dates: Optional[str] = None
    learning_outcomes: Optional[str] = None
    class_schedule: Optional[str] = None
    instructor_contact: Optional[str] = None
    additional_customizations: Optional[str] = None

Example

To generate a syllabus, provide an input JSON file with the necessary course information. The expected JSON structure is as follows:

{
    "user": {
        "id": "string",
        "fullName": "string",
        "email": "string"
    },
    "type": "tool",
    "tool_data": {
        "tool_id": 2,
        "inputs": [
            {
                "name": "subject_topic",
                "value": "Introduction to Algebra"
            },
            {
                "name": "grade_level",
                "value": "High School"
            },
            {
                "name": "subject",
                "value": "Mathematics"
            },
            {
                "name": "course_description",
                "value": "An introductory course on algebra and geometry."
            },
            {
                "name": "course_objectives",
                "value": "To teach students the fundamentals of algebra."
            },
            {
                "name": "required_materials",
                "value": "Textbook, calculator, notebook"
            },
            {
                "name": "grading_policy",
                "value": "50% Exams, 30% Homework, 20% Participation"
            },
            {
                "name": "course_outline",
                "value": "Week 1-2: Algebra basics, Week 3-4: Geometry"
            },
            {
                "name": "class_policies",
                "value": "No late submissions, attendance required"
            },
            {
                "name": "instructor_name",
                "value": "Dr. John Doe"
            },
            {
                "name": "instructor_title",
                "value": "Professor"
            },
            {
                "name": "important_dates",
                "value": "2024-08-01 to 2024-12-15"
            },
            {
                "name": "learning_outcomes",
                "value": "Students will understand basic algebraic principles."
            },
            {
                "name": "class_schedule",
                "value": "Monday and Wednesday, 10:00 AM - 11:30 AM"
            },
            {
                "name": "instructor_contact",
                "value": "johndoe@example.com"
            },
            {
                "name": "additional_customizations",
                "value": "Include extra instructor_contact johndo@example.com in the syllabus."
            }
        ]
    }
}

Response Interface

Schema

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[str, str] = Field(description="The grading scale")

class LearningResource(BaseModel):
    title: str = Field(description="The title of the learning resource")
    author: str = Field(description="The author of the learning resource")
    year: int = Field(description="The year of creation of the learning resource")

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 course schedule item")
    activity_desc: str = Field(description="The description of the activity for the course schedule item")

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 and procedures of the course")
    assessment_grading_criteria: AssessmentGradingCriteria = Field(description="The assessment and 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")

Example

{
  "data": {
    "course_name": "Introduction to Algebra",
    "grade_level": "High School",
    "subject": "Mathematics",
    "course_description": "An introductory course on algebra and geometry.",
    "course_objectives": [
      "To teach students the fundamentals of algebra."
    ],
    "required_materials": [
      "Textbook",
      "Calculator",
      "Notebook"
    ],
    "grading_policy": {
      "Exams": 0.5,
      "Homework": 0.3,
      "Participation": 0.2
    },
    "course_outline": [
      {
        "week": "1-2",
        "topics": "Algebra basics"
      },
      {
        "week": "3-4",
        "topics": "Geometry"
      }
    ],
    "class_policies": [
      "No late submissions",
      "Attendance required"
    ],
    "instructor": {
      "name": "Dr. John Doe",
      "title": "Professor",
      "contact": "johndoe@example.com",
      "instructor_contact": "johndo@example.com"
    }
  }
}

File Structure