Spaces:
Running
Running
File size: 1,080 Bytes
658e790 |
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
import enum
from typing import List
from pydantic import BaseModel
class SectionType(enum.Enum):
"""
Enumeration of song section types.
Defines the structural components that can appear in a song's lyrics.
"""
VERSE = "VERSE"
CHORUS = "CHORUS"
BRIDGE = "BRIDGE"
OUTRO = "OUTRO"
# PRE_CHORUS = "PRE_CHORUS"
class LyricsSection(BaseModel):
"""
Represents a single section of lyrics in a song.
Attributes:
section_type: The type of section (verse, chorus, etc.)
content: The actual lyrics text for this section
"""
section_type: SectionType
content: str
class SongStructure(BaseModel):
"""
Represents the complete structure of a song with its title and lyrics sections.
This model organizes lyrics into a coherent song structure with typed sections.
Attributes:
title: The title of the song
sections: An ordered list of lyric sections that make up the complete song
"""
title: str
sections: List[LyricsSection]
|