From f59ac8f50eda3a7e2a4a30775702dc26640f4783 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 8 Jan 2025 14:00:19 +0100 Subject: [PATCH] hide ChatWithTools and ContextAgentInteraction task types Signed-off-by: Julien Veyssier --- lib/Service/AssistantService.php | 16 ++++++++++++++-- tests/psalm-baseline.xml | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/Service/AssistantService.php b/lib/Service/AssistantService.php index 7ec1fe03..a3bff54c 100644 --- a/lib/Service/AssistantService.php +++ b/lib/Service/AssistantService.php @@ -173,7 +173,17 @@ public function getAvailableTaskTypes(): array { } /** @var string $typeId */ foreach ($availableTaskTypes as $typeId => $taskTypeArray) { - // skip chat task type (not directly useful to the end user) + // skip chat, chat with tools and ContextAgent task types (not directly useful to the end user) + if (!self::DEBUG) { + if (class_exists('OCP\\TaskProcessing\\TaskTypes\\TextToTextChatWithTools') + && $typeId === \OCP\TaskProcessing\TaskTypes\TextToTextChatWithTools::ID) { + continue; + } + if (class_exists('OCP\\TaskProcessing\\TaskTypes\\ContextAgentInteraction') + && $typeId === \OCP\TaskProcessing\TaskTypes\ContextAgentInteraction::ID) { + continue; + } + } if ($typeId === TextToTextChat::ID) { // add the chattyUI virtual task type $types[] = [ @@ -191,7 +201,9 @@ public function getAvailableTaskTypes(): array { 'priority' => self::TASK_TYPE_PRIORITIES['chatty-llm'] ?? 1000, ]; // do not add the raw TextToTextChat type - continue; + if (!self::DEBUG) { + continue; + } } $taskTypeArray['id'] = $typeId; $taskTypeArray['priority'] = self::TASK_TYPE_PRIORITIES[$typeId] ?? 1000; diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 7d91178c..4ee21a00 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -42,6 +42,8 @@ + +