From cf2c42ae36a3c7280887bd3f15329739f9a6d221 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 14 Jul 2023 15:59:50 +0200 Subject: Massive refactoring: Turn LanguageModel OCP API into TextProcessing API Signed-off-by: Marcel Klehr (cherry picked from commit ffe27ce14ca74b509c8721c9fba7c759498fa471) --- lib/public/LanguageModel/TopicsTask.php | 66 --------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 lib/public/LanguageModel/TopicsTask.php (limited to 'lib/public/LanguageModel/TopicsTask.php') diff --git a/lib/public/LanguageModel/TopicsTask.php b/lib/public/LanguageModel/TopicsTask.php deleted file mode 100644 index ab2c5916061..00000000000 --- a/lib/public/LanguageModel/TopicsTask.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * @author Marcel Klehr - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -namespace OCP\LanguageModel; - -/** - * This LanguageModel Task represents topics synthesis - * which outputs comma-separated topics for the passed text - * @since 27.1.0 - * @template-extends AbstractLanguageModelTask - */ -final class TopicsTask extends AbstractLanguageModelTask { - /** - * @since 27.1.0 - */ - public const TYPE = 'topics'; - - /** - * @inheritDoc - * @since 27.1.0 - */ - public function visitProvider(ILanguageModelProvider $provider): string { - if (!$this->canUseProvider($provider)) { - throw new \RuntimeException('TopicsTask#visitProvider expects ITopicsProvider'); - } - return $provider->findTopics($this->getInput()); - } - - /** - * @inheritDoc - * @since 27.1.0 - */ - public function canUseProvider(ILanguageModelProvider $provider): bool { - return $provider instanceof ITopicsProvider; - } - - /** - * @inheritDoc - * @since 27.1.0 - */ - public function getType(): string { - return self::TYPE; - } -} -- cgit v1.2.3