Skip to content

Commit baf44be

Browse files
committed
Removed large print statement + old skills fix
1 parent 54e2704 commit baf44be

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

interpreter/core/async_core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ def respond(self, run_code=None):
128128
if "end" in chunk:
129129
print("\n```\n\n------------\n\n", flush=True)
130130
if chunk.get("format") != "active_line":
131-
print(chunk.get("content", ""), end="", flush=True)
131+
if "format" in chunk and "base64" in chunk["format"]:
132+
print("\n[An image was produced]")
133+
else:
134+
print(chunk.get("content", ""), end="", flush=True)
132135

133136
self.output_queue.sync_q.put(chunk)
134137

interpreter/core/llm/utils/convert_to_openai_messages.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,10 @@ def convert_to_openai_messages(
102102
new_message["role"] = "user"
103103
new_message["content"] = content
104104
elif interpreter.code_output_sender == "assistant":
105-
if "@@@SEND_MESSAGE_AS_USER@@@" in message["content"]:
106-
new_message["role"] = "user"
107-
new_message["content"] = message["content"].replace(
108-
"@@@SEND_MESSAGE_AS_USER@@@", ""
109-
)
110-
else:
111-
new_message["role"] = "assistant"
112-
new_message["content"] = (
113-
"\n```output\n" + message["content"] + "\n```"
114-
)
105+
new_message["role"] = "assistant"
106+
new_message["content"] = (
107+
"\n```output\n" + message["content"] + "\n```"
108+
)
115109

116110
elif message["type"] == "image":
117111
if message.get("format") == "description":

interpreter/core/respond.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ def respond(interpreter):
7676

7777
### RUN THE LLM ###
7878

79+
assert (
80+
len(interpreter.messages) > 0
81+
), "User message was not passed in. You need to pass in at least one message."
82+
7983
if (
8084
interpreter.messages[-1]["type"] != "code"
8185
): # If it is, we should run the code (we do below)

interpreter/core/utils/truncate_output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def truncate_output(data, max_output_chars=2800, add_scrollbars=False):
2-
if "@@@DO_NOT_TRUNCATE@@@" in data:
3-
return data
2+
# if "@@@DO_NOT_TRUNCATE@@@" in data:
3+
# return data
44

55
needs_truncation = False
66

0 commit comments

Comments
 (0)