Skip to content

Commit 913c3d3

Browse files
authored
Create intent_transformers.py (#319)
1 parent aebafc9 commit 913c3d3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from ovos_plugin_manager.templates.transformers import IntentTransformer
2+
from ovos_plugin_manager.utils import PluginTypes
3+
4+
5+
def find_intent_transformer_plugins() -> dict:
6+
"""
7+
Find all installed plugins
8+
@return: dict plugin names to entrypoints
9+
"""
10+
from ovos_plugin_manager.utils import find_plugins
11+
return find_plugins(PluginTypes.INTENT_TRANSFORMER)
12+
13+
14+
def load_intent_transformer_plugin(module_name: str) -> \
15+
type(IntentTransformer):
16+
"""
17+
Get an uninstantiated class for the requested module_name
18+
@param module_name: Plugin entrypoint name to load
19+
@return: Uninstantiated class
20+
"""
21+
from ovos_plugin_manager.utils import load_plugin
22+
return load_plugin(module_name, PluginTypes.INTENT_TRANSFORMER)

0 commit comments

Comments
 (0)