sitcom_simulator.models¶
Classes
|
A character in a script and information about their voice. |
|
A clip in a script, including the speaker, speech, and audio. |
|
Contains all the data for a script, including characters, clips, and metadata. |
|
Metadata for a script. |
|
The result of rendering a video. |
- class sitcom_simulator.models.Character(name, voice_token)¶
A character in a script and information about their voice.
- Parameters:
name (
str
) – The name of the charactervoice_token (
str
) – The token for the character’s voice
-
name:
str
¶
-
voice_token:
str
¶
- static from_dict(data)¶
Creates a Character from a dictionary with the same shape.
- Parameters:
data (dict[str, str])
- replace(**kwargs)¶
Returns a new Character with the specified fields replaced.
- __init__(name, voice_token)¶
- Parameters:
name (str)
voice_token (str)
- Return type:
None
- class sitcom_simulator.models.Clip(speaker, speech, image_prompt, image_path, image_url, audio_url, audio_path, title, duration)¶
A clip in a script, including the speaker, speech, and audio.
- Parameters:
speaker (
str
|None
) – The name of the speakerspeech (
str
|None
) – The speech for the clipimage_prompt (
str
|None
) – The prompt for the imageimage_url (
str
|None
) – The URL for the image (currently unused, but may be used in the future with a different image engine)image_path (
str
|None
) – The path to the imageaudio_url (
str
|None
) – The URL for the audio (currently unused, but may be used in the future with a different TTS engine)audio_path (
str
|None
) – The path to the audiotitle (
str
|None
) – The title of the clipduration (
str
|None
) – The duration of the clip
-
speaker:
str
|None
¶
-
speech:
str
|None
¶
-
image_prompt:
str
|None
¶
-
image_path:
str
|None
¶
-
image_url:
str
|None
¶
-
audio_url:
str
|None
¶
-
audio_path:
str
|None
¶
-
title:
str
|None
¶
-
duration:
str
|None
¶
- property needs_audio¶
Returns True if the clip needs audio, and False if it doesn’t.
- property needs_image¶
Returns True if the clip needs an image, and False if it doesn’t.
- static from_dict(data)¶
Creates a Clip from a dictionary with the same shape. All fields are optional.
- Parameters:
data (dict)
- replace(**kwargs)¶
Returns a new Clip with the specified fields replaced.
- __init__(speaker, speech, image_prompt, image_path, image_url, audio_url, audio_path, title, duration)¶
- Parameters:
speaker (str | None)
speech (str | None)
image_prompt (str | None)
image_path (str | None)
image_url (str | None)
audio_url (str | None)
audio_path (str | None)
title (str | None)
duration (str | None)
- Return type:
None
- class sitcom_simulator.models.ScriptMetadata(title, bgm_style, bgm_path, bgm_url, art_style, prompt, orientation)¶
Metadata for a script.
- Parameters:
title (
str
|None
) – The title of the scriptbgm_style (
str
|None
) – The style of the background musicbgm_path (
str
|None
) – The path to the background musicbgm_url (
str
|None
) – The URL to the background musicart_style (
str
|None
) – The style of the artprompt (
str
|None
) – The prompt for the scriptbgm_path – The path to the background music
orientation (
str
|None
) – The orientation of the video
-
title:
str
|None
¶
-
bgm_style:
str
|None
¶
-
bgm_path:
str
|None
¶
-
bgm_url:
str
|None
¶
-
art_style:
str
|None
¶
-
prompt:
str
|None
¶
-
orientation:
str
|None
¶
- static from_dict(data)¶
Creates a ScriptMetadata from a dictionary with the same shape. All fields are required except for bgm_path.
- Parameters:
data (dict)
- replace(**kwargs)¶
Returns a new ScriptMetadata with the specified fields replaced.
- __init__(title, bgm_style, bgm_path, bgm_url, art_style, prompt, orientation)¶
- Parameters:
title (str | None)
bgm_style (str | None)
bgm_path (str | None)
bgm_url (str | None)
art_style (str | None)
prompt (str | None)
orientation (str | None)
- Return type:
None
- class sitcom_simulator.models.Script(characters, clips, metadata)¶
Contains all the data for a script, including characters, clips, and metadata.
The clips are ordered in the order they should be played.
In general, the fields should be populated in the following order: 1. characters 2. clips 3. metadata
Metadata is last to give the language model more context before summarizing the script.
- Parameters:
characters (
list
[Character
]) – A list of characters in the scriptclips (
list
[Clip
]) – A list of clips in the scriptmetadata (
ScriptMetadata
) – The metadata for the script
-
metadata:
ScriptMetadata
¶
- static from_dict(data)¶
Returns a Script from a dictionary with the same shape.
- Parameters:
data (dict)
- replace(**kwargs)¶
Returns a new Script with the specified fields replaced.
- __init__(characters, clips, metadata)¶
- Parameters:
characters (list[Character])
clips (list[Clip])
metadata (ScriptMetadata)
- Return type:
None
- class sitcom_simulator.models.VideoResult(path, title, description)¶
The result of rendering a video.
- Parameters:
path (
str
) – The path to the rendered videotitle (
str
) – The title of the videodescription (
str
) – The description of the video
-
path:
str
¶
-
title:
str
¶
-
description:
str
¶
- __init__(path, title, description)¶
- Parameters:
path (str)
title (str)
description (str)
- Return type:
None