Spaces:
Running
Running
| # utils/classify.py | |
| def classify_task(task: str) -> dict: | |
| """ | |
| Clasifica la tarea del usuario para ayudar al routing / delegaci贸n | |
| Retorna un diccionario con flags booleanos | |
| """ | |
| text = task.lower() | |
| return { | |
| "image": any(w in text for w in [ | |
| "imagen", "image", "foto", "picture", "dibuj", "genera una imagen", | |
| "crea una imagen", "ilustra", "gato", "perro", "cat", "dog" | |
| ]), | |
| "excel": any(w in text for w in [ | |
| "excel", "xlsx", "planilla", "hoja de calculo", "spreadsheet", | |
| "registrar", "tabla de", "plantilla de" | |
| ]), | |
| "word": any(w in text for w in [ | |
| "informe", "reporte", "documento word", "docx", "redacta un informe", | |
| "escribe un informe", "escribe un reporte" | |
| ]), | |
| "analysis": any(w in text for w in [ | |
| "analiza", "evalua", "viabilidad", "riesgo", "revisar", "analisis" | |
| ]), | |
| "backend": any(w in text for w in [ | |
| "python", "script", "groovy", "jenkins", "api", "backend", | |
| "fastapi", "flask", "devops", "pipeline", ".py" | |
| ]), | |
| "frontend": any(w in text for w in [ | |
| "html", "css", "frontend", "web page", "p谩gina web", | |
| "interfaz web", "formulario" | |
| ]), | |
| "fullstack": "full stack" in text or "fullstack" in text or ( | |
| any(w in text for w in ["app completa", "aplicaci贸n completa"]) and | |
| any(w in text for w in ["python", "html", "web"]) | |
| ) | |
| } |