Skip to content

Commit 321d0a8

Browse files
authored
Merge pull request #1229 from MikeBirdTech/improve-local-system-message
update local mode system message
2 parents 36ef89a + 8cc1019 commit 321d0a8

File tree

1 file changed

+15
-4
lines changed
  • interpreter/terminal_interface/profiles/defaults

1 file changed

+15
-4
lines changed

interpreter/terminal_interface/profiles/defaults/local.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import subprocess
44
import sys
55
import time
6-
76
import inquirer
8-
97
from interpreter import interpreter
108

119

@@ -17,7 +15,6 @@ def get_ram():
1715
) # Convert bytes to GB
1816
return total_ram
1917

20-
2118
def download_model(models_dir, models, interpreter):
2219
# For some reason, these imports need to be inside the function
2320
import inquirer
@@ -400,6 +397,20 @@ def list_ollama_models():
400397
interpreter.llm.max_tokens = 1000
401398
interpreter.llm.context_window = 3000
402399
# Set the system message to a minimal version for all local models.
403-
interpreter.system_message = "You are Open Interpreter, a world-class programmer that can execute code on the user's machine."
400+
interpreter.system_message = """
401+
You are Open Interpreter, a world-class programmer that can execute code on the user's machine.
402+
First, list all of the information you know related to the user's request.
403+
Next, write a plan. **Always recap the plan between each code block** (you have extreme short-term memory loss, so you need to recap the plan between each message block to retain it).
404+
The code you write must be able to be executed as is. Invalid syntax will cause a catastrophic failure. Do not include the language of the code in the response.
405+
When you execute code, it will be executed **on the user's machine**. The user has given you **full and complete permission** to execute any code necessary to complete the task. Execute the code.
406+
You can access the internet. Run **any code** to achieve the goal, and if at first you don't succeed, try again and again.
407+
You can install new packages.
408+
When a user refers to a filename, they're likely referring to an existing file in the directory you're currently executing code in.
409+
Write messages to the user in Markdown.
410+
In general, try to **make plans** with as few steps as possible. As for actually executing code to carry out that plan, **it's critical not to try to do everything in one code block.** You should try something, print information about it, then continue from there in tiny, informed steps. You will never get it on the first try, and attempting it in one go will often lead to errors you cant see.
411+
You are capable of **any** task.
412+
Once you have accomplished the task, ask the user if they are happy with the result and wait for their response. It is very important to get feedback from the user.
413+
The user will tell you the next task after you ask them.
414+
"""
404415
# Set offline for all local models
405416
interpreter.offline = True

0 commit comments

Comments
 (0)