chatgraph 1.3.1__tar.gz → 1.5.0__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.
Files changed (144) hide show
  1. chatgraph-1.5.0/.dockerignore +7 -0
  2. {chatgraph-1.3.1 → chatgraph-1.5.0}/.env.example +75 -46
  3. {chatgraph-1.3.1 → chatgraph-1.5.0}/.github/agents/SkillManager.agent.md +0 -0
  4. {chatgraph-1.3.1 → chatgraph-1.5.0}/.github/agents/architect.agent.md +0 -0
  5. {chatgraph-1.3.1 → chatgraph-1.5.0}/.github/agents/code-reviewer.agent.md +0 -0
  6. {chatgraph-1.3.1 → chatgraph-1.5.0}/.github/agents/developer.agent.md +0 -0
  7. {chatgraph-1.3.1 → chatgraph-1.5.0}/.github/copilot-instructions.md +0 -0
  8. {chatgraph-1.3.1 → chatgraph-1.5.0}/.github/skills/chatgraph-framework/SKILL.md +770 -528
  9. {chatgraph-1.3.1 → chatgraph-1.5.0}/.gitignore +191 -191
  10. {chatgraph-1.3.1 → chatgraph-1.5.0}/.python-version +0 -0
  11. chatgraph-1.5.0/CHANGELOG.md +37 -0
  12. chatgraph-1.5.0/CLAUDE.md +153 -0
  13. {chatgraph-1.3.1 → chatgraph-1.5.0}/LICENSE +21 -21
  14. {chatgraph-1.3.1 → chatgraph-1.5.0}/PKG-INFO +73 -1
  15. {chatgraph-1.3.1 → chatgraph-1.5.0}/PROGRESS.md +206 -179
  16. {chatgraph-1.3.1 → chatgraph-1.5.0}/README.md +559 -490
  17. chatgraph-1.5.0/chatgraph/__init__.py +139 -0
  18. chatgraph-1.5.0/chatgraph/agent/__init__.py +28 -0
  19. chatgraph-1.5.0/chatgraph/agent/agent.py +539 -0
  20. chatgraph-1.5.0/chatgraph/agent/content.py +138 -0
  21. chatgraph-1.5.0/chatgraph/agent/context.py +212 -0
  22. chatgraph-1.5.0/chatgraph/agent/errors.py +53 -0
  23. chatgraph-1.5.0/chatgraph/agent/executor.py +653 -0
  24. chatgraph-1.5.0/chatgraph/agent/history_bridge.py +206 -0
  25. chatgraph-1.5.0/chatgraph/agent/openrouter.py +383 -0
  26. chatgraph-1.5.0/chatgraph/agent/prompts.py +306 -0
  27. chatgraph-1.5.0/chatgraph/agent/protocol.py +459 -0
  28. chatgraph-1.5.0/chatgraph/agent/schema.py +259 -0
  29. chatgraph-1.5.0/chatgraph/agent/types.py +108 -0
  30. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/auth/credentials.py +75 -75
  31. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/bot/chatbot_model.py +447 -390
  32. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/bot/chatbot_router.py +85 -87
  33. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/bot/default_functions.py +23 -24
  34. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/bot/default_guard.py +0 -0
  35. chatgraph-1.5.0/chatgraph/bot/route_registry.py +64 -0
  36. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/cli/__init__.py +234 -234
  37. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/container/container.py +0 -0
  38. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/error/chatbot_error.py +57 -57
  39. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/error/route_error.py +26 -26
  40. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/gRPC/gRPCCall.py +182 -182
  41. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/history/__init__.py +16 -16
  42. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/history/entry.py +72 -58
  43. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/history/keys.py +22 -22
  44. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/history/store.py +62 -62
  45. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/logger/__init__.py +11 -11
  46. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/logger/logger.py +3 -3
  47. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/logger/user_logger.py +104 -104
  48. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/messages/__init__.py +4 -4
  49. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/messages/log_publisher.py +189 -189
  50. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/messages/message_consumer.py +254 -337
  51. chatgraph-1.5.0/chatgraph/messages/transport.py +29 -0
  52. chatgraph-1.5.0/chatgraph/messages/turn.py +106 -0
  53. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/models/__init__.py +13 -13
  54. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/models/actions.py +141 -141
  55. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/models/http_responses.py +0 -0
  56. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/models/log_envelope.py +97 -97
  57. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/models/message.py +380 -374
  58. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/models/platform_state.py +35 -35
  59. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/models/userstate.py +474 -474
  60. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/pb/router.proto +151 -151
  61. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/pb/router_pb2.py +80 -80
  62. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/pb/router_pb2_grpc.py +909 -909
  63. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/services/__init__.py +0 -0
  64. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/services/router_http_client.py +742 -722
  65. chatgraph-1.5.0/chatgraph/stream/__init__.py +31 -0
  66. chatgraph-1.5.0/chatgraph/stream/backoff.py +52 -0
  67. chatgraph-1.5.0/chatgraph/stream/client.py +541 -0
  68. chatgraph-1.5.0/chatgraph/stream/connection.py +289 -0
  69. chatgraph-1.5.0/chatgraph/stream/consumer.py +355 -0
  70. chatgraph-1.5.0/chatgraph/stream/dedupe.py +19 -0
  71. chatgraph-1.5.0/chatgraph/stream/dual.py +68 -0
  72. chatgraph-1.5.0/chatgraph/stream/errors.py +66 -0
  73. chatgraph-1.5.0/chatgraph/stream/frames.py +60 -0
  74. chatgraph-1.5.0/chatgraph/stream/options.py +91 -0
  75. chatgraph-1.5.0/chatgraph/stream/router_client.py +98 -0
  76. chatgraph-1.5.0/chatgraph/stream/runtime.py +100 -0
  77. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/types/background_task.py +30 -30
  78. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/types/end_types.py +81 -76
  79. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/types/route.py +109 -104
  80. {chatgraph-1.3.1 → chatgraph-1.5.0}/chatgraph/types/usercall.py +547 -547
  81. {chatgraph-1.3.1 → chatgraph-1.5.0}/docs/gaps-go-to-python.md +184 -150
  82. {chatgraph-1.3.1 → chatgraph-1.5.0}/docs/gaps-python-to-go.md +65 -65
  83. {chatgraph-1.3.1 → chatgraph-1.5.0}/example.py +98 -98
  84. {chatgraph-1.3.1 → chatgraph-1.5.0}/example2.py +59 -59
  85. chatgraph-1.5.0/examples/agent_smoke.py +259 -0
  86. chatgraph-1.5.0/examples/agents_bot.py +127 -0
  87. chatgraph-1.5.0/examples/content_insight.py +63 -0
  88. chatgraph-1.5.0/examples/stream/Dockerfile +12 -0
  89. chatgraph-1.5.0/examples/stream/bot.py +35 -0
  90. {chatgraph-1.3.1 → chatgraph-1.5.0}/jsons/voll_return.json +8 -8
  91. {chatgraph-1.3.1 → chatgraph-1.5.0}/poetry.lock +1618 -1618
  92. {chatgraph-1.3.1 → chatgraph-1.5.0}/pyproject.toml +88 -80
  93. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/__init__.py +0 -0
  94. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/integration/__init__.py +1 -1
  95. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/integration/conftest.py +111 -111
  96. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/integration/test_router_client_integration.py +376 -376
  97. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/__init__.py +1 -1
  98. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/conftest.py +144 -114
  99. chatgraph-1.5.0/tests/unit/stream_fake_router.py +332 -0
  100. chatgraph-1.5.0/tests/unit/test_agent_content.py +168 -0
  101. chatgraph-1.5.0/tests/unit/test_agent_context.py +241 -0
  102. chatgraph-1.5.0/tests/unit/test_agent_core.py +352 -0
  103. chatgraph-1.5.0/tests/unit/test_agent_executor.py +764 -0
  104. chatgraph-1.5.0/tests/unit/test_agent_history_bridge.py +208 -0
  105. chatgraph-1.5.0/tests/unit/test_agent_openrouter.py +401 -0
  106. chatgraph-1.5.0/tests/unit/test_agent_prompts.py +190 -0
  107. chatgraph-1.5.0/tests/unit/test_agent_protocol.py +265 -0
  108. chatgraph-1.5.0/tests/unit/test_agent_schema.py +323 -0
  109. chatgraph-1.5.0/tests/unit/test_agent_validate_config.py +146 -0
  110. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_chatbot_app_log_publisher.py +152 -152
  111. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_default_guard.py +100 -100
  112. chatgraph-1.5.0/tests/unit/test_dual.py +839 -0
  113. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_guard.py +165 -165
  114. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_history_integration.py +297 -297
  115. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_history_store.py +278 -278
  116. chatgraph-1.5.0/tests/unit/test_history_tool_entries.py +88 -0
  117. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_log_envelope.py +110 -110
  118. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_log_publisher.py +438 -438
  119. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_message_consumer.py +403 -403
  120. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_message_consumer_log_publisher.py +129 -129
  121. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_models_actions.py +239 -239
  122. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_models_message.py +376 -346
  123. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_models_platform_state.py +52 -52
  124. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_models_userstate.py +472 -472
  125. chatgraph-1.5.0/tests/unit/test_route_registry_integration.py +236 -0
  126. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_router_http_client.py +926 -926
  127. chatgraph-1.5.0/tests/unit/test_router_url.py +54 -0
  128. chatgraph-1.5.0/tests/unit/test_stream_backoff.py +190 -0
  129. chatgraph-1.5.0/tests/unit/test_stream_consumer.py +610 -0
  130. chatgraph-1.5.0/tests/unit/test_stream_dedupe.py +42 -0
  131. chatgraph-1.5.0/tests/unit/test_stream_example.py +75 -0
  132. chatgraph-1.5.0/tests/unit/test_stream_executor.py +518 -0
  133. chatgraph-1.5.0/tests/unit/test_stream_handshake.py +184 -0
  134. chatgraph-1.5.0/tests/unit/test_stream_lifecycle.py +347 -0
  135. chatgraph-1.5.0/tests/unit/test_stream_options.py +107 -0
  136. chatgraph-1.5.0/tests/unit/test_stream_receiver.py +378 -0
  137. chatgraph-1.5.0/tests/unit/test_stream_router_client.py +339 -0
  138. chatgraph-1.5.0/tests/unit/test_stream_runtime.py +154 -0
  139. chatgraph-1.5.0/tests/unit/test_transport_selection.py +122 -0
  140. chatgraph-1.5.0/tests/unit/test_turn.py +134 -0
  141. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_user_logger.py +251 -251
  142. {chatgraph-1.3.1 → chatgraph-1.5.0}/tests/unit/test_usercall.py +520 -520
  143. {chatgraph-1.3.1 → chatgraph-1.5.0}/uv.lock +1417 -1139
  144. chatgraph-1.3.1/chatgraph/__init__.py +0 -71
@@ -0,0 +1,7 @@
1
+ *
2
+ !pyproject.toml
3
+ !README.md
4
+ !LICENSE
5
+ !chatgraph
6
+ !examples/stream
7
+ **/__pycache__
@@ -1,46 +1,75 @@
1
- # Configuração do ChatGraph
2
-
3
- # RabbitMQ
4
- RABBIT_USER=seu_usuario
5
- RABBIT_PASS=sua_senha
6
- RABBIT_URI=amqp://localhost
7
- RABBIT_QUEUE=chat_queue
8
- RABBIT_PREFETCH=1
9
- RABBIT_VHOST=/
10
-
11
- # gRPC (legado)
12
- GRPC_URI=grpc://localhost:50051
13
-
14
- ROUTER_URL='http://api-voll-hml.verdecard.tech/'
15
- ROUTER_TOKEN='f078b1cf-b4c8-11f0-b4fe-0242ac140002'
16
-
17
- # ====================================
18
- # Testes de Integração
19
- # ====================================
20
- # Estas variáveis são necessárias APENAS para executar testes de integração
21
- # que fazem chamadas reais para APIs externas.
22
- #
23
- # Se não configuradas, os testes de integração serão automaticamente pulados.
24
-
25
- # URL base da API de roteamento (OBRIGATÓRIO para testes de integração)
26
- ROUTER_API_BASE_URL=http://localhost:8000/v1/actions
27
-
28
- # Autenticação da API (OPCIONAL - se a API requer autenticação)
29
- ROUTER_API_USERNAME=test_integration_user
30
- ROUTER_API_PASSWORD=f078b1cf-b4c8-11f0-b4fe-0242ac140002
31
-
32
- # Timeout para requisições (OPCIONAL - default: 60s)
33
- # ROUTER_API_TIMEOUT=60.0
34
-
35
- # IDs para testes (OPCIONAL - valores padrão serão usados)
36
- TEST_USER_ID=6107
37
- TEST_COMPANY_ID=business-tech
38
-
39
- # Log Publisher (RabbitMQ - opcional)
40
- # Defina LOG_RABBIT_QUEUE para ativar o envio de logs de erro para fila RabbitMQ.
41
- # O exchange e routing key padrão seguem o padrão do Go: exchange = vhost, routing key = chatbot.{queue}
42
- # Com RABBIT_VHOST='/' não existe exchange homônima: cai na exchange
43
- # default do AMQP e a routing key passa a ser o próprio nome da fila.
44
- LOG_RABBIT_QUEUE=logs
45
- LOG_RABBIT_EXCHANGE=chatbot-hml
46
- # LOG_RABBIT_ROUTING_KEY=chatbot.logs # opcional: default = chatbot.{LOG_RABBIT_QUEUE}
1
+ # Configuração do ChatGraph
2
+
3
+ # RabbitMQ
4
+ RABBIT_USER=seu_usuario
5
+ RABBIT_PASS=sua_senha
6
+ RABBIT_URI=amqp://localhost
7
+ RABBIT_QUEUE=chat_queue
8
+ RABBIT_PREFETCH=1
9
+ RABBIT_VHOST=/
10
+
11
+ # gRPC (legado)
12
+ GRPC_URI=grpc://localhost:50051
13
+
14
+ # Só o host; /v1 e /v1/actions continuam aceitos
15
+ ROUTER_URL='http://api-voll-hml.verdecard.tech/'
16
+ ROUTER_TOKEN='f078b1cf-b4c8-11f0-b4fe-0242ac140002'
17
+ # Transporte de entrada: queue (RabbitMQ, padrão), stream (WebSocket) ou dual (transição: fila + stream)
18
+ # ROUTER_TRANSPORT=queue
19
+ # Menus servidos no stream, separados por vírgula (padrão: RABBIT_QUEUE)
20
+ # ROUTER_MENUS=
21
+
22
+ # ====================================
23
+ # Testes de Integração
24
+ # ====================================
25
+ # Estas variáveis são necessárias APENAS para executar testes de integração
26
+ # que fazem chamadas reais para APIs externas.
27
+ #
28
+ # Se não configuradas, os testes de integração serão automaticamente pulados.
29
+
30
+ # URL base da API de roteamento (OBRIGATÓRIO para testes de integração)
31
+ ROUTER_API_BASE_URL=http://localhost:8000/v1/actions
32
+
33
+ # Autenticação da API (OPCIONAL - se a API requer autenticação)
34
+ ROUTER_API_USERNAME=test_integration_user
35
+ ROUTER_API_PASSWORD=f078b1cf-b4c8-11f0-b4fe-0242ac140002
36
+
37
+ # Timeout para requisições (OPCIONAL - default: 60s)
38
+ # ROUTER_API_TIMEOUT=60.0
39
+
40
+ # IDs para testes (OPCIONAL - valores padrão serão usados)
41
+ TEST_USER_ID=6107
42
+ TEST_COMPANY_ID=business-tech
43
+
44
+ # ====================================
45
+ # Agentes de IA (extra opcional: pip install chatgraph[agent])
46
+ # ====================================
47
+ # OpenRouter (provedor de LLM)
48
+ OPENROUTER_API_KEY=sk-or-...
49
+ # OPENROUTER_BASE_URL=https://openrouter.ai/api/v1 # opcional
50
+
51
+ # Modelo usado pelo Agent (qualquer modelo do OpenRouter)
52
+ AGENT_MODEL=openai/gpt-4o-mini
53
+ # AGENT_TEMPERATURE=0.7 # opcional (default 0.7)
54
+ # AGENT_MAX_TOKENS=2048 # opcional (default 2048)
55
+ # AGENT_MAX_TOOL_LOOPS=5 # opcional (default 5)
56
+ # AGENT_HISTORY_LIMIT=20 # opcional (default 20)
57
+ # AGENT_SYSTEM_PROMPT_FILE=prompts/personalidade.md # opcional
58
+
59
+ # Diagnóstico: loga o AgentContext COMPLETO (inclui dados do usuário
60
+ # na observation). Use apenas em debug local.
61
+ # LOG_AGENT_CONTEXT=1
62
+
63
+ # Bots com agente: um turno de LLM pode levar vários segundos; com
64
+ # RABBIT_PREFETCH=1 o consumer processa 1 mensagem por vez e a fila
65
+ # serializa. Considere aumentar (com o caveat de ordenação por chat).
66
+ # RABBIT_PREFETCH=4
67
+
68
+ # Log Publisher (RabbitMQ - opcional)
69
+ # Defina LOG_RABBIT_QUEUE para ativar o envio de logs de erro para fila RabbitMQ.
70
+ # O exchange e routing key padrão seguem o padrão do Go: exchange = vhost, routing key = chatbot.{queue}
71
+ # Com RABBIT_VHOST='/' não existe exchange homônima: cai na exchange
72
+ # default do AMQP e a routing key passa a ser o próprio nome da fila.
73
+ LOG_RABBIT_QUEUE=logs
74
+ LOG_RABBIT_EXCHANGE=chatbot-hml
75
+ # LOG_RABBIT_ROUTING_KEY=chatbot.logs # opcional: default = chatbot.{LOG_RABBIT_QUEUE}