diff options
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/LanguageModel/FreePromptTask.php | 6 | ||||
-rw-r--r-- | lib/public/LanguageModel/SummaryTask.php | 16 | ||||
-rw-r--r-- | lib/public/LanguageModel/TopicsTask.php | 16 |
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; } |