FakeTextProcessingProvider.php 710 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Testing\Provider;
  7. use OCP\TextProcessing\FreePromptTaskType;
  8. use OCP\TextProcessing\IProvider;
  9. use OCP\TextProcessing\ITaskType;
  10. /** @template-implements IProvider<FreePromptTaskType|ITaskType> */
  11. class FakeTextProcessingProvider implements IProvider {
  12. public function getName(): string {
  13. return 'Fake text processing provider (asynchronous)';
  14. }
  15. public function process(string $prompt): string {
  16. return strrev($prompt) . ' (done with FakeTextProcessingProvider)';
  17. }
  18. public function getTaskType(): string {
  19. return FreePromptTaskType::class;
  20. }
  21. }