From 20a779e4aa48b68d9917964c55ba3d7cf02d0fb7 Mon Sep 17 00:00:00 2001 From: Lukas Schaefer Date: Thu, 3 Jul 2025 09:28:45 -0400 Subject: feat: support multiple images Signed-off-by: Lukas Schaefer --- lib/composer/composer/autoload_classmap.php | 2 +- lib/composer/composer/autoload_static.php | 2 +- lib/private/TaskProcessing/Manager.php | 2 +- .../TaskProcessing/TaskTypes/AnalyzeImage.php | 96 ---------------------- .../TaskProcessing/TaskTypes/AnalyzeImages.php | 96 ++++++++++++++++++++++ 5 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 lib/public/TaskProcessing/TaskTypes/AnalyzeImage.php create mode 100644 lib/public/TaskProcessing/TaskTypes/AnalyzeImages.php diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index a7c7f2dd2fa..941b5074aa5 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -842,7 +842,7 @@ return array( 'OCP\\TaskProcessing\\ShapeDescriptor' => $baseDir . '/lib/public/TaskProcessing/ShapeDescriptor.php', 'OCP\\TaskProcessing\\ShapeEnumValue' => $baseDir . '/lib/public/TaskProcessing/ShapeEnumValue.php', 'OCP\\TaskProcessing\\Task' => $baseDir . '/lib/public/TaskProcessing/Task.php', - 'OCP\\TaskProcessing\\TaskTypes\\AnalyzeImage' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/AnalyzeImage.php', + 'OCP\\TaskProcessing\\TaskTypes\\AnalyzeImages' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/AnalyzeImages.php', 'OCP\\TaskProcessing\\TaskTypes\\AudioToText' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/AudioToText.php', 'OCP\\TaskProcessing\\TaskTypes\\ContextAgentInteraction' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/ContextAgentInteraction.php', 'OCP\\TaskProcessing\\TaskTypes\\ContextWrite' => $baseDir . '/lib/public/TaskProcessing/TaskTypes/ContextWrite.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index eb835de9e98..850a9df146a 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -883,7 +883,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\TaskProcessing\\ShapeDescriptor' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/ShapeDescriptor.php', 'OCP\\TaskProcessing\\ShapeEnumValue' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/ShapeEnumValue.php', 'OCP\\TaskProcessing\\Task' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/Task.php', - 'OCP\\TaskProcessing\\TaskTypes\\AnalyzeImage' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/AnalyzeImage.php', + 'OCP\\TaskProcessing\\TaskTypes\\AnalyzeImages' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/AnalyzeImages.php', 'OCP\\TaskProcessing\\TaskTypes\\AudioToText' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/AudioToText.php', 'OCP\\TaskProcessing\\TaskTypes\\ContextAgentInteraction' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/ContextAgentInteraction.php', 'OCP\\TaskProcessing\\TaskTypes\\ContextWrite' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/TaskTypes/ContextWrite.php', diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 96992cf8bfe..7ef248aa97e 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -585,7 +585,7 @@ class Manager implements IManager { \OCP\TaskProcessing\TaskTypes\ContextAgentInteraction::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\ContextAgentInteraction::class), \OCP\TaskProcessing\TaskTypes\TextToTextProofread::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\TextToTextProofread::class), \OCP\TaskProcessing\TaskTypes\TextToSpeech::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\TextToSpeech::class), - \OCP\TaskProcessing\TaskTypes\AnalyzeImage::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\AnalyzeImage::class), + \OCP\TaskProcessing\TaskTypes\AnalyzeImages::ID => \OCP\Server::get(\OCP\TaskProcessing\TaskTypes\AnalyzeImages::class), ]; foreach ($context->getTaskProcessingTaskTypes() as $providerServiceRegistration) { diff --git a/lib/public/TaskProcessing/TaskTypes/AnalyzeImage.php b/lib/public/TaskProcessing/TaskTypes/AnalyzeImage.php deleted file mode 100644 index 189db572154..00000000000 --- a/lib/public/TaskProcessing/TaskTypes/AnalyzeImage.php +++ /dev/null @@ -1,96 +0,0 @@ -l = $l10nFactory->get('lib'); - } - - /** - * @inheritDoc - * @since 32.0.0 - */ - public function getName(): string { - return $this->l->t('Analyze image'); - } - - /** - * @inheritDoc - * @since 32.0.0 - */ - public function getDescription(): string { - return $this->l->t('Ask a question about an image.'); - } - - /** - * @return string - * @since 32.0.0 - */ - public function getId(): string { - return self::ID; - } - - /** - * @return ShapeDescriptor[] - * @since 32.0.0 - */ - public function getInputShape(): array { - return [ - 'image' => new ShapeDescriptor( - $this->l->t('Image'), - $this->l->t('Image to ask a question about'), - EShapeType::Image, - ), - 'input' => new ShapeDescriptor( - $this->l->t('Question'), - $this->l->t('What to ask about the image.'), - EShapeType::Text, - ), - ]; - } - - /** - * @return ShapeDescriptor[] - * @since 32.0.0 - */ - public function getOutputShape(): array { - return [ - 'output' => new ShapeDescriptor( - $this->l->t('Generated response'), - $this->l->t('The answer to the question'), - EShapeType::Text - ), - ]; - } -} diff --git a/lib/public/TaskProcessing/TaskTypes/AnalyzeImages.php b/lib/public/TaskProcessing/TaskTypes/AnalyzeImages.php new file mode 100644 index 00000000000..462016c5c19 --- /dev/null +++ b/lib/public/TaskProcessing/TaskTypes/AnalyzeImages.php @@ -0,0 +1,96 @@ +l = $l10nFactory->get('lib'); + } + + /** + * @inheritDoc + * @since 32.0.0 + */ + public function getName(): string { + return $this->l->t('Analyze images'); + } + + /** + * @inheritDoc + * @since 32.0.0 + */ + public function getDescription(): string { + return $this->l->t('Ask a question about the given images.'); + } + + /** + * @return string + * @since 32.0.0 + */ + public function getId(): string { + return self::ID; + } + + /** + * @return ShapeDescriptor[] + * @since 32.0.0 + */ + public function getInputShape(): array { + return [ + 'images' => new ShapeDescriptor( + $this->l->t('Images'), + $this->l->t('Images to ask a question about'), + EShapeType::ListOfImages, + ), + 'input' => new ShapeDescriptor( + $this->l->t('Question'), + $this->l->t('What to ask about the images.'), + EShapeType::Text, + ), + ]; + } + + /** + * @return ShapeDescriptor[] + * @since 32.0.0 + */ + public function getOutputShape(): array { + return [ + 'output' => new ShapeDescriptor( + $this->l->t('Generated response'), + $this->l->t('The answer to the question'), + EShapeType::Text + ), + ]; + } +} -- cgit v1.2.3