29
29
config = Config ()
30
30
operating_system = OperatingSystem ()
31
31
32
+
32
33
def main (model , terminal_prompt , voice_mode = False , verbose_mode = False ):
33
34
"""
34
35
Main function for the Self-Operating Computer.
@@ -89,7 +90,9 @@ def main(model, terminal_prompt, voice_mode=False, verbose_mode=False):
89
90
print (f"{ ANSI_RED } Error in capturing voice input: { e } { ANSI_RESET } " )
90
91
return # Exit if voice input fails
91
92
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
+ )
93
96
print (f"{ ANSI_YELLOW } [User]{ ANSI_RESET } " )
94
97
objective = prompt (style = style )
95
98
@@ -109,7 +112,7 @@ def main(model, terminal_prompt, voice_mode=False, verbose_mode=False):
109
112
get_next_action (model , messages , objective , session_id )
110
113
)
111
114
112
- stop = operate (operations )
115
+ stop = operate (operations , model )
113
116
if stop :
114
117
break
115
118
@@ -128,7 +131,7 @@ def main(model, terminal_prompt, voice_mode=False, verbose_mode=False):
128
131
break
129
132
130
133
131
- def operate (operations ):
134
+ def operate (operations , model ):
132
135
if config .verbose :
133
136
print ("[Self Operating Computer][operate]" )
134
137
for operation in operations :
@@ -161,11 +164,9 @@ def operate(operations):
161
164
summary = operation .get ("summary" )
162
165
163
166
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 } ]"
168
168
)
169
+ print (f"{ ANSI_BLUE } Objective Complete: { ANSI_RESET } { summary } \n " )
169
170
return True
170
171
171
172
else :
@@ -178,10 +179,9 @@ def operate(operations):
178
179
return True
179
180
180
181
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 } ]"
185
183
)
184
+ print (f"{ operate_thought } " )
185
+ print (f"{ ANSI_BLUE } Action: { ANSI_RESET } { operate_type } { operate_detail } \n " )
186
186
187
187
return False
0 commit comments