fix: restore embedded wiki images and optimize vector sync
This commit is contained in:
1 parent
30943159bf
commit
0c5e2e8cb0
23 files changed
+609
-136
No files matched your search
+24
-4
@@ -59,7 +59,7 @@ class LocalWikiEmbeddingConfig(BaseModel):
|
||||
base_url: str = ""
|
||||
api_key: str = Field(default="", repr=False)
|
||||
dimensions: int | None = Field(
|
||||
default=1024,
|
||||
default=None,
|
||||
ge=1,
|
||||
le=65536,
|
||||
description="Expected response vector dimensions; not sent to the embedding endpoint.",
|
||||
@@ -108,9 +108,7 @@ class LocalWikiIndexConfig(BaseModel):
|
||||
"""DeerFlow-owned mirror and exact-vector index for WeKnora Wiki pages."""
|
||||
|
||||
enabled: bool = False
|
||||
sync_enabled: bool = False
|
||||
internal_search_enabled: bool = False
|
||||
reference_ui_enabled: bool = False
|
||||
auto_sync: bool = False
|
||||
sync_interval_seconds: int = Field(default=120, ge=10, le=86400)
|
||||
sync_page_size: int = Field(default=100, ge=1, le=500)
|
||||
sync_concurrency: int = Field(default=3, ge=1, le=32)
|
||||
@@ -133,9 +131,31 @@ class LocalWikiIndexConfig(BaseModel):
|
||||
keyword_boost_weight: float = Field(default=0.15, ge=0, le=1)
|
||||
cache_max_knowledge_bases: int = Field(default=20, ge=1, le=1000)
|
||||
cache_revision_check_seconds: float = Field(default=5, ge=0, le=3600)
|
||||
database_batch_size: int = Field(default=50, ge=1, le=500)
|
||||
external_api: LocalWikiExternalApiConfig = Field(default_factory=LocalWikiExternalApiConfig)
|
||||
model_config = ConfigDict(extra="ignore")
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
def _migrate_legacy_flags(cls, value):
|
||||
if isinstance(value, dict) and "auto_sync" not in value and "sync_enabled" in value:
|
||||
value = {**value, "auto_sync": value.get("sync_enabled")}
|
||||
return value
|
||||
|
||||
@property
|
||||
def sync_enabled(self) -> bool:
|
||||
"""Backward-compatible status name; automatic work is one explicit switch."""
|
||||
|
||||
return self.auto_sync
|
||||
|
||||
@property
|
||||
def internal_search_enabled(self) -> bool:
|
||||
return self.enabled
|
||||
|
||||
@property
|
||||
def reference_ui_enabled(self) -> bool:
|
||||
return self.enabled
|
||||
|
||||
@model_validator(mode="after")
|
||||
def _validate_index(self):
|
||||
if self.chunk_overlap_chars >= self.chunk_max_chars:
|
||||
|
||||
Reference in new issue
Block a user