Adicionar app/services/intent_service.py

This commit is contained in:
2026-08-19 19:40:50 -03:00
parent d3bf385fc5
commit d839a75241
+20
View File
@@ -0,0 +1,20 @@
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"