feat: Enhance Kol Generation Service with web search and knowledge group support

- Added `EnableWebSearch` and `KnowledgeGroupIDs` fields to `KolGenerationSubmitRequest`.
- Updated `Submit` method in `KolGenerationService` to handle new request fields.
- Integrated web search and knowledge group validation based on card configuration.
- Introduced caching mechanisms in `KolPackageService`, `KolPromptService`, and `KolSubscriptionAdminService` to improve performance.
- Implemented knowledge context resolution in `KolGenerationWorker` to enrich prompts with relevant knowledge snippets.
- Added utility functions for handling card configuration in both backend and frontend.
- Created tests for knowledge extraction and rendering to ensure accuracy and reliability.
This commit is contained in:
2026-04-18 13:47:32 +08:00
parent 3ef0807456
commit b2605abd6a
27 changed files with 2051 additions and 171 deletions
+16 -7
View File
@@ -79,8 +79,8 @@ const enUS = {
contentManagement: "Content Management",
knowledge: "Knowledge Base",
images: "Image Management",
kolMarket: "KOL Marketplace",
kolMarketplace: "Template Marketplace",
kolMarket: "Refined Templates",
kolMarketplace: "Refined Templates",
kolWorkspace: "KOL Workspace",
kolManage: "Prompt Management",
kolDashboard: "Dashboard",
@@ -115,7 +115,7 @@ const enUS = {
},
templates: {
title: "Template Creation",
description: "Choose a suitable template or use the batch feature to quickly generate GEO content.",
description: "Manage both general-purpose and refined templates, with all related generation records gathered here.",
},
wizard: {
title: "Template Wizard",
@@ -160,7 +160,7 @@ const enUS = {
},
kol: {
marketplace: {
title: "KOL Template Marketplace",
title: "Refined Templates",
filter: {
industry: "Industry",
keyword: "Keyword",
@@ -179,7 +179,7 @@ const enUS = {
notSubscribed: "Not subscribed",
},
generate: {
title: "Generate Article",
title: "Refined Template Generation",
submit: "Generate",
fillVariables: "Please fill in the following variables and click generate",
},
@@ -242,7 +242,7 @@ const enUS = {
platforms: "Platforms",
},
sections: {
templates: "Article Templates",
generalTemplates: "General-Purpose Templates",
recent: "Recent Generations",
overview: "Overview",
quota: "Plan & Quota",
@@ -441,7 +441,7 @@ const enUS = {
instant_task: "Instant task",
schedule_task: "Scheduled task",
free_create: "Free create",
kol: "KOL generation",
kol: "Refined template generation",
},
},
freeCreate: {
@@ -469,6 +469,11 @@ const enUS = {
},
templates: {
eyebrow: "Article Creation",
sections: {
generalTemplates: "General-Purpose Templates",
refinedTemplates: "Refined Templates",
records: "Template Creation Records",
},
actions: {
batchGenerate: "Batch generate",
chooseTemplate: "Choose template",
@@ -484,6 +489,7 @@ const enUS = {
keywordPlaceholder: "Search by article title",
},
list: {
eyebrow: "Template Creation Records",
count: "{count} articles",
empty: "No articles have been created yet.",
preview: "Preview",
@@ -497,6 +503,9 @@ const enUS = {
},
picker: {
title: "Choose the template you want to use",
empty: "Choose either general-purpose templates or refined template generation first",
generalDescription: "Choose a general-purpose template to start creating",
refinedDescription: "Choose a refined template and start refined generation directly",
viewExample: "View example",
},
wizard: {
+16 -7
View File
@@ -79,8 +79,8 @@ const zhCN = {
contentManagement: "内容管理",
knowledge: "知识库",
images: "图片管理",
kolMarket: "KOL 市场",
kolMarketplace: "模版市场",
kolMarket: "精调模版",
kolMarketplace: "精调模版",
kolWorkspace: "KOL 工作台",
kolManage: "提示词管理",
kolDashboard: "数据看板",
@@ -115,7 +115,7 @@ const zhCN = {
},
templates: {
title: "模版创作",
description: "选择合适的模版或使用批量功能,快速生成GEO内容。",
description: "统一查看普通通用模版与精调模版,相关生成记录都会在这里汇总展示。",
},
wizard: {
title: "模版向导",
@@ -160,7 +160,7 @@ const zhCN = {
},
kol: {
marketplace: {
title: "KOL 模版市场",
title: "精调模版",
filter: {
industry: "行业",
keyword: "关键字",
@@ -179,7 +179,7 @@ const zhCN = {
notSubscribed: "未订阅",
},
generate: {
title: "生成文章",
title: "精调模版生成",
submit: "生成",
fillVariables: "填写以下变量后点击生成",
},
@@ -242,7 +242,7 @@ const zhCN = {
platforms: "媒体平台数",
},
sections: {
templates: "文章模版类型",
generalTemplates: "普通通用模版",
recent: "最近生成",
overview: "数据总览",
quota: "套餐与额度",
@@ -441,7 +441,7 @@ const zhCN = {
instant_task: "即时任务",
schedule_task: "定时任务",
free_create: "自由创作",
kol: "KOL 生成",
kol: "精调模版生成",
},
},
freeCreate: {
@@ -469,6 +469,11 @@ const zhCN = {
},
templates: {
eyebrow: "Article Creation",
sections: {
generalTemplates: "普通通用模版",
refinedTemplates: "精调模版",
records: "模版创作记录",
},
actions: {
batchGenerate: "批量生成文章",
chooseTemplate: "选择模版创作",
@@ -484,6 +489,7 @@ const zhCN = {
keywordPlaceholder: "请输入标题内容搜索",
},
list: {
eyebrow: "模版创作记录",
count: "共 {count} 篇文章",
empty: "还未创建文章,暂无相关数据~",
preview: "预览正文",
@@ -497,6 +503,9 @@ const zhCN = {
},
picker: {
title: "选择你需要的模版创作",
empty: "请选择普通通用模版或精调模版生成",
generalDescription: "选择普通通用模版进入创作",
refinedDescription: "选择精调模版后直接发起精调模版生成",
viewExample: "查看示例",
},
wizard: {