edf345cd72
- Freeze all config models (AppConfig + 15 sub-configs) with frozen=True - Purify from_file() — remove 9 load_*_from_dict() side-effect calls - Replace mtime/reload/push/pop machinery with single ContextVar + init_app_config() - Delete 10 sub-module globals and their getters/setters/loaders - Migrate 50+ consumers from get_*_config() to get_app_config().xxx - Expand DeerFlowContext: app_config + thread_id + agent_name (frozen dataclass) - Wire into Gateway runtime (worker.py) and DeerFlowClient via context= parameter - Remove sandbox_id from runtime.context — flows through ThreadState.sandbox only - Middleware/tools access runtime.context directly via Runtime[DeerFlowContext] generic - resolve_context() retained at server entry points for LangGraph Server fallback
20 lines
577 B
Python
20 lines
577 B
Python
"""Configuration for deferred tool loading via tool_search."""
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class ToolSearchConfig(BaseModel):
|
|
"""Configuration for deferred tool loading via tool_search.
|
|
|
|
When enabled, MCP tools are not loaded into the agent's context directly.
|
|
Instead, they are listed by name in the system prompt and discoverable
|
|
via the tool_search tool at runtime.
|
|
"""
|
|
|
|
model_config = ConfigDict(frozen=True)
|
|
|
|
enabled: bool = Field(
|
|
default=False,
|
|
description="Defer tools and enable tool_search",
|
|
)
|