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:
wizardchen
2026-06-09 20:34:16 +08:00
committed by lyingbug
parent d8a26f7c23
commit 2aadd61fcc
14 changed files with 371 additions and 23 deletions
+7 -1
View File
@@ -96,7 +96,13 @@ type KnowledgeService interface {
payload *types.ManualKnowledgePayload,
) (*types.Knowledge, error)
// ReparseKnowledge deletes existing document content and re-parses the knowledge asynchronously.
ReparseKnowledge(ctx context.Context, knowledgeID string) (*types.Knowledge, error)
// When processOverrides is non-nil, it is validated and persisted to the knowledge metadata
// before re-parsing, letting callers adjust parse config on reparse; nil keeps stored overrides.
ReparseKnowledge(
ctx context.Context,
knowledgeID string,
processOverrides *types.KnowledgeProcessOverrides,
) (*types.Knowledge, error)
// CancelKnowledgeParse marks an in-progress parse as cancelled by the
// user. The knowledge row and any partially written chunks/index are
// kept; downstream queued tasks for the same knowledge are best-effort