From 04e444c4159fabca8517e4ac72468cb53be6e71d Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 11 Dec 2025 13:38:42 +0100 Subject: [PATCH 1/5] feat: Add buttons to suggest agency tools Signed-off-by: Marcel Klehr --- src/components/ChattyLLM/ChattyLLMInputForm.vue | 8 ++++++++ src/components/ChattyLLM/NoSession.vue | 1 + 2 files changed, 9 insertions(+) diff --git a/src/components/ChattyLLM/ChattyLLMInputForm.vue b/src/components/ChattyLLM/ChattyLLMInputForm.vue index 3dbcc2b3..f8039c59 100644 --- a/src/components/ChattyLLM/ChattyLLMInputForm.vue +++ b/src/components/ChattyLLM/ChattyLLMInputForm.vue @@ -86,6 +86,14 @@ +
+ From c3a4357dd35af41c34ab95c8bbd2659b4df8b9e5 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 11 Dec 2025 15:04:40 +0100 Subject: [PATCH 2/5] feat: Add tool-use suggestions when agency is enabled Signed-off-by: Marcel Klehr --- .../BeforeTemplateRenderedListener.php | 6 ++- .../ChattyLLM/ChattyLLMInputForm.vue | 43 +++++++++++++++---- src/components/ChattyLLM/NoSession.vue | 4 +- 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index 54cd4662..73a344b0 100644 --- a/lib/Listener/BeforeTemplateRenderedListener.php +++ b/lib/Listener/BeforeTemplateRenderedListener.php @@ -22,6 +22,7 @@ use OCP\IConfig; use OCP\IUser; use OCP\IUserSession; +use OCP\TaskProcessing\IManager; use OCP\Util; /** @@ -37,6 +38,7 @@ public function __construct( private IEventDispatcher $eventDispatcher, private AssistantService $assistantService, private ?string $userId, + private IManager $taskProcessingManager, ) { } @@ -72,7 +74,9 @@ public function handle(Event $event): void { $this->initialStateService->provideInitialState('audio_chat_available', $this->assistantService->isAudioChatAvailable()); $autoplayAudioChat = $this->config->getUserValue($this->userId, Application::APP_ID, 'autoplay_audio_chat', '1') === '1'; $this->initialStateService->provideInitialState('autoplay_audio_chat', $autoplayAudioChat); - } + $agencyAvailable = class_exists('OCP\\TaskProcessing\\TaskTypes\\ContextAgentInteraction') && array_key_exists(\OCP\TaskProcessing\TaskTypes\ContextAgentInteraction::ID, $this->taskProcessingManager->getAvailableTaskTypes()); + $this->initialStateService->provideInitialState('agency_available', $agencyAvailable); + } if (class_exists(\OCA\Viewer\Event\LoadViewer::class)) { $this->eventDispatcher->dispatchTyped(new \OCA\Viewer\Event\LoadViewer()); } diff --git a/src/components/ChattyLLM/ChattyLLMInputForm.vue b/src/components/ChattyLLM/ChattyLLMInputForm.vue index f8039c59..168af562 100644 --- a/src/components/ChattyLLM/ChattyLLMInputForm.vue +++ b/src/components/ChattyLLM/ChattyLLMInputForm.vue @@ -86,14 +86,18 @@ - +
{ + const agencyAvailable = loadState('assistant', 'agency_available', false) return { // { id: number, title: string, user_id: string, timestamp: number } active: null, @@ -269,6 +274,21 @@ export default { pollTitleGenerationTimerId: null, autoplayAudioChat: loadState('assistant', 'autoplay_audio_chat', true), slowPickup: false, + agencyAvailable, + agencySuggestions: [ + { + aria: t('assisant', 'Ask assistant, what\'s the weather in Berlin right now'), + message: t('assisant', 'What\'s the weather in Berlin right now?'), + }, + { + aria: t('assisant', 'Ask assistant, to create a share link for a file'), + message: t('assisant', 'Can you create a share link for the following file in my documents? welcome.txt'), + }, + { + aria: t('assisant', 'Ask assistant, which actions it can do for you'), + message: t('assisant', 'Which actions can you do for me?'), + }, + ], } }, @@ -1031,6 +1051,13 @@ export default { position: sticky; bottom: 0; } + + &__agency-suggestions { + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; + } } } diff --git a/src/components/ChattyLLM/NoSession.vue b/src/components/ChattyLLM/NoSession.vue index c0c8d2ba..343eb006 100644 --- a/src/components/ChattyLLM/NoSession.vue +++ b/src/components/ChattyLLM/NoSession.vue @@ -7,7 +7,9 @@ - + From 559fa2f36adff8c3f8df8dd5f1bcbc58fbc25846 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 15 Dec 2025 08:23:22 +0100 Subject: [PATCH 3/5] fix: Address review comments Signed-off-by: Marcel Klehr --- src/components/ChattyLLM/ChattyLLMInputForm.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/ChattyLLM/ChattyLLMInputForm.vue b/src/components/ChattyLLM/ChattyLLMInputForm.vue index 168af562..b1ac2bbd 100644 --- a/src/components/ChattyLLM/ChattyLLMInputForm.vue +++ b/src/components/ChattyLLM/ChattyLLMInputForm.vue @@ -92,7 +92,7 @@ :key="suggestion.message" class="session-area__agency-suggestion" :aria-label="suggestion.aria" - variant="secondary" + variant="tertiary" @click="chatContent = suggestion.message"> {{ t('assistant', suggestion.message) }} @@ -1054,9 +1054,14 @@ export default { &__agency-suggestions { display: flex; - flex-direction: column; + flex-direction: row; align-items: center; gap: 10px; + flex-wrap: wrap; + justify-content: center; + } + &__agency-suggestion { + flex-shrink: 0; } } } From 8beb05533fb45c7eb852651beea8df5cd925fb75 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 15 Dec 2025 08:26:38 +0100 Subject: [PATCH 4/5] fix: Run cs:fix Signed-off-by: Marcel Klehr --- lib/Listener/BeforeTemplateRenderedListener.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index 73a344b0..97e9ebba 100644 --- a/lib/Listener/BeforeTemplateRenderedListener.php +++ b/lib/Listener/BeforeTemplateRenderedListener.php @@ -38,7 +38,7 @@ public function __construct( private IEventDispatcher $eventDispatcher, private AssistantService $assistantService, private ?string $userId, - private IManager $taskProcessingManager, + private IManager $taskProcessingManager, ) { } @@ -74,9 +74,9 @@ public function handle(Event $event): void { $this->initialStateService->provideInitialState('audio_chat_available', $this->assistantService->isAudioChatAvailable()); $autoplayAudioChat = $this->config->getUserValue($this->userId, Application::APP_ID, 'autoplay_audio_chat', '1') === '1'; $this->initialStateService->provideInitialState('autoplay_audio_chat', $autoplayAudioChat); - $agencyAvailable = class_exists('OCP\\TaskProcessing\\TaskTypes\\ContextAgentInteraction') && array_key_exists(\OCP\TaskProcessing\TaskTypes\ContextAgentInteraction::ID, $this->taskProcessingManager->getAvailableTaskTypes()); - $this->initialStateService->provideInitialState('agency_available', $agencyAvailable); - } + $agencyAvailable = class_exists('OCP\\TaskProcessing\\TaskTypes\\ContextAgentInteraction') && array_key_exists(\OCP\TaskProcessing\TaskTypes\ContextAgentInteraction::ID, $this->taskProcessingManager->getAvailableTaskTypes()); + $this->initialStateService->provideInitialState('agency_available', $agencyAvailable); + } if (class_exists(\OCA\Viewer\Event\LoadViewer::class)) { $this->eventDispatcher->dispatchTyped(new \OCA\Viewer\Event\LoadViewer()); } From d38420d063f020519a991f12d53e29d9feb38c84 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 22 Dec 2025 09:26:04 +0100 Subject: [PATCH 5/5] fix: Move agency suggestions to the bottom of the modal above the message input Signed-off-by: Marcel Klehr --- .../ChattyLLM/ChattyLLMInputForm.vue | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/components/ChattyLLM/ChattyLLMInputForm.vue b/src/components/ChattyLLM/ChattyLLMInputForm.vue index b1ac2bbd..3c49188c 100644 --- a/src/components/ChattyLLM/ChattyLLMInputForm.vue +++ b/src/components/ChattyLLM/ChattyLLMInputForm.vue @@ -86,18 +86,6 @@ -
{{ t('assistant', 'Output shown here is generated by AI. Make sure to always double-check.') }}

+
+ +

{{ t('assistant', 'Messages should not be longer than {maxLength} characters (currently {length}).', { maxLength: 64_000, length: chatContent.length }) }} @@ -244,7 +241,6 @@ export default { }, data: () => { - const agencyAvailable = loadState('assistant', 'agency_available', false) return { // { id: number, title: string, user_id: string, timestamp: number } active: null, @@ -274,15 +270,15 @@ export default { pollTitleGenerationTimerId: null, autoplayAudioChat: loadState('assistant', 'autoplay_audio_chat', true), slowPickup: false, - agencyAvailable, + agencyAvailable: loadState('assistant', 'agency_available', false), agencySuggestions: [ { - aria: t('assisant', 'Ask assistant, what\'s the weather in Berlin right now'), - message: t('assisant', 'What\'s the weather in Berlin right now?'), + aria: t('assisant', 'Ask assistant, what\'s the weather today'), + message: t('assisant', 'What\'s the weather today?'), }, { aria: t('assisant', 'Ask assistant, to create a share link for a file'), - message: t('assisant', 'Can you create a share link for the following file in my documents? welcome.txt'), + message: t('assisant', 'Can you create a share link for me?'), }, { aria: t('assisant', 'Ask assistant, which actions it can do for you'), @@ -1055,10 +1051,11 @@ export default { &__agency-suggestions { display: flex; flex-direction: row; - align-items: center; + align-items: start; gap: 10px; flex-wrap: wrap; - justify-content: center; + justify-content: start; + padding: 0 1em; } &__agency-suggestion { flex-shrink: 0;