@@ -24,6 +24,9 @@ class Skills:
24
24
"""
25
25
Manages access to pre-imported automation skills.
26
26
27
+ Note: Skills system must be enabled via profile (like 'the01') or by creating
28
+ OpenInterpreter with import_skills=True.
29
+
27
30
Available methods:
28
31
- list(): Returns names of available skills
29
32
- search(query): Lists available skills (currently same as list())
@@ -47,6 +50,15 @@ def list(self):
47
50
Returns:
48
51
list[str]: Names of available skills with () to indicate they're callable
49
52
"""
53
+ if not self .computer .import_skills :
54
+ print ("Skills are disabled. To enable skills, either use a profile like 'the01' that supports skills, "
55
+ "or create an instance of OpenInterpreter with import_skills=True" )
56
+ return []
57
+
58
+ if not self .computer ._has_imported_skills :
59
+ print ("Skills have not been imported yet." )
60
+ return []
61
+
50
62
return [
51
63
file .replace (".py" , "()" )
52
64
for file in os .listdir (self .path )
@@ -70,6 +82,15 @@ def search(self, query):
70
82
Returns:
71
83
list[str]: Names of available skills with () to indicate they're callable
72
84
"""
85
+ if not self .computer .import_skills :
86
+ print ("Skills are disabled. To enable skills, either use a profile like 'the01' that supports skills, "
87
+ "or create an instance of OpenInterpreter with import_skills=True" )
88
+ return []
89
+
90
+ if not self .computer ._has_imported_skills :
91
+ print ("Skills have not been imported yet." )
92
+ return []
93
+
73
94
return [
74
95
file .replace (".py" , "()" )
75
96
for file in os .listdir (self .path )
@@ -84,6 +105,9 @@ def import_skills(self):
84
105
This method is called automatically during system setup to load available skills.
85
106
Assistant should use list(), search(), or call skills directly instead of this method.
86
107
"""
108
+ if not self .computer .import_skills :
109
+ return
110
+
87
111
previous_save_skills_setting = self .computer .save_skills
88
112
89
113
self .computer .save_skills = False
0 commit comments