-
Notifications
You must be signed in to change notification settings - Fork 219
Expand file tree
/
Copy pathmodels.py
More file actions
29 lines (19 loc) · 1010 Bytes
/
models.py
File metadata and controls
29 lines (19 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from typing import Dict, List, Optional
from pydantic import BaseModel
class Lesson(BaseModel):
"""Represents a lesson within a course"""
lesson_number: int # Sequential lesson number (1, 2, 3, etc.)
title: str # Lesson title
lesson_link: Optional[str] = None # URL link to the lesson
class Course(BaseModel):
"""Represents a complete course with its lessons"""
title: str # Full course title (used as unique identifier)
course_link: Optional[str] = None # URL link to the course
instructor: Optional[str] = None # Course instructor name (optional metadata)
lessons: List[Lesson] = [] # List of lessons in this course
class CourseChunk(BaseModel):
"""Represents a text chunk from a course for vector storage"""
content: str # The actual text content
course_title: str # Which course this chunk belongs to
lesson_number: Optional[int] = None # Which lesson this chunk is from
chunk_index: int # Position of this chunk in the document