Adicionar app/services/intent_service.py
This commit is contained in:
@@ -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"
|
||||||
Reference in New Issue
Block a user