diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-10-24 14:20:45 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2023-12-19 12:31:21 +0100 |
commit | 928fee8ab47841cbc970a1e3b5176eb902fe748b (patch) | |
tree | 73b2a33a2ec09ac53497f186834991736d536373 /apps/settings | |
parent | d8381acf861202bed821e92f3cf8647db87a0efe (diff) | |
download | nextcloud-server-928fee8ab47841cbc970a1e3b5176eb902fe748b.tar.gz nextcloud-server-928fee8ab47841cbc970a1e3b5176eb902fe748b.zip |
enh(SpeechToText): Allow providers to declare a dynamic ID instead of using className
this allows AppAPI to register anonymous classes as SpeechToText providers
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/lib/Settings/Admin/ArtificialIntelligence.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php index 0af82a74c5e..8a283ba1e70 100644 --- a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php +++ b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php @@ -31,6 +31,7 @@ use OCP\IConfig; use OCP\IL10N; use OCP\Settings\IDelegatedSettings; use OCP\SpeechToText\ISpeechToTextManager; +use OCP\SpeechToText\ISpeechToTextProviderWithId; use OCP\TextProcessing\IManager; use OCP\TextProcessing\IProvider; use OCP\TextProcessing\ITaskType; @@ -69,7 +70,7 @@ class ArtificialIntelligence implements IDelegatedSettings { $sttProviders = []; foreach ($this->sttManager->getProviders() as $provider) { $sttProviders[] = [ - 'class' => $provider::class, + 'class' => $provider instanceof ISpeechToTextProviderWithId ? $provider->getId() : $provider::class, 'name' => $provider->getName(), ]; } |