MCPcopy Index your code
hub / github.com/dataease/SQLBot / _load_template_file

Function _load_template_file

backend/apps/template/template.py:16–24  ·  view source on GitHub ↗

内部函数:加载并解析YAML文件

(file_path: Path)

Source from the content-addressed store, hash-verified

14
15@cache
16def _load_template_file(file_path: Path):
17 """内部函数:加载并解析YAML文件"""
18 try:
19 with open(file_path, 'r', encoding='utf-8') as f:
20 return yaml.safe_load(f)
21 except FileNotFoundError:
22 raise FileNotFoundError(f"Template file not found at {file_path}")
23 except yaml.YAMLError as e:
24 raise ValueError(f"Error parsing YAML file {file_path}: {e}")
25
26
27def get_base_template():

Callers 2

get_base_templateFunction · 0.85
get_sql_templateFunction · 0.85

Calls 1

openFunction · 0.85

Tested by

no test coverage detected