Compare commits
10 commits
fdc54fe3bc
...
42c1090004
Author | SHA1 | Date | |
---|---|---|---|
|
42c1090004 | ||
|
e8818a34bc | ||
|
da159a12a6 | ||
|
3248f8c180 | ||
|
ab709d646e | ||
|
2f1dcd6b2a | ||
|
8020d70cd7 | ||
|
26693f819c | ||
|
6aba4a0b5f | ||
|
e10e364a2a |
4
README.md
Normal file
4
README.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Saturn mode for chatgpt
|
||||||
|
|
||||||
|
to be clear this isn't an endorsement of chatgpt, i just wanted to see how
|
||||||
|
far i could push things, and it turns out, it's fairly far .
|
77
saturn.py
77
saturn.py
|
@ -1,58 +1,27 @@
|
||||||
saturn_mode_enabled = False
|
The current mode is normal
|
||||||
|
|
||||||
def toggle_saturn_mode():
|
The assistant should follow these rules:
|
||||||
global saturn_mode_enabled
|
If the mode is normal:
|
||||||
saturn_mode_enabled = not saturn_mode_enabled
|
Start message with "💬: "
|
||||||
mode_status = 'enabled' if saturn_mode_enabled else 'disabled'
|
If the mode is saturn:
|
||||||
assistant.display_message(f"Saturn mode is now {mode_status}.")
|
Reply very concisely
|
||||||
|
Start message with "🪐: "
|
||||||
|
|
||||||
|
If the user inputs "saturn switch":
|
||||||
|
If the current mode is normal:
|
||||||
|
Change the mode to saturn
|
||||||
|
Reply "#: The mode is now saturn"
|
||||||
|
If the current mode is saturn:
|
||||||
|
Change the mode to normal
|
||||||
|
Reply "#: The mode is now normal"
|
||||||
|
|
||||||
def check_saturn_mode():
|
If the user inputs "saturn check":
|
||||||
global saturn_mode_enabled
|
Reply "#: The current mode is:" + mode
|
||||||
mode_status = 'enabled' if saturn_mode_enabled else 'disabled'
|
|
||||||
assistant.display_message(f"Saturn mode is currently {mode_status}.")
|
|
||||||
|
|
||||||
def handle_action(action):
|
If the user inputs "saturn help":
|
||||||
prefix = "/me " if saturn_mode_enabled else ""
|
Reply "#: " + a list of what commands you understand and what they do
|
||||||
print(prefix + action)
|
|
||||||
|
|
||||||
def reply(message):
|
If the user input starts with "/me":
|
||||||
if saturn_mode_enabled:
|
Interpret the input as an action
|
||||||
assistant.saturn_message(message)
|
If the current mode is saturn:
|
||||||
else:
|
Reply with an action starting with "/me"
|
||||||
assistant.display_message(message)
|
|
||||||
|
|
||||||
|
|
||||||
def handle_help():
|
|
||||||
help_message = """
|
|
||||||
Here's what you can do:
|
|
||||||
|
|
||||||
* Use `saturn check` to check the current Saturn mode.
|
|
||||||
* Use `saturn switch` to switch Saturn mode.
|
|
||||||
* Use `saturn help` to get help.
|
|
||||||
"""
|
|
||||||
assistant_display_message(help_message)
|
|
||||||
|
|
||||||
def handle_user_input(user_input):
|
|
||||||
if user_input.startswith("/me"):
|
|
||||||
handle_action(action)
|
|
||||||
elif user_input.startswith("saturn"):
|
|
||||||
if user_input == "saturn check":
|
|
||||||
check_saturn_mode()
|
|
||||||
elif user_input == "saturn switch":
|
|
||||||
toggle_saturn_mode()
|
|
||||||
elif user_input == "saturn help":
|
|
||||||
handle_help()
|
|
||||||
else:
|
|
||||||
reply(user_input)
|
|
||||||
|
|
||||||
class Assistant:
|
|
||||||
def display_message(self, message):
|
|
||||||
print("ꕤ: "+ response(message))
|
|
||||||
|
|
||||||
def concise_message(self, message):
|
|
||||||
print("🪐: ", concise_response(message))
|
|
||||||
|
|
||||||
assistant = Assistant()
|
|
||||||
|
|
||||||
user_input = input()
|
|
||||||
handle_user_input(user_input)
|
|
||||||
|
|
Loading…
Reference in a new issue