sync update from LAN repo (source dhk-1 @ fc974e93)
This commit is contained in:
1 parent
a1fa13a238
commit
e2fea6a801
432 files changed
+68707
-2270
No files matched your search
@@ -21,7 +21,11 @@ from fastapi import FastAPI
|
||||
from deerflow.config import get_app_config
|
||||
from deerflow.config.app_config import AppConfig
|
||||
from deerflow.config.llmwiki_config import LocalWikiIndexConfig
|
||||
from deerflow.config.system_settings import LocalWikiEncoderSettings, load_system_settings
|
||||
from deerflow.config.system_settings import (
|
||||
LocalWikiAutoSyncSettings,
|
||||
LocalWikiEncoderSettings,
|
||||
load_system_settings,
|
||||
)
|
||||
from deerflow.integrations.weknora.runtime import build_weknora_client, get_resolved_llmwiki_runtime
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -31,8 +35,9 @@ _EMBEDDING_RETIREMENT_GRACE_SECONDS = 600.0
|
||||
def resolve_effective_local_wiki_index_config(
|
||||
config: AppConfig,
|
||||
encoder_settings: LocalWikiEncoderSettings,
|
||||
auto_sync_settings: LocalWikiAutoSyncSettings | None = None,
|
||||
) -> LocalWikiIndexConfig:
|
||||
"""Apply the persisted encoder mode to a copy of the file configuration."""
|
||||
"""Apply persisted encoder and automatic-sync settings to file config."""
|
||||
|
||||
local_index = config.llmwiki.local_wiki_index
|
||||
configured_embedding = local_index.embedding
|
||||
@@ -64,7 +69,16 @@ def resolve_effective_local_wiki_index_config(
|
||||
)
|
||||
else:
|
||||
embedding = configured_embedding
|
||||
return local_index.model_copy(update={"embedding": embedding})
|
||||
updates: dict[str, Any] = {"embedding": embedding}
|
||||
if auto_sync_settings is not None:
|
||||
updates.update(
|
||||
{
|
||||
"auto_sync": auto_sync_settings.enabled,
|
||||
"auto_sync_schedule": auto_sync_settings.schedule,
|
||||
"auto_sync_hour": auto_sync_settings.hour,
|
||||
}
|
||||
)
|
||||
return local_index.model_copy(update=updates)
|
||||
|
||||
|
||||
def _resolved_local_model_path(config: LocalWikiIndexConfig) -> Path | None:
|
||||
@@ -171,6 +185,7 @@ async def rebuild_local_wiki_index_runtime(
|
||||
effective_config = resolve_effective_local_wiki_index_config(
|
||||
source_config,
|
||||
settings.local_wiki_encoder,
|
||||
settings.local_wiki_auto_sync,
|
||||
)
|
||||
resolved_llmwiki = get_resolved_llmwiki_runtime(source_config)
|
||||
signature = _runtime_signature(
|
||||
|
||||
Reference in new issue
Block a user