lpgcast.episode¶
Attributes¶
JsonScalar = str | int | float | bool | None
module-attribute
¶
Classes¶
ContextItem
¶
Bases: BaseModel
An earlier text in the same thread, shown for reference only.
Source code in lpgcast/episode.py
Episode
¶
Bases: BaseModel
One text to cast.
The structured half of a record — author, channel, thread — belongs in
metadata and is written by an ordinary GraFlo resource, never read off
the text by the model; metadata is not shown to the model.
Source code in lpgcast/episode.py
Attributes¶
context = Field(default_factory=list, description='Preceding texts in the thread, for resolving references only.')
class-attribute
instance-attribute
¶
metadata = Field(default_factory=dict, description='Source metadata, never shown to the model.')
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='forbid')
class-attribute
instance-attribute
¶
reference_time = Field(default=None, description='When the text was written; resolves relative dates.')
class-attribute
instance-attribute
¶
source_id = Field(min_length=1, description='Stable identifier of the source record.')
class-attribute
instance-attribute
¶
text = Field(min_length=1, description='The text to cast.')
class-attribute
instance-attribute
¶
EpisodeFileError
¶
Functions:¶
read_episodes(path)
¶
Read episodes from a JSON Lines file, one object per line.
Blank lines are skipped.
Raises:
| Type | Description |
|---|---|
EpisodeFileError
|
on the first line that is not a valid episode. |