加载工具配置文件
(yaml_path: str)
| 20 | |
| 21 | |
| 22 | def load_tools_config(yaml_path: str) -> List[Dict]: |
| 23 | """加载工具配置文件""" |
| 24 | try: |
| 25 | with open(yaml_path, 'r', encoding='utf-8') as f: |
| 26 | config = yaml.safe_load(f) |
| 27 | |
| 28 | if 'tools' not in config: |
| 29 | raise ValueError("配置文件中没有找到'tools'字段") |
| 30 | |
| 31 | return config['tools'] |
| 32 | except Exception as e: |
| 33 | raise RuntimeError(f"加载配置文件失败: {e}") |
| 34 | |
| 35 | |
| 36 | def get_external_ip() -> str: |