fix: Fix YAML syntax errors and validator prompt formatting
- Fix YAML files with unquoted strings containing quotes - Export singleton instances in ai/__init__.py - Fix validator scoring prompt to use replace() instead of format() to avoid conflicts with JSON curly braces Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -261,11 +261,8 @@ class ContentValidator:
|
||||
if not scoring_prompt:
|
||||
scoring_prompt = self._default_scoring_prompt()
|
||||
|
||||
# Renderizar prompt
|
||||
prompt = scoring_prompt.format(
|
||||
content=content,
|
||||
platform=platform
|
||||
)
|
||||
# Renderizar prompt usando replace para evitar problemas con JSON
|
||||
prompt = scoring_prompt.replace("{content}", content).replace("{platform}", platform)
|
||||
|
||||
# Llamar a DeepSeek
|
||||
response = self.client.chat.completions.create(
|
||||
@@ -340,7 +337,7 @@ CRITERIOS (suma = 100):
|
||||
- CTA (0-10): ¿CTA claro si aplica?
|
||||
|
||||
RESPONDE EN JSON:
|
||||
{{"total": N, "breakdown": {{"hook_strength": N, "clarity": N, "actionability": N, "originality": N, "brand_voice": N, "cta_effectiveness": N}}, "feedback": "sugerencia"}}"""
|
||||
{"total": N, "breakdown": {"hook_strength": N, "clarity": N, "actionability": N, "originality": N, "brand_voice": N, "cta_effectiveness": N}, "feedback": "sugerencia"}"""
|
||||
|
||||
def _extract_score_from_text(self, text: str) -> Dict:
|
||||
"""Extraer score de texto si falla JSON parsing."""
|
||||
|
||||
Reference in New Issue
Block a user