Skip to content

Commit 9dabcb5

Browse files
committed
Change name of paramater to terminal_prompt to avoid override of imported prompt
1 parent 2341c23 commit 9dabcb5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

operate/main.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@
133133
"""
134134

135135

136-
137136
class ModelNotRecognizedException(Exception):
138137
"""Exception raised for unrecognized models."""
139138

@@ -195,7 +194,7 @@ def supports_ansi():
195194
ANSI_BRIGHT_MAGENTA = ""
196195

197196

198-
def main(model, accurate_mode, prompt, voice_mode=False):
197+
def main(model, accurate_mode, terminal_prompt, voice_mode=False):
199198
"""
200199
Main function for the Self-Operating Computer
201200
"""
@@ -217,7 +216,7 @@ def main(model, accurate_mode, prompt, voice_mode=False):
217216
sys.exit(1)
218217

219218
# Skip message dialog if prompt was given directly
220-
if not prompt:
219+
if not terminal_prompt:
221220
message_dialog(
222221
title="Self-Operating Computer",
223222
text="Ask a computer to do anything.",
@@ -233,8 +232,8 @@ def main(model, accurate_mode, prompt, voice_mode=False):
233232
else:
234233
print("\033c", end="")
235234

236-
if prompt: # Skip objective prompt if it was given as an argument
237-
objective = prompt
235+
if terminal_prompt: # Skip objective prompt if it was given as an argument
236+
objective = terminal_prompt
238237
elif voice_mode:
239238
print(
240239
f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_RESET} Listening for your command... (speak now)"
@@ -843,7 +842,7 @@ def main_entry():
843842
action="store_true",
844843
required=False,
845844
)
846-
845+
847846
# Allow for direct input of prompt
848847
parser.add_argument(
849848
"--prompt",
@@ -854,7 +853,12 @@ def main_entry():
854853

855854
try:
856855
args = parser.parse_args()
857-
main(args.model, accurate_mode=args.accurate, prompt=args.prompt, voice_mode=args.voice)
856+
main(
857+
args.model,
858+
accurate_mode=args.accurate,
859+
terminal_prompt=args.prompt,
860+
voice_mode=args.voice,
861+
)
858862
except KeyboardInterrupt:
859863
print(f"\n{ANSI_BRIGHT_MAGENTA}Exiting...")
860864

0 commit comments

Comments
 (0)