Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
验证完毕
weitonga27f12a6cbea
diff --git a/.env.example b/.env.exampleindex b35b340e9..67c8863f9 100644--- a/.env.example+++ b/.env.example@@ -512,3 +512,6 @@ DOCREADER_TRANSPORT=grpc# 用于OIDC用于信息中提取用户数据# OIDC_USER_INFO_MAPPING_USER_NAME=name# OIDC_USER_INFO_MAPPING_EMAIL=email++# Document processing task timeout. Large files may need more than Asynq's default 30m.+# WEKNORA_DOCUMENT_PROCESS_TIMEOUT=2hdiff --git a/config/config.yaml b/config/config.yamlindex 48209531c..c6b69f3c1 100644--- a/config/config.yaml+++ b/config/config.yaml@@ -42,6 +42,7 @@ knowledge_base:chunk_size: 512chunk_overlap: 50split_markers: ["\n\n", "\n", "。"]+ document_process_timeout: 2himage_processing:enable_multimodal: truediff --git a/internal/config/config.go b/internal/config/config.goindex 6da56e903..4b851e759 100644--- a/internal/config/config.go+++ b/internal/config/config.go@@ -154,11 +154,12 @@ type ServerConfig struct {// KnowledgeBaseConfig 知识库配置type KnowledgeBaseConfig struct {- ChunkSize int `yaml:"chunk_size" json:"chunk_size"`- ChunkOverlap int `yaml:"chunk_overlap" json:"chunk_overlap"`- SplitMarkers []string `yaml:"split_markers" json:"split_markers"`- KeepSeparator bool `yaml:"keep_separator" json:"keep_separator"`- ImageProcessing *ImageProcessingConfig `yaml:"image_processing" json:"image_processing"`+ ChunkSize int `yaml:"chunk_size" json:"chunk_size"`+ ChunkOverlap int `yaml:"chunk_overlap" json:"chunk_overlap"`+ SplitMarkers []string `yaml:"split_markers" json:"split_markers"`+ KeepSeparator bool `yaml:"keep_separator" json:"keep_separator"`+ ImageProcessing *ImageProcessingConfig `yaml:"image_processing" json:"image_processing"`+ DocumentProcessTimeout time.Duration `yaml:"document_process_timeout" json:"document_process_timeout"`}// ImageProcessingConfig 图像处理配置@@ -434,6 +435,7 @@ func LoadConfig() (*Config, error) {// Validate configuration valuesapplyOIDCEnvOverrides(&cfg)applyAgentEnvOverrides(&cfg)+ applyKnowledgeBaseEnvOverrides(&cfg)if err := ValidateConfig(&cfg); err != nil {return nil, err@@ -561,6 +563,20 @@ func applyOIDCEnvOverrides(cfg *Config) {}}+func applyKnowledgeBaseEnvOverrides(cfg *Config) {+ if cfg.KnowledgeBase == nil {+ cfg.KnowledgeBase = &KnowledgeBaseConfig{}+ }+ if cfg.KnowledgeBase.DocumentProcessTimeout <= 0 {+ cfg.KnowledgeBase.DocumentProcessTimeout = 2 * time.Hour+ }+ if value := strings.TrimSpace(os.Getenv("WEKNORA_DOCUMENT_PROCESS_TIMEOUT")); value != "" {+ if d, err := time.ParseDuration(value); err == nil {+ cfg.KnowledgeBase.DocumentProcessTimeout = d+ }+ }+}+func applyAgentEnvOverrides(cfg *Config) {if cfg.Agent == nil {cfg.Agent = &AgentConfig{}