A text-based adventure powered by OpenAI's GPT 3.5-Turbo model. Every adventure is new and different; even the same choices entail a different story each time. Immerse and lose yourself in an endless narrative that could be curated by your dreams. Very lightweight with a clean, modern, and user-friendly interface.
Setup is easy, just follow the steps:
- Download Python (v3.11.4+) from here. To check if you have it installed, run the following command
$python --version
- Fork and clone the repository
- Run the following command to install all libraries
$pip install openai customtkinter tk pillow
- (OPTIONAL) Create a tokens.py with the following function:
Grab your token from here.
def openAIToken(): return "sk-..." # Enter your token in the string
If this step is omitted, it will prompt for a token once the app is launched. The entered token is stored locally only for the duration of the session - Open cmd and change the directory to the repository folder, then run main.py using:
$python main.py
Currently, due to an issue with the Nix environment, there is unexpected behaviour on the Replit installation; there are some known issues with the Replit version:
- The token request window does not appear if
tokens.py
is omitted - Popup windows not capturing priority
- Can not clone a chat, you must create a new adventure instead
It is highly advised to use the Local Machine installation instead! Following are the steps to run it on Replit:
- Fork the repository and ensure it is public
- Go to replit, log in, and press
Create Repl
- Import from GitHub
- Run the following command in the shell to install all dependencies
$pip install openai customtkinter tk pillow
- Create a tokens.py with the following function:
Replit will automatically ask you to turn that into a secret. Press yes, name the secret 'OpenAI Token', and refactor the code:
def openAIToken(): return "sk-..." # Enter your token in the string
Grab your token from here.import os def OpenAIToken(): return os.environ['OpenAI Token']
If this step is omitted, the program will refuse to open. - Press on Run to test out the program :)
There are a few things that can not be changed from the app and must be changed from within the code (found in main.py
).
mock_data: boolean
Whether the application should make API calls or use mock data.
False
(default) means it uses API calls.
story_length_choices: int
This is the number of choices the GPT model is instructed to contain in the story.
This value is only a suggestion to the language model, and should not be used as a hard cap by any means.
Default is 10
story_length_minutes: int
This is the number of minutes the GPT model is instructed to make the story.
This value is only a suggestion to the language model, and should not be used as a hard cap by any means.
Default is 2
MODEL: str
This value determines the model that will be queried for a response. A list of models can be found here
Default is "gpt-3.5-turbo"
These are some bugs I encountered during development and will look into
- Replit does not output
Token Request
window. Presumably because theApp
does not get loaded until after a token has been received Window freezes when making API callsIf selected chat is deleted, it stays on screenDuplicate chats clone new messages- Chats do not right align properly sometimes - keeping window axis X locked for now
TypeError
withNoneType
is sometimes raised when working with mock data