fix(TaskProcessing): Adjust OCR task type to allow for multiple files and pdfs

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2025-12-09 09:21:33 +01:00
parent 65d008b40c
commit 25044f82ae
2 changed files with 8 additions and 7 deletions

View file

@ -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) {

View file

@ -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
),
];
}