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
4 changes: 4 additions & 0 deletions lib/Listener/BeforeTemplateRenderedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use OCP\IConfig;
use OCP\IUser;
use OCP\IUserSession;
use OCP\TaskProcessing\IManager;
use OCP\Util;

/**
Expand All @@ -37,6 +38,7 @@ public function __construct(
private IEventDispatcher $eventDispatcher,
private AssistantService $assistantService,
private ?string $userId,
private IManager $taskProcessingManager,
) {
}

Expand Down Expand Up @@ -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());
Expand Down
37 changes: 37 additions & 0 deletions src/components/ChattyLLM/ChattyLLMInputForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@
<p class="session-area__disclaimer">
{{ t('assistant', 'Output shown here is generated by AI. Make sure to always double-check.') }}
</p>
<div v-if="agencyAvailable && (messages == null || messages.length === 0)" class="session-area__agency-suggestions">
<NcButton v-for="suggestion in agencySuggestions"
:key="suggestion.message"
class="session-area__agency-suggestion"
:aria-label="suggestion.aria"
variant="tertiary"
:text="suggestion.message"
@click="chatContent = suggestion.message" />
</div>
<p v-if="chatContent?.length > 64_000"
class="session-area__disclaimer">
{{ t('assistant', 'Messages should not be longer than {maxLength} characters (currently {length}).', { maxLength: 64_000, length: chatContent.length }) }}
Expand Down Expand Up @@ -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?'),
},
],
}
},

Expand Down Expand Up @@ -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;
}
}
}
</style>
3 changes: 3 additions & 0 deletions src/components/ChattyLLM/NoSession.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<template #icon>
<slot name="icon" />
</template>
<template #action>
<slot name="action" />
</template>
</NcEmptyContent>
</template>

Expand Down
Loading