Merge pull request #56928 from nextcloud/fix/taskprocessing-ocr

fix(TaskProcessing): Adjust OCR task type to allow for multiple files and pdfs
pull/56909/merge
Marcel Klehr 2025-12-09 13:52:57 +07:00 committed by GitHub
commit f967134f58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

@ -611,6 +611,7 @@ class Manager implements IManager {
\OCP\TaskProcessing\TaskTypes\AudioToAudioChat::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\AudioToAudioChat::class),
\OCP\TaskProcessing\TaskTypes\ContextAgentAudioInteraction::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\ContextAgentAudioInteraction::class),
\OCP\TaskProcessing\TaskTypes\AnalyzeImages::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\AnalyzeImages::class),
\OCP\TaskProcessing\TaskTypes\ImageToTextOpticalCharacterRecognition::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\ImageToTextOpticalCharacterRecognition::class),
];
foreach ($context->getTaskProcessingTaskTypes() as $providerServiceRegistration) {

@ -48,7 +48,7 @@ class ImageToTextOpticalCharacterRecognition implements ITaskType {
* @since 33.0.0
*/
public function getDescription(): string {
return $this->l->t('Extract text from an image');
return $this->l->t('Extract text from files like images or PDFs');
}
/**
@ -65,9 +65,9 @@ class ImageToTextOpticalCharacterRecognition implements ITaskType {
public function getInputShape(): array {
return [
'input' => new ShapeDescriptor(
$this->l->t('Input Image'),
$this->l->t('The image to extract text from'),
EShapeType::Image
$this->l->t('Input files'),
$this->l->t('The files to extract text from'),
EShapeType::ListOfFiles
),
];
}
@ -79,9 +79,9 @@ class ImageToTextOpticalCharacterRecognition implements ITaskType {
public function getOutputShape(): array {
return [
'output' => new ShapeDescriptor(
$this->l->t('Output text'),
$this->l->t('The text that was extracted from the image'),
EShapeType::Text
$this->l->t('Output texts'),
$this->l->t('The texts that were extracted from the files'),
EShapeType::ListOfTexts
),
];
}