summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-06-16 13:27:59 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-08-09 09:55:24 +0200
commited3672a5c2abbeaa3976e4dcee8169b42d9c9783 (patch)
tree7025c16532d02ae00815cf1cd108feb62b38a4d9 /lib/private/AppFramework
parent7031072717f7cd121335777dee56ac6aa8c91da4 (diff)
downloadnextcloud-server-ed3672a5c2abbeaa3976e4dcee8169b42d9c9783.tar.gz
nextcloud-server-ed3672a5c2abbeaa3976e4dcee8169b42d9c9783.zip
LLM OCP API: Add to RegistrationContext
Signed-off-by: Marcel Klehr <mklehr@gmx.net> (cherry picked from commit 82d3b00ab1f5ed3206a986e4969778bff77ca560)
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index 8fcafab2d87..67e8b390c15 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -33,6 +33,7 @@ use Closure;
use OCP\Calendar\Resource\IBackend as IResourceBackend;
use OCP\Calendar\Room\IBackend as IRoomBackend;
use OCP\Collaboration\Reference\IReferenceProvider;
+use OCP\LanguageModel\ILanguageModelProvider;
use OCP\SpeechToText\ISpeechToTextProvider;
use OCP\Talk\ITalkBackend;
use OCP\Translation\ITranslationProvider;
@@ -115,6 +116,9 @@ class RegistrationContext {
/** @var ServiceRegistration<ISpeechToTextProvider>[] */
private $speechToTextProviders = [];
+ /** @var ServiceRegistration<ILanguageModelProvider>[] */
+ private $languageModelProviders = [];
+
/** @var ServiceRegistration<ICustomTemplateProvider>[] */
private $templateProviders = [];
@@ -262,6 +266,12 @@ class RegistrationContext {
$providerClass
);
}
+ public function registerLanguageModelProvider(string $providerClass): void {
+ $this->context->registerLanguageModelProvider(
+ $this->appId,
+ $providerClass
+ );
+ }
public function registerTemplateProvider(string $providerClass): void {
$this->context->registerTemplateProvider(
@@ -429,6 +439,10 @@ class RegistrationContext {
$this->speechToTextProviders[] = new ServiceRegistration($appId, $class);
}
+ public function registerLanguageModelProvider(string $appId, string $class): void {
+ $this->languageModelProviders[] = new ServiceRegistration($appId, $class);
+ }
+
public function registerTemplateProvider(string $appId, string $class): void {
$this->templateProviders[] = new ServiceRegistration($appId, $class);
}
@@ -708,6 +722,13 @@ class RegistrationContext {
}
/**
+ * @return ServiceRegistration<ILanguageModelProvider>[]
+ */
+ public function getLanguageModelProviders(): array {
+ return $this->languageModelProviders;
+ }
+
+ /**
* @return ServiceRegistration<ICustomTemplateProvider>[]
*/
public function getTemplateProviders(): array {