SummaryTaskType.php 892 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 OCP\IL10N;
  9. use OCP\L10N\IFactory;
  10. /**
  11. * This is the text processing task type for summaries
  12. * @since 27.1.0
  13. */
  14. class SummaryTaskType implements ITaskType {
  15. private IL10N $l;
  16. /**
  17. * Constructor for SummaryTaskType
  18. *
  19. * @param IFactory $l10nFactory
  20. * @since 27.1.0
  21. */
  22. public function __construct(
  23. IFactory $l10nFactory,
  24. ) {
  25. $this->l = $l10nFactory->get('core');
  26. }
  27. /**
  28. * @inheritDoc
  29. * @since 27.1.0
  30. */
  31. public function getName(): string {
  32. return $this->l->t('Summarize');
  33. }
  34. /**
  35. * @inheritDoc
  36. * @since 27.1.0
  37. */
  38. public function getDescription(): string {
  39. return $this->l->t('Summarizes text by reducing its length without losing key information.');
  40. }
  41. }