FakeTextProcessingProviderSync.php 839 B

123456789101112131415161718192021222324252627282930313233
  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\IProviderWithExpectedRuntime;
  9. use OCP\TextProcessing\ITaskType;
  10. /**
  11. * @template-implements IProviderWithExpectedRuntime<FreePromptTaskType|ITaskType>
  12. */
  13. class FakeTextProcessingProviderSync implements IProviderWithExpectedRuntime {
  14. public function getName(): string {
  15. return 'Fake text processing provider (synchronous)';
  16. }
  17. public function process(string $prompt): string {
  18. return strrev($prompt) . ' (done with FakeTextProcessingProviderSync)';
  19. }
  20. public function getTaskType(): string {
  21. return FreePromptTaskType::class;
  22. }
  23. public function getExpectedRuntime(): int {
  24. return 1;
  25. }
  26. }