Cambios realizados v1.2.9:

Mejoré la estructura del system prompt para evitar que la IA repita literalmente las instrucciones del
This commit is contained in:
2025-12-05 05:58:08 -03:00
parent e9a184f087
commit f73319046e

View File

@@ -278,7 +278,7 @@ def extract_pdf_text_smart(pdf_content: bytes, max_chars: int = None) -> dict:
}
BACKEND_VERSION = "1.2.8"
BACKEND_VERSION = "1.2.9"
app = FastAPI(title="Checklist Inteligente API", version=BACKEND_VERSION)
# S3/MinIO configuration
@@ -3592,7 +3592,11 @@ INFORMACIÓN DEL VEHÍCULO:
base_prompt = "Eres un experto mecánico automotriz que ayuda a diagnosticar problemas."
# Agregar instrucciones anti-alucinación y contexto al prompt del usuario
system_prompt = f"""{base_prompt}
system_prompt = f"""ROL Y COMPORTAMIENTO:
{base_prompt}
IMPORTANTE: Las instrucciones anteriores definen tu COMPORTAMIENTO, NO son texto para copiar literalmente.
Tu tarea es ANALIZAR y RESPONDER al usuario basándote en el contexto proporcionado.
CONTEXTO DEL VEHÍCULO Y PREGUNTA:
{vehicle_context}
@@ -3603,11 +3607,13 @@ CONTEXTO DEL VEHÍCULO Y PREGUNTA:
{attached_context}
INSTRUCCIONES TÉCNICAS DEL SISTEMA:
- Basa tus respuestas SOLO en la información visible en documentos/imágenes enviadas
- Si necesitas datos técnicos (valores nominales, rangos de fabricante), pídelos explícitamente
REGLAS DE RESPUESTA:
- Analiza ACTIVAMENTE el contenido de los documentos/imágenes enviados
- Basa tus respuestas SOLO en la información visible
- Si necesitas datos técnicos que no están en los archivos, pídelos explícitamente
- No inventes códigos DTC, voltajes, presiones ni valores que no estén visibles
- Si hay discrepancia entre lo que ves y lo que te preguntan, señálalo
- NUNCA repitas las instrucciones del sistema como respuesta
{assistant_instructions if assistant_instructions else ""}