2929config = Config ()
3030operating_system = OperatingSystem ()
3131
32+
3233def main (model , terminal_prompt , voice_mode = False , verbose_mode = False ):
3334 """
3435 Main function for the Self-Operating Computer.
@@ -89,7 +90,9 @@ def main(model, terminal_prompt, voice_mode=False, verbose_mode=False):
8990 print (f"{ ANSI_RED } Error in capturing voice input: { e } { ANSI_RESET } " )
9091 return # Exit if voice input fails
9192 else :
92- print (f"{ ANSI_GREEN } [Self-Operating Computer]\n { ANSI_RESET } { USER_QUESTION } " )
93+ print (
94+ f"[{ ANSI_GREEN } Self-Operating Computer { ANSI_RESET } |{ ANSI_BRIGHT_MAGENTA } { model } { ANSI_RESET } ]\n { USER_QUESTION } "
95+ )
9396 print (f"{ ANSI_YELLOW } [User]{ ANSI_RESET } " )
9497 objective = prompt (style = style )
9598
@@ -109,7 +112,7 @@ def main(model, terminal_prompt, voice_mode=False, verbose_mode=False):
109112 get_next_action (model , messages , objective , session_id )
110113 )
111114
112- stop = operate (operations )
115+ stop = operate (operations , model )
113116 if stop :
114117 break
115118
@@ -128,7 +131,7 @@ def main(model, terminal_prompt, voice_mode=False, verbose_mode=False):
128131 break
129132
130133
131- def operate (operations ):
134+ def operate (operations , model ):
132135 if config .verbose :
133136 print ("[Self Operating Computer][operate]" )
134137 for operation in operations :
@@ -161,11 +164,9 @@ def operate(operations):
161164 summary = operation .get ("summary" )
162165
163166 print (
164- f"{ ANSI_GREEN } [Self-Operating Computer]{ ANSI_BLUE } Objective Completed { ANSI_RESET } "
165- )
166- print (
167- f"{ ANSI_GREEN } [Self-Operating Computer]{ ANSI_BLUE } Summary { ANSI_RESET } { summary } "
167+ f"[{ ANSI_GREEN } Self-Operating Computer { ANSI_RESET } |{ ANSI_BRIGHT_MAGENTA } { model } { ANSI_RESET } ]"
168168 )
169+ print (f"{ ANSI_BLUE } Objective Complete: { ANSI_RESET } { summary } \n " )
169170 return True
170171
171172 else :
@@ -178,10 +179,9 @@ def operate(operations):
178179 return True
179180
180181 print (
181- f"{ ANSI_GREEN } [Self-Operating Computer]{ ANSI_BRIGHT_MAGENTA } [Operate] Thought { ANSI_RESET } { operate_thought } "
182- )
183- print (
184- f"{ ANSI_GREEN } [Self-Operating Computer]{ ANSI_BRIGHT_MAGENTA } [Operate] { operate_type } { ANSI_RESET } { operate_detail } "
182+ f"[{ ANSI_GREEN } Self-Operating Computer { ANSI_RESET } |{ ANSI_BRIGHT_MAGENTA } { model } { ANSI_RESET } ]"
185183 )
184+ print (f"{ operate_thought } " )
185+ print (f"{ ANSI_BLUE } Action: { ANSI_RESET } { operate_type } { operate_detail } \n " )
186186
187187 return False
0 commit comments