Spaces:
Running
Running
fix get_template bug
Browse files
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(
|
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 |
|