|
1 | | -from ovos_plugin_manager.templates.embeddings import EmbeddingsDB, TextEmbeddingsStore, FaceEmbeddingsStore, VoiceEmbeddingsStore |
| 1 | +from ovos_plugin_manager.templates.embeddings import EmbeddingsDB, ImageEmbedder, TextEmbedder, VoiceEmbedder, FaceEmbedder |
2 | 2 | from ovos_plugin_manager.utils import PluginTypes |
3 | 3 |
|
4 | 4 |
|
5 | | -def find_embeddings_plugins() -> dict: |
| 5 | +def find_embeddings_db_plugins() -> dict: |
6 | 6 | """ |
7 | | - Find all installed plugins |
8 | | - @return: dict plugin names to entrypoints |
| 7 | + Discover all installed general embeddings database plugins. |
| 8 | + |
| 9 | + Returns: |
| 10 | + dict: A mapping of plugin names to their entrypoints for general embeddings database plugins. |
9 | 11 | """ |
10 | 12 | from ovos_plugin_manager.utils import find_plugins |
11 | 13 | return find_plugins(PluginTypes.EMBEDDINGS) |
12 | 14 |
|
13 | 15 |
|
14 | | -def load_embeddings_plugin(module_name: str) -> type(EmbeddingsDB): |
| 16 | +def load_embeddings_db_plugin(module_name: str) -> type(EmbeddingsDB): |
15 | 17 | """ |
16 | | - Get an uninstantiated class for the requested module_name |
17 | | - @param module_name: Plugin entrypoint name to load |
18 | | - @return: Uninstantiated class |
| 18 | + Load and return the uninstantiated class of a general embeddings database plugin by its module name. |
| 19 | + |
| 20 | + Parameters: |
| 21 | + module_name (str): The entrypoint name of the embeddings database plugin to load. |
| 22 | + |
| 23 | + Returns: |
| 24 | + type(EmbeddingsDB): The plugin class corresponding to the specified module name. |
19 | 25 | """ |
20 | 26 | from ovos_plugin_manager.utils import load_plugin |
21 | 27 | return load_plugin(module_name, PluginTypes.EMBEDDINGS) |
22 | 28 |
|
23 | 29 |
|
24 | 30 | def find_voice_embeddings_plugins() -> dict: |
25 | 31 | """ |
26 | | - Find all installed plugins |
27 | | - @return: dict plugin names to entrypoints |
| 32 | + Discover all installed voice embeddings plugins. |
| 33 | + |
| 34 | + Returns: |
| 35 | + dict: A mapping of plugin names to their entrypoints for available voice embeddings plugins. |
28 | 36 | """ |
29 | 37 | from ovos_plugin_manager.utils import find_plugins |
30 | 38 | return find_plugins(PluginTypes.VOICE_EMBEDDINGS) |
31 | 39 |
|
32 | 40 |
|
33 | | -def load_voice_embeddings_plugin(module_name: str) -> type(VoiceEmbeddingsStore): |
| 41 | +def load_voice_embeddings_plugin(module_name: str) -> type(VoiceEmbedder): |
34 | 42 | """ |
35 | | - Get an uninstantiated class for the requested module_name |
36 | | - @param module_name: Plugin entrypoint name to load |
37 | | - @return: Uninstantiated class |
| 43 | + Load and return the uninstantiated class of a voice embeddings plugin by its module name. |
| 44 | + |
| 45 | + Parameters: |
| 46 | + module_name (str): The entrypoint name of the voice embeddings plugin to load. |
| 47 | + |
| 48 | + Returns: |
| 49 | + type(VoiceEmbedder): The uninstantiated class of the specified voice embeddings plugin. |
38 | 50 | """ |
39 | 51 | from ovos_plugin_manager.utils import load_plugin |
40 | 52 | return load_plugin(module_name, PluginTypes.VOICE_EMBEDDINGS) |
41 | 53 |
|
42 | 54 |
|
| 55 | +def find_image_embeddings_plugins() -> dict: |
| 56 | + """ |
| 57 | + Discover all installed image embeddings plugins. |
| 58 | + |
| 59 | + Returns: |
| 60 | + dict: A mapping of plugin names to their entrypoints for image embeddings plugins. |
| 61 | + """ |
| 62 | + from ovos_plugin_manager.utils import find_plugins |
| 63 | + return find_plugins(PluginTypes.IMAGE_EMBEDDINGS) |
| 64 | + |
| 65 | + |
| 66 | +def load_image_embeddings_plugin(module_name: str) -> type(ImageEmbedder): |
| 67 | + """ |
| 68 | + Load and return the uninstantiated class of an image embeddings plugin specified by its module name. |
| 69 | + |
| 70 | + Parameters: |
| 71 | + module_name (str): The entrypoint name of the image embeddings plugin to load. |
| 72 | + |
| 73 | + Returns: |
| 74 | + type(ImageEmbedder): The uninstantiated class of the requested image embeddings plugin. |
| 75 | + """ |
| 76 | + from ovos_plugin_manager.utils import load_plugin |
| 77 | + return load_plugin(module_name, PluginTypes.IMAGE_EMBEDDINGS) |
| 78 | + |
43 | 79 | def find_face_embeddings_plugins() -> dict: |
44 | 80 | """ |
45 | | - Find all installed plugins |
46 | | - @return: dict plugin names to entrypoints |
| 81 | + Find all installed face embeddings plugins. |
| 82 | + |
| 83 | + Returns: |
| 84 | + dict: A mapping of plugin names to their entrypoints for face embeddings plugins. |
47 | 85 | """ |
48 | 86 | from ovos_plugin_manager.utils import find_plugins |
49 | 87 | return find_plugins(PluginTypes.FACE_EMBEDDINGS) |
50 | 88 |
|
51 | 89 |
|
52 | | -def load_face_embeddings_plugin(module_name: str) -> type(FaceEmbeddingsStore): |
| 90 | +def load_face_embeddings_plugin(module_name: str) -> type(FaceEmbedder): |
53 | 91 | """ |
54 | | - Get an uninstantiated class for the requested module_name |
55 | | - @param module_name: Plugin entrypoint name to load |
56 | | - @return: Uninstantiated class |
| 92 | + Load and return the uninstantiated class of a face embeddings plugin by its module name. |
| 93 | + |
| 94 | + Parameters: |
| 95 | + module_name (str): The entrypoint name of the face embeddings plugin to load. |
| 96 | + |
| 97 | + Returns: |
| 98 | + type(FaceEmbedder): The uninstantiated class of the specified face embeddings plugin. |
57 | 99 | """ |
58 | 100 | from ovos_plugin_manager.utils import load_plugin |
59 | 101 | return load_plugin(module_name, PluginTypes.FACE_EMBEDDINGS) |
60 | 102 |
|
61 | 103 |
|
62 | 104 | def find_text_embeddings_plugins() -> dict: |
63 | 105 | """ |
64 | | - Find all installed plugins |
65 | | - @return: dict plugin names to entrypoints |
| 106 | + Discover all installed text embeddings plugins. |
| 107 | + |
| 108 | + Returns: |
| 109 | + dict: A mapping of plugin names to their entrypoints for text embeddings plugins. |
66 | 110 | """ |
67 | 111 | from ovos_plugin_manager.utils import find_plugins |
68 | 112 | return find_plugins(PluginTypes.TEXT_EMBEDDINGS) |
69 | 113 |
|
70 | 114 |
|
71 | | -def load_text_embeddings_plugin(module_name: str) -> type(TextEmbeddingsStore): |
| 115 | +def load_text_embeddings_plugin(module_name: str) -> type(TextEmbedder): |
72 | 116 | """ |
73 | | - Get an uninstantiated class for the requested module_name |
74 | | - @param module_name: Plugin entrypoint name to load |
75 | | - @return: Uninstantiated class |
| 117 | + Load and return the uninstantiated class of a text embeddings plugin specified by its module name. |
| 118 | + |
| 119 | + Parameters: |
| 120 | + module_name (str): The entrypoint name of the text embeddings plugin to load. |
| 121 | + |
| 122 | + Returns: |
| 123 | + type(TextEmbedder): The uninstantiated class of the specified text embeddings plugin. |
76 | 124 | """ |
77 | 125 | from ovos_plugin_manager.utils import load_plugin |
78 | 126 | return load_plugin(module_name, PluginTypes.TEXT_EMBEDDINGS) |
0 commit comments