Skip to content

Commit f59ac8f

Browse files
committed
hide ChatWithTools and ContextAgentInteraction task types
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent 1ad93f7 commit f59ac8f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

lib/Service/AssistantService.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,17 @@ public function getAvailableTaskTypes(): array {
173173
}
174174
/** @var string $typeId */
175175
foreach ($availableTaskTypes as $typeId => $taskTypeArray) {
176-
// skip chat task type (not directly useful to the end user)
176+
// skip chat, chat with tools and ContextAgent task types (not directly useful to the end user)
177+
if (!self::DEBUG) {
178+
if (class_exists('OCP\\TaskProcessing\\TaskTypes\\TextToTextChatWithTools')
179+
&& $typeId === \OCP\TaskProcessing\TaskTypes\TextToTextChatWithTools::ID) {
180+
continue;
181+
}
182+
if (class_exists('OCP\\TaskProcessing\\TaskTypes\\ContextAgentInteraction')
183+
&& $typeId === \OCP\TaskProcessing\TaskTypes\ContextAgentInteraction::ID) {
184+
continue;
185+
}
186+
}
177187
if ($typeId === TextToTextChat::ID) {
178188
// add the chattyUI virtual task type
179189
$types[] = [
@@ -191,7 +201,9 @@ public function getAvailableTaskTypes(): array {
191201
'priority' => self::TASK_TYPE_PRIORITIES['chatty-llm'] ?? 1000,
192202
];
193203
// do not add the raw TextToTextChat type
194-
continue;
204+
if (!self::DEBUG) {
205+
continue;
206+
}
195207
}
196208
$taskTypeArray['id'] = $typeId;
197209
$taskTypeArray['priority'] = self::TASK_TYPE_PRIORITIES[$typeId] ?? 1000;

tests/psalm-baseline.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
</MoreSpecificReturnType>
4343
<RedundantCondition>
4444
<code><![CDATA[!self::DEBUG]]></code>
45+
<code><![CDATA[!self::DEBUG]]></code>
46+
<code><![CDATA[!self::DEBUG]]></code>
4547
</RedundantCondition>
4648
<TypeDoesNotContainType>
4749
<code><![CDATA[self::DEBUG]]></code>

0 commit comments

Comments
 (0)