sitcom_simulator.script.script_generator

Functions

formatted_script(script)

script_from_file(path)

write_script(prompt[, ...])

Uses AI to generate a script matching the prompt.

sitcom_simulator.script.script_generator.write_script(prompt, manual_character_selection=False, max_tokens=2048, require_approval=False, temperature=0.5, model='gpt-4o-mini', custom_script_instructions=None, custom_character_instructions=None, fakeyou_characters=True, narrator_dropout=False)

Uses AI to generate a script matching the prompt.

If characters are passed in, the resulting dialog is constrained to those characters. Otherwise, it prompts the user to select the appropriate characters.

Parameters:
  • prompt (str) – The prompt for the script

  • manual_character_selection – Whether to prompt the user to select the characters. If manual_character_selection == False and characters == None, an LLM will extract characters.

  • max_tokens (int) – The maximum number of tokens to generate

  • require_approval (bool) – Whether to prompt the user to approve the generated script

  • temperature (float) – The temperature to use when generating the script

  • model (str) – The language model to use

  • custom_script_instructions (str | None) – A string containing custom instructions for the language model writing the script. Must contain the placeholders ‘{prompt}’, ‘{music_categories}’, and ‘{characters}’.

  • custom_character_instructions (str | None) – A string containing custom instructions for the language model extracting the characters from the prompt. Must contain the placeholder ‘{prompt}’.

  • fakeyou_characters (bool) – Whether to restrict character selection to only voices from fakeyou.com

  • narrator_dropout (bool) – Whether to forcibly remove narrators from the script (ChatGPT often goes heavy on the narrators)

Return type:

Script

sitcom_simulator.script.script_generator.script_from_file(path)
Return type:

Script

Parameters:

path (str)

sitcom_simulator.script.script_generator.formatted_script(script)
Return type:

str

Parameters:

script (Script)