feat: Add comprehensive documentation for WeKnora knowledge base and wiki features
- Introduced multiple new documentation files, including a complete documentation index, quick reference guides, and comprehensive analyses of the knowledge base and wiki settings. - The new files provide detailed insights into the architecture, data models, API endpoints, and implementation strategies for the knowledge base and wiki functionalities. - Enhanced navigation and usability for developers and team members by summarizing key components, configurations, and data flows related to the knowledge base system. These additions significantly improve the clarity and accessibility of documentation, supporting better onboarding and reference for current and future team members.
This commit is contained in:
@@ -89,7 +89,7 @@ func NewInitializationHandler(
|
||||
// KBModelConfigRequest 知识库模型配置请求(简化版,只传模型ID)
|
||||
type KBModelConfigRequest struct {
|
||||
LLMModelID string `json:"llmModelId" binding:"required"`
|
||||
EmbeddingModelID string `json:"embeddingModelId" binding:"required"`
|
||||
EmbeddingModelID string `json:"embeddingModelId"` // optional when RAG indexing is disabled
|
||||
VLMConfig *types.VLMConfig `json:"vlm_config"`
|
||||
ASRConfig *types.ASRConfig `json:"asr_config"`
|
||||
|
||||
@@ -236,7 +236,7 @@ func (h *InitializationHandler) UpdateKBConfig(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 检查Embedding模型是否可以修改
|
||||
if kb.EmbeddingModelID != "" && kb.EmbeddingModelID != req.EmbeddingModelID {
|
||||
if kb.EmbeddingModelID != "" && req.EmbeddingModelID != "" && kb.EmbeddingModelID != req.EmbeddingModelID {
|
||||
// 检查是否已有文件
|
||||
knowledgeList, err := h.knowledgeService.ListPagedKnowledgeByKnowledgeBaseID(ctx,
|
||||
kbIdStr, &types.Pagination{
|
||||
@@ -258,16 +258,21 @@ func (h *InitializationHandler) UpdateKBConfig(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
embeddingModel, err := h.modelService.GetModelByID(ctx, req.EmbeddingModelID)
|
||||
if err != nil || embeddingModel == nil {
|
||||
logger.Error(ctx, "Embedding model not found")
|
||||
c.Error(errors.NewBadRequestError("Embedding模型不存在"))
|
||||
return
|
||||
// Embedding模型仅在需要时验证(RAG检索启用时)
|
||||
if req.EmbeddingModelID != "" {
|
||||
embeddingModel, err := h.modelService.GetModelByID(ctx, req.EmbeddingModelID)
|
||||
if err != nil || embeddingModel == nil {
|
||||
logger.Error(ctx, "Embedding model not found")
|
||||
c.Error(errors.NewBadRequestError("Embedding模型不存在"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 更新知识库的模型ID
|
||||
kb.SummaryModelID = req.LLMModelID
|
||||
kb.EmbeddingModelID = req.EmbeddingModelID
|
||||
if req.EmbeddingModelID != "" {
|
||||
kb.EmbeddingModelID = req.EmbeddingModelID
|
||||
}
|
||||
|
||||
// 处理多模态模型配置
|
||||
kb.VLMConfig = types.VLMConfig{}
|
||||
|
||||
Reference in New Issue
Block a user