feat: implement reparse functionality with process configuration support
- Enhanced the `reparseKnowledge` function to accept optional process configuration overrides, allowing users to adjust parsing settings during reparse operations. - Updated the frontend components to integrate reparse capabilities, including the `UploadConfirmDialog` and `KnowledgeBase` views, providing a user-friendly interface for confirming reparse actions. - Added new localization strings for reparse confirmation and process configuration details in multiple languages. - Modified the backend API to handle reparse requests with optional configuration, ensuring proper validation and persistence of overrides. - Introduced new types and interfaces to manage reparse-specific data structures in the store, improving type safety and clarity in the codebase.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import type { KnowledgeProcessOverrides } from '@/types/knowledgeProcess'
|
||||
|
||||
export type UploadConfirmMode = 'file' | 'url' | 'manual'
|
||||
export type UploadConfirmMode = 'file' | 'url' | 'manual' | 'reparse'
|
||||
|
||||
export interface UploadConfirmManualSource {
|
||||
kbId: string
|
||||
@@ -11,12 +11,20 @@ export interface UploadConfirmManualSource {
|
||||
tagId?: string
|
||||
}
|
||||
|
||||
export interface UploadConfirmReparseSource {
|
||||
knowledgeId: string
|
||||
fileName?: string
|
||||
fileType?: string
|
||||
processOverrides?: KnowledgeProcessOverrides | null
|
||||
}
|
||||
|
||||
export interface UploadConfirmResult {
|
||||
processConfig: KnowledgeProcessOverrides
|
||||
mode: UploadConfirmMode
|
||||
files?: File[]
|
||||
urls?: string[]
|
||||
manual?: UploadConfirmManualSource
|
||||
reparse?: UploadConfirmReparseSource
|
||||
}
|
||||
|
||||
export interface OpenUploadConfirmOptions {
|
||||
@@ -25,6 +33,7 @@ export interface OpenUploadConfirmOptions {
|
||||
files?: File[]
|
||||
urls?: string[]
|
||||
manual?: UploadConfirmManualSource
|
||||
reparse?: UploadConfirmReparseSource
|
||||
acceptFileTypes?: string
|
||||
supportedFileTypes?: string[]
|
||||
}
|
||||
@@ -37,6 +46,7 @@ export const useUploadConfirmStore = defineStore('uploadConfirm', {
|
||||
files: [] as File[],
|
||||
urls: [] as string[],
|
||||
manual: null as UploadConfirmManualSource | null,
|
||||
reparse: null as UploadConfirmReparseSource | null,
|
||||
acceptFileTypes: '',
|
||||
supportedFileTypes: [] as string[],
|
||||
pendingResolve: null as ((value: UploadConfirmResult) => void) | null,
|
||||
@@ -52,6 +62,7 @@ export const useUploadConfirmStore = defineStore('uploadConfirm', {
|
||||
this.files = options.files ? [...options.files] : []
|
||||
this.urls = options.urls ? [...options.urls] : []
|
||||
this.manual = options.manual || null
|
||||
this.reparse = options.reparse || null
|
||||
this.acceptFileTypes = options.acceptFileTypes || ''
|
||||
this.supportedFileTypes = options.supportedFileTypes ? [...options.supportedFileTypes] : []
|
||||
this.pendingResolve = resolve
|
||||
@@ -76,6 +87,7 @@ export const useUploadConfirmStore = defineStore('uploadConfirm', {
|
||||
this.files = []
|
||||
this.urls = []
|
||||
this.manual = null
|
||||
this.reparse = null
|
||||
this.acceptFileTypes = ''
|
||||
this.supportedFileTypes = []
|
||||
this.pendingResolve = null
|
||||
|
||||
Reference in New Issue
Block a user