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
2 changes: 2 additions & 0 deletions lib/Listener/BeforeTemplateRenderedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public function handle(Event $event): void {
if ($assistantEnabled) {
$lastTargetLanguage = $this->config->getUserValue($this->userId, Application::APP_ID, 'last_target_language', '');
$this->initialStateService->provideInitialState('last-target-language', $lastTargetLanguage);
$indexingComplete = $this->appConfig->getValueInt('context_chat', 'last_indexed_time', 0) !== 0;
$this->initialStateService->provideInitialState('contextChatIndexingComplete', $indexingComplete);
}
Util::addScript(Application::APP_ID, Application::APP_ID . '-main');
}
Expand Down
7 changes: 7 additions & 0 deletions src/components/ContextChat/ContextChatInputForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
-->
<template>
<div class="cc-input-form">
<NcNoteCard v-if="!indexingComplete" type="warning">
{{ t('assistant', 'Context Chat has not finished indexing all your documents yet, it may not be able to answer your questions, yet.') }}
</NcNoteCard>
<TextInput
id="context_chat_input"
:value="inputs.prompt"
Expand Down Expand Up @@ -128,12 +131,14 @@ import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'

import TextInput from '../fields/TextInput.vue'

import axios from '@nextcloud/axios'
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
import { generateUrl } from '@nextcloud/router'
import { loadState } from '@nextcloud/initial-state'

const _ScopeType = Object.freeze({
NONE: 'none',
Expand Down Expand Up @@ -196,6 +201,7 @@ export default {
NcCheckboxRadioSwitch,
NcSelect,
PlaylistRemoveIcon,
NcNoteCard,
},

props: {
Expand All @@ -221,6 +227,7 @@ export default {
defaultProviderKey: 'files__default',

sccEnabled: !!this.inputs.scopeType && this.inputs.scopeType !== _ScopeType.NONE && !!this.inputs.scopeList,
indexingComplete: loadState('assistant', 'contextChatIndexingComplete'),
}
},

Expand Down
Loading