aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-06-20 17:50:56 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-08-09 10:00:16 +0200
commit02c78be7902bff1806816776edbbc59473b11b3e (patch)
treef9be4a6ed68f8657e48c9d02843ad2d57f0f5fa1 /lib/public
parent0024f0d1cb12421ec6fd59b01875c8b2045ad657 (diff)
downloadnextcloud-server-02c78be7902bff1806816776edbbc59473b11b3e.tar.gz
nextcloud-server-02c78be7902bff1806816776edbbc59473b11b3e.zip
LLM OCP API: Fix static analysis
Signed-off-by: Marcel Klehr <mklehr@gmx.net> (cherry picked from commit fac83ce4b66cde708c720284f7102090ac99d540)
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/LanguageModel/FreePromptTask.php6
-rw-r--r--lib/public/LanguageModel/SummaryTask.php16
-rw-r--r--lib/public/LanguageModel/TopicsTask.php16
3 files changed, 32 insertions, 6 deletions
diff --git a/lib/public/LanguageModel/FreePromptTask.php b/lib/public/LanguageModel/FreePromptTask.php
index c577d9c653b..75d8f1a0da2 100644
--- a/lib/public/LanguageModel/FreePromptTask.php
+++ b/lib/public/LanguageModel/FreePromptTask.php
@@ -20,10 +20,16 @@ final class FreePromptTask extends AbstractLanguageModelTask {
return $provider->prompt($this->getInput());
}
+ /**
+ * @inheritDoc
+ */
public function canUseProvider(ILanguageModelProvider $provider): bool {
return true;
}
+ /**
+ * @inheritDoc
+ */
public function getType(): string {
return self::TYPE;
}
diff --git a/lib/public/LanguageModel/SummaryTask.php b/lib/public/LanguageModel/SummaryTask.php
index 3c300246f03..0f7a96287c3 100644
--- a/lib/public/LanguageModel/SummaryTask.php
+++ b/lib/public/LanguageModel/SummaryTask.php
@@ -4,13 +4,17 @@ namespace OCP\LanguageModel;
use RuntimeException;
+/**
+ * @since 28.0.0
+ */
final class SummaryTask extends AbstractLanguageModelTask {
+ /**
+ * @since 28.0.0
+ */
public const TYPE = 'summarize';
/**
- * @param ILanguageModelProvider $provider
- * @throws RuntimeException
- * @return string
+ * @inheritDoc
*/
public function visitProvider(ILanguageModelProvider $provider): string {
if (!$provider instanceof ISummaryProvider) {
@@ -19,10 +23,16 @@ final class SummaryTask extends AbstractLanguageModelTask {
return $provider->summarize($this->getInput());
}
+ /**
+ * @inheritDoc
+ */
public function canUseProvider(ILanguageModelProvider $provider): bool {
return $provider instanceof ISummaryProvider;
}
+ /**
+ * @inheritDoc
+ */
public function getType(): string {
return self::TYPE;
}
diff --git a/lib/public/LanguageModel/TopicsTask.php b/lib/public/LanguageModel/TopicsTask.php
index 98ffabfc815..f704afdcfc0 100644
--- a/lib/public/LanguageModel/TopicsTask.php
+++ b/lib/public/LanguageModel/TopicsTask.php
@@ -4,13 +4,17 @@ namespace OCP\LanguageModel;
use RuntimeException;
+/**
+ * @since 28.0.0
+ */
final class TopicsTask extends AbstractLanguageModelTask {
+ /**
+ * @since 28.0.0
+ */
public const TYPE = 'topics';
/**
- * @param ILanguageModelProvider $provider
- * @throws RuntimeException
- * @return string
+ * @inheritDoc
*/
public function visitProvider(ILanguageModelProvider $provider): string {
if (!$provider instanceof ITopicsProvider) {
@@ -19,10 +23,16 @@ final class TopicsTask extends AbstractLanguageModelTask {
return $provider->findTopics($this->getInput());
}
+ /**
+ * @inheritDoc
+ */
public function canUseProvider(ILanguageModelProvider $provider): bool {
return $provider instanceof ITopicsProvider;
}
+ /**
+ * @inheritDoc
+ */
public function getType(): string {
return self::TYPE;
}