@@ -195,7 +195,7 @@ def supports_ansi():
195195 ANSI_BRIGHT_MAGENTA = ""
196196
197197
198- def main (model , accurate_mode , voice_mode = False ):
198+ def main (model , accurate_mode , prompt , voice_mode = False ):
199199 """
200200 Main function for the Self-Operating Computer
201201 """
@@ -216,11 +216,15 @@ def main(model, accurate_mode, voice_mode=False):
216216 )
217217 sys .exit (1 )
218218
219- message_dialog (
220- title = "Self-Operating Computer" ,
221- text = "Ask a computer to do anything." ,
222- style = style ,
223- ).run ()
219+ # Skip message dialog if prompt was given directly
220+ if not prompt :
221+ message_dialog (
222+ title = "Self-Operating Computer" ,
223+ text = "Ask a computer to do anything." ,
224+ style = style ,
225+ ).run ()
226+ else :
227+ print ("Running direct prompt..." )
224228
225229 print ("SYSTEM" , platform .system ())
226230 # Clear the console
@@ -229,7 +233,9 @@ def main(model, accurate_mode, voice_mode=False):
229233 else :
230234 print ("\033 c" , end = "" )
231235
232- if voice_mode :
236+ if prompt : # Skip objective prompt if it was given as an argument
237+ objective = prompt
238+ elif voice_mode :
233239 print (
234240 f"{ ANSI_GREEN } [Self-Operating Computer]{ ANSI_RESET } Listening for your command... (speak now)"
235241 )
@@ -835,10 +841,18 @@ def main_entry():
835841 action = "store_true" ,
836842 required = False ,
837843 )
844+
845+ # Allow for direct input of prompt
846+ parser .add_argument (
847+ "--prompt" ,
848+ help = "Directly input the objective prompt" ,
849+ type = str ,
850+ required = False ,
851+ )
838852
839853 try :
840854 args = parser .parse_args ()
841- main (args .model , accurate_mode = args .accurate , voice_mode = args .voice )
855+ main (args .model , accurate_mode = args .accurate , prompt = args . prompt , voice_mode = args .voice )
842856 except KeyboardInterrupt :
843857 print (f"\n { ANSI_BRIGHT_MAGENTA } Exiting..." )
844858
0 commit comments