sync update from LAN repo (source dhk-1 @ 3e87be55)
This commit is contained in:
1 parent
ab6068a7c1
commit
42f2a26fa8
1482 files changed
+227759
-9584
No files matched your search
@@ -17,6 +17,7 @@ from deerflow.config.database_config import DatabaseConfig
|
||||
from deerflow.config.extensions_config import ExtensionsConfig
|
||||
from deerflow.config.gateway_config import GatewayConfig
|
||||
from deerflow.config.guardrails_config import GuardrailsConfig, load_guardrails_config_from_dict
|
||||
from deerflow.config.html_runtime_config import HtmlRuntimeConfig
|
||||
from deerflow.config.knowledge_config import KnowledgeConfig
|
||||
from deerflow.config.knowledge_ingest_config import KnowledgeIngestConfig
|
||||
from deerflow.config.llmwiki_config import LlmWikiConfig
|
||||
@@ -27,6 +28,7 @@ from deerflow.config.model_config import ModelConfig
|
||||
from deerflow.config.report_collaboration_config import ReportCollaborationConfig
|
||||
from deerflow.config.run_events_config import RunEventsConfig
|
||||
from deerflow.config.runtime_paths import existing_project_file
|
||||
from deerflow.config.runtime_performance_config import RuntimePerformanceConfig
|
||||
from deerflow.config.sandbox_config import SandboxConfig
|
||||
from deerflow.config.sentiment_agent_config import SentimentAgentConfig
|
||||
from deerflow.config.skill_evolution_config import SkillEvolutionConfig
|
||||
@@ -43,6 +45,7 @@ from deerflow.config.token_usage_config import TokenUsageConfig
|
||||
from deerflow.config.tool_config import ToolConfig, ToolGroupConfig
|
||||
from deerflow.config.tool_search_config import ToolSearchConfig, load_tool_search_config_from_dict
|
||||
from deerflow.config.vision_config import VisionConfig
|
||||
from deerflow.config.web_app_config import WebAppConfig
|
||||
from deerflow.config.workflow_config import WorkflowConfig
|
||||
from deerflow.config.y_log_config import YLogConfig
|
||||
|
||||
@@ -116,6 +119,7 @@ class AppConfig(BaseModel):
|
||||
"""Config for the DeerFlow application"""
|
||||
|
||||
log_level: str = Field(default="info", description="Logging level for deerflow and app modules (debug/info/warning/error); third-party libraries are not affected")
|
||||
runtime_performance: RuntimePerformanceConfig = Field(default_factory=RuntimePerformanceConfig, description="Skill-view reuse and cache default on; model timing and the Gateway executor stay off unless set. Set a skill-view switch false to disable it.")
|
||||
token_usage: TokenUsageConfig = Field(default_factory=TokenUsageConfig, description="Token usage tracking configuration")
|
||||
models: list[ModelConfig] = Field(default_factory=list, description="Available models")
|
||||
vision: VisionConfig = Field(default_factory=VisionConfig, description="Image recognition (识图) configuration")
|
||||
@@ -151,7 +155,15 @@ class AppConfig(BaseModel):
|
||||
knowledge_ingest: KnowledgeIngestConfig = Field(default_factory=KnowledgeIngestConfig, description="External knowledge-ingest endpoint configuration")
|
||||
task_deeplink: TaskDeeplinkConfig = Field(default_factory=TaskDeeplinkConfig, description="任务深链(rwfx)目的树闸门与跳转地址配置(前端经 /api/public/config/task-deeplink 读取)")
|
||||
y_log: YLogConfig = Field(default_factory=YLogConfig, description="操作日志上报配置(前端经 /api/public/config/y-log 读取)")
|
||||
html_runtime: HtmlRuntimeConfig = Field(
|
||||
default_factory=HtmlRuntimeConfig,
|
||||
description="后台生成 HTML 的浏览器绘图库与地图瓦片配置",
|
||||
)
|
||||
workflows: WorkflowConfig = Field(default_factory=WorkflowConfig, description="Workflow Studio limits / iframe origins")
|
||||
web_app: WebAppConfig = Field(
|
||||
default_factory=WebAppConfig,
|
||||
description="Web App 产物模式(多页面站点生成/构建/预览,默认关闭、可降级)",
|
||||
)
|
||||
report_collaboration: ReportCollaborationConfig = Field(
|
||||
default_factory=ReportCollaborationConfig,
|
||||
description="AgentScope report-collaboration workbench (default off)",
|
||||
@@ -211,6 +223,7 @@ class AppConfig(BaseModel):
|
||||
cls._check_config_version(config_data, resolved_path)
|
||||
|
||||
config_data = cls.resolve_env_variables(config_data)
|
||||
cls._resolve_relative_mount_paths(config_data, resolved_path.parent)
|
||||
cls._apply_database_defaults(config_data)
|
||||
|
||||
# Load title config if present
|
||||
@@ -272,6 +285,36 @@ class AppConfig(BaseModel):
|
||||
result = cls.model_validate(config_data)
|
||||
return result
|
||||
|
||||
@classmethod
|
||||
def _resolve_relative_mount_paths(
|
||||
cls,
|
||||
config_data: dict[str, Any],
|
||||
config_dir: Path,
|
||||
) -> None:
|
||||
"""Resolve portable sandbox mount paths beside ``config.yaml``.
|
||||
|
||||
Deployment copies frequently live at different absolute paths. A
|
||||
relative ``sandbox.mounts[*].host_path`` therefore means "relative to
|
||||
the config file", never relative to the process working directory.
|
||||
Providers continue to receive absolute paths, which keeps both the
|
||||
local path mapper and Docker bind mounts deterministic.
|
||||
"""
|
||||
sandbox = config_data.get("sandbox")
|
||||
if not isinstance(sandbox, dict):
|
||||
return
|
||||
mounts = sandbox.get("mounts")
|
||||
if not isinstance(mounts, list):
|
||||
return
|
||||
for mount in mounts:
|
||||
if not isinstance(mount, dict):
|
||||
continue
|
||||
raw_host_path = mount.get("host_path")
|
||||
if not isinstance(raw_host_path, str) or not raw_host_path.strip():
|
||||
continue
|
||||
host_path = Path(raw_host_path)
|
||||
if not host_path.is_absolute():
|
||||
mount["host_path"] = str((config_dir / host_path).resolve())
|
||||
|
||||
@classmethod
|
||||
def _apply_database_defaults(cls, config_data: dict[str, Any]) -> None:
|
||||
"""Apply config.yaml defaults for persistence when the section is absent."""
|
||||
@@ -427,6 +470,15 @@ def _load_and_cache_app_config(config_path: str | None = None) -> AppConfig:
|
||||
summarization.keep,
|
||||
summarization.trim_tokens_to_summarize,
|
||||
)
|
||||
performance = _app_config.runtime_performance
|
||||
logger.info(
|
||||
"RUNTIME_PERFORMANCE skill_view_reuse_enabled=%s skill_view_cache_enabled=%s model_timing_nonblocking_enabled=%s asyncio_thread_pool_enabled=%s asyncio_thread_pool_size=%d",
|
||||
performance.skill_view_reuse_enabled,
|
||||
performance.skill_view_cache_enabled,
|
||||
performance.model_timing_nonblocking_enabled,
|
||||
performance.asyncio_thread_pool_enabled,
|
||||
performance.asyncio_thread_pool_size,
|
||||
)
|
||||
return _app_config
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user