From 4b3f41812fca207aece809920f53a44743eec68f Mon Sep 17 00:00:00 2001 From: wizardchen Date: Sun, 19 Apr 2026 19:12:47 +0800 Subject: [PATCH] feat: Update chat creation UI and enhance knowledge post-processing logic - Modified the chat creation component to improve layout and responsiveness by adjusting the dialogue answers section. - Refined the logic in the KnowledgePostProcessService to conditionally spawn wiki ingest tasks based on wiki configuration settings, enhancing task management. - Added migration scripts for creating and dropping the `wiki_page_issues` table, facilitating better issue tracking within the wiki system. These changes enhance the user interface for chat creation and improve the backend processing of knowledge base tasks, contributing to a more efficient and user-friendly experience. --- frontend/src/views/creatChat/creatChat.vue | 3 ++- internal/application/service/knowledge_post_process.go | 4 ++-- ..._page_issues.down.sql => 000037_wiki_page_issues.down.sql} | 0 ...wiki_page_issues.up.sql => 000037_wiki_page_issues.up.sql} | 0 4 files changed, 4 insertions(+), 3 deletions(-) rename migrations/versioned/{000033_wiki_page_issues.down.sql => 000037_wiki_page_issues.down.sql} (100%) rename migrations/versioned/{000033_wiki_page_issues.up.sql => 000037_wiki_page_issues.up.sql} (100%) diff --git a/frontend/src/views/creatChat/creatChat.vue b/frontend/src/views/creatChat/creatChat.vue index 60eb3912..eb36c8e4 100644 --- a/frontend/src/views/creatChat/creatChat.vue +++ b/frontend/src/views/creatChat/creatChat.vue @@ -243,10 +243,11 @@ const handleKBEditorSuccess = (kbId: string) => { } .dialogue-answers { - position: absolute; display: flex; flex-flow: column; align-items: center; + width: 100%; + max-width: 800px; :deep(.answers-input) { position: static; diff --git a/internal/application/service/knowledge_post_process.go b/internal/application/service/knowledge_post_process.go index 5dfa0e69..c83da667 100644 --- a/internal/application/service/knowledge_post_process.go +++ b/internal/application/service/knowledge_post_process.go @@ -119,8 +119,8 @@ func (s *KnowledgePostProcessService) Handle(ctx context.Context, task *asynq.Ta } } - // 6. Spawn Wiki Ingest Task for wiki-type knowledge bases - if kb.Type == types.KnowledgeBaseTypeWiki && len(textChunks) > 0 { + // 6. Spawn Wiki Ingest Task if wiki is enabled and auto ingest is enabled + if kb.IsWikiEnabled() && kb.WikiConfig.AutoIngest && len(textChunks) > 0 { EnqueueWikiIngest(ctx, s.taskEnqueuer, s.redisClient, payload.TenantID, payload.KnowledgeBaseID, payload.KnowledgeID) logger.Infof(ctx, "[KnowledgePostProcess] Enqueued wiki ingest task for %s", payload.KnowledgeID) } diff --git a/migrations/versioned/000033_wiki_page_issues.down.sql b/migrations/versioned/000037_wiki_page_issues.down.sql similarity index 100% rename from migrations/versioned/000033_wiki_page_issues.down.sql rename to migrations/versioned/000037_wiki_page_issues.down.sql diff --git a/migrations/versioned/000033_wiki_page_issues.up.sql b/migrations/versioned/000037_wiki_page_issues.up.sql similarity index 100% rename from migrations/versioned/000033_wiki_page_issues.up.sql rename to migrations/versioned/000037_wiki_page_issues.up.sql