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
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

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