Fixed skill library
This commit is contained in:
parent
8789443bea
commit
d5131b5d8a
|
@ -1,5 +0,0 @@
|
||||||
import sys
|
|
||||||
|
|
||||||
def explore_functions():
|
|
||||||
"""None"""
|
|
||||||
import sys
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
def fibonacci():
|
|
||||||
"""None"""
|
|
||||||
fib = [0, 1]
|
|
|
@ -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")
|
|
@ -1,5 +0,0 @@
|
||||||
import time
|
|
||||||
|
|
||||||
def schedule_fixed():
|
|
||||||
"""None"""
|
|
||||||
time.sleep(delay)
|
|
|
@ -172,7 +172,7 @@ finally:
|
||||||
|
|
||||||
# SKILLS
|
# 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
|
import sys
|
||||||
|
@ -186,9 +186,9 @@ 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']
|
query = combined_messages
|
||||||
interpreter.computer.skills.path = OI_SKILLS_DIR
|
interpreter.computer.skills.path = '''OI_SKILLS_DIR'''
|
||||||
|
|
||||||
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]
|
||||||
|
|
|
@ -87,6 +87,7 @@ def teach():
|
||||||
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
|
||||||
for chunk in interpreter.chat(step, stream=True, display=False):
|
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:
|
if chunk["role"] == "computer" and "start" not in chunk and "end" not in chunk:
|
||||||
chunk_type = chunk["type"]
|
chunk_type = chunk["type"]
|
||||||
chunk_content = chunk["content"]
|
chunk_content = chunk["content"]
|
||||||
|
|
Loading…
Reference in New Issue