Fixed skill library

This commit is contained in:
killian 2024-02-19 02:20:24 -08:00
parent 8789443bea
commit d5131b5d8a
6 changed files with 30 additions and 19 deletions

View File

@ -1,5 +0,0 @@
import sys
def explore_functions():
"""None"""
import sys

View File

@ -1,5 +0,0 @@
def fibonacci():
"""None"""
fib = [0, 1]

View File

@ -0,0 +1,25 @@
def openAbleton():
"""open ableton"""
import os
os.system("open /Applications/Ableton\ Live\ 10\ Suite.app")
import os
# Search can be slow if there are many files
# This will search in the Applications folder only
applications = "/Applications/"
# walk function will generate the file names in a directory tree
# We will look for any application that contains "Ableton" in its name
for foldername, subfolders, filenames in os.walk(applications):
for filename in filenames:
if "Ableton" in filename:
ableton_path = os.path.join(foldername, filename)
break
ableton_path
os.system("open /Applications/Ableton\ Live\ 11\ Intro.app")

View File

@ -1,5 +0,0 @@
import time
def schedule_fixed():
"""None"""
time.sleep(delay)

View File

@ -172,7 +172,7 @@ finally:
# SKILLS
You may use the following functions (assume they're imported) to complete your goals whenever possible:
Try to use the following functions (assume they're imported) to complete your goals whenever possible:
{{
import sys
@ -186,9 +186,9 @@ interpreter.model = "gpt-3.5"
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 = combined_messages
query = query_msg[0]['content']
interpreter.computer.skills.path = OI_SKILLS_DIR
#query = query_msg[0]['content']
query = combined_messages
interpreter.computer.skills.path = '''OI_SKILLS_DIR'''
skills = interpreter.computer.skills.search(query)
lowercase_skills = [skill[0].lower() + skill[1:] for skill in skills]

View File

@ -87,6 +87,7 @@ def teach():
interpreter.computer.languages = [l for l in interpreter.computer.languages if l.name.lower() == "python"]
interpreter.force_task_completion = True
for chunk in interpreter.chat(step, stream=True, display=False):
print(chunk)
if chunk["role"] == "computer" and "start" not in chunk and "end" not in chunk:
chunk_type = chunk["type"]
chunk_content = chunk["content"]