Skip to content

Commit 12b29d0

Browse files
committed
Add another useful print
1 parent d03805a commit 12b29d0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

operate/models/apis.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import time
33
import json
44
import base64
5-
5+
import traceback
66
import 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

0 commit comments

Comments
 (0)