aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/LanguageModel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/LanguageModel')
-rw-r--r--lib/public/LanguageModel/AbstractLanguageModelTask.php178
-rw-r--r--lib/public/LanguageModel/Events/AbstractLanguageModelEvent.php51
-rw-r--r--lib/public/LanguageModel/Events/TaskFailedEvent.php30
-rw-r--r--lib/public/LanguageModel/Events/TaskSuccessfulEvent.php18
-rw-r--r--lib/public/LanguageModel/FreePromptTask.php61
-rw-r--r--lib/public/LanguageModel/HeadlineTask.php66
-rw-r--r--lib/public/LanguageModel/IHeadlineProvider.php44
-rw-r--r--lib/public/LanguageModel/ILanguageModelManager.php81
-rw-r--r--lib/public/LanguageModel/ILanguageModelProvider.php49
-rw-r--r--lib/public/LanguageModel/ILanguageModelTask.php146
-rw-r--r--lib/public/LanguageModel/ISummaryProvider.php44
-rw-r--r--lib/public/LanguageModel/ITopicsProvider.php44
-rw-r--r--lib/public/LanguageModel/SummaryTask.php66
-rw-r--r--lib/public/LanguageModel/TopicsTask.php66
14 files changed, 0 insertions, 944 deletions
diff --git a/lib/public/LanguageModel/AbstractLanguageModelTask.php b/lib/public/LanguageModel/AbstractLanguageModelTask.php
deleted file mode 100644
index 91b81b9615b..00000000000
--- a/lib/public/LanguageModel/AbstractLanguageModelTask.php
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-namespace OCP\LanguageModel;
-
-/**
- * This is an abstract LanguageModel task that implements basic
- * goodies for downstream tasks
- * @since 28.0.
- * @template T of ILanguageModelProvider
- * @template-implements ILanguageModelTask<T>
- */
-abstract class AbstractLanguageModelTask implements ILanguageModelTask {
- protected ?int $id = null;
- protected ?string $output = null;
-
- /**
- * @psalm-var ILanguageModelTask::STATUS_*
- */
- protected int $status = ILanguageModelTask::STATUS_UNKNOWN;
-
- /**
- * @param string $input
- * @param string $appId
- * @param string|null $userId
- * @param string $identifier An arbitrary identifier for this task. max length: 255 chars
- * @since 27.1.0
- */
- final public function __construct(
- protected string $input,
- protected string $appId,
- protected ?string $userId,
- protected string $identifier = '',
- ) {
- }
-
- /**
- * @return string
- * @since 27.1.0
- */
- abstract public function getType(): string;
-
- /**
- * @return string|null
- * @since 27.1.0
- */
- final public function getOutput(): ?string {
- return $this->output;
- }
-
- /**
- * @param string|null $output
- * @since 27.1.0
- */
- final public function setOutput(?string $output): void {
- $this->output = $output;
- }
-
- /**
- * @psalm-return ILanguageModelTask::STATUS_*
- * @since 27.1.0
- */
- final public function getStatus(): int {
- return $this->status;
- }
-
- /**
- * @psalm-param ILanguageModelTask::STATUS_* $status
- * @since 27.1.0
- */
- final public function setStatus(int $status): void {
- $this->status = $status;
- }
-
- /**
- * @return int|null
- * @since 27.1.0
- */
- final public function getId(): ?int {
- return $this->id;
- }
-
- /**
- * @param int|null $id
- * @since 27.1.0
- */
- final public function setId(?int $id): void {
- $this->id = $id;
- }
-
- /**
- * @return string
- * @since 27.1.0
- */
- final public function getInput(): string {
- return $this->input;
- }
-
- /**
- * @return string
- * @since 27.1.0
- */
- final public function getAppId(): string {
- return $this->appId;
- }
-
- /**
- * @return string
- * @since 27.1.0
- */
- final public function getIdentifier(): string {
- return $this->identifier;
- }
-
- /**
- * @return string|null
- * @since 27.1.0
- */
- final public function getUserId(): ?string {
- return $this->userId;
- }
-
- /**
- * @return array
- * @since 27.1.0
- */
- public function jsonSerialize() {
- return [
- 'id' => $this->getId(),
- 'type' => $this->getType(),
- 'status' => $this->getStatus(),
- 'userId' => $this->getUserId(),
- 'appId' => $this->getAppId(),
- 'input' => $this->getInput(),
- 'output' => $this->getOutput(),
- 'identifier' => $this->getIdentifier(),
- ];
- }
-
- /**
- * @param string $type
- * @param string $input
- * @param string|null $userId
- * @param string $appId
- * @param string $identifier
- * @return ILanguageModelTask
- * @throws \InvalidArgumentException
- * @since 27.1.0
- */
- final public static function factory(string $type, string $input, ?string $userId, string $appId, string $identifier = ''): ILanguageModelTask {
- if (!in_array($type, array_keys(self::TYPES))) {
- throw new \InvalidArgumentException('Unknown task type');
- }
- return new (ILanguageModelTask::TYPES[$type])($input, $appId, $userId, $identifier);
- }
-}
diff --git a/lib/public/LanguageModel/Events/AbstractLanguageModelEvent.php b/lib/public/LanguageModel/Events/AbstractLanguageModelEvent.php
deleted file mode 100644
index c8abc7373eb..00000000000
--- a/lib/public/LanguageModel/Events/AbstractLanguageModelEvent.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- *
- */
-namespace OCP\LanguageModel\Events;
-
-use OCP\EventDispatcher\Event;
-use OCP\LanguageModel\ILanguageModelTask;
-
-/**
- * @since 27.1.0
- */
-abstract class AbstractLanguageModelEvent extends Event {
- /**
- * @since 27.1.0
- */
- public function __construct(
- private ILanguageModelTask $task
- ) {
- parent::__construct();
- }
-
- /**
- * @return ILanguageModelTask
- * @since 27.1.0
- */
- public function getTask(): ILanguageModelTask {
- return $this->task;
- }
-}
diff --git a/lib/public/LanguageModel/Events/TaskFailedEvent.php b/lib/public/LanguageModel/Events/TaskFailedEvent.php
deleted file mode 100644
index f42203a6e48..00000000000
--- a/lib/public/LanguageModel/Events/TaskFailedEvent.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-namespace OCP\LanguageModel\Events;
-
-use OCP\LanguageModel\ILanguageModelTask;
-
-/**
- * @since 27.1.0
- */
-class TaskFailedEvent extends AbstractLanguageModelEvent {
- /**
- * @param ILanguageModelTask $task
- * @param string $errorMessage
- * @since 27.1.0
- */
- public function __construct(
- ILanguageModelTask $task,
- private string $errorMessage,
- ) {
- parent::__construct($task);
- }
-
- /**
- * @return string
- * @since 27.1.0
- */
- public function getErrorMessage(): string {
- return $this->errorMessage;
- }
-}
diff --git a/lib/public/LanguageModel/Events/TaskSuccessfulEvent.php b/lib/public/LanguageModel/Events/TaskSuccessfulEvent.php
deleted file mode 100644
index 77a61ac5c6e..00000000000
--- a/lib/public/LanguageModel/Events/TaskSuccessfulEvent.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-namespace OCP\LanguageModel\Events;
-
-use OCP\LanguageModel\ILanguageModelTask;
-
-/**
- * @since 27.1.0
- */
-class TaskSuccessfulEvent extends AbstractLanguageModelEvent {
- /**
- * @param ILanguageModelTask $task
- * @since 27.1.0
- */
- public function __construct(ILanguageModelTask $task) {
- parent::__construct($task);
- }
-}
diff --git a/lib/public/LanguageModel/FreePromptTask.php b/lib/public/LanguageModel/FreePromptTask.php
deleted file mode 100644
index 560d6e7d1fb..00000000000
--- a/lib/public/LanguageModel/FreePromptTask.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-namespace OCP\LanguageModel;
-
-/**
- * @since 27.1.0
- * @template-extends AbstractLanguageModelTask<ILanguageModelProvider>
- */
-final class FreePromptTask extends AbstractLanguageModelTask {
- /**
- * @since 27.1.0
- */
- public const TYPE = 'free_prompt';
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function visitProvider(ILanguageModelProvider $provider): string {
- return $provider->prompt($this->getInput());
- }
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function canUseProvider(ILanguageModelProvider $provider): bool {
- return true;
- }
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function getType(): string {
- return self::TYPE;
- }
-}
diff --git a/lib/public/LanguageModel/HeadlineTask.php b/lib/public/LanguageModel/HeadlineTask.php
deleted file mode 100644
index 4c62b9722a9..00000000000
--- a/lib/public/LanguageModel/HeadlineTask.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-namespace OCP\LanguageModel;
-
-/**
- * This LanguageModel Task represents headline generation
- * which generates a headline for the passed text
- * @since 27.1.0
- * @template-extends AbstractLanguageModelTask<IHeadlineProvider>
- */
-final class HeadlineTask extends AbstractLanguageModelTask {
- /**
- * @since 27.1.0
- */
- public const TYPE = 'headline';
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function visitProvider(ILanguageModelProvider $provider): string {
- if (!$this->canUseProvider($provider)) {
- throw new \RuntimeException('HeadlineTask#visitProvider expects IHeadlineProvider');
- }
- return $provider->findHeadline($this->getInput());
- }
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function canUseProvider(ILanguageModelProvider $provider): bool {
- return $provider instanceof IHeadlineProvider;
- }
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function getType(): string {
- return self::TYPE;
- }
-}
diff --git a/lib/public/LanguageModel/IHeadlineProvider.php b/lib/public/LanguageModel/IHeadlineProvider.php
deleted file mode 100644
index 30185f4d4b3..00000000000
--- a/lib/public/LanguageModel/IHeadlineProvider.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2022 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-
-namespace OCP\LanguageModel;
-
-use RuntimeException;
-
-/**
- * This LanguageModel Provider represents headline generation
- * which generates a headline for the passed text
- * @since 27.1.0
- */
-interface IHeadlineProvider extends ILanguageModelProvider {
- /**
- * @param string $text The text to find headline for
- * @returns string the headline
- * @since 27.1.0
- * @throws RuntimeException If the text could not be transcribed
- */
- public function findHeadline(string $text): string;
-}
diff --git a/lib/public/LanguageModel/ILanguageModelManager.php b/lib/public/LanguageModel/ILanguageModelManager.php
deleted file mode 100644
index 0afc99b91ab..00000000000
--- a/lib/public/LanguageModel/ILanguageModelManager.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-
-namespace OCP\LanguageModel;
-
-use OCP\Common\Exception\NotFoundException;
-use OCP\PreConditionNotMetException;
-use RuntimeException;
-
-/**
- * API surface for apps interacting with and making use of LanguageModel providers
- * without known which providers are installed
- * @since 27.1.0
- */
-interface ILanguageModelManager {
- /**
- * @since 27.1.0
- */
- public function hasProviders(): bool;
-
- /**
- * @return string[]
- * @since 27.1.0
- */
- public function getAvailableTaskClasses(): array;
-
- /**
- * @return string[]
- * @since 27.1.0
- */
- public function getAvailableTaskTypes(): array;
-
- /**
- * @throws PreConditionNotMetException If no or not the requested provider was registered but this method was still called
- * @throws RuntimeException If something else failed
- * @since 27.1.0
- */
- public function runTask(ILanguageModelTask $task): string;
-
- /**
- * Will schedule an LLM inference process in the background. The result will become available
- * with the \OCP\LanguageModel\Events\TaskSuccessfulEvent
- * If inference fails a \OCP\LanguageModel\Events\TaskFailedEvent will be dispatched instead
- *
- * @throws PreConditionNotMetException If no or not the requested provider was registered but this method was still called
- * @since 27.1.0
- */
- public function scheduleTask(ILanguageModelTask $task) : void;
-
- /**
- * @param int $id The id of the task
- * @return ILanguageModelTask
- * @throws RuntimeException If the query failed
- * @throws NotFoundException If the task could not be found
- * @since 27.1.0
- */
- public function getTask(int $id): ILanguageModelTask;
-}
diff --git a/lib/public/LanguageModel/ILanguageModelProvider.php b/lib/public/LanguageModel/ILanguageModelProvider.php
deleted file mode 100644
index 34e7eb6c4e5..00000000000
--- a/lib/public/LanguageModel/ILanguageModelProvider.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-
-namespace OCP\LanguageModel;
-
-use RuntimeException;
-
-/**
- * This is the minimum interface that is implemented by apps that
- * implement a LanguageModel provider
- * @since 27.1.0
- */
-interface ILanguageModelProvider {
- /**
- * @since 27.1.0
- */
- public function getName(): string;
-
- /**
- * @param string $prompt The prompt to call the model with
- * @return string the output
- * @since 27.1.0
- * @throws RuntimeException If the text could not be transcribed
- */
- public function prompt(string $prompt): string;
-}
diff --git a/lib/public/LanguageModel/ILanguageModelTask.php b/lib/public/LanguageModel/ILanguageModelTask.php
deleted file mode 100644
index 0f552c8de54..00000000000
--- a/lib/public/LanguageModel/ILanguageModelTask.php
+++ /dev/null
@@ -1,146 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-namespace OCP\LanguageModel;
-
-/**
- * @since 27.1.0
- * @template T of ILanguageModelProvider
- */
-interface ILanguageModelTask extends \JsonSerializable {
- /**
- * @since 27.1.0
- */
- public const STATUS_FAILED = 4;
- /**
- * @since 27.1.0
- */
- public const STATUS_SUCCESSFUL = 3;
- /**
- * @since 27.1.0
- */
- public const STATUS_RUNNING = 2;
- /**
- * @since 27.1.0
- */
- public const STATUS_SCHEDULED = 1;
- /**
- * @since 27.1.0
- */
- public const STATUS_UNKNOWN = 0;
-
- /**
- * @since 27.1.0
- */
- public const TYPES = [
- FreePromptTask::TYPE => FreePromptTask::class,
- SummaryTask::TYPE => SummaryTask::class,
- HeadlineTask::TYPE => HeadlineTask::class,
- TopicsTask::TYPE => TopicsTask::class,
- ];
-
- /**
- * @psalm-param T $provider
- * @param ILanguageModelProvider $provider
- * @return string
- * @since 27.1.0
- */
- public function visitProvider(ILanguageModelProvider $provider): string;
-
- /**
- * @psalm-param T $provider
- * @param ILanguageModelProvider $provider
- * @return bool
- * @since 27.1.0
- */
- public function canUseProvider(ILanguageModelProvider $provider): bool;
-
-
- /**
- * @return string
- * @since 27.1.0
- */
- public function getType(): string;
-
- /**
- * @return ILanguageModelTask::STATUS_*
- * @since 27.1.0
- */
- public function getStatus(): int;
-
- /**
- * @param ILanguageModelTask::STATUS_* $status
- * @since 27.1.0
- */
- public function setStatus(int $status): void;
-
- /**
- * @param int|null $id
- * @since 27.1.0
- */
- public function setId(?int $id): void;
-
- /**
- * @return int|null
- * @since 27.1.0
- */
- public function getId(): ?int;
-
- /**
- * @return string
- * @since 27.1.0
- */
- public function getInput(): string;
-
- /**
- * @param string|null $output
- * @since 27.1.0
- */
- public function setOutput(?string $output): void;
-
- /**
- * @return null|string
- * @since 27.1.0
- */
- public function getOutput(): ?string;
-
- /**
- * @return string
- * @since 27.1.0
- */
- public function getAppId(): string;
-
- /**
- * @return string
- * @since 27.1.0
- */
- public function getIdentifier(): string;
-
- /**
- * @return string|null
- * @since 27.1.0
- */
- public function getUserId(): ?string;
-}
diff --git a/lib/public/LanguageModel/ISummaryProvider.php b/lib/public/LanguageModel/ISummaryProvider.php
deleted file mode 100644
index c286e74eb19..00000000000
--- a/lib/public/LanguageModel/ISummaryProvider.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2022 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-
-namespace OCP\LanguageModel;
-
-use RuntimeException;
-
-/**
- * This LanguageModel Provider implements summarization
- * which sums up the passed text.
- * @since 27.1.0
- */
-interface ISummaryProvider extends ILanguageModelProvider {
- /**
- * @param string $text The text to summarize
- * @returns string the summary
- * @since 27.1.0
- * @throws RuntimeException If the text could not be transcribed
- */
- public function summarize(string $text): string;
-}
diff --git a/lib/public/LanguageModel/ITopicsProvider.php b/lib/public/LanguageModel/ITopicsProvider.php
deleted file mode 100644
index f061976a3ba..00000000000
--- a/lib/public/LanguageModel/ITopicsProvider.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-
-namespace OCP\LanguageModel;
-
-use RuntimeException;
-
-/**
- * This LanguageModel Provider implements topics synthesis
- * which outputs comma-separated topics for the passed text
- * @since 27.1.0
- */
-interface ITopicsProvider extends ILanguageModelProvider {
- /**
- * @param string $text The text to find topics for
- * @returns string the topics, comma separated
- * @since 27.1.0
- * @throws RuntimeException If the text could not be transcribed
- */
- public function findTopics(string $text): string;
-}
diff --git a/lib/public/LanguageModel/SummaryTask.php b/lib/public/LanguageModel/SummaryTask.php
deleted file mode 100644
index 47864532ae3..00000000000
--- a/lib/public/LanguageModel/SummaryTask.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-namespace OCP\LanguageModel;
-
-/**
- * This is an absctract LanguageModel Task represents summarization
- * which sums up the passed text.
- * @since 27.1.0
- * @template-extends AbstractLanguageModelTask<ISummaryProvider>
- */
-final class SummaryTask extends AbstractLanguageModelTask {
- /**
- * @since 27.1.0
- */
- public const TYPE = 'summarize';
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function visitProvider(ILanguageModelProvider $provider): string {
- if (!$this->canUseProvider($provider)) {
- throw new \RuntimeException('SummaryTask#visitProvider expects ISummaryProvider');
- }
- return $provider->summarize($this->getInput());
- }
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function canUseProvider(ILanguageModelProvider $provider): bool {
- return $provider instanceof ISummaryProvider;
- }
-
- /**
- * @inheritDoc
- * @since 27.1.0
- */
- public function getType(): string {
- return self::TYPE;
- }
-}
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 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
- *
- * @author Marcel Klehr <mklehr@gmx.net>
- *
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-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<ITopicsProvider>
- */
-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;
- }
-}