atendentepro 0.6.3__tar.gz → 0.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {atendentepro-0.6.3 → atendentepro-0.6.4}/CHANGELOG.md +24 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/PKG-INFO +284 -35
- {atendentepro-0.6.3 → atendentepro-0.6.4}/README.md +283 -34
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/__init__.py +10 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/models/__init__.py +14 -1
- atendentepro-0.6.4/atendentepro/models/context.py +182 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/network.py +143 -50
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/templates/__init__.py +8 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/templates/manager.py +138 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/pyproject.toml +1 -1
- atendentepro-0.6.3/atendentepro/models/context.py +0 -21
- {atendentepro-0.6.3 → atendentepro-0.6.4}/LICENSE +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/MANIFEST.in +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/README.md +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/__init__.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/answer.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/confirmation.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/escalation.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/feedback.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/flow.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/interview.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/knowledge.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/onboarding.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/triage.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/agents/usage.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/config/__init__.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/config/settings.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/guardrails/__init__.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/guardrails/manager.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/license.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/models/outputs.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/__init__.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/answer.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/confirmation.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/escalation.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/feedback.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/flow.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/interview.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/knowledge.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/onboarding.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/prompts/triage.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/utils/__init__.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/utils/openai_client.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro/utils/tracing.py +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/atendentepro.egg-info/SOURCES.txt +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/requirements.txt +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/setup.cfg +0 -0
- {atendentepro-0.6.3 → atendentepro-0.6.4}/setup.py +0 -0
|
@@ -5,6 +5,26 @@ All notable changes to AtendentePro will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.4] - 2025-01-14
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Filtros de Acesso (Role/User)**: Novo sistema de controle de acesso baseado em roles e usuários
|
|
12
|
+
- `UserContext`: Contexto do usuário com user_id, role e metadata
|
|
13
|
+
- `AccessFilter`: Filtros whitelist/blacklist para roles e users
|
|
14
|
+
- `FilteredPromptSection`: Seções de prompt condicionais por role/user
|
|
15
|
+
- `FilteredTool`: Tools com filtro de acesso
|
|
16
|
+
- **Novos parâmetros em `create_standard_network`**:
|
|
17
|
+
- `user_context`: Contexto do usuário para filtragem
|
|
18
|
+
- `agent_filters`: Filtros de agente por role/user
|
|
19
|
+
- `conditional_prompts`: Prompts condicionais por role/user
|
|
20
|
+
- `filtered_tools`: Tools filtradas por role/user
|
|
21
|
+
- **Configuração via YAML** (`access_config.yaml`): Suporte a configuração de filtros via arquivo
|
|
22
|
+
- **Exemplos completos**: Pasta `docs/examples/access_filters/` com casos de uso
|
|
23
|
+
|
|
24
|
+
### Documentation
|
|
25
|
+
- README atualizado com seção completa de Filtros de Acesso
|
|
26
|
+
- Exemplos de código e YAML para diferentes cenários
|
|
27
|
+
|
|
8
28
|
## [0.6.3] - 2025-01-12
|
|
9
29
|
|
|
10
30
|
### Changed
|
|
@@ -13,6 +33,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
33
|
- **CI mais rápido**: Cache de pip adicionado e matriz reduzida para Python 3.9 e 3.12
|
|
14
34
|
- Instalação base reduzida de ~300MB para ~50MB
|
|
15
35
|
|
|
36
|
+
### Added
|
|
37
|
+
- **Exemplos de Single Reply Mode**: Pasta `docs/examples/single_reply/` com exemplos completos
|
|
38
|
+
- Documentação expandida no README com casos de uso práticos (FAQ Bot, Bot de Leads)
|
|
39
|
+
|
|
16
40
|
### Fixed
|
|
17
41
|
- Warnings de instalação eliminados com pinagem de versões
|
|
18
42
|
- Tempo de deploy reduzido de ~40min para ~8-10min
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atendentepro
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: Framework de orquestração de agentes IA com tom e estilo customizáveis. Integra documentos (RAG), APIs e bancos de dados em uma plataforma inteligente multi-agente.
|
|
5
5
|
Author-email: BeMonkAI <contato@monkai.com.br>
|
|
6
6
|
Maintainer-email: BeMonkAI <contato@monkai.com.br>
|
|
@@ -95,6 +95,7 @@ Plataforma que unifica múltiplos agentes especializados para resolver demandas
|
|
|
95
95
|
- [Fluxo de Handoffs](#-fluxo-de-handoffs)
|
|
96
96
|
- [Estilo de Comunicação](#-estilo-de-comunicação-agentstyle)
|
|
97
97
|
- [Single Reply Mode](#-single-reply-mode)
|
|
98
|
+
- [Filtros de Acesso](#-filtros-de-acesso-roleuser)
|
|
98
99
|
- [Tracing e Monitoramento](#-tracing-e-monitoramento)
|
|
99
100
|
- [Suporte](#-suporte)
|
|
100
101
|
|
|
@@ -712,80 +713,328 @@ agents:
|
|
|
712
713
|
|
|
713
714
|
O **Single Reply Mode** permite configurar agentes para responderem apenas uma vez e automaticamente transferirem de volta para o Triage. Isso evita que a conversa fique "presa" em um agente específico.
|
|
714
715
|
|
|
716
|
+
📂 **Exemplos completos**: [docs/examples/single_reply/](docs/examples/single_reply/)
|
|
717
|
+
|
|
715
718
|
### Quando Usar
|
|
716
719
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
+
| Cenário | Recomendação |
|
|
721
|
+
|---------|--------------|
|
|
722
|
+
| **Chatbots de alto volume** | ✅ Ativar para respostas rápidas |
|
|
723
|
+
| **FAQ simples** | ✅ Knowledge com single_reply |
|
|
724
|
+
| **Coleta de dados** | ❌ Interview precisa múltiplas interações |
|
|
725
|
+
| **Onboarding** | ❌ Precisa guiar o usuário em etapas |
|
|
726
|
+
| **Confirmações** | ✅ Confirma e volta ao Triage |
|
|
720
727
|
|
|
721
|
-
### Via Código
|
|
728
|
+
### Exemplo 1: FAQ Bot (Via Código)
|
|
729
|
+
|
|
730
|
+
Chatbot otimizado para perguntas frequentes:
|
|
722
731
|
|
|
723
732
|
```python
|
|
724
733
|
from pathlib import Path
|
|
725
734
|
from atendentepro import create_standard_network
|
|
726
735
|
|
|
727
|
-
#
|
|
736
|
+
# FAQ Bot: Knowledge e Answer respondem uma vez
|
|
728
737
|
network = create_standard_network(
|
|
729
738
|
templates_root=Path("./meu_cliente"),
|
|
730
739
|
client="config",
|
|
731
|
-
global_single_reply=
|
|
740
|
+
global_single_reply=False,
|
|
741
|
+
single_reply_agents={
|
|
742
|
+
"knowledge": True, # FAQ: responde e volta
|
|
743
|
+
"answer": True, # Perguntas gerais: responde e volta
|
|
744
|
+
"flow": True, # Menu: apresenta e volta
|
|
745
|
+
},
|
|
732
746
|
)
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
### Exemplo 2: Bot de Leads (Via Código)
|
|
733
750
|
|
|
734
|
-
|
|
751
|
+
Bot que coleta dados mas responde dúvidas rapidamente:
|
|
752
|
+
|
|
753
|
+
```python
|
|
735
754
|
network = create_standard_network(
|
|
736
755
|
templates_root=Path("./meu_cliente"),
|
|
737
756
|
client="config",
|
|
738
757
|
global_single_reply=False,
|
|
739
758
|
single_reply_agents={
|
|
740
|
-
|
|
741
|
-
"
|
|
742
|
-
|
|
743
|
-
#
|
|
759
|
+
# Interview PRECISA de múltiplas interações para coletar dados
|
|
760
|
+
"interview": False,
|
|
761
|
+
|
|
762
|
+
# Outros agentes podem ser rápidos
|
|
763
|
+
"knowledge": True, # Tira dúvidas sobre produto
|
|
764
|
+
"answer": True, # Responde perguntas
|
|
765
|
+
"confirmation": True, # Confirma cadastro
|
|
744
766
|
},
|
|
745
767
|
)
|
|
746
768
|
```
|
|
747
769
|
|
|
770
|
+
### Exemplo 3: Ativar para TODOS os agentes
|
|
771
|
+
|
|
772
|
+
```python
|
|
773
|
+
network = create_standard_network(
|
|
774
|
+
templates_root=Path("./meu_cliente"),
|
|
775
|
+
client="config",
|
|
776
|
+
global_single_reply=True, # Todos respondem uma vez
|
|
777
|
+
)
|
|
778
|
+
```
|
|
779
|
+
|
|
748
780
|
### Via YAML (single_reply_config.yaml)
|
|
749
781
|
|
|
750
782
|
Crie o arquivo `single_reply_config.yaml` na pasta do cliente:
|
|
751
783
|
|
|
752
784
|
```yaml
|
|
753
|
-
# Global:
|
|
785
|
+
# Global: se true, TODOS os agentes respondem apenas uma vez
|
|
754
786
|
global: false
|
|
755
787
|
|
|
756
|
-
# Configuração por agente
|
|
788
|
+
# Configuração por agente (sobrescreve global)
|
|
757
789
|
agents:
|
|
758
|
-
# Agentes
|
|
759
|
-
knowledge: true
|
|
760
|
-
|
|
761
|
-
|
|
790
|
+
# Agentes de consulta: respondem uma vez
|
|
791
|
+
knowledge: true # FAQ: responde e volta
|
|
792
|
+
answer: true # Perguntas: responde e volta
|
|
793
|
+
confirmation: true # Confirma e volta
|
|
794
|
+
usage: true # Explica uso e volta
|
|
795
|
+
|
|
796
|
+
# Agentes de coleta: múltiplas interações
|
|
797
|
+
interview: false # Precisa coletar dados
|
|
798
|
+
onboarding: false # Precisa guiar usuário
|
|
762
799
|
|
|
763
|
-
#
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
800
|
+
# Opcionais
|
|
801
|
+
flow: true # Menu: apresenta e volta
|
|
802
|
+
escalation: true # Registra e volta
|
|
803
|
+
feedback: true # Coleta feedback e volta
|
|
767
804
|
```
|
|
768
805
|
|
|
769
|
-
###
|
|
806
|
+
### Fluxo Visual
|
|
770
807
|
|
|
771
|
-
|
|
808
|
+
**Com single_reply=True:**
|
|
772
809
|
|
|
773
810
|
```
|
|
774
|
-
[Usuário
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
811
|
+
[Usuário: "Qual o preço?"]
|
|
812
|
+
↓
|
|
813
|
+
[Triage] → detecta consulta
|
|
814
|
+
↓
|
|
815
|
+
[Knowledge] → responde: "R$ 99,90"
|
|
816
|
+
↓
|
|
817
|
+
[Triage] ← retorno AUTOMÁTICO
|
|
818
|
+
↓
|
|
819
|
+
[Usuário: "E a entrega?"]
|
|
820
|
+
↓
|
|
821
|
+
[Triage] → nova análise (ciclo reinicia)
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
**Com single_reply=False (padrão):**
|
|
825
|
+
|
|
779
826
|
```
|
|
827
|
+
[Usuário: "Qual o preço?"]
|
|
828
|
+
↓
|
|
829
|
+
[Triage] → detecta consulta
|
|
830
|
+
↓
|
|
831
|
+
[Knowledge] → responde: "R$ 99,90"
|
|
832
|
+
↓
|
|
833
|
+
[Usuário: "E a entrega?"]
|
|
834
|
+
↓
|
|
835
|
+
[Knowledge] → continua no mesmo agente
|
|
836
|
+
↓
|
|
837
|
+
[Usuário: "Quero falar com humano"]
|
|
838
|
+
↓
|
|
839
|
+
[Knowledge] → handoff para Escalation
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
### Configuração Recomendada
|
|
843
|
+
|
|
844
|
+
Para a maioria dos casos de uso:
|
|
845
|
+
|
|
846
|
+
```yaml
|
|
847
|
+
global: false
|
|
848
|
+
|
|
849
|
+
agents:
|
|
850
|
+
knowledge: true # FAQ
|
|
851
|
+
answer: true # Perguntas gerais
|
|
852
|
+
confirmation: true # Confirmações
|
|
853
|
+
|
|
854
|
+
interview: false # Coleta de dados
|
|
855
|
+
onboarding: false # Guia de usuário
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
---
|
|
859
|
+
|
|
860
|
+
## 🔐 Filtros de Acesso (Role/User)
|
|
861
|
+
|
|
862
|
+
O sistema de **Filtros de Acesso** permite controlar quais agentes, prompts e tools estão disponíveis para cada usuário ou role (função).
|
|
863
|
+
|
|
864
|
+
📂 **Exemplos completos**: [docs/examples/access_filters/](docs/examples/access_filters/)
|
|
865
|
+
|
|
866
|
+
### Quando Usar
|
|
867
|
+
|
|
868
|
+
| Cenário | Solução |
|
|
869
|
+
|---------|---------|
|
|
870
|
+
| **Multi-tenant** | Diferentes clientes veem diferentes agentes |
|
|
871
|
+
| **Níveis de acesso** | Admin vê mais opções que cliente |
|
|
872
|
+
| **Segurança** | Dados sensíveis só para roles específicas |
|
|
873
|
+
| **Personalização** | Diferentes instruções por departamento |
|
|
874
|
+
|
|
875
|
+
### Níveis de Filtragem
|
|
876
|
+
|
|
877
|
+
1. **Agentes**: Habilitar/desabilitar agentes inteiros
|
|
878
|
+
2. **Prompts**: Adicionar seções condicionais aos prompts
|
|
879
|
+
3. **Tools**: Habilitar/desabilitar tools específicas
|
|
880
|
+
|
|
881
|
+
### Exemplo 1: Filtros de Agente (Via Código)
|
|
882
|
+
|
|
883
|
+
```python
|
|
884
|
+
from pathlib import Path
|
|
885
|
+
from atendentepro import (
|
|
886
|
+
create_standard_network,
|
|
887
|
+
UserContext,
|
|
888
|
+
AccessFilter,
|
|
889
|
+
)
|
|
890
|
+
|
|
891
|
+
# Usuário com role de vendedor
|
|
892
|
+
user = UserContext(user_id="vendedor_123", role="vendedor")
|
|
893
|
+
|
|
894
|
+
# Filtros de agente
|
|
895
|
+
agent_filters = {
|
|
896
|
+
# Feedback só para admin
|
|
897
|
+
"feedback": AccessFilter(allowed_roles=["admin"]),
|
|
898
|
+
# Escalation para todos exceto clientes
|
|
899
|
+
"escalation": AccessFilter(denied_roles=["cliente"]),
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
network = create_standard_network(
|
|
903
|
+
templates_root=Path("./meu_cliente"),
|
|
904
|
+
client="config",
|
|
905
|
+
user_context=user,
|
|
906
|
+
agent_filters=agent_filters,
|
|
907
|
+
)
|
|
908
|
+
```
|
|
909
|
+
|
|
910
|
+
### Exemplo 2: Prompts Condicionais
|
|
911
|
+
|
|
912
|
+
Adicione instruções específicas baseadas na role:
|
|
913
|
+
|
|
914
|
+
```python
|
|
915
|
+
from atendentepro import FilteredPromptSection
|
|
916
|
+
|
|
917
|
+
conditional_prompts = {
|
|
918
|
+
"knowledge": [
|
|
919
|
+
# Seção para vendedores
|
|
920
|
+
FilteredPromptSection(
|
|
921
|
+
content="\\n## Descontos\\nVocê pode oferecer até 15% de desconto.",
|
|
922
|
+
filter=AccessFilter(allowed_roles=["vendedor"]),
|
|
923
|
+
),
|
|
924
|
+
# Seção para admin
|
|
925
|
+
FilteredPromptSection(
|
|
926
|
+
content="\\n## Admin\\nVocê tem acesso total ao sistema.",
|
|
927
|
+
filter=AccessFilter(allowed_roles=["admin"]),
|
|
928
|
+
),
|
|
929
|
+
],
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
network = create_standard_network(
|
|
933
|
+
templates_root=Path("./meu_cliente"),
|
|
934
|
+
client="config",
|
|
935
|
+
user_context=user,
|
|
936
|
+
conditional_prompts=conditional_prompts,
|
|
937
|
+
)
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
### Exemplo 3: Tools Filtradas
|
|
941
|
+
|
|
942
|
+
```python
|
|
943
|
+
from atendentepro import FilteredTool
|
|
944
|
+
from agents import function_tool
|
|
945
|
+
|
|
946
|
+
@function_tool
|
|
947
|
+
def deletar_cliente(cliente_id: str) -> str:
|
|
948
|
+
"""Remove um cliente do sistema."""
|
|
949
|
+
return f"Cliente {cliente_id} removido"
|
|
950
|
+
|
|
951
|
+
filtered_tools = {
|
|
952
|
+
"knowledge": [
|
|
953
|
+
FilteredTool(
|
|
954
|
+
tool=deletar_cliente,
|
|
955
|
+
filter=AccessFilter(allowed_roles=["admin"]), # Só admin
|
|
956
|
+
),
|
|
957
|
+
],
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
network = create_standard_network(
|
|
961
|
+
templates_root=Path("./meu_cliente"),
|
|
962
|
+
client="config",
|
|
963
|
+
user_context=user,
|
|
964
|
+
filtered_tools=filtered_tools,
|
|
965
|
+
)
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
### Via YAML (access_config.yaml)
|
|
969
|
+
|
|
970
|
+
```yaml
|
|
971
|
+
# Filtros de agente
|
|
972
|
+
agent_filters:
|
|
973
|
+
feedback:
|
|
974
|
+
allowed_roles: ["admin"]
|
|
975
|
+
escalation:
|
|
976
|
+
denied_roles: ["cliente"]
|
|
977
|
+
|
|
978
|
+
# Prompts condicionais
|
|
979
|
+
conditional_prompts:
|
|
980
|
+
knowledge:
|
|
981
|
+
- content: |
|
|
982
|
+
## Capacidades de Vendedor
|
|
983
|
+
Você pode oferecer até 15% de desconto.
|
|
984
|
+
filter:
|
|
985
|
+
allowed_roles: ["vendedor"]
|
|
986
|
+
|
|
987
|
+
# Acesso a tools
|
|
988
|
+
tool_access:
|
|
989
|
+
deletar_cliente:
|
|
990
|
+
allowed_roles: ["admin"]
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
### Tipos de Filtro
|
|
994
|
+
|
|
995
|
+
| Tipo | Descrição | Exemplo |
|
|
996
|
+
|------|-----------|---------|
|
|
997
|
+
| `allowed_roles` | Whitelist de roles | `["admin", "gerente"]` |
|
|
998
|
+
| `denied_roles` | Blacklist de roles | `["cliente"]` |
|
|
999
|
+
| `allowed_users` | Whitelist de usuários | `["user_vip_1"]` |
|
|
1000
|
+
| `denied_users` | Blacklist de usuários | `["user_bloqueado"]` |
|
|
1001
|
+
|
|
1002
|
+
### Prioridade de Avaliação
|
|
1003
|
+
|
|
1004
|
+
1. `denied_users` - Se usuário está negado, **bloqueia**
|
|
1005
|
+
2. `allowed_users` - Se lista existe e usuário está nela, **permite**
|
|
1006
|
+
3. `denied_roles` - Se role está negada, **bloqueia**
|
|
1007
|
+
4. `allowed_roles` - Se lista existe e role não está nela, **bloqueia**
|
|
1008
|
+
5. **Permite por padrão** - Se nenhum filtro matched
|
|
780
1009
|
|
|
781
|
-
|
|
1010
|
+
### Fluxo Visual
|
|
782
1011
|
|
|
783
1012
|
```
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
1013
|
+
┌────────────────────────────────────────────────┐
|
|
1014
|
+
│ Requisição: role="vendedor" │
|
|
1015
|
+
└────────────────────────────────────────────────┘
|
|
1016
|
+
│
|
|
1017
|
+
▼
|
|
1018
|
+
┌────────────────────────────────────────────────┐
|
|
1019
|
+
│ FILTRO DE AGENTES │
|
|
1020
|
+
│ Knowledge: ✅ (vendedor allowed) │
|
|
1021
|
+
│ Escalation: ✅ (vendedor not denied) │
|
|
1022
|
+
│ Feedback: ❌ (only admin) │
|
|
1023
|
+
└────────────────────────────────────────────────┘
|
|
1024
|
+
│
|
|
1025
|
+
▼
|
|
1026
|
+
┌────────────────────────────────────────────────┐
|
|
1027
|
+
│ FILTRO DE PROMPTS │
|
|
1028
|
+
│ Knowledge recebe: "## Descontos..." │
|
|
1029
|
+
│ (seção condicional para vendedor) │
|
|
1030
|
+
└────────────────────────────────────────────────┘
|
|
1031
|
+
│
|
|
1032
|
+
▼
|
|
1033
|
+
┌────────────────────────────────────────────────┐
|
|
1034
|
+
│ FILTRO DE TOOLS │
|
|
1035
|
+
│ consultar_comissao: ✅ │
|
|
1036
|
+
│ deletar_cliente: ❌ (only admin) │
|
|
1037
|
+
└────────────────────────────────────────────────┘
|
|
789
1038
|
```
|
|
790
1039
|
|
|
791
1040
|
---
|