Added check for training file upload
This commit is contained in:
parent
c1d362665c
commit
e3ff66653c
1 changed files with 50 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import { ref, computed, onMounted, onUnmounted, watch, reactive } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import {
|
||||
Alert,
|
||||
Card,
|
||||
Typography,
|
||||
Button,
|
||||
|
|
@ -41,6 +42,32 @@ const userStore = useUserStore()
|
|||
|
||||
const roleId = computed(() => route.params.roleId as string)
|
||||
const flowDetails = ref<OnboardingFlow | null>(null)
|
||||
|
||||
const trainingFileWarning = ref<string | null>(null)
|
||||
|
||||
const fetchTrainingFileWarning = async () => {
|
||||
try {
|
||||
const res = await apiClient.get<{ status: string }[]>(API.knowledge.trainingFiles.list(), {
|
||||
params: { role_uuid: roleId.value },
|
||||
})
|
||||
const files: { status: string }[] = Array.isArray(res.data)
|
||||
? res.data
|
||||
: (res.data as { results?: { status: string }[] }).results ?? []
|
||||
const ingesting = files.filter((f) => f.status === 'ingesting').length
|
||||
const failed = files.filter((f) => f.status === 'failed').length
|
||||
if (ingesting === 0 && failed === 0) {
|
||||
trainingFileWarning.value = null
|
||||
return
|
||||
}
|
||||
const parts: string[] = []
|
||||
if (ingesting > 0) parts.push(`${ingesting} file${ingesting > 1 ? 's are' : ' is'} still being processed`)
|
||||
if (failed > 0) parts.push(`${failed} file${failed > 1 ? 's' : ''} failed to ingest`)
|
||||
trainingFileWarning.value =
|
||||
parts.join(' and ') + '. Generated content may not reflect all uploaded documents.'
|
||||
} catch {
|
||||
trainingFileWarning.value = null
|
||||
}
|
||||
}
|
||||
const session = ref<OnboardingSession | null>(null)
|
||||
const currentPageIndex = ref(0)
|
||||
const loading = ref(false)
|
||||
|
|
@ -96,7 +123,7 @@ const pageHelpByPage = computed<
|
|||
|
||||
const currentPageHelp = computed(() => {
|
||||
if (!currentPage.value) return []
|
||||
return pageHelpByPage.value[currentPage.value.uuid] || []
|
||||
return [...(pageHelpByPage.value[currentPage.value.uuid] || [])].reverse()
|
||||
})
|
||||
|
||||
const currentPageBody = computed(() => {
|
||||
|
|
@ -316,6 +343,7 @@ const startAgenticGeneration = async () => {
|
|||
isAutoGenerating.value = true
|
||||
generationHandled.value = false
|
||||
agentStore.clearLog()
|
||||
await fetchTrainingFileWarning()
|
||||
agentStore.connect(roleId.value)
|
||||
|
||||
const checkInterval = setInterval(() => {
|
||||
|
|
@ -627,6 +655,14 @@ watch(
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<Alert
|
||||
v-if="trainingFileWarning"
|
||||
:message="trainingFileWarning"
|
||||
type="warning"
|
||||
show-icon
|
||||
style="margin-bottom: 12px"
|
||||
/>
|
||||
|
||||
<div class="orchestrator-logs">
|
||||
<div v-for="(log, i) in agentStore.eventLog" :key="i" class="log-entry">
|
||||
<Tag :color="log.type.includes('tool') ? 'green' : 'blue'" class="log-tag">
|
||||
|
|
@ -754,7 +790,7 @@ watch(
|
|||
</div>
|
||||
<div
|
||||
class="markdown-body"
|
||||
v-html="kaStore.isAsking && kaStore.streamBuffer
|
||||
v-html="kaStore.isAsking && kaStore.streamBuffer && kaMode === 'update_page'
|
||||
? DOMPurify.sanitize(marked.parse(kaStore.streamBuffer) as string)
|
||||
: renderedBody"
|
||||
></div>
|
||||
|
|
@ -910,6 +946,18 @@ watch(
|
|||
</Button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="kaStore.isAsking && kaStore.streamBuffer && kaMode === 'separate'"
|
||||
class="ka-thread-item"
|
||||
style="margin-bottom: 0.75rem"
|
||||
>
|
||||
<Typography.Text class="white-text" strong>KA:</Typography.Text>
|
||||
<div
|
||||
class="markdown-body"
|
||||
v-html="DOMPurify.sanitize(marked.parse(kaStore.streamBuffer) as string)"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<div v-if="currentPageHelp.length" class="ka-thread">
|
||||
<div
|
||||
v-for="(entry, idx) in currentPageHelp"
|
||||
|
|
|
|||
Loading…
Reference in a new issue