脕lvaro Valenzuela Valdes commited on
Commit 路
db789b9
1
Parent(s): 44737dd
feat: upgrade proposal draft generation with professional structure
Browse files- backend/app/services/agents.py +21 -11
backend/app/services/agents.py
CHANGED
|
@@ -71,23 +71,33 @@ async def run_full_analysis(tender: Tender, company_profile: CompanyProfile, doc
|
|
| 71 |
audit_log.append("馃挕 Consolidando hallazgos...")
|
| 72 |
|
| 73 |
synthesis_prompt = (
|
| 74 |
-
f"SISTEMA DE CONSENSO ANDESOPS AI\n"
|
| 75 |
f"Licitaci贸n: {tender.name}\n"
|
|
|
|
| 76 |
f"Reporte Legal: {legal_resp}\n"
|
| 77 |
f"Reporte T茅cnico: {tech_resp}\n"
|
| 78 |
f"Reporte Estrat茅gico: {strat_resp}\n\n"
|
| 79 |
-
f"Genera un JSON 'AnalysisResult' siguiendo estas reglas:\n"
|
| 80 |
f"1. fit_score (int 0-100)\n"
|
| 81 |
f"2. decision ('Recommended', 'Review Carefully', 'Not Recommended')\n"
|
| 82 |
-
f"3. executive_summary
|
| 83 |
-
f"4. risks
|
| 84 |
-
f"5. key_requirements
|
| 85 |
-
f"6. compliance_gaps
|
| 86 |
-
f"7. action_plan
|
| 87 |
-
f"8. strategic_roadmap
|
| 88 |
-
f"9. proposal_draft
|
| 89 |
-
f"
|
| 90 |
-
f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
)
|
| 92 |
|
| 93 |
final_output = await call_gemini(synthesis_prompt, is_json=True)
|
|
|
|
| 71 |
audit_log.append("馃挕 Consolidando hallazgos...")
|
| 72 |
|
| 73 |
synthesis_prompt = (
|
| 74 |
+
f"SISTEMA DE CONSENSO ANDESOPS AI (ESTRUCTURA DE ALTO IMPACTO)\n"
|
| 75 |
f"Licitaci贸n: {tender.name}\n"
|
| 76 |
+
f"Comprador: {tender.buyer}\n"
|
| 77 |
f"Reporte Legal: {legal_resp}\n"
|
| 78 |
f"Reporte T茅cnico: {tech_resp}\n"
|
| 79 |
f"Reporte Estrat茅gico: {strat_resp}\n\n"
|
| 80 |
+
f"Genera un JSON 'AnalysisResult' siguiendo estas reglas estrictas:\n"
|
| 81 |
f"1. fit_score (int 0-100)\n"
|
| 82 |
f"2. decision ('Recommended', 'Review Carefully', 'Not Recommended')\n"
|
| 83 |
+
f"3. executive_summary: Un resumen ejecutivo de alto nivel, profesional y persuasivo.\n"
|
| 84 |
+
f"4. risks: Lista de {{title, severity, explanation}} con los riesgos cr铆ticos detectados.\n"
|
| 85 |
+
f"5. key_requirements: Lista de requisitos t茅cnicos/administrativos ineludibles.\n"
|
| 86 |
+
f"6. compliance_gaps: Brechas que la empresa debe cerrar para ganar.\n"
|
| 87 |
+
f"7. action_plan: Pasos concretos a seguir.\n"
|
| 88 |
+
f"8. strategic_roadmap: Un roadmap estrat茅gico en Markdown que explique c贸mo ganar.\n"
|
| 89 |
+
f"9. proposal_draft: **CR脥TICO** - Genera un borrador de propuesta t茅cnica formal y detallado en Markdown.\n"
|
| 90 |
+
f" Debe incluir: \n"
|
| 91 |
+
f" - Portada (T铆tulo de Licitaci贸n, Empresa, Fecha)\n"
|
| 92 |
+
f" - Introducci贸n y Objetivos\n"
|
| 93 |
+
f" - Soluci贸n T茅cnica Propuesta (basada en el reporte t茅cnico)\n"
|
| 94 |
+
f" - Metodolog铆a de Implementaci贸n\n"
|
| 95 |
+
f" - Propuesta de Valor Diferenciadora (por qu茅 elegirnos)\n"
|
| 96 |
+
f" - Cronograma estimado\n"
|
| 97 |
+
f" - Conclusi贸n Profesional\n"
|
| 98 |
+
f"10. requirement_responses: Genera una lista de {{question, answer}} respondiendo a los requisitos m谩s probables de la licitaci贸n basados en la informaci贸n disponible.\n"
|
| 99 |
+
f"11. report_markdown: Un reporte general para consumo interno.\n"
|
| 100 |
+
f"Responde 脷NICAMENTE con el JSON plano. No incluyas explicaciones fuera del JSON."
|
| 101 |
)
|
| 102 |
|
| 103 |
final_output = await call_gemini(synthesis_prompt, is_json=True)
|