atendentepro 0.5.1__py3-none-any.whl → 0.5.4__py3-none-any.whl
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/README.md +2 -2
- atendentepro/__init__.py +2 -2
- atendentepro/license.py +3 -3
- atendentepro-0.5.4.dist-info/METADATA +608 -0
- {atendentepro-0.5.1.dist-info → atendentepro-0.5.4.dist-info}/RECORD +9 -9
- {atendentepro-0.5.1.dist-info → atendentepro-0.5.4.dist-info}/licenses/LICENSE +3 -3
- atendentepro-0.5.1.dist-info/METADATA +0 -320
- {atendentepro-0.5.1.dist-info → atendentepro-0.5.4.dist-info}/WHEEL +0 -0
- {atendentepro-0.5.1.dist-info → atendentepro-0.5.4.dist-info}/entry_points.txt +0 -0
- {atendentepro-0.5.1.dist-info → atendentepro-0.5.4.dist-info}/top_level.txt +0 -0
atendentepro/README.md
CHANGED
|
@@ -77,8 +77,8 @@ if is_activated():
|
|
|
77
77
|
### Obter um Token
|
|
78
78
|
|
|
79
79
|
Entre em contato para obter seu token de licença:
|
|
80
|
-
- 📧 **Email:** contato@
|
|
81
|
-
- 🌐 **Site:** https://
|
|
80
|
+
- 📧 **Email:** contato@monkai.com.br
|
|
81
|
+
- 🌐 **Site:** https://www.monkai.com.br
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
atendentepro/__init__.py
CHANGED
|
@@ -38,13 +38,13 @@ Exemplo de uso básico:
|
|
|
38
38
|
# 4. Usar o agente de triagem como ponto de entrada
|
|
39
39
|
triage_agent = network.triage
|
|
40
40
|
|
|
41
|
-
Para obter um token de licença, entre em contato: contato@
|
|
41
|
+
Para obter um token de licença, entre em contato: contato@monkai.com.br
|
|
42
42
|
Para mais informações, consulte a documentação.
|
|
43
43
|
"""
|
|
44
44
|
|
|
45
45
|
__version__ = "0.5.0"
|
|
46
46
|
__author__ = "BeMonkAI"
|
|
47
|
-
__email__ = "contato@
|
|
47
|
+
__email__ = "contato@monkai.com.br"
|
|
48
48
|
__license__ = "Proprietary"
|
|
49
49
|
|
|
50
50
|
# License (deve ser importado primeiro)
|
atendentepro/license.py
CHANGED
|
@@ -77,7 +77,7 @@ class LicenseNotActivatedError(LicenseError):
|
|
|
77
77
|
"║ export ATENDENTEPRO_LICENSE_KEY='seu-token' ║\n"
|
|
78
78
|
"║ ║\n"
|
|
79
79
|
"║ Para obter um token, entre em contato: ║\n"
|
|
80
|
-
"║ 📧 contato@
|
|
80
|
+
"║ 📧 contato@monkai.com.br ║\n"
|
|
81
81
|
"║ ║\n"
|
|
82
82
|
"╚══════════════════════════════════════════════════════════════╝\n"
|
|
83
83
|
)
|
|
@@ -96,7 +96,7 @@ class LicenseExpiredError(LicenseError):
|
|
|
96
96
|
f"║ Sua licença expirou em: {expiration:<36}║\n"
|
|
97
97
|
f"║ ║\n"
|
|
98
98
|
f"║ Para renovar, entre em contato: ║\n"
|
|
99
|
-
f"║ 📧 contato@
|
|
99
|
+
f"║ 📧 contato@monkai.com.br ║\n"
|
|
100
100
|
f"║ ║\n"
|
|
101
101
|
f"╚══════════════════════════════════════════════════════════════╝\n"
|
|
102
102
|
)
|
|
@@ -115,7 +115,7 @@ class InvalidTokenError(LicenseError):
|
|
|
115
115
|
"║ O token fornecido não é válido. ║\n"
|
|
116
116
|
"║ ║\n"
|
|
117
117
|
"║ Verifique se o token está correto ou entre em contato: ║\n"
|
|
118
|
-
"║ 📧 contato@
|
|
118
|
+
"║ 📧 contato@monkai.com.br ║\n"
|
|
119
119
|
"║ ║\n"
|
|
120
120
|
"╚══════════════════════════════════════════════════════════════╝\n"
|
|
121
121
|
)
|
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: atendentepro
|
|
3
|
+
Version: 0.5.4
|
|
4
|
+
Summary: Sistema de Atendimento Inteligente com Múltiplos Agentes IA - Biblioteca independente e modular baseada no OpenAI Agents SDK
|
|
5
|
+
Author-email: BeMonkAI <contato@monkai.com.br>
|
|
6
|
+
Maintainer-email: BeMonkAI <contato@monkai.com.br>
|
|
7
|
+
License: Proprietary
|
|
8
|
+
Project-URL: Homepage, https://github.com/BeMonkAI/atendentepro
|
|
9
|
+
Project-URL: Documentation, https://github.com/BeMonkAI/atendentepro#readme
|
|
10
|
+
Project-URL: Repository, https://github.com/BeMonkAI/atendentepro
|
|
11
|
+
Project-URL: Issues, https://github.com/BeMonkAI/atendentepro/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/BeMonkAI/atendentepro/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: ai,agents,customer-service,chatbot,openai,multi-agent,atendimento,openai-agents,conversational-ai,rag
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: Other/Proprietary License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Communications :: Chat
|
|
24
|
+
Classifier: Operating System :: OS Independent
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: openai-agents>=0.3.3
|
|
29
|
+
Requires-Dist: openai>=1.107.1
|
|
30
|
+
Requires-Dist: pydantic>=2.0.0
|
|
31
|
+
Requires-Dist: PyYAML>=6.0
|
|
32
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
33
|
+
Requires-Dist: httpx>=0.27.0
|
|
34
|
+
Requires-Dist: numpy>=1.24.0
|
|
35
|
+
Requires-Dist: scikit-learn>=1.3.0
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
39
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
40
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
41
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
42
|
+
Provides-Extra: docs
|
|
43
|
+
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
44
|
+
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
|
|
45
|
+
Provides-Extra: rag
|
|
46
|
+
Requires-Dist: PyPDF2>=3.0.0; extra == "rag"
|
|
47
|
+
Requires-Dist: python-docx>=0.8.11; extra == "rag"
|
|
48
|
+
Requires-Dist: python-pptx>=0.6.21; extra == "rag"
|
|
49
|
+
Requires-Dist: PyMuPDF>=1.23.0; extra == "rag"
|
|
50
|
+
Provides-Extra: tracing
|
|
51
|
+
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "tracing"
|
|
52
|
+
Requires-Dist: azure-monitor-opentelemetry-exporter>=1.0.0; extra == "tracing"
|
|
53
|
+
Provides-Extra: all
|
|
54
|
+
Requires-Dist: atendentepro[dev,docs,rag,tracing]; extra == "all"
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
|
|
57
|
+
# AtendentePro 🤖
|
|
58
|
+
|
|
59
|
+
[](https://www.python.org/downloads/)
|
|
60
|
+
[](https://pypi.org/project/atendentepro/)
|
|
61
|
+
[](LICENSE)
|
|
62
|
+
|
|
63
|
+
**Sistema de Atendimento Inteligente com Múltiplos Agentes IA**
|
|
64
|
+
|
|
65
|
+
Uma biblioteca Python modular para criar sistemas de atendimento automatizado usando múltiplos agentes de IA especializados baseados no [OpenAI Agents SDK](https://github.com/openai/openai-agents-python).
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 📋 Índice
|
|
70
|
+
|
|
71
|
+
- [Instalação](#-instalação)
|
|
72
|
+
- [Ativação (Licença)](#-ativação-licença)
|
|
73
|
+
- [Configurar API Key](#-configurar-api-key)
|
|
74
|
+
- [Início Rápido](#-início-rápido)
|
|
75
|
+
- [Arquitetura](#-arquitetura)
|
|
76
|
+
- [Agentes Disponíveis](#-agentes-disponíveis)
|
|
77
|
+
- [Criar Templates Customizados](#-criar-templates-customizados)
|
|
78
|
+
- [Configurações YAML](#-configurações-yaml)
|
|
79
|
+
- [Escalation Agent](#-escalation-agent)
|
|
80
|
+
- [Feedback Agent](#-feedback-agent)
|
|
81
|
+
- [Fluxo de Handoffs](#-fluxo-de-handoffs)
|
|
82
|
+
- [Suporte](#-suporte)
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 📦 Instalação
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Via PyPI
|
|
90
|
+
pip install atendentepro
|
|
91
|
+
|
|
92
|
+
# Ou via pip com versão específica
|
|
93
|
+
pip install atendentepro==0.5.3
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 🔑 Ativação (Licença)
|
|
99
|
+
|
|
100
|
+
A biblioteca **requer um token de licença** para funcionar.
|
|
101
|
+
|
|
102
|
+
### Opção 1: Variável de Ambiente (Recomendado)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
export ATENDENTEPRO_LICENSE_KEY="ATP_seu-token-aqui"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Opção 2: Via Código
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from atendentepro import activate
|
|
112
|
+
|
|
113
|
+
activate("ATP_seu-token-aqui")
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Opção 3: Arquivo .env
|
|
117
|
+
|
|
118
|
+
```env
|
|
119
|
+
ATENDENTEPRO_LICENSE_KEY=ATP_seu-token-aqui
|
|
120
|
+
OPENAI_API_KEY=sk-sua-chave-openai
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Obter um Token
|
|
124
|
+
|
|
125
|
+
Entre em contato para obter seu token:
|
|
126
|
+
- 📧 **Email:** contato@monkai.com.br
|
|
127
|
+
- 🌐 **Site:** https://www.monkai.com.br
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 🔐 Configurar API Key
|
|
132
|
+
|
|
133
|
+
### OpenAI
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# .env
|
|
137
|
+
OPENAI_API_KEY=sk-sua-chave-openai
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Azure OpenAI
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# .env
|
|
144
|
+
OPENAI_PROVIDER=azure
|
|
145
|
+
AZURE_API_KEY=sua-chave-azure
|
|
146
|
+
AZURE_API_ENDPOINT=https://seu-recurso.openai.azure.com
|
|
147
|
+
AZURE_API_VERSION=2024-02-15-preview
|
|
148
|
+
AZURE_DEPLOYMENT_NAME=gpt-4o
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Via Código
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from atendentepro import activate, configure
|
|
155
|
+
|
|
156
|
+
activate("ATP_seu-token")
|
|
157
|
+
|
|
158
|
+
configure(
|
|
159
|
+
openai_api_key="sk-sua-chave-openai",
|
|
160
|
+
default_model="gpt-4o-mini"
|
|
161
|
+
)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## ⚡ Início Rápido
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
import asyncio
|
|
170
|
+
from pathlib import Path
|
|
171
|
+
from atendentepro import activate, create_standard_network
|
|
172
|
+
from agents import Runner
|
|
173
|
+
|
|
174
|
+
# 1. Ativar
|
|
175
|
+
activate("ATP_seu-token")
|
|
176
|
+
|
|
177
|
+
async def main():
|
|
178
|
+
# 2. Criar rede de agentes
|
|
179
|
+
network = create_standard_network(
|
|
180
|
+
templates_root=Path("./meu_cliente"),
|
|
181
|
+
client="config"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
# 3. Executar conversa
|
|
185
|
+
result = await Runner.run(
|
|
186
|
+
network.triage,
|
|
187
|
+
[{"role": "user", "content": "Olá, preciso de ajuda"}]
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
print(result.final_output)
|
|
191
|
+
|
|
192
|
+
asyncio.run(main())
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 🏗️ Arquitetura
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
┌────────────────────────────────────────────────────────────────────────────┐
|
|
201
|
+
│ ATENDENTEPRO │
|
|
202
|
+
├────────────────────────────────────────────────────────────────────────────┤
|
|
203
|
+
│ │
|
|
204
|
+
│ 👤 Usuário │
|
|
205
|
+
│ │ │
|
|
206
|
+
│ ▼ │
|
|
207
|
+
│ ┌─────────────┐ │
|
|
208
|
+
│ │ Triage │──► Classifica intenção do usuário │
|
|
209
|
+
│ └─────────────┘ │
|
|
210
|
+
│ │ │
|
|
211
|
+
│ ┌────┴────┬─────────┬─────────┬─────────┬─────────┬─────────┐ │
|
|
212
|
+
│ ▼ ▼ ▼ ▼ ▼ ▼ ▼ │
|
|
213
|
+
│ ┌──────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ │
|
|
214
|
+
│ │ Flow │ │Knowl. │ │Confirm│ │ Usage │ │Onboard│ │Escala.│ │Feedbk.│ │
|
|
215
|
+
│ └──────┘ └───────┘ └───────┘ └───────┘ └───────┘ └───────┘ └───────┘ │
|
|
216
|
+
│ │ │
|
|
217
|
+
│ ▼ │
|
|
218
|
+
│ ┌─────────────┐ │
|
|
219
|
+
│ │ Interview │──► Coleta informações estruturadas │
|
|
220
|
+
│ └─────────────┘ │
|
|
221
|
+
│ │ │
|
|
222
|
+
│ ▼ │
|
|
223
|
+
│ ┌─────────────┐ │
|
|
224
|
+
│ │ Answer │──► Sintetiza resposta final │
|
|
225
|
+
│ └─────────────┘ │
|
|
226
|
+
│ │
|
|
227
|
+
│ ══════════════════════════════════════════════════════════════════════ │
|
|
228
|
+
│ 📞 Escalation → Transfere para atendimento humano IMEDIATO │
|
|
229
|
+
│ 📝 Feedback → Registra tickets para resposta POSTERIOR │
|
|
230
|
+
│ │
|
|
231
|
+
└────────────────────────────────────────────────────────────────────────────┘
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 🤖 Agentes Disponíveis
|
|
237
|
+
|
|
238
|
+
| Agente | Descrição | Quando Usar |
|
|
239
|
+
|--------|-----------|-------------|
|
|
240
|
+
| **Triage** | Classifica intenção e direciona | Sempre (ponto de entrada) |
|
|
241
|
+
| **Flow** | Apresenta opções/menu ao usuário | Múltiplas opções disponíveis |
|
|
242
|
+
| **Interview** | Coleta informações através de perguntas | Precisa de dados do usuário |
|
|
243
|
+
| **Answer** | Sintetiza resposta final | Após coletar informações |
|
|
244
|
+
| **Knowledge** | Consulta RAG e dados estruturados | Perguntas sobre documentos/dados |
|
|
245
|
+
| **Confirmation** | Valida com respostas sim/não | Confirmar ações |
|
|
246
|
+
| **Usage** | Responde dúvidas sobre o sistema | "Como funciona?" |
|
|
247
|
+
| **Onboarding** | Cadastro de novos usuários | Novos usuários |
|
|
248
|
+
| **Escalation** | Transfere para humano | Urgente/não resolvido |
|
|
249
|
+
| **Feedback** | Registra tickets | Dúvidas/reclamações/sugestões |
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 📁 Criar Templates Customizados
|
|
254
|
+
|
|
255
|
+
### Estrutura de Pastas
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
meu_cliente/
|
|
259
|
+
├── triage_config.yaml # ✅ Obrigatório
|
|
260
|
+
├── flow_config.yaml # Recomendado
|
|
261
|
+
├── interview_config.yaml # Recomendado
|
|
262
|
+
├── answer_config.yaml # Opcional
|
|
263
|
+
├── knowledge_config.yaml # Opcional
|
|
264
|
+
├── escalation_config.yaml # Recomendado
|
|
265
|
+
├── feedback_config.yaml # Recomendado
|
|
266
|
+
├── guardrails_config.yaml # Recomendado
|
|
267
|
+
└── data/ # Dados estruturados (CSV, etc.)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Usar o Template
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
from pathlib import Path
|
|
274
|
+
from atendentepro import create_standard_network
|
|
275
|
+
|
|
276
|
+
network = create_standard_network(
|
|
277
|
+
templates_root=Path("./"),
|
|
278
|
+
client="meu_cliente",
|
|
279
|
+
include_escalation=True,
|
|
280
|
+
include_feedback=True,
|
|
281
|
+
)
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## ⚙️ Configurações YAML
|
|
287
|
+
|
|
288
|
+
### triage_config.yaml (Obrigatório)
|
|
289
|
+
|
|
290
|
+
Define palavras-chave para classificação:
|
|
291
|
+
|
|
292
|
+
```yaml
|
|
293
|
+
agent_name: "Triage Agent"
|
|
294
|
+
|
|
295
|
+
keywords:
|
|
296
|
+
- agent: "Flow Agent"
|
|
297
|
+
keywords:
|
|
298
|
+
- "produto"
|
|
299
|
+
- "serviço"
|
|
300
|
+
- "preço"
|
|
301
|
+
|
|
302
|
+
- agent: "Knowledge Agent"
|
|
303
|
+
keywords:
|
|
304
|
+
- "documentação"
|
|
305
|
+
- "manual"
|
|
306
|
+
- "como funciona"
|
|
307
|
+
|
|
308
|
+
- agent: "Escalation Agent"
|
|
309
|
+
keywords:
|
|
310
|
+
- "falar com humano"
|
|
311
|
+
- "atendente"
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### flow_config.yaml
|
|
315
|
+
|
|
316
|
+
Define opções/menu:
|
|
317
|
+
|
|
318
|
+
```yaml
|
|
319
|
+
agent_name: "Flow Agent"
|
|
320
|
+
|
|
321
|
+
topics:
|
|
322
|
+
- id: 1
|
|
323
|
+
label: "Vendas"
|
|
324
|
+
keywords: ["comprar", "preço", "orçamento"]
|
|
325
|
+
|
|
326
|
+
- id: 2
|
|
327
|
+
label: "Suporte"
|
|
328
|
+
keywords: ["problema", "erro", "ajuda"]
|
|
329
|
+
|
|
330
|
+
- id: 3
|
|
331
|
+
label: "Financeiro"
|
|
332
|
+
keywords: ["pagamento", "boleto", "fatura"]
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### interview_config.yaml
|
|
336
|
+
|
|
337
|
+
Define perguntas para coleta:
|
|
338
|
+
|
|
339
|
+
```yaml
|
|
340
|
+
agent_name: "Interview Agent"
|
|
341
|
+
|
|
342
|
+
interview_questions: |
|
|
343
|
+
Para cada tópico, faça as seguintes perguntas:
|
|
344
|
+
|
|
345
|
+
## Vendas
|
|
346
|
+
1. Qual produto você tem interesse?
|
|
347
|
+
2. Qual quantidade desejada?
|
|
348
|
+
3. Qual seu email para contato?
|
|
349
|
+
|
|
350
|
+
## Suporte
|
|
351
|
+
1. Descreva o problema
|
|
352
|
+
2. Quando começou?
|
|
353
|
+
3. Já tentou alguma solução?
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### guardrails_config.yaml
|
|
357
|
+
|
|
358
|
+
Define escopo e restrições:
|
|
359
|
+
|
|
360
|
+
```yaml
|
|
361
|
+
scope: |
|
|
362
|
+
Este assistente pode ajudar com:
|
|
363
|
+
- Informações sobre produtos
|
|
364
|
+
- Suporte técnico
|
|
365
|
+
- Dúvidas sobre serviços
|
|
366
|
+
|
|
367
|
+
forbidden_topics:
|
|
368
|
+
- "política"
|
|
369
|
+
- "religião"
|
|
370
|
+
- "conteúdo adulto"
|
|
371
|
+
|
|
372
|
+
out_of_scope_message: |
|
|
373
|
+
Desculpe, não posso ajudar com esse assunto.
|
|
374
|
+
Posso ajudar com produtos, suporte ou serviços.
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## 📞 Escalation Agent
|
|
380
|
+
|
|
381
|
+
Transfere para atendimento humano quando:
|
|
382
|
+
- Usuário solicita explicitamente
|
|
383
|
+
- Tópico não coberto pelo sistema
|
|
384
|
+
- Usuário demonstra frustração
|
|
385
|
+
- Agente não consegue resolver
|
|
386
|
+
|
|
387
|
+
### escalation_config.yaml
|
|
388
|
+
|
|
389
|
+
```yaml
|
|
390
|
+
name: "Escalation Agent"
|
|
391
|
+
|
|
392
|
+
triggers:
|
|
393
|
+
explicit_request:
|
|
394
|
+
- "quero falar com um humano"
|
|
395
|
+
- "atendente humano"
|
|
396
|
+
- "falar com uma pessoa"
|
|
397
|
+
|
|
398
|
+
frustration:
|
|
399
|
+
- "você não está me ajudando"
|
|
400
|
+
- "isso não resolve"
|
|
401
|
+
|
|
402
|
+
channels:
|
|
403
|
+
phone:
|
|
404
|
+
enabled: true
|
|
405
|
+
number: "0800-123-4567"
|
|
406
|
+
hours: "Seg-Sex 8h-18h"
|
|
407
|
+
|
|
408
|
+
email:
|
|
409
|
+
enabled: true
|
|
410
|
+
address: "atendimento@empresa.com"
|
|
411
|
+
sla: "Resposta em até 24h"
|
|
412
|
+
|
|
413
|
+
whatsapp:
|
|
414
|
+
enabled: true
|
|
415
|
+
number: "(11) 99999-9999"
|
|
416
|
+
|
|
417
|
+
business_hours:
|
|
418
|
+
start: 8
|
|
419
|
+
end: 18
|
|
420
|
+
days: [monday, tuesday, wednesday, thursday, friday]
|
|
421
|
+
|
|
422
|
+
messages:
|
|
423
|
+
greeting: "Entendo que você precisa de um atendimento especializado."
|
|
424
|
+
out_of_hours: "Nosso atendimento funciona de Seg-Sex, 8h-18h."
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### Usar Escalation
|
|
428
|
+
|
|
429
|
+
```python
|
|
430
|
+
network = create_standard_network(
|
|
431
|
+
templates_root=Path("./meu_cliente"),
|
|
432
|
+
client="config",
|
|
433
|
+
include_escalation=True,
|
|
434
|
+
escalation_channels="""
|
|
435
|
+
📞 Telefone: 0800-123-4567 (Seg-Sex 8h-18h)
|
|
436
|
+
📧 Email: atendimento@empresa.com
|
|
437
|
+
💬 WhatsApp: (11) 99999-9999
|
|
438
|
+
""",
|
|
439
|
+
)
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## 📝 Feedback Agent
|
|
445
|
+
|
|
446
|
+
Registra tickets para:
|
|
447
|
+
- ❓ **Dúvidas** - Perguntas que precisam de pesquisa
|
|
448
|
+
- 💬 **Feedback** - Opinião sobre produto/serviço
|
|
449
|
+
- 📢 **Reclamação** - Insatisfação formal (prioridade alta)
|
|
450
|
+
- 💡 **Sugestão** - Ideia de melhoria
|
|
451
|
+
- ⭐ **Elogio** - Agradecimento
|
|
452
|
+
- ⚠️ **Problema** - Bug/erro técnico (prioridade alta)
|
|
453
|
+
|
|
454
|
+
### feedback_config.yaml
|
|
455
|
+
|
|
456
|
+
```yaml
|
|
457
|
+
name: "Feedback Agent"
|
|
458
|
+
|
|
459
|
+
protocol_prefix: "SAC" # Formato: SAC-20240106-ABC123
|
|
460
|
+
|
|
461
|
+
ticket_types:
|
|
462
|
+
- name: "duvida"
|
|
463
|
+
label: "Dúvida"
|
|
464
|
+
default_priority: "normal"
|
|
465
|
+
|
|
466
|
+
- name: "reclamacao"
|
|
467
|
+
label: "Reclamação"
|
|
468
|
+
default_priority: "alta"
|
|
469
|
+
|
|
470
|
+
- name: "sugestao"
|
|
471
|
+
label: "Sugestão"
|
|
472
|
+
default_priority: "baixa"
|
|
473
|
+
|
|
474
|
+
email:
|
|
475
|
+
enabled: true
|
|
476
|
+
brand_color: "#660099"
|
|
477
|
+
brand_name: "Minha Empresa"
|
|
478
|
+
sla_message: "Retornaremos em até 24h úteis."
|
|
479
|
+
|
|
480
|
+
priorities:
|
|
481
|
+
- name: "baixa"
|
|
482
|
+
sla_hours: 72
|
|
483
|
+
- name: "normal"
|
|
484
|
+
sla_hours: 24
|
|
485
|
+
- name: "alta"
|
|
486
|
+
sla_hours: 8
|
|
487
|
+
- name: "urgente"
|
|
488
|
+
sla_hours: 2
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### Usar Feedback
|
|
492
|
+
|
|
493
|
+
```python
|
|
494
|
+
network = create_standard_network(
|
|
495
|
+
templates_root=Path("./meu_cliente"),
|
|
496
|
+
client="config",
|
|
497
|
+
include_feedback=True,
|
|
498
|
+
feedback_protocol_prefix="SAC",
|
|
499
|
+
feedback_brand_color="#660099",
|
|
500
|
+
feedback_brand_name="Minha Empresa",
|
|
501
|
+
)
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### Diferença: Escalation vs Feedback
|
|
505
|
+
|
|
506
|
+
| Aspecto | Escalation | Feedback |
|
|
507
|
+
|---------|------------|----------|
|
|
508
|
+
| **Propósito** | Atendimento IMEDIATO | Registro para DEPOIS |
|
|
509
|
+
| **Urgência** | Alta | Pode aguardar |
|
|
510
|
+
| **Canal** | Telefone, chat | Email, ticket |
|
|
511
|
+
| **Protocolo** | ESC-XXXXXX | SAC-XXXXXX |
|
|
512
|
+
| **Quando usar** | "Quero falar com alguém" | "Tenho uma sugestão" |
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## 🔄 Fluxo de Handoffs
|
|
517
|
+
|
|
518
|
+
```
|
|
519
|
+
Triage ──► Flow, Knowledge, Confirmation, Usage, Onboarding, Escalation, Feedback
|
|
520
|
+
Flow ────► Interview, Triage, Escalation, Feedback
|
|
521
|
+
Interview► Answer, Escalation, Feedback
|
|
522
|
+
Answer ──► Triage, Escalation, Feedback
|
|
523
|
+
Knowledge► Triage, Escalation, Feedback
|
|
524
|
+
Escalation► Triage, Feedback
|
|
525
|
+
Feedback ► Triage, Escalation
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Configuração de Handoffs
|
|
529
|
+
|
|
530
|
+
```python
|
|
531
|
+
# Todos os handoffs habilitados (padrão)
|
|
532
|
+
network = create_standard_network(
|
|
533
|
+
templates_root=Path("./meu_cliente"),
|
|
534
|
+
client="config",
|
|
535
|
+
include_escalation=True, # Padrão: True
|
|
536
|
+
include_feedback=True, # Padrão: True
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
# Sem Escalation ou Feedback
|
|
540
|
+
network = create_standard_network(
|
|
541
|
+
templates_root=Path("./meu_cliente"),
|
|
542
|
+
client="config",
|
|
543
|
+
include_escalation=False,
|
|
544
|
+
include_feedback=False,
|
|
545
|
+
)
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
550
|
+
## 🔧 Dependências
|
|
551
|
+
|
|
552
|
+
- Python 3.9+
|
|
553
|
+
- openai-agents >= 0.3.3
|
|
554
|
+
- openai >= 1.107.1
|
|
555
|
+
- pydantic >= 2.0.0
|
|
556
|
+
- PyYAML >= 6.0
|
|
557
|
+
- python-dotenv >= 1.0.0
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## 📄 Variáveis de Ambiente
|
|
562
|
+
|
|
563
|
+
| Variável | Descrição | Obrigatório |
|
|
564
|
+
|----------|-----------|-------------|
|
|
565
|
+
| `ATENDENTEPRO_LICENSE_KEY` | Token de licença | ✅ Sim |
|
|
566
|
+
| `OPENAI_API_KEY` | Chave API OpenAI | ✅ (se OpenAI) |
|
|
567
|
+
| `OPENAI_PROVIDER` | `openai` ou `azure` | Não |
|
|
568
|
+
| `DEFAULT_MODEL` | Modelo padrão | Não |
|
|
569
|
+
| `AZURE_API_KEY` | Chave API Azure | ✅ (se Azure) |
|
|
570
|
+
| `AZURE_API_ENDPOINT` | Endpoint Azure | ✅ (se Azure) |
|
|
571
|
+
| `SMTP_HOST` | Servidor SMTP | Para emails |
|
|
572
|
+
| `SMTP_USER` | Usuário SMTP | Para emails |
|
|
573
|
+
| `SMTP_PASSWORD` | Senha SMTP | Para emails |
|
|
574
|
+
|
|
575
|
+
---
|
|
576
|
+
|
|
577
|
+
## 🤝 Suporte
|
|
578
|
+
|
|
579
|
+
- 📧 **Email:** contato@monkai.com.br
|
|
580
|
+
- 🌐 **Site:** https://www.monkai.com.br
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
## 📝 Changelog
|
|
585
|
+
|
|
586
|
+
### v0.5.3
|
|
587
|
+
- Documentação completa no README para PyPI
|
|
588
|
+
|
|
589
|
+
### v0.5.2
|
|
590
|
+
- Atualização de contatos (monkai.com.br)
|
|
591
|
+
|
|
592
|
+
### v0.5.1
|
|
593
|
+
- Prompts modulares para Escalation e Feedback
|
|
594
|
+
- Remoção de handoff circular Answer→Interview
|
|
595
|
+
|
|
596
|
+
### v0.5.0
|
|
597
|
+
- Novo: Feedback Agent (tickets/SAC)
|
|
598
|
+
|
|
599
|
+
### v0.4.0
|
|
600
|
+
- Novo: Escalation Agent (transferência humana)
|
|
601
|
+
|
|
602
|
+
### v0.3.0
|
|
603
|
+
- Sistema de licenciamento
|
|
604
|
+
- Publicação inicial no PyPI
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
**Made with ❤️ by MonkAI**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
atendentepro/README.md,sha256=
|
|
2
|
-
atendentepro/__init__.py,sha256=
|
|
3
|
-
atendentepro/license.py,sha256=
|
|
1
|
+
atendentepro/README.md,sha256=AMVMJlVOlXcwU_kRGBiIoSn8hASLHrhZwxV1jr1LJsU,43012
|
|
2
|
+
atendentepro/__init__.py,sha256=r_9RwvfKcvcS6bk2a1sdQsQyf_CUW-tljE-vh3TeLyw,5150
|
|
3
|
+
atendentepro/license.py,sha256=rlPtysXNqAzEQkP2VjUAVu_nMndhPgfKv1yN2ruUYVI,17570
|
|
4
4
|
atendentepro/network.py,sha256=CHJVoggOE--LzVvR1XROtjeFqnwJctP2L4dHgCVCXXE,14419
|
|
5
5
|
atendentepro/agents/__init__.py,sha256=OcPhG1Dp6xe49B5YIti4HVmaZDoDIrFLfRa8GmI4jpQ,1638
|
|
6
6
|
atendentepro/agents/answer.py,sha256=dIZzGL_ddjC96JIiWSwDg33phwca8NpWFxO16FFYVoA,1905
|
|
@@ -35,9 +35,9 @@ atendentepro/templates/manager.py,sha256=KdE4khWDMD2S607TDTMkvJ8lZzQ9D_TD_lBaXYS
|
|
|
35
35
|
atendentepro/utils/__init__.py,sha256=6EgS4DrW4fG17JdaHNKWMpzicigfFLVJO2VxPV73k9c,334
|
|
36
36
|
atendentepro/utils/openai_client.py,sha256=R0ns7SU36vTgploq14-QJMTke1pPxcAXlENDeoHU0L4,4552
|
|
37
37
|
atendentepro/utils/tracing.py,sha256=HQ3l4IiNcesCJ6l5qcERWyeBQav0G1ea-H8Rei6eQpE,2319
|
|
38
|
-
atendentepro-0.5.
|
|
39
|
-
atendentepro-0.5.
|
|
40
|
-
atendentepro-0.5.
|
|
41
|
-
atendentepro-0.5.
|
|
42
|
-
atendentepro-0.5.
|
|
43
|
-
atendentepro-0.5.
|
|
38
|
+
atendentepro-0.5.4.dist-info/licenses/LICENSE,sha256=TF6CdXxePoT9DXtPnCejiU5mUwWzrFzd1iyWJyoMauA,983
|
|
39
|
+
atendentepro-0.5.4.dist-info/METADATA,sha256=deSSZIKIKITPhVPdMgaExwmExiqcdm9rGvMgHoa3n6A,17806
|
|
40
|
+
atendentepro-0.5.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
41
|
+
atendentepro-0.5.4.dist-info/entry_points.txt,sha256=OP0upzqJF3MLS6VX-M-5BfUwx5YLJO2sJ3YBAp4e6yI,89
|
|
42
|
+
atendentepro-0.5.4.dist-info/top_level.txt,sha256=BFasD4SMmgDUmWKlTIZ1PeuukoRBhyiMIz8umKWVCcs,13
|
|
43
|
+
atendentepro-0.5.4.dist-info/RECORD,,
|
|
@@ -9,7 +9,7 @@ modification, distribution, or use of this software, via any medium, is
|
|
|
9
9
|
strictly prohibited without the express written permission of BeMonkAI.
|
|
10
10
|
|
|
11
11
|
This software requires a valid license key for use. License keys can be
|
|
12
|
-
obtained by contacting: contato@
|
|
12
|
+
obtained by contacting: contato@monkai.com.br
|
|
13
13
|
|
|
14
14
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
15
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
@@ -20,6 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
20
20
|
SOFTWARE.
|
|
21
21
|
|
|
22
22
|
For licensing inquiries:
|
|
23
|
-
Email: contato@
|
|
24
|
-
Website: https://
|
|
23
|
+
Email: contato@monkai.com.br
|
|
24
|
+
Website: https://www.monkai.com.br
|
|
25
25
|
|
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: atendentepro
|
|
3
|
-
Version: 0.5.1
|
|
4
|
-
Summary: Sistema de Atendimento Inteligente com Múltiplos Agentes IA - Biblioteca independente e modular baseada no OpenAI Agents SDK
|
|
5
|
-
Author-email: BeMonkAI <contato@bemonkai.com>
|
|
6
|
-
Maintainer-email: BeMonkAI <contato@bemonkai.com>
|
|
7
|
-
License: Proprietary
|
|
8
|
-
Project-URL: Homepage, https://github.com/BeMonkAI/atendentepro
|
|
9
|
-
Project-URL: Documentation, https://github.com/BeMonkAI/atendentepro#readme
|
|
10
|
-
Project-URL: Repository, https://github.com/BeMonkAI/atendentepro
|
|
11
|
-
Project-URL: Issues, https://github.com/BeMonkAI/atendentepro/issues
|
|
12
|
-
Project-URL: Changelog, https://github.com/BeMonkAI/atendentepro/blob/main/CHANGELOG.md
|
|
13
|
-
Keywords: ai,agents,customer-service,chatbot,openai,multi-agent,atendimento,openai-agents,conversational-ai,rag
|
|
14
|
-
Classifier: Development Status :: 4 - Beta
|
|
15
|
-
Classifier: Intended Audience :: Developers
|
|
16
|
-
Classifier: License :: Other/Proprietary License
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
-
Classifier: Topic :: Communications :: Chat
|
|
24
|
-
Classifier: Operating System :: OS Independent
|
|
25
|
-
Requires-Python: >=3.9
|
|
26
|
-
Description-Content-Type: text/markdown
|
|
27
|
-
License-File: LICENSE
|
|
28
|
-
Requires-Dist: openai-agents>=0.3.3
|
|
29
|
-
Requires-Dist: openai>=1.107.1
|
|
30
|
-
Requires-Dist: pydantic>=2.0.0
|
|
31
|
-
Requires-Dist: PyYAML>=6.0
|
|
32
|
-
Requires-Dist: python-dotenv>=1.0.0
|
|
33
|
-
Requires-Dist: httpx>=0.27.0
|
|
34
|
-
Requires-Dist: numpy>=1.24.0
|
|
35
|
-
Requires-Dist: scikit-learn>=1.3.0
|
|
36
|
-
Provides-Extra: dev
|
|
37
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
38
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
39
|
-
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
40
|
-
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
41
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
42
|
-
Provides-Extra: docs
|
|
43
|
-
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
|
|
44
|
-
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
|
|
45
|
-
Provides-Extra: rag
|
|
46
|
-
Requires-Dist: PyPDF2>=3.0.0; extra == "rag"
|
|
47
|
-
Requires-Dist: python-docx>=0.8.11; extra == "rag"
|
|
48
|
-
Requires-Dist: python-pptx>=0.6.21; extra == "rag"
|
|
49
|
-
Requires-Dist: PyMuPDF>=1.23.0; extra == "rag"
|
|
50
|
-
Provides-Extra: tracing
|
|
51
|
-
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "tracing"
|
|
52
|
-
Requires-Dist: azure-monitor-opentelemetry-exporter>=1.0.0; extra == "tracing"
|
|
53
|
-
Provides-Extra: all
|
|
54
|
-
Requires-Dist: atendentepro[dev,docs,rag,tracing]; extra == "all"
|
|
55
|
-
Dynamic: license-file
|
|
56
|
-
|
|
57
|
-
# AtendentePro 🤖
|
|
58
|
-
|
|
59
|
-
[](https://www.python.org/downloads/)
|
|
60
|
-
[](LICENSE)
|
|
61
|
-
[](CHANGELOG.md)
|
|
62
|
-
|
|
63
|
-
**Sistema de Atendimento Inteligente com Múltiplos Agentes IA**
|
|
64
|
-
|
|
65
|
-
Uma biblioteca Python modular e independente para criar sistemas de atendimento automatizado usando múltiplos agentes de IA especializados baseados no [OpenAI Agents SDK](https://github.com/openai/openai-agents-python).
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## 📋 Índice
|
|
70
|
-
|
|
71
|
-
- [Instalação](#-instalação)
|
|
72
|
-
- [Ativação (Licença)](#-ativação-licença)
|
|
73
|
-
- [Início Rápido](#-início-rápido)
|
|
74
|
-
- [Arquitetura](#-arquitetura)
|
|
75
|
-
- [Agentes](#-agentes)
|
|
76
|
-
- [Templates](#-templates)
|
|
77
|
-
- [Documentação](#-documentação)
|
|
78
|
-
- [Suporte](#-suporte)
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## 📦 Instalação
|
|
83
|
-
|
|
84
|
-
### Via pip (Privado)
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
# Instalar do repositório privado
|
|
88
|
-
pip install atendentepro --extra-index-url https://pypi.bemonkai.com/simple/
|
|
89
|
-
|
|
90
|
-
# Ou via GitHub
|
|
91
|
-
pip install git+https://github.com/BeMonkAI/atendentepro.git
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Desenvolvimento Local
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Clonar repositório
|
|
98
|
-
git clone https://github.com/BeMonkAI/atendentepro.git
|
|
99
|
-
cd atendentepro
|
|
100
|
-
|
|
101
|
-
# Criar ambiente virtual
|
|
102
|
-
python -m venv venv
|
|
103
|
-
source venv/bin/activate # Linux/Mac
|
|
104
|
-
# ou: venv\Scripts\activate # Windows
|
|
105
|
-
|
|
106
|
-
# Instalar em modo editable
|
|
107
|
-
pip install -e .
|
|
108
|
-
|
|
109
|
-
# Com dependências de desenvolvimento
|
|
110
|
-
pip install -e ".[dev]"
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
## 🔑 Ativação (Licença)
|
|
116
|
-
|
|
117
|
-
A biblioteca **requer um token de licença** para funcionar.
|
|
118
|
-
|
|
119
|
-
### Opção 1: Variável de Ambiente (Recomendado)
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
export ATENDENTEPRO_LICENSE_KEY="ATP_seu-token-aqui"
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Opção 2: Via Código
|
|
126
|
-
|
|
127
|
-
```python
|
|
128
|
-
from atendentepro import activate
|
|
129
|
-
|
|
130
|
-
activate("ATP_seu-token-aqui")
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Opção 3: Arquivo .env
|
|
134
|
-
|
|
135
|
-
```env
|
|
136
|
-
ATENDENTEPRO_LICENSE_KEY=ATP_seu-token-aqui
|
|
137
|
-
OPENAI_API_KEY=sk-sua-chave-openai
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Obter um Token
|
|
141
|
-
|
|
142
|
-
Entre em contato para obter seu token:
|
|
143
|
-
- 📧 **Email:** contato@bemonkai.com
|
|
144
|
-
- 🌐 **Site:** https://bemonkai.com
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## ⚡ Início Rápido
|
|
149
|
-
|
|
150
|
-
```python
|
|
151
|
-
import asyncio
|
|
152
|
-
from pathlib import Path
|
|
153
|
-
from atendentepro import activate, create_standard_network
|
|
154
|
-
from agents import Runner
|
|
155
|
-
|
|
156
|
-
# 1. Ativar (ou use variável de ambiente)
|
|
157
|
-
activate("ATP_seu-token")
|
|
158
|
-
|
|
159
|
-
async def main():
|
|
160
|
-
# 2. Criar rede de agentes usando template standard
|
|
161
|
-
network = create_standard_network(
|
|
162
|
-
templates_root=Path("./templates"), # Template genérico de exemplo
|
|
163
|
-
client="standard"
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
# 3. Executar conversa
|
|
167
|
-
result = await Runner.run(
|
|
168
|
-
network.triage,
|
|
169
|
-
[{"role": "user", "content": "Olá, preciso de ajuda"}]
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
print(result.final_output)
|
|
173
|
-
|
|
174
|
-
asyncio.run(main())
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## 🏗️ Arquitetura
|
|
180
|
-
|
|
181
|
-
```
|
|
182
|
-
┌────────────────────────────────────────────────────────────────────────────┐
|
|
183
|
-
│ ATENDENTEPRO │
|
|
184
|
-
├────────────────────────────────────────────────────────────────────────────┤
|
|
185
|
-
│ │
|
|
186
|
-
│ 👤 Usuário │
|
|
187
|
-
│ │ │
|
|
188
|
-
│ ▼ │
|
|
189
|
-
│ ┌─────────────┐ │
|
|
190
|
-
│ │ Triage │──► Classifica intenção │
|
|
191
|
-
│ └─────────────┘ │
|
|
192
|
-
│ │ │
|
|
193
|
-
│ ┌────┴────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┐ │
|
|
194
|
-
│ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ │
|
|
195
|
-
│ ┌──────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ │
|
|
196
|
-
│ │ Flow │ │Knowl. │ │Confirm│ │ Usage │ │Onboard│ │Escala.│ │Feedbk.│ │
|
|
197
|
-
│ └──────┘ └───────┘ └───────┘ └───────┘ └───────┘ └───────┘ └───────┘ │
|
|
198
|
-
│ │ │ │ │
|
|
199
|
-
│ │ Todos os agentes podem escalar ─────────►│ │ │
|
|
200
|
-
│ │ ou registrar feedback ──────────────────────────────► │
|
|
201
|
-
│ ▼ │
|
|
202
|
-
│ ┌─────────────┐ │
|
|
203
|
-
│ │ Interview │──► Coleta informações │
|
|
204
|
-
│ └─────────────┘ │
|
|
205
|
-
│ │ │
|
|
206
|
-
│ ▼ │
|
|
207
|
-
│ ┌─────────────┐ │
|
|
208
|
-
│ │ Answer │──► Resposta final │
|
|
209
|
-
│ └─────────────┘ │
|
|
210
|
-
│ │
|
|
211
|
-
│ ═══════════════════════════════════════════════════════════════════════ │
|
|
212
|
-
│ 📞 Escalation ──► Transfere para atendimento humano IMEDIATO │
|
|
213
|
-
│ 📝 Feedback ──► Registra tickets para resposta POSTERIOR │
|
|
214
|
-
│ │
|
|
215
|
-
└────────────────────────────────────────────────────────────────────────────┘
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## 🤖 Agentes
|
|
221
|
-
|
|
222
|
-
| Agente | Descrição |
|
|
223
|
-
|--------|-----------|
|
|
224
|
-
| **Triage** | Classifica intenção e direciona para agente especializado |
|
|
225
|
-
| **Flow** | Apresenta opções/menu ao usuário |
|
|
226
|
-
| **Interview** | Coleta informações através de perguntas |
|
|
227
|
-
| **Answer** | Sintetiza resposta final |
|
|
228
|
-
| **Knowledge** | Consulta RAG e dados estruturados |
|
|
229
|
-
| **Confirmation** | Valida com respostas sim/não |
|
|
230
|
-
| **Usage** | Responde dúvidas sobre o sistema |
|
|
231
|
-
| **Onboarding** | Cadastro de novos usuários |
|
|
232
|
-
| **Escalation** | Transfere para atendimento humano quando necessário |
|
|
233
|
-
| **Feedback** | Registra dúvidas, feedbacks, reclamações e sugestões |
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
## 📁 Templates
|
|
238
|
-
|
|
239
|
-
Templates são configurações YAML que personalizam o comportamento dos agentes:
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
templates/ # ✅ Templates genéricos (incluídos no repositório)
|
|
243
|
-
└── standard/ # Template de exemplo
|
|
244
|
-
├── triage_config.yaml
|
|
245
|
-
├── flow_config.yaml
|
|
246
|
-
├── escalation_config.yaml
|
|
247
|
-
├── feedback_config.yaml
|
|
248
|
-
└── ...
|
|
249
|
-
|
|
250
|
-
client_templates/ # 🔒 Templates de clientes (não incluídos no repositório)
|
|
251
|
-
└── meu_cliente/ # Template customizado
|
|
252
|
-
├── triage_config.yaml
|
|
253
|
-
├── tools.py # Tools customizadas
|
|
254
|
-
└── network.py # Rede específica
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
> **Nota:** A pasta `templates/` contém exemplos genéricos e é incluída no repositório.
|
|
258
|
-
> A pasta `client_templates/` contém configurações de clientes e está no `.gitignore`.
|
|
259
|
-
|
|
260
|
-
Veja a [documentação completa](atendentepro/README.md) para criar templates.
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
## 📚 Documentação
|
|
265
|
-
|
|
266
|
-
- [📖 Documentação da Biblioteca](atendentepro/README.md)
|
|
267
|
-
- [📊 Fluxogramas](docs/fluxogramas/)
|
|
268
|
-
- [💡 Exemplos](examples/)
|
|
269
|
-
- [📝 Changelog](CHANGELOG.md)
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
## 🔧 Dependências
|
|
274
|
-
|
|
275
|
-
- Python 3.9+
|
|
276
|
-
- openai-agents >= 0.3.3
|
|
277
|
-
- openai >= 1.107.1
|
|
278
|
-
- pydantic >= 2.0.0
|
|
279
|
-
- PyYAML >= 6.0
|
|
280
|
-
- python-dotenv >= 1.0.0
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## 🛠️ Desenvolvimento
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
# Instalar dependências de desenvolvimento
|
|
288
|
-
pip install -e ".[dev]"
|
|
289
|
-
|
|
290
|
-
# Rodar testes
|
|
291
|
-
pytest
|
|
292
|
-
|
|
293
|
-
# Formatar código
|
|
294
|
-
black atendentepro
|
|
295
|
-
isort atendentepro
|
|
296
|
-
|
|
297
|
-
# Type checking
|
|
298
|
-
mypy atendentepro
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
## 📄 Licença
|
|
304
|
-
|
|
305
|
-
Este software é **proprietário** e requer uma licença válida para uso.
|
|
306
|
-
|
|
307
|
-
Veja o arquivo [LICENSE](LICENSE) para mais detalhes.
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
## 🤝 Suporte
|
|
312
|
-
|
|
313
|
-
- 📧 **Email:** contato@bemonkai.com
|
|
314
|
-
- 🌐 **Site:** https://bemonkai.com
|
|
315
|
-
- 🐛 **Issues:** https://github.com/BeMonkAI/atendentepro/issues
|
|
316
|
-
|
|
317
|
-
---
|
|
318
|
-
|
|
319
|
-
**Made with ❤️ by BeMonkAI**
|
|
320
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|