Skip to content
Merged
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 @@ -871,6 +871,7 @@
'OCP\\TaskProcessing\\Exception\\ProcessingException' => $baseDir . '/lib/public/TaskProcessing/Exception/ProcessingException.php',
'OCP\\TaskProcessing\\Exception\\UnauthorizedException' => $baseDir . '/lib/public/TaskProcessing/Exception/UnauthorizedException.php',
'OCP\\TaskProcessing\\Exception\\ValidationException' => $baseDir . '/lib/public/TaskProcessing/Exception/ValidationException.php',
'OCP\\TaskProcessing\\IInternalTaskType' => $baseDir . '/lib/public/TaskProcessing/IInternalTaskType.php',
'OCP\\TaskProcessing\\IManager' => $baseDir . '/lib/public/TaskProcessing/IManager.php',
'OCP\\TaskProcessing\\IProvider' => $baseDir . '/lib/public/TaskProcessing/IProvider.php',
'OCP\\TaskProcessing\\ISynchronousProvider' => $baseDir . '/lib/public/TaskProcessing/ISynchronousProvider.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 @@ -912,6 +912,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\TaskProcessing\\Exception\\ProcessingException' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/Exception/ProcessingException.php',
'OCP\\TaskProcessing\\Exception\\UnauthorizedException' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/Exception/UnauthorizedException.php',
'OCP\\TaskProcessing\\Exception\\ValidationException' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/Exception/ValidationException.php',
'OCP\\TaskProcessing\\IInternalTaskType' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/IInternalTaskType.php',
'OCP\\TaskProcessing\\IManager' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/IManager.php',
'OCP\\TaskProcessing\\IProvider' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/IProvider.php',
'OCP\\TaskProcessing\\ISynchronousProvider' => __DIR__ . '/../../..' . '/lib/public/TaskProcessing/ISynchronousProvider.php',
Expand Down
4 changes: 3 additions & 1 deletion lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
use OCP\TaskProcessing\Exception\ProcessingException;
use OCP\TaskProcessing\Exception\UnauthorizedException;
use OCP\TaskProcessing\Exception\ValidationException;
use OCP\TaskProcessing\IInternalTaskType;
use OCP\TaskProcessing\IManager;
use OCP\TaskProcessing\IProvider;
use OCP\TaskProcessing\ISynchronousProvider;
Expand Down Expand Up @@ -88,7 +89,7 @@ class Manager implements IManager {
private ?array $providers = null;

/**
* @var array<array-key,array{name: string, description: string, inputShape: ShapeDescriptor[], inputShapeEnumValues: ShapeEnumValue[][], inputShapeDefaults: array<array-key, numeric|string>, optionalInputShape: ShapeDescriptor[], optionalInputShapeEnumValues: ShapeEnumValue[][], optionalInputShapeDefaults: array<array-key, numeric|string>, outputShape: ShapeDescriptor[], outputShapeEnumValues: ShapeEnumValue[][], optionalOutputShape: ShapeDescriptor[], optionalOutputShapeEnumValues: ShapeEnumValue[][]}>
* @var array<array-key,array{name: string, description: string, inputShape: ShapeDescriptor[], inputShapeEnumValues: ShapeEnumValue[][], inputShapeDefaults: array<array-key, numeric|string>, isInternal: bool, optionalInputShape: ShapeDescriptor[], optionalInputShapeEnumValues: ShapeEnumValue[][], optionalInputShapeDefaults: array<array-key, numeric|string>, outputShape: ShapeDescriptor[], outputShapeEnumValues: ShapeEnumValue[][], optionalOutputShape: ShapeDescriptor[], optionalOutputShapeEnumValues: ShapeEnumValue[][]}>
*/
private ?array $availableTaskTypes = null;

Expand Down Expand Up @@ -878,6 +879,7 @@ public function getAvailableTaskTypes(bool $showDisabled = false, ?string $userI
'outputShapeEnumValues' => $provider->getOutputShapeEnumValues(),
'optionalOutputShape' => $provider->getOptionalOutputShape(),
'optionalOutputShapeEnumValues' => $provider->getOptionalOutputShapeEnumValues(),
'isInternal' => $taskType instanceof IInternalTaskType,
];
} catch (\Throwable $e) {
$this->logger->error('Failed to set up TaskProcessing provider ' . $provider::class, ['exception' => $e]);
Expand Down
19 changes: 19 additions & 0 deletions lib/public/TaskProcessing/IInternalTaskType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

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

namespace OCP\TaskProcessing;

/**
* This is a task type interface that is implemented by task processing
* task types that should not show up in the assistant UI
* @since 33.0.0
*/
interface IInternalTaskType extends ITaskType {

}
3 changes: 2 additions & 1 deletion lib/public/TaskProcessing/IManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ public function getPreferredProvider(string $taskTypeId);
/**
* @param bool $showDisabled if false, disabled task types will be filtered out
* @param ?string $userId to check if the user is a guest. Will be obtained from session if left to default
* @return array<string, array{name: string, description: string, inputShape: ShapeDescriptor[], inputShapeEnumValues: ShapeEnumValue[][], inputShapeDefaults: array<array-key, numeric|string>, optionalInputShape: ShapeDescriptor[], optionalInputShapeEnumValues: ShapeEnumValue[][], optionalInputShapeDefaults: array<array-key, numeric|string>, outputShape: ShapeDescriptor[], outputShapeEnumValues: ShapeEnumValue[][], optionalOutputShape: ShapeDescriptor[], optionalOutputShapeEnumValues: ShapeEnumValue[][]}>
* @return array<string, array{name: string, description: string, inputShape: ShapeDescriptor[], inputShapeEnumValues: ShapeEnumValue[][], inputShapeDefaults: array<array-key, numeric|string>, isInternal: bool, optionalInputShape: ShapeDescriptor[], optionalInputShapeEnumValues: ShapeEnumValue[][], optionalInputShapeDefaults: array<array-key, numeric|string>, outputShape: ShapeDescriptor[], outputShapeEnumValues: ShapeEnumValue[][], optionalOutputShape: ShapeDescriptor[], optionalOutputShapeEnumValues: ShapeEnumValue[][]}>
* @since 30.0.0
* @since 31.0.0 Added the `showDisabled` argument.
* @since 31.0.7 Added the `userId` argument
* @since 33.0.0 Added `isInternal` to return value
*/
public function getAvailableTaskTypes(bool $showDisabled = false, ?string $userId = null): array;

Expand Down
4 changes: 2 additions & 2 deletions lib/public/TaskProcessing/TaskTypes/AudioToAudioChat.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\IInternalTaskType;
use OCP\TaskProcessing\ShapeDescriptor;

/**
* This is the task processing task type for audio chat
* @since 32.0.0
*/
class AudioToAudioChat implements ITaskType {
class AudioToAudioChat implements IInternalTaskType {
/**
* @since 32.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\IInternalTaskType;
use OCP\TaskProcessing\ShapeDescriptor;

/**
* This is the task processing task type for Context Agent interaction
* @since 32.0.0
*/
class ContextAgentAudioInteraction implements ITaskType {
class ContextAgentAudioInteraction implements IInternalTaskType {
public const ID = 'core:contextagent:audio-interaction';

private IL10N $l;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\IInternalTaskType;
use OCP\TaskProcessing\ShapeDescriptor;

/**
* This is the task processing task type for Context Agent interaction
* @since 31.0.0
*/
class ContextAgentInteraction implements ITaskType {
class ContextAgentInteraction implements IInternalTaskType {
public const ID = 'core:contextagent:interaction';

private IL10N $l;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\IInternalTaskType;
use OCP\TaskProcessing\ShapeDescriptor;

/**
* This is the task processing task type for invoking Chat-enabled LLMs with tool call support
* @since 31.0.0
*/
class TextToTextChatWithTools implements ITaskType {
class TextToTextChatWithTools implements IInternalTaskType {
public const ID = 'core:text2text:chatwithtools';

private IL10N $l;
Expand Down
Loading