sitcom_simulator.models

Classes

Character(name, voice_token)

A character in a script and information about their voice.

Clip(speaker, speech, image_prompt, ...)

A clip in a script, including the speaker, speech, and audio.

Script(characters, clips, metadata)

Contains all the data for a script, including characters, clips, and metadata.

ScriptMetadata(title, bgm_style, bgm_path, ...)

Metadata for a script.

VideoResult(path, title, description)

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 character

  • voice_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 speaker

  • speech (str | None) – The speech for the clip

  • image_prompt (str | None) – The prompt for the image

  • image_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 image

  • audio_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 audio

  • title (str | None) – The title of the clip

  • duration (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 script

  • bgm_style (str | None) – The style of the background music

  • bgm_path (str | None) – The path to the background music

  • bgm_url (str | None) – The URL to the background music

  • art_style (str | None) – The style of the art

  • prompt (str | None) – The prompt for the script

  • bgm_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 script

  • clips (list[Clip]) – A list of clips in the script

  • metadata (ScriptMetadata) – The metadata for the script

characters: list[Character]
clips: list[Clip]
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:
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 video

  • title (str) – The title of the video

  • description (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