Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@
'OCP\\TaskProcessing\\TaskTypes\\TextToTextFormalization' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/TextToTextFormalization.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextHeadline' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/TextToTextHeadline.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextProofread' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/TextToTextProofread.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextReformatParagraphs' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/TextToTextReformatParagraphs.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextReformulation' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/TextToTextReformulation.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextSimplification' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/TextToTextSimplification.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextSummary' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/TextToTextSummary.php',
Expand Down
1 change: 1 addition & 0 deletions lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\TaskProcessing\\TaskTypes\\TextToTextFormalization' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/TextToTextFormalization.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextHeadline' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/TextToTextHeadline.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextProofread' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/TextToTextProofread.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextReformatParagraphs' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/TextToTextReformatParagraphs.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextReformulation' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/TextToTextReformulation.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextSimplification' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/TextToTextSimplification.php',
'OCP\\TaskProcessing\\TaskTypes\\TextToTextSummary' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/TextToTextSummary.php',
Expand Down
2 changes: 2 additions & 0 deletions lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
use OCP\TaskProcessing\TaskTypes\TextToTextFormalization;
use OCP\TaskProcessing\TaskTypes\TextToTextHeadline;
use OCP\TaskProcessing\TaskTypes\TextToTextProofread;
use OCP\TaskProcessing\TaskTypes\TextToTextReformatParagraphs;
use OCP\TaskProcessing\TaskTypes\TextToTextReformulation;
use OCP\TaskProcessing\TaskTypes\TextToTextSimplification;
use OCP\TaskProcessing\TaskTypes\TextToTextSummary;
Expand Down Expand Up @@ -689,6 +690,7 @@ private function _getTaskTypes(): array {
TextToTextChatWithTools::ID => Server::get(TextToTextChatWithTools::class),
ContextAgentInteraction::ID => Server::get(ContextAgentInteraction::class),
TextToTextProofread::ID => Server::get(TextToTextProofread::class),
TextToTextReformatParagraphs::ID => Server::get(TextToTextReformatParagraphs::class),
TextToSpeech::ID => Server::get(TextToSpeech::class),
AudioToAudioChat::ID => Server::get(AudioToAudioChat::class),
ContextAgentAudioInteraction::ID => Server::get(ContextAgentAudioInteraction::class),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCP\TaskProcessing\TaskTypes;

use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\ShapeDescriptor;

/**
* This is the task processing task type for reformatting text into paragraphs
* @since 34.0.0
*/
class TextToTextReformatParagraphs implements ITaskType {
/**
* @since 34.0.0
*/
public const ID = 'core:text2text:reformatparagraphs';

private IL10N $l;

/**
* @param IFactory $l10nFactory
* @since 34.0.0
*/
public function __construct(
IFactory $l10nFactory,
) {
$this->l = $l10nFactory->get('lib');
}

/**
* @inheritDoc
* @since 34.0.0
*/
#[\Override]
public function getName(): string {
return $this->l->t('Reformat paragraphs');
}

/**
* @inheritDoc
* @since 34.0.0
*/
#[\Override]
public function getDescription(): string {
return $this->l->t('Reformats a text into multiple paragraphs separated by topic');
}

/**
* @return string
* @since 34.0.0
*/
#[\Override]
public function getId(): string {
return self::ID;
}

/**
* @return ShapeDescriptor[]
* @since 34.0.0
*/
#[\Override]
public function getInputShape(): array {
return [
'input' => new ShapeDescriptor(
$this->l->t('Text'),
$this->l->t('The text to reformat'),
EShapeType::Text
),
];
}

/**
* @return ShapeDescriptor[]
* @since 34.0.0
*/
#[\Override]
public function getOutputShape(): array {
return [
'output' => new ShapeDescriptor(
$this->l->t('Reformatted text'),
$this->l->t('The reformatted text with paragraphs separated by topic'),
EShapeType::Text
),
];
}
}
Loading