21
21
22
22
23
23
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
+ """
24
38
def __init__ (self , computer ):
25
39
self .computer = computer
26
40
self .path = str (Path (oi_dir ) / "skills" )
27
41
self .new_skill = NewSkill (self )
28
42
29
43
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
+ """
30
50
return [
31
51
file .replace (".py" , "()" )
32
52
for file in os .listdir (self .path )
33
53
if file .endswith (".py" )
34
54
]
35
55
36
56
def run (self , skill ):
57
+ """
58
+ DEPRECATED: Do not use this method.
59
+ Skills are already imported - call them directly as functions instead.
60
+ """
37
61
print (
38
62
"To run a skill, run its name as a function name (it is already imported)."
39
63
)
40
64
41
65
def search (self , query ):
42
66
"""
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
44
72
"""
45
73
return [
46
74
file .replace (".py" , "()" )
@@ -49,6 +77,13 @@ def search(self, query):
49
77
]
50
78
51
79
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
+ """
52
87
previous_save_skills_setting = self .computer .save_skills
53
88
54
89
self .computer .save_skills = False
0 commit comments