Tool behavior configuration. No more magic numbers!
| 81 | |
| 82 | |
| 83 | class ToolConfig(BaseModel): |
| 84 | """Tool behavior configuration. |
| 85 | |
| 86 | No more magic numbers! |
| 87 | """ |
| 88 | |
| 89 | include_tools: list[str] | None = Field( |
| 90 | default=None, |
| 91 | description="Whitelist of tool names (None = all)", |
| 92 | ) |
| 93 | exclude_tools: list[str] | None = Field( |
| 94 | default=None, |
| 95 | description="Blacklist of tool names", |
| 96 | ) |
| 97 | dynamic_tools_enabled: bool = Field( |
| 98 | default=DEFAULT_DYNAMIC_TOOLS_ENABLED, |
| 99 | description="Enable dynamic tool discovery", |
| 100 | ) |
| 101 | confirm_tools: bool = Field( |
| 102 | default=DEFAULT_CONFIRM_TOOLS, |
| 103 | description="Require confirmation before execution", |
| 104 | ) |
| 105 | max_concurrency: int = Field( |
| 106 | default=DEFAULT_MAX_TOOL_CONCURRENCY, |
| 107 | gt=0, |
| 108 | le=100, |
| 109 | description="Max concurrent tool executions", |
| 110 | ) |
| 111 | |
| 112 | model_config = {"frozen": True} |
| 113 | |
| 114 | @field_validator("include_tools", "exclude_tools") |
| 115 | @classmethod |
| 116 | def validate_tool_lists(cls, v: list[str] | None) -> list[str] | None: |
| 117 | """Ensure tool lists are non-empty if provided.""" |
| 118 | if v is not None and len(v) == 0: |
| 119 | return None |
| 120 | return v |
| 121 | |
| 122 | |
| 123 | class VaultConfig(BaseModel): |
no outgoing calls