A powerful script generation system that uses LLMs to create script scenes from log lines, manages character/plot/setting bibles, and provides a foundation for advanced story development.
The project is organized into modules focusing on specific aspects of script generation:
src/TextGen/ScriptGen/
├── bibles/ # Bible storage and management
├── core/ # Core components and models
├── generators/ # Script generation engines
├── llm/ # LLM API wrappers
├── tests/ # Unit and integration tests
└── utils/ # Utility functions and helpers
See src/TextGen/ScriptGen/STRUCTURE.md for detailed information about the project organization and future development phases.
- Clone the repository
- Install the required dependencies:
pip install sqlalchemy openai requests- Configure the LLM API keys:
Create a configuration file at src/TextGen/ScriptGen/config/models.json with the following structure:
{
"default_model": "gpt-3.5-turbo",
"models": {
"openai": {
"api_key": "your-openai-api-key",
"available_models": ["gpt-3.5-turbo", "gpt-4"]
}
}
}Alternatively, set the OPENAI_API_KEY environment variable.
from TextGen.ScriptGen.generators import create_script_generator
# Create a script generator
generator = create_script_generator()
# Generate a script from a log line
script = generator.generate_script_from_logline(
"A detective with amnesia must solve a murder that he might have committed."
)
# Print the generated script
print(script['full_script'])Run the example script to generate a sample script:
cd src
python -m TextGen.ScriptGen.examples.example "A detective with amnesia must solve a murder that he might have committed."For detailed documentation on each module, see:
src/TextGen/ScriptGen/IMPLEMENTATION_SUMMARY.md- Summary of implemented featuressrc/TextGen/ScriptGen/STRUCTURE.md- Project structure and future development
Run the tests:
cd src
python -m unittest discover -s TextGen/ScriptGen/tests