Spaces:
Sleeping
Sleeping
Update sophistication/generator.py
Browse files- sophistication/generator.py +32 -28
sophistication/generator.py
CHANGED
@@ -1,29 +1,33 @@
|
|
1 |
-
from .sophistication_levels import sophistication_levels
|
2 |
-
|
3 |
-
def create_sophistication_instruction(
|
4 |
-
"""
|
5 |
-
Creates
|
6 |
-
|
7 |
-
Args:
|
8 |
-
|
9 |
-
|
10 |
-
Returns:
|
11 |
-
str: Instruction for the
|
12 |
-
"""
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
instruction
|
20 |
-
NIVEL DE SOFISTICACI脫N DEL MERCADO:
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
return instruction
|
|
|
1 |
+
from sophistication.sophistication_levels import sophistication_levels
|
2 |
+
|
3 |
+
def create_sophistication_instruction(sophistication_key):
|
4 |
+
"""
|
5 |
+
Creates instruction text based on the selected sophistication level key.
|
6 |
+
|
7 |
+
Args:
|
8 |
+
sophistication_key: String key for the sophistication level (e.g., "Nivel 1 - Mercado Nuevo")
|
9 |
+
|
10 |
+
Returns:
|
11 |
+
str: Instruction text for the selected sophistication level
|
12 |
+
"""
|
13 |
+
# Get the sophistication level data from the dictionary using the key
|
14 |
+
level_data = sophistication_levels.get(sophistication_key, {})
|
15 |
+
|
16 |
+
if not level_data:
|
17 |
+
return ""
|
18 |
+
|
19 |
+
# Create the instruction text using the level data
|
20 |
+
instruction = f"""NIVEL DE SOFISTICACI脫N DEL MERCADO:
|
21 |
+
{level_data.get('description', '')}
|
22 |
+
|
23 |
+
Estrategia recomendada:
|
24 |
+
{level_data.get('strategy', '')}
|
25 |
+
|
26 |
+
Caracter铆sticas de este nivel:
|
27 |
+
- {'\n- '.join(level_data.get('characteristics', []))}
|
28 |
+
|
29 |
+
Ejemplo de gancho para este nivel:
|
30 |
+
"{level_data.get('example', '')}"
|
31 |
+
"""
|
32 |
+
|
33 |
return instruction
|