Files
jusfutura/app/services/intent_service.py
T

21 lines
856 B
Python

class IntentService:
def detect_intent(self, message: str) -> str:
m = message.lower()
if any(x in m for x in ["modo advogado", "modo corporativo", "apenas conversar", "só conversar"]):
return "set_mode"
if any(x in m for x in ["petição", "parecer", "contrato", "relatório", "recurso"]):
return "document"
if any(x in m for x in ["pesquise", "jurisprudência", "notícia", "norma", "stj", "stf", "anvisa", "cvm"]):
return "search"
if any(x in m for x in ["monitore", "me avise", "alerta"]):
return "monitoring"
return "chat"
def extract_mode(self, message: str) -> str:
m = message.lower()
if "advogado" in m:
return "advogado"
if "corporativo" in m:
return "corporativo"
return "conversar"