atendentepro 0.5.4__py3-none-any.whl → 0.5.6__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/network.py CHANGED
@@ -102,9 +102,17 @@ class AgentNetwork:
102
102
  def create_standard_network(
103
103
  templates_root: Path,
104
104
  client: str = "standard",
105
+ # Agents to include
106
+ include_flow: bool = True,
107
+ include_interview: bool = True,
108
+ include_answer: bool = True,
109
+ include_knowledge: bool = True,
110
+ include_confirmation: bool = True,
111
+ include_usage: bool = True,
105
112
  include_onboarding: bool = False,
106
113
  include_escalation: bool = True,
107
114
  include_feedback: bool = True,
115
+ # Agent-specific configurations
108
116
  escalation_channels: str = "",
109
117
  feedback_protocol_prefix: str = "TKT",
110
118
  feedback_brand_color: str = "#4A90D9",
@@ -114,7 +122,10 @@ def create_standard_network(
114
122
  """
115
123
  Create a standard agent network with proper handoff configuration.
116
124
 
117
- This creates the default network configuration with:
125
+ This creates a configurable network where you can enable/disable specific agents.
126
+ The Triage agent is always included as it's the entry point.
127
+
128
+ Default handoff configuration (when all agents are enabled):
118
129
  - Triage -> Flow, Confirmation, Knowledge, Usage, Escalation, Feedback
119
130
  - Flow -> Interview, Triage, Escalation, Feedback
120
131
  - Interview -> Answer, Escalation, Feedback
@@ -122,13 +133,19 @@ def create_standard_network(
122
133
  - Confirmation -> Triage, Escalation, Feedback
123
134
  - Knowledge -> Triage, Escalation, Feedback
124
135
  - Usage -> Triage, Escalation, Feedback
125
- - Escalation -> Triage
136
+ - Escalation -> Triage, Feedback
126
137
  - Feedback -> Triage, Escalation
127
138
 
128
139
  Args:
129
140
  templates_root: Root directory for template configurations.
130
141
  client: Client key to load configurations for.
131
- include_onboarding: Whether to include the onboarding agent.
142
+ include_flow: Whether to include the flow agent (default True).
143
+ include_interview: Whether to include the interview agent (default True).
144
+ include_answer: Whether to include the answer agent (default True).
145
+ include_knowledge: Whether to include the knowledge agent (default True).
146
+ include_confirmation: Whether to include the confirmation agent (default True).
147
+ include_usage: Whether to include the usage agent (default True).
148
+ include_onboarding: Whether to include the onboarding agent (default False).
132
149
  include_escalation: Whether to include the escalation agent (default True).
133
150
  include_feedback: Whether to include the feedback agent (default True).
134
151
  escalation_channels: Description of available escalation channels.
@@ -142,6 +159,25 @@ def create_standard_network(
142
159
 
143
160
  Raises:
144
161
  LicenseNotActivatedError: If the library is not activated.
162
+
163
+ Example:
164
+ # Create network without Knowledge agent
165
+ network = create_standard_network(
166
+ templates_root=Path("templates"),
167
+ client="my_client",
168
+ include_knowledge=False,
169
+ )
170
+
171
+ # Create minimal network (only Triage, Flow, Interview, Answer)
172
+ network = create_standard_network(
173
+ templates_root=Path("templates"),
174
+ client="my_client",
175
+ include_knowledge=False,
176
+ include_confirmation=False,
177
+ include_usage=False,
178
+ include_escalation=False,
179
+ include_feedback=False,
180
+ )
145
181
  """
146
182
  # Verificar licença
147
183
  require_activation()
@@ -210,50 +246,64 @@ def create_standard_network(
210
246
  tools = custom_tools or {}
211
247
 
212
248
  # Create agents without handoffs first
249
+ # Triage is always created (entry point)
213
250
  triage = create_triage_agent(
214
251
  keywords_text=triage_keywords,
215
252
  guardrails=get_guardrails_for_agent("Triage Agent", templates_root),
216
253
  )
217
254
 
218
- flow = create_flow_agent(
219
- flow_template=flow_template,
220
- flow_keywords=flow_keywords,
221
- guardrails=get_guardrails_for_agent("Flow Agent", templates_root),
222
- )
255
+ # Create optional agents based on include flags
256
+ flow = None
257
+ if include_flow:
258
+ flow = create_flow_agent(
259
+ flow_template=flow_template,
260
+ flow_keywords=flow_keywords,
261
+ guardrails=get_guardrails_for_agent("Flow Agent", templates_root),
262
+ )
223
263
 
224
- interview = create_interview_agent(
225
- interview_template=flow_template,
226
- interview_questions=interview_questions,
227
- tools=tools.get("interview", []),
228
- guardrails=get_guardrails_for_agent("Interview Agent", templates_root),
229
- )
264
+ interview = None
265
+ if include_interview:
266
+ interview = create_interview_agent(
267
+ interview_template=flow_template,
268
+ interview_questions=interview_questions,
269
+ tools=tools.get("interview", []),
270
+ guardrails=get_guardrails_for_agent("Interview Agent", templates_root),
271
+ )
230
272
 
231
- answer = create_answer_agent(
232
- answer_template="",
233
- guardrails=get_guardrails_for_agent("Answer Agent", templates_root),
234
- )
273
+ answer = None
274
+ if include_answer:
275
+ answer = create_answer_agent(
276
+ answer_template="",
277
+ guardrails=get_guardrails_for_agent("Answer Agent", templates_root),
278
+ )
235
279
 
236
- knowledge = create_knowledge_agent(
237
- knowledge_about=knowledge_about,
238
- knowledge_template=knowledge_template,
239
- knowledge_format=knowledge_format,
240
- embeddings_path=embeddings_path,
241
- data_sources_description=data_sources_description,
242
- include_rag_tool=has_embeddings,
243
- tools=tools.get("knowledge", []),
244
- guardrails=get_guardrails_for_agent("Knowledge Agent", templates_root),
245
- )
280
+ knowledge = None
281
+ if include_knowledge:
282
+ knowledge = create_knowledge_agent(
283
+ knowledge_about=knowledge_about,
284
+ knowledge_template=knowledge_template,
285
+ knowledge_format=knowledge_format,
286
+ embeddings_path=embeddings_path,
287
+ data_sources_description=data_sources_description,
288
+ include_rag_tool=has_embeddings,
289
+ tools=tools.get("knowledge", []),
290
+ guardrails=get_guardrails_for_agent("Knowledge Agent", templates_root),
291
+ )
246
292
 
247
- confirmation = create_confirmation_agent(
248
- confirmation_about=confirmation_about,
249
- confirmation_template=confirmation_template,
250
- confirmation_format=confirmation_format,
251
- guardrails=get_guardrails_for_agent("Confirmation Agent", templates_root),
252
- )
293
+ confirmation = None
294
+ if include_confirmation:
295
+ confirmation = create_confirmation_agent(
296
+ confirmation_about=confirmation_about,
297
+ confirmation_template=confirmation_template,
298
+ confirmation_format=confirmation_format,
299
+ guardrails=get_guardrails_for_agent("Confirmation Agent", templates_root),
300
+ )
253
301
 
254
- usage = create_usage_agent(
255
- guardrails=get_guardrails_for_agent("Usage Agent", templates_root),
256
- )
302
+ usage = None
303
+ if include_usage:
304
+ usage = create_usage_agent(
305
+ guardrails=get_guardrails_for_agent("Usage Agent", templates_root),
306
+ )
257
307
 
258
308
  # Create escalation agent if requested
259
309
  escalation = None
@@ -275,48 +325,74 @@ def create_standard_network(
275
325
  guardrails=get_guardrails_for_agent("Feedback Agent", templates_root),
276
326
  )
277
327
 
278
- # Configure handoffs
279
- triage_handoffs = [flow, confirmation, knowledge, usage]
280
- flow_handoffs = [interview, triage]
281
- confirmation_handoffs = [triage]
282
- knowledge_handoffs = [triage]
283
- usage_handoffs = [triage]
284
- interview_handoffs = [answer]
285
- answer_handoffs = [triage] # Answer só volta para Triage (não faz sentido voltar para Interview)
286
- escalation_handoffs = [triage]
287
- feedback_handoffs = [triage]
328
+ # Configure handoffs dynamically based on which agents are included
329
+ # Helper function to filter None values
330
+ def filter_agents(*agents):
331
+ return [a for a in agents if a is not None]
332
+
333
+ # Build triage handoffs (main routing)
334
+ triage_handoffs = filter_agents(flow, confirmation, knowledge, usage)
335
+
336
+ # Other agent handoffs
337
+ flow_handoffs = filter_agents(interview, triage) if flow else []
338
+ confirmation_handoffs = [triage] if confirmation else []
339
+ knowledge_handoffs = [triage] if knowledge else []
340
+ usage_handoffs = [triage] if usage else []
341
+ interview_handoffs = filter_agents(answer) if interview else []
342
+ answer_handoffs = [triage] if answer else []
343
+ escalation_handoffs = [triage] if escalation else []
344
+ feedback_handoffs = [triage] if feedback else []
288
345
 
289
346
  # Add escalation to all agents if enabled
290
347
  if escalation:
291
348
  triage_handoffs.append(escalation)
292
- flow_handoffs.append(escalation)
293
- confirmation_handoffs.append(escalation)
294
- knowledge_handoffs.append(escalation)
295
- usage_handoffs.append(escalation)
296
- interview_handoffs.append(escalation)
297
- answer_handoffs.append(escalation)
349
+ if flow:
350
+ flow_handoffs.append(escalation)
351
+ if confirmation:
352
+ confirmation_handoffs.append(escalation)
353
+ if knowledge:
354
+ knowledge_handoffs.append(escalation)
355
+ if usage:
356
+ usage_handoffs.append(escalation)
357
+ if interview:
358
+ interview_handoffs.append(escalation)
359
+ if answer:
360
+ answer_handoffs.append(escalation)
298
361
  if feedback:
299
362
  feedback_handoffs.append(escalation)
300
363
 
301
364
  # Add feedback to all agents if enabled
302
365
  if feedback:
303
366
  triage_handoffs.append(feedback)
304
- flow_handoffs.append(feedback)
305
- confirmation_handoffs.append(feedback)
306
- knowledge_handoffs.append(feedback)
307
- usage_handoffs.append(feedback)
308
- interview_handoffs.append(feedback)
309
- answer_handoffs.append(feedback)
367
+ if flow:
368
+ flow_handoffs.append(feedback)
369
+ if confirmation:
370
+ confirmation_handoffs.append(feedback)
371
+ if knowledge:
372
+ knowledge_handoffs.append(feedback)
373
+ if usage:
374
+ usage_handoffs.append(feedback)
375
+ if interview:
376
+ interview_handoffs.append(feedback)
377
+ if answer:
378
+ answer_handoffs.append(feedback)
310
379
  if escalation:
311
380
  escalation_handoffs.append(feedback)
312
381
 
382
+ # Apply handoffs to agents
313
383
  triage.handoffs = triage_handoffs
314
- flow.handoffs = flow_handoffs
315
- confirmation.handoffs = confirmation_handoffs
316
- knowledge.handoffs = knowledge_handoffs
317
- usage.handoffs = usage_handoffs
318
- interview.handoffs = interview_handoffs
319
- answer.handoffs = answer_handoffs
384
+ if flow:
385
+ flow.handoffs = flow_handoffs
386
+ if confirmation:
387
+ confirmation.handoffs = confirmation_handoffs
388
+ if knowledge:
389
+ knowledge.handoffs = knowledge_handoffs
390
+ if usage:
391
+ usage.handoffs = usage_handoffs
392
+ if interview:
393
+ interview.handoffs = interview_handoffs
394
+ if answer:
395
+ answer.handoffs = answer_handoffs
320
396
  if escalation:
321
397
  escalation.handoffs = escalation_handoffs
322
398
  if feedback:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atendentepro
3
- Version: 0.5.4
3
+ Version: 0.5.6
4
4
  Summary: Sistema de Atendimento Inteligente com Múltiplos Agentes IA - Biblioteca independente e modular baseada no OpenAI Agents SDK
5
5
  Author-email: BeMonkAI <contato@monkai.com.br>
6
6
  Maintainer-email: BeMonkAI <contato@monkai.com.br>
@@ -525,26 +525,61 @@ Escalation► Triage, Feedback
525
525
  Feedback ► Triage, Escalation
526
526
  ```
527
527
 
528
- ### Configuração de Handoffs
528
+ ### Configuração de Agentes
529
+
530
+ Você pode escolher exatamente quais agentes incluir na sua rede:
529
531
 
530
532
  ```python
531
- # Todos os handoffs habilitados (padrão)
533
+ from pathlib import Path
534
+ from atendentepro import create_standard_network
535
+
536
+ # Todos os agentes habilitados (padrão)
532
537
  network = create_standard_network(
533
538
  templates_root=Path("./meu_cliente"),
534
539
  client="config",
535
- include_escalation=True, # Padrão: True
536
- include_feedback=True, # Padrão: True
537
540
  )
538
541
 
539
- # Sem Escalation ou Feedback
542
+ # Sem Knowledge Agent (para clientes sem base de conhecimento)
540
543
  network = create_standard_network(
541
544
  templates_root=Path("./meu_cliente"),
542
545
  client="config",
546
+ include_knowledge=False,
547
+ )
548
+
549
+ # Rede mínima (apenas fluxo principal)
550
+ network = create_standard_network(
551
+ templates_root=Path("./meu_cliente"),
552
+ client="config",
553
+ include_knowledge=False,
554
+ include_confirmation=False,
555
+ include_usage=False,
543
556
  include_escalation=False,
544
557
  include_feedback=False,
545
558
  )
559
+
560
+ # Apenas captura de leads (sem Knowledge nem Usage)
561
+ network = create_standard_network(
562
+ templates_root=Path("./meu_cliente"),
563
+ client="config",
564
+ include_knowledge=False,
565
+ include_usage=False,
566
+ )
546
567
  ```
547
568
 
569
+ ### Parâmetros Disponíveis
570
+
571
+ | Parâmetro | Padrão | Descrição |
572
+ |-----------|--------|-----------|
573
+ | `include_flow` | `True` | Agente de fluxo conversacional |
574
+ | `include_interview` | `True` | Agente de entrevista/coleta |
575
+ | `include_answer` | `True` | Agente de resposta final |
576
+ | `include_knowledge` | `True` | Agente de base de conhecimento |
577
+ | `include_confirmation` | `True` | Agente de confirmação |
578
+ | `include_usage` | `True` | Agente de instruções de uso |
579
+ | `include_onboarding` | `False` | Agente de boas-vindas |
580
+ | `include_escalation` | `True` | Agente de escalonamento humano |
581
+ | `include_feedback` | `True` | Agente de tickets/feedback |
582
+
548
583
  ---
549
584
 
550
585
  ## 🔧 Dependências
@@ -1,7 +1,7 @@
1
1
  atendentepro/README.md,sha256=AMVMJlVOlXcwU_kRGBiIoSn8hASLHrhZwxV1jr1LJsU,43012
2
2
  atendentepro/__init__.py,sha256=r_9RwvfKcvcS6bk2a1sdQsQyf_CUW-tljE-vh3TeLyw,5150
3
3
  atendentepro/license.py,sha256=rlPtysXNqAzEQkP2VjUAVu_nMndhPgfKv1yN2ruUYVI,17570
4
- atendentepro/network.py,sha256=CHJVoggOE--LzVvR1XROtjeFqnwJctP2L4dHgCVCXXE,14419
4
+ atendentepro/network.py,sha256=s7h9if2oS_15BL8VoONjMlihEFCkJqdHxR5WFL81gl4,17310
5
5
  atendentepro/agents/__init__.py,sha256=OcPhG1Dp6xe49B5YIti4HVmaZDoDIrFLfRa8GmI4jpQ,1638
6
6
  atendentepro/agents/answer.py,sha256=dIZzGL_ddjC96JIiWSwDg33phwca8NpWFxO16FFYVoA,1905
7
7
  atendentepro/agents/confirmation.py,sha256=5Zg4z9A90CydYiEk8CEAKnnza71algFKF-N1WLwGDQI,2311
@@ -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.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,,
38
+ atendentepro-0.5.6.dist-info/licenses/LICENSE,sha256=TF6CdXxePoT9DXtPnCejiU5mUwWzrFzd1iyWJyoMauA,983
39
+ atendentepro-0.5.6.dist-info/METADATA,sha256=ujtXRzOUoraqgh2a4hX9qP7pTKEXNS5S5QoZ0Kj64v0,19013
40
+ atendentepro-0.5.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
+ atendentepro-0.5.6.dist-info/entry_points.txt,sha256=OP0upzqJF3MLS6VX-M-5BfUwx5YLJO2sJ3YBAp4e6yI,89
42
+ atendentepro-0.5.6.dist-info/top_level.txt,sha256=BFasD4SMmgDUmWKlTIZ1PeuukoRBhyiMIz8umKWVCcs,13
43
+ atendentepro-0.5.6.dist-info/RECORD,,