Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	fix template bug
Browse files
    	
        app.py
    CHANGED
    
    | @@ -54,18 +54,18 @@ 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(user_templates)
         | 
| 67 | 
            -
             | 
| 68 | 
            -
                return sorted(list(set(templates))) | 
| 69 |  | 
| 70 |  | 
| 71 | 
             
            def load_yaml_template(template_path: Path) -> Dict:
         | 
|  | |
| 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 |  | 
| 71 | 
             
            def load_yaml_template(template_path: Path) -> Dict:
         | 
