Skip to content

Commit 75ef14d

Browse files
committed
Add docstrings to explain skills system to OI
OI tries to call help(computer.skills.import_skills) or help(computer.skills.list), for instance and there is no documentation.
1 parent 21babb1 commit 75ef14d

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

interpreter/core/computer/skills/skills.py

+36-1
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,54 @@
2121

2222

2323
class Skills:
24+
"""
25+
Manages access to pre-imported automation skills.
26+
27+
Available methods:
28+
- list(): Returns names of available skills
29+
- search(query): Lists available skills (currently same as list())
30+
31+
Usage:
32+
To use a skill, call it directly as a function:
33+
example_skill()
34+
35+
To create a new skill:
36+
computer.skills.new_skill.create()
37+
"""
2438
def __init__(self, computer):
2539
self.computer = computer
2640
self.path = str(Path(oi_dir) / "skills")
2741
self.new_skill = NewSkill(self)
2842

2943
def list(self):
44+
"""
45+
Lists all available skills. Skills are already imported and can be called directly.
46+
47+
Returns:
48+
list[str]: Names of available skills with () to indicate they're callable
49+
"""
3050
return [
3151
file.replace(".py", "()")
3252
for file in os.listdir(self.path)
3353
if file.endswith(".py")
3454
]
3555

3656
def run(self, skill):
57+
"""
58+
DEPRECATED: Do not use this method.
59+
Skills are already imported - call them directly as functions instead.
60+
"""
3761
print(
3862
"To run a skill, run its name as a function name (it is already imported)."
3963
)
4064

4165
def search(self, query):
4266
"""
43-
This just lists all for now.
67+
Lists available skills (currently same as list()).
68+
Skills are already imported and can be called directly.
69+
70+
Returns:
71+
list[str]: Names of available skills with () to indicate they're callable
4472
"""
4573
return [
4674
file.replace(".py", "()")
@@ -49,6 +77,13 @@ def search(self, query):
4977
]
5078

5179
def import_skills(self):
80+
"""
81+
[INTERNAL METHOD - NOT FOR Assistant USE]
82+
System initialization method that imports all Python files from the skills directory.
83+
84+
This method is called automatically during system setup to load available skills.
85+
Assistant should use list(), search(), or call skills directly instead of this method.
86+
"""
5287
previous_save_skills_setting = self.computer.save_skills
5388

5489
self.computer.save_skills = False

0 commit comments

Comments
 (0)