diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index 54cd4662..97e9ebba 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,6 +74,8 @@ 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 3dbcc2b3..3c49188c 100644 --- a/src/components/ChattyLLM/ChattyLLMInputForm.vue +++ b/src/components/ChattyLLM/ChattyLLMInputForm.vue @@ -128,6 +128,15 @@

{{ 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 }) }} @@ -261,6 +270,21 @@ export default { pollTitleGenerationTimerId: null, autoplayAudioChat: loadState('assistant', 'autoplay_audio_chat', true), slowPickup: false, + agencyAvailable: loadState('assistant', 'agency_available', false), + agencySuggestions: [ + { + 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 me?'), + }, + { + aria: t('assisant', 'Ask assistant, which actions it can do for you'), + message: t('assisant', 'Which actions can you do for me?'), + }, + ], } }, @@ -1023,6 +1047,19 @@ export default { position: sticky; bottom: 0; } + + &__agency-suggestions { + display: flex; + flex-direction: row; + align-items: start; + gap: 10px; + flex-wrap: wrap; + justify-content: start; + padding: 0 1em; + } + &__agency-suggestion { + flex-shrink: 0; + } } } diff --git a/src/components/ChattyLLM/NoSession.vue b/src/components/ChattyLLM/NoSession.vue index 3f278287..343eb006 100644 --- a/src/components/ChattyLLM/NoSession.vue +++ b/src/components/ChattyLLM/NoSession.vue @@ -7,6 +7,9 @@ +