Skip to content

Commit

Permalink
hide ChatWithTools and ContextAgentInteraction task types
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Jan 8, 2025
1 parent 1ad93f7 commit f59ac8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/Service/AssistantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
</MoreSpecificReturnType>
<RedundantCondition>
<code><![CDATA[!self::DEBUG]]></code>
<code><![CDATA[!self::DEBUG]]></code>
<code><![CDATA[!self::DEBUG]]></code>
</RedundantCondition>
<TypeDoesNotContainType>
<code><![CDATA[self::DEBUG]]></code>
Expand Down

0 comments on commit f59ac8f

Please sign in to comment.