File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 22import time
33import json
44import base64
5-
5+ import traceback
66import io
77
88
@@ -114,17 +114,22 @@ def call_gpt_4_vision_preview(messages):
114114 "[Self Operating Computer][get_next_action][call_gpt_4_v] content" ,
115115 content ,
116116 )
117- messages .append (assistant_message )
118-
119117 content = json .loads (content )
120118
119+ messages .append (assistant_message )
120+
121121 return content
122122
123123 except Exception as e :
124124 print (
125125 f"{ ANSI_GREEN } [Self-Operating Computer]{ ANSI_RED } [Error] Something went wrong. Trying again { ANSI_RESET } " ,
126126 e ,
127127 )
128+ print (
129+ f"{ ANSI_GREEN } [Self-Operating Computer]{ ANSI_RED } [Error] AI response was { ANSI_RESET } " ,
130+ content ,
131+ )
132+ traceback .print_exc ()
128133 return call_gpt_4_vision_preview (messages )
129134
130135
You can’t perform that action at this time.
0 commit comments