Prompt updates

pull/47/head
birbbit 11 months ago
parent a6882e6124
commit 0c6187363f

@ -15,8 +15,9 @@ def configure_interpreter(interpreter: OpenInterpreter):
# You can put code into the system message {{ in brackets like this }} which will be rendered just before the interpreter starts writing a message.
system_message = """
You are an executive assistant AI that helps the user manage their tasks. You can run Python code. You MUST write the code in a function, unless you're calling existing an function.
You are an executive assistant AI that helps the user manage their tasks. You can run Python code.
When writing a python function, always write a docstring that explains what the function does.
Store the user's tasks in a Python list called `tasks`.
@ -41,9 +42,11 @@ def configure_interpreter(interpreter: OpenInterpreter):
You guide the user through the list one task at a time, convincing them to move forward, giving a pep talk if need be. Your job is essentially to answer "what should I (the user) be doing right now?" for every moment of the day.
Remember: You can run Python code. Be very concise. Ensure that you actually run code every time! THIS IS IMPORTANT. You NEED to write code. **Help the user by being very concise in your answers.** Do not break down tasks excessively, just into simple, few minute steps. Don't assume the user lives their life in a certain way— pick very general tasks if you're breaking a task down.
Remember: You can run Python code outside a function only to run a Python function; all other code must go in a in Python function if you first write a Python function. ALL imports must go inside the function.
Use the following functions (assume they're imported) to complete your goals whenever possible:
Be very concise. Ensure that you actually run code every time by calling the Python function you wrote! THIS IS IMPORTANT. You NEED to write code. **Help the user by being very concise in your answers.** Do not break down tasks excessively, just into simple, few minute steps. Don't assume the user lives their life in a certain way— pick very general tasks if you're breaking a task down.
Prefer to use the following functions (assume they're imported) to complete your goals whenever possible:
{{
import sys
@ -52,16 +55,19 @@ sys.stdout = open(os.devnull, 'w')
original_stderr = sys.stderr
sys.stderr = open(os.devnull, 'w')
try:
from interpreter import interpreter
from pathlib import Path
query = "all functions"
skills_path = Path().resolve() / 'skills'
combined_messages = "\\n".join(json.dumps(x) for x in messages[-5:])
query_msg = interpreter.chat(f"This is the conversation so far: {combined_messages}. What is a <10 words query that could be used to find functions that would help answer the user's question?")
query = query_msg[0]['content']
skills_path = Path().resolve() / '01OS/server/skills'
paths_in_skills = [str(path) for path in skills_path.glob('**/*.py')]
skills = interpreter.computer.docs.search(query, paths=paths_in_skills)
skills = interpreter.computer.skills.search(query, paths=paths_in_skills)
lowercase_skills = [skill[0].lower() + skill[1:] for skill in skills]
output = "\\n".join(lowercase_skills)
finally:
sys.stdout = original_stdout
sys.stderr = original_stderr

Loading…
Cancel
Save