加载角色元数据
()
| 645 | |
| 646 | def load_roles_meta() -> Dict[str, Any]: |
| 647 | """加载角色元数据""" |
| 648 | role_meta_file = os.path.join( |
| 649 | os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), |
| 650 | "data", "roles.json" |
| 651 | ) |
| 652 | if os.path.exists(role_meta_file): |
| 653 | with open(role_meta_file, 'r', encoding='utf-8') as f: |
| 654 | return json.load(f) |
| 655 | return {"roles": {}, "current_role": None} |
| 656 | |
| 657 | |
| 658 | def get_role_chat_id(role_name: str) -> Optional[str]: |
| 659 | """获取角色的飞书聊天 ID""" |
no outgoing calls
no test coverage detected