JeCabrera commited on
Commit
43fb5c2
verified
1 Parent(s): 202cf3c

Update sophistication/generator.py

Browse files
Files changed (1) hide show
  1. 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(sophistication_level_key):
4
- """
5
- Creates an instruction for the AI based on the selected sophistication level.
6
-
7
- Args:
8
- sophistication_level_key: The key of the selected sophistication level
9
-
10
- Returns:
11
- str: Instruction for the AI based on the sophistication level
12
- """
13
- if sophistication_level_key not in sophistication_levels:
14
- # Default to level 1 if the key is not found
15
- sophistication_level_key = list(sophistication_levels.keys())[0]
16
-
17
- level_data = sophistication_levels[sophistication_level_key]
18
-
19
- instruction = f"""
20
- NIVEL DE SOFISTICACI脫N DEL MERCADO: {level_data['description']}
21
-
22
- ESTRATEGIA A APLICAR: {level_data['strategy']}
23
-
24
- EJEMPLO DE REFERENCIA: {level_data['example']}
25
-
26
- Adapta la promesa y el tono seg煤n este nivel de sofisticaci贸n del mercado.
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