XiangJinYu commited on
Commit
5189325
·
verified ·
1 Parent(s): 57c258b

fix get_template bug

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -54,17 +54,17 @@ def get_all_templates() -> List[str]:
54
  :return: List of template names
55
  """
56
  settings_path = Path("metagpt/ext/spo/settings")
57
-
58
  # Get default templates
59
  templates = [f.stem for f in settings_path.glob("*.yaml")]
60
-
61
  # Get user-specific templates if user_id exists
62
  if "user_id" in st.session_state:
63
  user_path = settings_path / st.session_state.user_id
64
  if user_path.exists():
65
- user_templates = [f.stem for f in user_path.glob("*.yaml")]
66
- templates.extend(f"{st.session_state.user_id}/{user_templates}")
67
-
68
  return sorted(list(set(templates)))
69
 
70
 
 
54
  :return: List of template names
55
  """
56
  settings_path = Path("metagpt/ext/spo/settings")
57
+
58
  # Get default templates
59
  templates = [f.stem for f in settings_path.glob("*.yaml")]
60
+
61
  # Get user-specific templates if user_id exists
62
  if "user_id" in st.session_state:
63
  user_path = settings_path / st.session_state.user_id
64
  if user_path.exists():
65
+ user_templates = [f"{st.session_state.user_id}/{f.stem}" for f in user_path.glob("*.yaml")]
66
+ templates.extend(user_templates)
67
+
68
  return sorted(list(set(templates)))
69
 
70