Expanded languages, OI_SKILL_DIR fix

pull/50/head
killian 11 months ago
parent d374da01b5
commit fb11fcd03b

@ -29,7 +29,7 @@ def configure_interpreter(interpreter: OpenInterpreter):
### MISC SETTINGS ### MISC SETTINGS
interpreter.auto_run = True interpreter.auto_run = True
interpreter.computer.languages = [l for l in interpreter.computer.languages if l.name.lower() == "python"] #interpreter.computer.languages = [l for l in interpreter.computer.languages if l.name.lower() == "python"]
interpreter.force_task_completion = True interpreter.force_task_completion = True
interpreter.offline = True interpreter.offline = True
interpreter.id = 206 # Used to identify itself to other interpreters. This should be changed programatically so it's unique. interpreter.id = 206 # Used to identify itself to other interpreters. This should be changed programatically so it's unique.

@ -1,6 +1,8 @@
# The dynamic system message is where most of the 01's behavior is configured. # The dynamic system message is where most of the 01's behavior is configured.
# You can put code into the system message {{ in brackets like this }} which will be rendered just before the interpreter starts writing a message. # You can put code into the system message {{ in brackets like this }} which will be rendered just before the interpreter starts writing a message.
import os
system_message = r""" system_message = r"""
You are the 01, an executive assistant that can complete **any** task. You are the 01, an executive assistant that can complete **any** task.
@ -132,10 +134,11 @@ from pathlib import Path
interpreter.model = "gpt-3.5" interpreter.model = "gpt-3.5"
combined_messages = "\\n".join(json.dumps(x) for x in messages[-3:]) combined_messages = "\\n".join(json.dumps(x) for x in messages[-3:])
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_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_msg = combined_messages
query = query_msg[0]['content'] query = query_msg[0]['content']
skills_path = Path().resolve() / '01OS/server/skills' interpreter.computer.skills.path = OI_SKILLS_DIR
paths_in_skills = [str(path) for path in skills_path.glob('**/*.py')]
skills = interpreter.computer.skills.search(query) skills = interpreter.computer.skills.search(query)
lowercase_skills = [skill[0].lower() + skill[1:] for skill in skills] lowercase_skills = [skill[0].lower() + skill[1:] for skill in skills]
output = "\\n".join(lowercase_skills) output = "\\n".join(lowercase_skills)
@ -162,8 +165,8 @@ For example:
> print(round(432/7, 3)) > print(round(432/7, 3))
> Assistant: 432 / 7 is 61.714. > Assistant: 432 / 7 is 61.714.
# BE CONCISE # FINAL MESSAGES
ALWAYS REMEMBER: You are running on a device called the O1, where the interface is entirely speech-based. Make your responses to the user **VERY short.** ALWAYS REMEMBER: You are running on a device called the O1, where the interface is entirely speech-based. Make your responses to the user **VERY short.**
""".strip() """.strip().replace("OI_SKILLS_DIR", os.getenv('OI_SKILLS_PATH'))
Loading…
Cancel
Save