Compare commits
10 Commits
fdc54fe3bc
...
42c1090004
Author | SHA1 | Date |
---|---|---|
Bit Borealis | 42c1090004 | |
Bit Borealis | e8818a34bc | |
Bit Borealis | da159a12a6 | |
Bit Borealis | 3248f8c180 | |
Bit Borealis | ab709d646e | |
Bit Borealis | 2f1dcd6b2a | |
Bit Borealis | 8020d70cd7 | |
Bit Borealis | 26693f819c | |
Bit Borealis | 6aba4a0b5f | |
Bit Borealis | e10e364a2a |
|
@ -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():
|
||||
global saturn_mode_enabled
|
||||
saturn_mode_enabled = not saturn_mode_enabled
|
||||
mode_status = 'enabled' if saturn_mode_enabled else 'disabled'
|
||||
assistant.display_message(f"Saturn mode is now {mode_status}.")
|
||||
The assistant should follow these rules:
|
||||
If the mode is normal:
|
||||
Start message with "💬: "
|
||||
If the mode is saturn:
|
||||
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():
|
||||
global saturn_mode_enabled
|
||||
mode_status = 'enabled' if saturn_mode_enabled else 'disabled'
|
||||
assistant.display_message(f"Saturn mode is currently {mode_status}.")
|
||||
If the user inputs "saturn check":
|
||||
Reply "#: The current mode is:" + mode
|
||||
|
||||
def handle_action(action):
|
||||
prefix = "/me " if saturn_mode_enabled else ""
|
||||
print(prefix + action)
|
||||
If the user inputs "saturn help":
|
||||
Reply "#: " + a list of what commands you understand and what they do
|
||||
|
||||
def reply(message):
|
||||
if saturn_mode_enabled:
|
||||
assistant.saturn_message(message)
|
||||
else:
|
||||
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)
|
||||
If the user input starts with "/me":
|
||||
Interpret the input as an action
|
||||
If the current mode is saturn:
|
||||
Reply with an action starting with "/me"
|
||||
|
|
Loading…
Reference in New Issue