| 123456789101112131415161718192021222324 |
- """
- Tools 包 - 工具注册和 Schema 生成
- """
- import os
- from agent.tools.registry import ToolRegistry, tool, get_tool_registry
- from agent.tools.schema import SchemaGenerator
- from agent.tools.models import ToolResult, ToolContext, ToolContextImpl
- # 导入 builtin 工具以触发 @tool 装饰器注册(可通过环境变量关闭)
- if os.getenv("AGENT_DISABLE_BUILTIN_TOOL_REGISTRATION", "").lower() not in {"1", "true", "yes", "on"}:
- # noqa: F401 表示这是故意的副作用导入
- import agent.tools.builtin # noqa: F401
- __all__ = [
- "ToolRegistry",
- "tool",
- "get_tool_registry",
- "SchemaGenerator",
- "ToolResult",
- "ToolContext",
- "ToolContextImpl",
- ]
|