IProvider.php 968 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\TextProcessing;
  8. use RuntimeException;
  9. /**
  10. * This is the interface that is implemented by apps that
  11. * implement a text processing provider
  12. * @psalm-template-covariant T of ITaskType
  13. * @since 27.1.0
  14. * @deprecated 30.0.0
  15. */
  16. interface IProvider {
  17. /**
  18. * The localized name of this provider
  19. * @since 27.1.0
  20. */
  21. public function getName(): string;
  22. /**
  23. * Processes a text
  24. *
  25. * @param string $prompt The input text
  26. * @return string the output text
  27. * @since 27.1.0
  28. * @throws RuntimeException If the text could not be processed
  29. */
  30. public function process(string $prompt): string;
  31. /**
  32. * Returns the task type class string of the task type, that this
  33. * provider handles
  34. *
  35. * @since 27.1.0
  36. * @return class-string<T>
  37. */
  38. public function getTaskType(): string;
  39. }