MCPcopy Create free account
hub / github.com/DSGWJQ/Feagent / _sanitize_name

Method _sanitize_name

src/domain/services/node_code_generator.py:448–456  ·  view source on GitHub ↗

规范化节点名称

(self, name: str)

Source from the content-addressed store, hash-verified

446 return YamlGenerationResult(yaml_content="", is_valid=False, errors=[str(e)])
447
448 def _sanitize_name(self, name: str) -> str:
449 """规范化节点名称"""
450 # 替换非法字符
451 sanitized = re.sub(r"[^a-zA-Z0-9_]", "_", name)
452 # 移除连续下划线
453 sanitized = re.sub(r"_+", "_", sanitized)
454 # 移除首尾下划线
455 sanitized = sanitized.strip("_")
456 return sanitized.lower()
457
458 def _format_parameters(self, parameters: list[dict[str, Any]]) -> list[dict[str, Any]]:
459 """格式化参数列表"""

Callers 2

generate_yamlMethod · 0.95
generate_completeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected