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