Skip to content

Commit 342db59

Browse files
committed
If languages == [], don't add markdown message
1 parent fd8e91e commit 342db59

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

interpreter/core/llm/run_text_llm.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
def run_text_llm(llm, params):
22
## Setup
33

4-
try:
5-
# Add the system message
6-
params["messages"][0][
7-
"content"
8-
] += "\nTo execute code on the user's machine, write a markdown code block. Specify the language after the ```. You will receive the output. Use any programming language."
9-
except:
10-
print('params["messages"][0]', params["messages"][0])
11-
raise
4+
if llm.interpreter.computer.terminal.languages != []:
5+
try:
6+
# Add the system message
7+
params["messages"][0][
8+
"content"
9+
] += "\nTo execute code on the user's machine, write a markdown code block. Specify the language after the ```. You will receive the output. Use any programming language."
10+
except:
11+
print('params["messages"][0]', params["messages"][0])
12+
raise
1213

1314
## Convert output to LMC format
1415

0 commit comments

Comments
 (0)