Spaces:
Sleeping
Sleeping
| from sophistication.sophistication_levels import sophistication_levels | |
| def create_sophistication_instruction(sophistication_key): | |
| """ | |
| Creates instruction text based on the selected sophistication level key. | |
| Args: | |
| sophistication_key: String key for the sophistication level (e.g., "Nivel 1 - Mercado Nuevo") | |
| Returns: | |
| str: Instruction text for the selected sophistication level | |
| """ | |
| # Get the sophistication level data from the dictionary using the key | |
| level_data = sophistication_levels.get(sophistication_key, {}) | |
| if not level_data: | |
| return "" | |
| # Format the characteristics list outside the f-string | |
| characteristics = level_data.get('characteristics', []) | |
| characteristics_text = '\n- '.join(characteristics) | |
| # Create the instruction text using the level data | |
| instruction = f"""NIVEL DE SOFISTICACIÓN DEL MERCADO: | |
| {level_data.get('description', '')} | |
| Estrategia recomendada: | |
| {level_data.get('strategy', '')} | |
| Características de este nivel: | |
| - {characteristics_text} | |
| Ejemplo de gancho para este nivel: | |
| "{level_data.get('example', '')}" | |
| """ | |
| return instruction |