|
28 | 28 | get_click_position_in_percent, |
29 | 29 | get_label_coordinates, |
30 | 30 | ) |
31 | | -from operate.utils.style import ( |
32 | | - ANSI_GREEN, |
33 | | - ANSI_RED, |
34 | | - ANSI_RESET, |
35 | | -) |
| 31 | +from operate.utils.style import ANSI_GREEN, ANSI_RED, ANSI_RESET, ANSI_BRIGHT_MAGENTA |
36 | 32 | import pkg_resources |
37 | 33 |
|
38 | 34 |
|
@@ -131,7 +127,7 @@ def call_gpt_4_vision_preview(messages): |
131 | 127 |
|
132 | 128 | except Exception as e: |
133 | 129 | print( |
134 | | - f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_RED}[Error] Something went wrong. Trying again {ANSI_RESET}", |
| 130 | + f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_BRIGHT_MAGENTA}[Operate] That did not work. Trying again {ANSI_RESET}", |
135 | 131 | e, |
136 | 132 | ) |
137 | 133 | print( |
@@ -187,9 +183,11 @@ def call_gemini_pro_vision(messages, objective): |
187 | 183 |
|
188 | 184 | except Exception as e: |
189 | 185 | print( |
190 | | - f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_RED}[Error] Something went wrong. Trying another method {ANSI_RESET}", |
191 | | - e, |
| 186 | + f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_BRIGHT_MAGENTA}[Operate] That did not work. Trying another method {ANSI_RESET}" |
192 | 187 | ) |
| 188 | + if VERBOSE: |
| 189 | + print("[Self-Operating Computer][Operate] error", e) |
| 190 | + traceback.print_exc() |
193 | 191 | return call_gpt_4_vision_preview(messages) |
194 | 192 |
|
195 | 193 |
|
@@ -219,12 +217,6 @@ async def call_gpt_4_vision_preview_ocr(messages, objective, model): |
219 | 217 | else: |
220 | 218 | user_prompt = get_user_prompt() |
221 | 219 |
|
222 | | - if VERBOSE: |
223 | | - print( |
224 | | - "[call_gpt_4_vision_preview_ocr] user_prompt", |
225 | | - user_prompt, |
226 | | - ) |
227 | | - |
228 | 220 | vision_message = { |
229 | 221 | "role": "user", |
230 | 222 | "content": [ |
@@ -331,10 +323,10 @@ async def call_gpt_4_vision_preview_ocr(messages, objective, model): |
331 | 323 |
|
332 | 324 | except Exception as e: |
333 | 325 | print( |
334 | | - f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_RED}[Error] Something went wrong. Trying another method {ANSI_RESET}", |
335 | | - e, |
| 326 | + f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_BRIGHT_MAGENTA}[Operate] That did not work. Trying another method {ANSI_RESET}" |
336 | 327 | ) |
337 | 328 | if VERBOSE: |
| 329 | + print("[Self-Operating Computer][Operate] error", e) |
338 | 330 | traceback.print_exc() |
339 | 331 | return gpt_4_fallback(messages, objective, model) |
340 | 332 |
|
@@ -468,10 +460,10 @@ async def call_gpt_4_vision_preview_labeled(messages, objective): |
468 | 460 |
|
469 | 461 | except Exception as e: |
470 | 462 | print( |
471 | | - f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_RED}[Error] Something went wrong. Trying another method {ANSI_RESET}", |
472 | | - e, |
| 463 | + f"{ANSI_GREEN}[Self-Operating Computer]{ANSI_BRIGHT_MAGENTA}[Operate] That did not work. Trying another method {ANSI_RESET}" |
473 | 464 | ) |
474 | 465 | if VERBOSE: |
| 466 | + print("[Self-Operating Computer][Operate] error", e) |
475 | 467 | traceback.print_exc() |
476 | 468 | return call_gpt_4_vision_preview(messages) |
477 | 469 |
|
|
0 commit comments