StoryChain is a Python project that utilizes the Groq API to generate a complete story based on a user-provided starting prompt. The project allows users to interactively add new elements to the story, such as characters, plot twists, and more.
To set up the StoryChain project on your PC, follow these steps:
- Install the Groq library, Run
pip install groqin your terminal/command prompt. - Replace the API token: Replace the api_key variable in the code with your own Groq API token. To obtain a token, follow these steps:
- Go to the Groq website and sign up for an account.
- Click on your profile picture in the top right corner and select "API Tokens".
- Click on "Create a new token" and follow the prompts to generate a token.
- Copy the token and replace the existing token in the code.
- Run the code: Save the code in a file (e.g., storychain.py) and run it using Python (e.g., python storychain.py).
The StoryChain project currently supports the following features:
-
Generating a complete story based on a user-provided starting prompt Interactively adding new elements to the story, such as: New characters New plot twists A twist Adding New Features You can extend the StoryChain project by adding new features, such as:
-
Supporting multiple story genres (e.g., sci-fi, fantasy, romance)
-
Allowing users to save and load stories
-
Integrating with other natural language processing (NLP) models or APIs
To use the StoryChain project, simply run the code and follow the prompts. You will be asked to provide a starting prompt for the story, and then you can interactively add new elements to the story.
Here's an example of how you can use the StoryChain project:
Run the code and provide a starting prompt, such as "In a world where magic exists..." The project will generate a complete story based on your prompt. You can then interactively add new elements to the story, such as a new character or a plot twist. The project will generate a revised story incorporating your changes. Note: This is just a basic example, and you can experiment with different prompts and features to create unique stories.