railtracks 1.1.2__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 (269) hide show
  1. railtracks-1.1.2/LICENSE +0 -0
  2. railtracks-1.1.2/PKG-INFO +129 -0
  3. railtracks-1.1.2/README.md +100 -0
  4. railtracks-1.1.2/pyproject.toml +59 -0
  5. railtracks-1.1.2/src/railtracks/__init__.py +50 -0
  6. railtracks-1.1.2/src/railtracks/_session.py +411 -0
  7. railtracks-1.1.2/src/railtracks/built_nodes/__init__.py +0 -0
  8. railtracks-1.1.2/src/railtracks/built_nodes/_node_builder.py +425 -0
  9. railtracks-1.1.2/src/railtracks/built_nodes/concrete/__init__.py +35 -0
  10. railtracks-1.1.2/src/railtracks/built_nodes/concrete/_llm_base.py +358 -0
  11. railtracks-1.1.2/src/railtracks/built_nodes/concrete/_tool_call_base.py +235 -0
  12. railtracks-1.1.2/src/railtracks/built_nodes/concrete/chat_tool_call_llm.py +144 -0
  13. railtracks-1.1.2/src/railtracks/built_nodes/concrete/function_base.py +168 -0
  14. railtracks-1.1.2/src/railtracks/built_nodes/concrete/response.py +64 -0
  15. railtracks-1.1.2/src/railtracks/built_nodes/concrete/structured_llm_base.py +91 -0
  16. railtracks-1.1.2/src/railtracks/built_nodes/concrete/structured_tool_call_llm_base.py +105 -0
  17. railtracks-1.1.2/src/railtracks/built_nodes/concrete/terminal_llm_base.py +79 -0
  18. railtracks-1.1.2/src/railtracks/built_nodes/concrete/tool_call_llm_base.py +9 -0
  19. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/__init__.py +9 -0
  20. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/agent.py +160 -0
  21. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/chatui.py +73 -0
  22. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/function.py +153 -0
  23. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/helpers/__init__.py +11 -0
  24. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/helpers/structured_llm.py +62 -0
  25. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/helpers/structured_tool_call_llm.py +71 -0
  26. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/helpers/terminal_llm.py +52 -0
  27. railtracks-1.1.2/src/railtracks/built_nodes/easy_usage_wrappers/helpers/tool_call_llm.py +62 -0
  28. railtracks-1.1.2/src/railtracks/context/__init__.py +9 -0
  29. railtracks-1.1.2/src/railtracks/context/central.py +387 -0
  30. railtracks-1.1.2/src/railtracks/context/external.py +99 -0
  31. railtracks-1.1.2/src/railtracks/context/internal.py +108 -0
  32. railtracks-1.1.2/src/railtracks/exceptions/__init__.py +17 -0
  33. railtracks-1.1.2/src/railtracks/exceptions/_base.py +16 -0
  34. railtracks-1.1.2/src/railtracks/exceptions/errors.py +133 -0
  35. railtracks-1.1.2/src/railtracks/exceptions/messages/exception_messages.py +69 -0
  36. railtracks-1.1.2/src/railtracks/exceptions/messages/exception_messages.yaml +94 -0
  37. railtracks-1.1.2/src/railtracks/execution/__init__.py +0 -0
  38. railtracks-1.1.2/src/railtracks/execution/coordinator.py +194 -0
  39. railtracks-1.1.2/src/railtracks/execution/execution_strategy.py +124 -0
  40. railtracks-1.1.2/src/railtracks/execution/task.py +36 -0
  41. railtracks-1.1.2/src/railtracks/integrations/__init__.py +0 -0
  42. railtracks-1.1.2/src/railtracks/interaction/__init__.py +9 -0
  43. railtracks-1.1.2/src/railtracks/interaction/_call.py +227 -0
  44. railtracks-1.1.2/src/railtracks/interaction/batch.py +62 -0
  45. railtracks-1.1.2/src/railtracks/interaction/broadcast_.py +16 -0
  46. railtracks-1.1.2/src/railtracks/llm/__init__.py +34 -0
  47. railtracks-1.1.2/src/railtracks/llm/_exception_base.py +16 -0
  48. railtracks-1.1.2/src/railtracks/llm/content.py +45 -0
  49. railtracks-1.1.2/src/railtracks/llm/history.py +21 -0
  50. railtracks-1.1.2/src/railtracks/llm/message.py +154 -0
  51. railtracks-1.1.2/src/railtracks/llm/model.py +260 -0
  52. railtracks-1.1.2/src/railtracks/llm/models/__init__.py +5 -0
  53. railtracks-1.1.2/src/railtracks/llm/models/_litellm_wrapper.py +514 -0
  54. railtracks-1.1.2/src/railtracks/llm/models/_model_exception_base.py +67 -0
  55. railtracks-1.1.2/src/railtracks/llm/models/api_providers/__init__.py +6 -0
  56. railtracks-1.1.2/src/railtracks/llm/models/api_providers/_provider_wrapper.py +65 -0
  57. railtracks-1.1.2/src/railtracks/llm/models/api_providers/anthropic.py +7 -0
  58. railtracks-1.1.2/src/railtracks/llm/models/api_providers/gemini.py +11 -0
  59. railtracks-1.1.2/src/railtracks/llm/models/api_providers/huggingface.py +34 -0
  60. railtracks-1.1.2/src/railtracks/llm/models/api_providers/openai.py +11 -0
  61. railtracks-1.1.2/src/railtracks/llm/models/cloud/__init__.py +3 -0
  62. railtracks-1.1.2/src/railtracks/llm/models/cloud/azureai.py +78 -0
  63. railtracks-1.1.2/src/railtracks/llm/models/local/__init__.py +3 -0
  64. railtracks-1.1.2/src/railtracks/llm/models/local/ollama.py +101 -0
  65. railtracks-1.1.2/src/railtracks/llm/response.py +122 -0
  66. railtracks-1.1.2/src/railtracks/llm/tools/__init__.py +17 -0
  67. railtracks-1.1.2/src/railtracks/llm/tools/docstring_parser.py +144 -0
  68. railtracks-1.1.2/src/railtracks/llm/tools/parameter.py +204 -0
  69. railtracks-1.1.2/src/railtracks/llm/tools/parameter_handlers.py +231 -0
  70. railtracks-1.1.2/src/railtracks/llm/tools/schema_parser.py +383 -0
  71. railtracks-1.1.2/src/railtracks/llm/tools/tool.py +231 -0
  72. railtracks-1.1.2/src/railtracks/llm/type_mapping.py +152 -0
  73. railtracks-1.1.2/src/railtracks/nodes/__init__.py +0 -0
  74. railtracks-1.1.2/src/railtracks/nodes/manifest.py +23 -0
  75. railtracks-1.1.2/src/railtracks/nodes/nodes.py +166 -0
  76. railtracks-1.1.2/src/railtracks/nodes/tool_callable.py +27 -0
  77. railtracks-1.1.2/src/railtracks/nodes/utils.py +64 -0
  78. railtracks-1.1.2/src/railtracks/prebuilt/__init__.py +5 -0
  79. railtracks-1.1.2/src/railtracks/prebuilt/rag_node.py +47 -0
  80. railtracks-1.1.2/src/railtracks/prompts/__init__.py +0 -0
  81. railtracks-1.1.2/src/railtracks/prompts/prompt.py +32 -0
  82. railtracks-1.1.2/src/railtracks/pubsub/__init__.py +28 -0
  83. railtracks-1.1.2/src/railtracks/pubsub/_subscriber.py +20 -0
  84. railtracks-1.1.2/src/railtracks/pubsub/messages.py +186 -0
  85. railtracks-1.1.2/src/railtracks/pubsub/publisher.py +30 -0
  86. railtracks-1.1.2/src/railtracks/pubsub/utils.py +27 -0
  87. railtracks-1.1.2/src/railtracks/rag/__init__.py +6 -0
  88. railtracks-1.1.2/src/railtracks/rag/chunking_service.py +160 -0
  89. railtracks-1.1.2/src/railtracks/rag/embedding_service.py +133 -0
  90. railtracks-1.1.2/src/railtracks/rag/rag_core.py +157 -0
  91. railtracks-1.1.2/src/railtracks/rag/text_object.py +94 -0
  92. railtracks-1.1.2/src/railtracks/rag/utils.py +179 -0
  93. railtracks-1.1.2/src/railtracks/rag/vector_store/__init__.py +13 -0
  94. railtracks-1.1.2/src/railtracks/rag/vector_store/base.py +223 -0
  95. railtracks-1.1.2/src/railtracks/rag/vector_store/factory.py +32 -0
  96. railtracks-1.1.2/src/railtracks/rag/vector_store/in_memory.py +371 -0
  97. railtracks-1.1.2/src/railtracks/rag/vector_store/utils.py +41 -0
  98. railtracks-1.1.2/src/railtracks/rt_mcp/__init__.py +10 -0
  99. railtracks-1.1.2/src/railtracks/rt_mcp/jupyter_compat.py +193 -0
  100. railtracks-1.1.2/src/railtracks/rt_mcp/main.py +247 -0
  101. railtracks-1.1.2/src/railtracks/rt_mcp/mcp_tool.py +24 -0
  102. railtracks-1.1.2/src/railtracks/rt_mcp/node_to_mcp.py +127 -0
  103. railtracks-1.1.2/src/railtracks/state/__init__.py +0 -0
  104. railtracks-1.1.2/src/railtracks/state/forest.py +202 -0
  105. railtracks-1.1.2/src/railtracks/state/info.py +215 -0
  106. railtracks-1.1.2/src/railtracks/state/node.py +121 -0
  107. railtracks-1.1.2/src/railtracks/state/request.py +439 -0
  108. railtracks-1.1.2/src/railtracks/state/serialize.py +182 -0
  109. railtracks-1.1.2/src/railtracks/state/state.py +453 -0
  110. railtracks-1.1.2/src/railtracks/state/utils.py +48 -0
  111. railtracks-1.1.2/src/railtracks/utils/__init__.py +0 -0
  112. railtracks-1.1.2/src/railtracks/utils/config.py +83 -0
  113. railtracks-1.1.2/src/railtracks/utils/logging/__init__.py +5 -0
  114. railtracks-1.1.2/src/railtracks/utils/logging/action.py +93 -0
  115. railtracks-1.1.2/src/railtracks/utils/logging/config.py +202 -0
  116. railtracks-1.1.2/src/railtracks/utils/logging/create.py +20 -0
  117. railtracks-1.1.2/src/railtracks/utils/profiling.py +116 -0
  118. railtracks-1.1.2/src/railtracks/utils/prompt_injection.py +51 -0
  119. railtracks-1.1.2/src/railtracks/utils/publisher.py +231 -0
  120. railtracks-1.1.2/src/railtracks/utils/serialization/__init__.py +1 -0
  121. railtracks-1.1.2/src/railtracks/utils/serialization/graph.py +82 -0
  122. railtracks-1.1.2/src/railtracks/utils/visuals/browser/chat.css +678 -0
  123. railtracks-1.1.2/src/railtracks/utils/visuals/browser/chat.html +64 -0
  124. railtracks-1.1.2/src/railtracks/utils/visuals/browser/chat.js +400 -0
  125. railtracks-1.1.2/src/railtracks/utils/visuals/browser/chat_ui.py +237 -0
  126. railtracks-1.1.2/src/railtracks/validation/__init__.py +0 -0
  127. railtracks-1.1.2/src/railtracks/validation/node_creation/validation.py +420 -0
  128. railtracks-1.1.2/src/railtracks/validation/node_invocation/validation.py +57 -0
  129. railtracks-1.1.2/tests/__init__.py +0 -0
  130. railtracks-1.1.2/tests/conftest.py +138 -0
  131. railtracks-1.1.2/tests/end_to_end/__init__.py +0 -0
  132. railtracks-1.1.2/tests/end_to_end/tools/__init__.py +0 -0
  133. railtracks-1.1.2/tests/end_to_end/tools/conftest.py +49 -0
  134. railtracks-1.1.2/tests/end_to_end/tools/extra_cases_for_later.json +447 -0
  135. railtracks-1.1.2/tests/end_to_end/tools/test_parameter_conversion.py +46 -0
  136. railtracks-1.1.2/tests/end_to_end/tools/test_schemas_for_tools.json +1174 -0
  137. railtracks-1.1.2/tests/integration_tests/__init__.py +0 -0
  138. railtracks-1.1.2/tests/integration_tests/conftest.py +152 -0
  139. railtracks-1.1.2/tests/integration_tests/context/__init__.py +0 -0
  140. railtracks-1.1.2/tests/integration_tests/context/test_external.py +130 -0
  141. railtracks-1.1.2/tests/integration_tests/context/test_internal.py +120 -0
  142. railtracks-1.1.2/tests/integration_tests/interaction/conftest.py +277 -0
  143. railtracks-1.1.2/tests/integration_tests/interaction/test_batch.py +124 -0
  144. railtracks-1.1.2/tests/integration_tests/interaction/test_call.py +517 -0
  145. railtracks-1.1.2/tests/integration_tests/library/__init__.py +0 -0
  146. railtracks-1.1.2/tests/integration_tests/library/conftest.py +75 -0
  147. railtracks-1.1.2/tests/integration_tests/library/test_basic_llms.py +52 -0
  148. railtracks-1.1.2/tests/integration_tests/library/test_function.py +508 -0
  149. railtracks-1.1.2/tests/integration_tests/library/test_tool_calling_llms.py +186 -0
  150. railtracks-1.1.2/tests/integration_tests/library/test_tool_manifestation.py +166 -0
  151. railtracks-1.1.2/tests/integration_tests/rag/test_rag_examples_integration.py +194 -0
  152. railtracks-1.1.2/tests/integration_tests/rt_mcp/__init__.py +0 -0
  153. railtracks-1.1.2/tests/integration_tests/rt_mcp/test_mcp.py +95 -0
  154. railtracks-1.1.2/tests/integration_tests/rt_mcp/test_node_to_mcp.py +93 -0
  155. railtracks-1.1.2/tests/integration_tests/run/.covailence/363d501f-c9a9-4bdb-940a-8c264f520e69.json +1 -0
  156. railtracks-1.1.2/tests/integration_tests/run/.covailence/75b7a1e9-8896-4c94-910a-b5b1b525cf5a.json +1 -0
  157. railtracks-1.1.2/tests/integration_tests/run/.covailence/a319b94e-07bc-4007-af58-9167fb3094d0.json +1 -0
  158. railtracks-1.1.2/tests/integration_tests/run/.covailence/fbefdbb9-6151-405f-a778-e36917033d05.json +1 -0
  159. railtracks-1.1.2/tests/integration_tests/run/__init__.py +0 -0
  160. railtracks-1.1.2/tests/integration_tests/run/test_broadcast.py +119 -0
  161. railtracks-1.1.2/tests/integration_tests/run/test_error_handler.py +146 -0
  162. railtracks-1.1.2/tests/integration_tests/run/test_exterior_call.py +218 -0
  163. railtracks-1.1.2/tests/integration_tests/run/test_multiple_runners.py +56 -0
  164. railtracks-1.1.2/tests/integration_tests/run/test_parallelization.py +56 -0
  165. railtracks-1.1.2/tests/integration_tests/state_schema.json +368 -0
  166. railtracks-1.1.2/tests/integration_tests/test_session.py +166 -0
  167. railtracks-1.1.2/tests/integration_tests/test_state.py +163 -0
  168. railtracks-1.1.2/tests/integration_tests/validation/test_duplicate_warnings.py +65 -0
  169. railtracks-1.1.2/tests/llm_live_tests/__init__.py +0 -0
  170. railtracks-1.1.2/tests/llm_live_tests/llm_map.py +8 -0
  171. railtracks-1.1.2/tests/llm_live_tests/rag/conftest.py +11 -0
  172. railtracks-1.1.2/tests/llm_live_tests/rag/test_rag_core_intergration.py +49 -0
  173. railtracks-1.1.2/tests/llm_live_tests/rag/test_rag_node_intergration.py +43 -0
  174. railtracks-1.1.2/tests/llm_live_tests/test_basic.py +86 -0
  175. railtracks-1.1.2/tests/llm_live_tests/test_rt_mcp.py +66 -0
  176. railtracks-1.1.2/tests/llm_live_tests/test_tool_calling.py +155 -0
  177. railtracks-1.1.2/tests/unit_tests/__init__.py +0 -0
  178. railtracks-1.1.2/tests/unit_tests/conftest.py +28 -0
  179. railtracks-1.1.2/tests/unit_tests/context/conftest.py +53 -0
  180. railtracks-1.1.2/tests/unit_tests/context/test_central.py +148 -0
  181. railtracks-1.1.2/tests/unit_tests/context/test_external.py +110 -0
  182. railtracks-1.1.2/tests/unit_tests/context/test_internal.py +86 -0
  183. railtracks-1.1.2/tests/unit_tests/execution/conftest.py +31 -0
  184. railtracks-1.1.2/tests/unit_tests/execution/test_coordinator.py +123 -0
  185. railtracks-1.1.2/tests/unit_tests/execution/test_execution_strategy.py +70 -0
  186. railtracks-1.1.2/tests/unit_tests/execution/test_task.py +42 -0
  187. railtracks-1.1.2/tests/unit_tests/integrations/__init__.py +0 -0
  188. railtracks-1.1.2/tests/unit_tests/interaction/__init__.py +0 -0
  189. railtracks-1.1.2/tests/unit_tests/interaction/conftest.py +79 -0
  190. railtracks-1.1.2/tests/unit_tests/interaction/test_batch.py +66 -0
  191. railtracks-1.1.2/tests/unit_tests/interaction/test_broadcast.py +26 -0
  192. railtracks-1.1.2/tests/unit_tests/interaction/test_call.py +331 -0
  193. railtracks-1.1.2/tests/unit_tests/llm/__init__.py +0 -0
  194. railtracks-1.1.2/tests/unit_tests/llm/conftest.py +37 -0
  195. railtracks-1.1.2/tests/unit_tests/llm/models/api_providers/test_anthropic.py +8 -0
  196. railtracks-1.1.2/tests/unit_tests/llm/models/api_providers/test_gemini.py +8 -0
  197. railtracks-1.1.2/tests/unit_tests/llm/models/api_providers/test_huggingface.py +9 -0
  198. railtracks-1.1.2/tests/unit_tests/llm/models/api_providers/test_openai.py +9 -0
  199. railtracks-1.1.2/tests/unit_tests/llm/models/api_providers/test_provider_llm.py +66 -0
  200. railtracks-1.1.2/tests/unit_tests/llm/models/cloud/test_azureai.py +101 -0
  201. railtracks-1.1.2/tests/unit_tests/llm/models/conftest.py +130 -0
  202. railtracks-1.1.2/tests/unit_tests/llm/models/local/test_ollama.py +143 -0
  203. railtracks-1.1.2/tests/unit_tests/llm/models/test_litellm_wrapper.py +251 -0
  204. railtracks-1.1.2/tests/unit_tests/llm/test_content.py +60 -0
  205. railtracks-1.1.2/tests/unit_tests/llm/test_history.py +38 -0
  206. railtracks-1.1.2/tests/unit_tests/llm/test_message.py +98 -0
  207. railtracks-1.1.2/tests/unit_tests/llm/test_model.py +201 -0
  208. railtracks-1.1.2/tests/unit_tests/llm/test_response.py +120 -0
  209. railtracks-1.1.2/tests/unit_tests/llm/test_type_mapping.py +110 -0
  210. railtracks-1.1.2/tests/unit_tests/llm/tools/test_docstring_parser.py +219 -0
  211. railtracks-1.1.2/tests/unit_tests/llm/tools/test_parameter.py +222 -0
  212. railtracks-1.1.2/tests/unit_tests/llm/tools/test_schema_parser.py +430 -0
  213. railtracks-1.1.2/tests/unit_tests/nodes/__init__.py +0 -0
  214. railtracks-1.1.2/tests/unit_tests/nodes/conftest.py +82 -0
  215. railtracks-1.1.2/tests/unit_tests/nodes/library/__init__.py +0 -0
  216. railtracks-1.1.2/tests/unit_tests/nodes/library/conftest.py +133 -0
  217. railtracks-1.1.2/tests/unit_tests/nodes/library/easy_usage_wrappers/__init__.py +0 -0
  218. railtracks-1.1.2/tests/unit_tests/nodes/library/easy_usage_wrappers/test_one_wrapper.py +60 -0
  219. railtracks-1.1.2/tests/unit_tests/nodes/library/test_function.py +308 -0
  220. railtracks-1.1.2/tests/unit_tests/nodes/library/test_function_manifest_validation.py +186 -0
  221. railtracks-1.1.2/tests/unit_tests/nodes/library/test_llm_base.py +153 -0
  222. railtracks-1.1.2/tests/unit_tests/nodes/library/test_prepare_tool_message_history.py +78 -0
  223. railtracks-1.1.2/tests/unit_tests/nodes/library/test_structured.py +269 -0
  224. railtracks-1.1.2/tests/unit_tests/nodes/library/test_terminal_llm.py +230 -0
  225. railtracks-1.1.2/tests/unit_tests/nodes/library/tool_calling_llms/__init__.py +0 -0
  226. railtracks-1.1.2/tests/unit_tests/nodes/library/tool_calling_llms/conftest.py +22 -0
  227. railtracks-1.1.2/tests/unit_tests/nodes/library/tool_calling_llms/test_structured_tool_call_llm.py +283 -0
  228. railtracks-1.1.2/tests/unit_tests/nodes/library/tool_calling_llms/test_tool_call_llm.py +310 -0
  229. railtracks-1.1.2/tests/unit_tests/nodes/test_manifest.py +50 -0
  230. railtracks-1.1.2/tests/unit_tests/nodes/test_node.py +151 -0
  231. railtracks-1.1.2/tests/unit_tests/nodes/test_node_builder.py +127 -0
  232. railtracks-1.1.2/tests/unit_tests/nodes/test_tool_callable.py +37 -0
  233. railtracks-1.1.2/tests/unit_tests/prompt/__init__.py +0 -0
  234. railtracks-1.1.2/tests/unit_tests/prompt/test_prompt.py +121 -0
  235. railtracks-1.1.2/tests/unit_tests/pubsub/__init__.py +0 -0
  236. railtracks-1.1.2/tests/unit_tests/pubsub/conftest.py +36 -0
  237. railtracks-1.1.2/tests/unit_tests/pubsub/test_messages.py +109 -0
  238. railtracks-1.1.2/tests/unit_tests/pubsub/test_publisher.py +26 -0
  239. railtracks-1.1.2/tests/unit_tests/rag/conftest.py +90 -0
  240. railtracks-1.1.2/tests/unit_tests/rag/test_chunking_service_unit.py +69 -0
  241. railtracks-1.1.2/tests/unit_tests/rag/test_embedding_service_unit.py +43 -0
  242. railtracks-1.1.2/tests/unit_tests/rag/test_rag_core_unit.py +212 -0
  243. railtracks-1.1.2/tests/unit_tests/rag/vector_store/test_inmemory_vectorstore_unit.py +377 -0
  244. railtracks-1.1.2/tests/unit_tests/rag/vector_store/test_utils_unit.py +52 -0
  245. railtracks-1.1.2/tests/unit_tests/rt_mcp/conftest.py +219 -0
  246. railtracks-1.1.2/tests/unit_tests/rt_mcp/test_jupyter_compat.py +81 -0
  247. railtracks-1.1.2/tests/unit_tests/rt_mcp/test_main.py +167 -0
  248. railtracks-1.1.2/tests/unit_tests/rt_mcp/test_to_node.py +110 -0
  249. railtracks-1.1.2/tests/unit_tests/state/conftest.py +223 -0
  250. railtracks-1.1.2/tests/unit_tests/state/test_forest.py +214 -0
  251. railtracks-1.1.2/tests/unit_tests/state/test_info.py +147 -0
  252. railtracks-1.1.2/tests/unit_tests/state/test_node.py +116 -0
  253. railtracks-1.1.2/tests/unit_tests/state/test_request.py +254 -0
  254. railtracks-1.1.2/tests/unit_tests/state/test_state.py +166 -0
  255. railtracks-1.1.2/tests/unit_tests/state/test_utils.py +78 -0
  256. railtracks-1.1.2/tests/unit_tests/test_exceptions.py +111 -0
  257. railtracks-1.1.2/tests/unit_tests/test_session.py +365 -0
  258. railtracks-1.1.2/tests/unit_tests/utils/conftest.py +52 -0
  259. railtracks-1.1.2/tests/unit_tests/utils/logging/test_action.py +38 -0
  260. railtracks-1.1.2/tests/unit_tests/utils/logging/test_create.py +12 -0
  261. railtracks-1.1.2/tests/unit_tests/utils/serialization/__init__.py +0 -0
  262. railtracks-1.1.2/tests/unit_tests/utils/serialization/conftest.py +61 -0
  263. railtracks-1.1.2/tests/unit_tests/utils/serialization/test_graph.py +153 -0
  264. railtracks-1.1.2/tests/unit_tests/utils/serialization/test_serialize.py +64 -0
  265. railtracks-1.1.2/tests/unit_tests/utils/test_config.py +152 -0
  266. railtracks-1.1.2/tests/unit_tests/utils/test_profiling.py +258 -0
  267. railtracks-1.1.2/tests/unit_tests/utils/test_prompt_injection.py +88 -0
  268. railtracks-1.1.2/tests/unit_tests/utils/test_publisher.py +623 -0
  269. railtracks-1.1.2/tests/unit_tests/utils/visuals/browser/test_chat_ui.py +352 -0
File without changes
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: railtracks
3
+ Version: 1.1.2
4
+ Summary: Railtown AI RailTracks Framework for building resilient agentic systems
5
+ Author-email: Logan Underwood <logan@railtown.ai>, Levi Varsanyi <levi@railtown.ai>, Jaime Bueza <jaime@railtown.ai>, Amir Refaee <amir@railtown.ai>, Aryan Ballani <aryan@railtown.ai>, Tristan Brown <tristan@railtown.ai>
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: colorama >= 0.4.6
9
+ Requires-Dist: litellm[proxy] >= 1.70.2
10
+ Requires-Dist: mcp >= 1.9.0
11
+ Requires-Dist: openai < 1.100.0
12
+ Requires-Dist: pydantic >= 2.5.3, <3
13
+ Requires-Dist: python-dotenv >= 1.0.0
14
+ Requires-Dist: PyYAML >= 6.0
15
+ Requires-Dist: railtracks[chat, rag, integrations] ; extra == "all"
16
+ Requires-Dist: fastapi >= 0.104.0 ; extra == "chat"
17
+ Requires-Dist: railtracks[chat] ; extra == "core"
18
+ Requires-Dist: litellm[proxy] >= 1.70.2 ; extra == "rag"
19
+ Requires-Dist: openai < 1.100.0 ; extra == "rag"
20
+ Project-URL: railtown, https://railtown.ai
21
+ Project-URL: railtracks, https://railtracks.org
22
+ Project-URL: repository, https://github.com/RailtownAI/railtracks
23
+ Project-URL: ui-repository, https://github.com/RailtownAI/railtracks-visualizer
24
+ Provides-Extra: all
25
+ Provides-Extra: chat
26
+ Provides-Extra: core
27
+ Provides-Extra: integrations
28
+ Provides-Extra: rag
29
+
30
+ # RailTracks
31
+
32
+ ## Overview
33
+
34
+ **RailTracks** is a lightweight framework for building agentic systems; modular, intelligent agents that can be composed to solve complex tasks more effectively than any single module could.
35
+
36
+ The framework supports the entire lifecycle of agentic development: building, testing, debugging, and deploying. Its core principle is modularity, your systems are constructed from reusable, modular components.
37
+
38
+ ---
39
+
40
+ ## Why RailTracks?
41
+
42
+ Many frameworks for building LLM-powered applications focus on pipelines, chains, or prompt orchestration. While effective for simple use cases, they quickly become brittle or overly complex when handling asynchronous tasks, multi-step reasoning, and heterogeneous agents.
43
+
44
+ **RailTracks was designed from the ground up with the developer in mind to support real-world agentic systems**, with an emphasis on:
45
+
46
+ * **Programmatic structure without rigidity** – Unlike declarative workflows (e.g., LangChain), RailTracks encourages clean Pythonic control flow.
47
+ * **Agent-first abstraction** – Inspired by real-world coordination, RailTracks focuses on defining smart agents that collaborate via tools—not just chaining LLM calls.
48
+ * **Automatic Parallelism** – All executions are automatically parallelized where possible, freeing you from managing threading or async manually.
49
+ * **Transparent Execution** – Includes integrated logging, history tracing, and built-in visualizations to show exactly how your system behaves.
50
+ * **Minimal API** – The small configurable API makes life a breeze compared to other tools. No magic.
51
+ * **Visual Insights** – Graph-based visualizations help you understand data flow and agent interactions at a glance.
52
+ * **Pluggable Models** – Use any LLM provider: OpenAI, open-weight models, or your own local inference engine.
53
+
54
+ Where frameworks like LangGraph emphasize pipelines, RailTracks aims to be the developer-friendly sweet spot: powerful enough for complex systems, but simple enough to understand, extend, and debug.
55
+
56
+ ---
57
+
58
+ ## Quick Start
59
+
60
+ Build your first agentic system in just a few steps.
61
+
62
+ ### Step 1: Install the Library
63
+
64
+ ```bash
65
+ # Core library
66
+ pip install railtracks
67
+
68
+ # [Optional] CLI support for development and visualization
69
+ pip install railtracks-cli
70
+ ```
71
+
72
+ ### Step 2: Define Your Modular Components
73
+
74
+ ```python
75
+ import railtracks as rt
76
+
77
+ def number_of_chars(text: str) -> int:
78
+ return len(text)
79
+
80
+ def number_of_words(text: str) -> int:
81
+ return len(text.split())
82
+
83
+ def number_of_characters(text: str, character_of_interest: str) -> int:
84
+ return text.count(character_of_interest)
85
+
86
+ TotalNumberChars = rt.function_node(number_of_chars)
87
+ TotalNumberWords = rt.function_node(number_of_words)
88
+ CharacterCount = rt.function_node(number_of_characters)
89
+
90
+ TextAnalyzer = rt.agent_node(
91
+ tool_nodes={TotalNumberChars, TotalNumberWords, CharacterCount},
92
+ llm=rt.llm.OpenAILLM("gpt-4o"),
93
+ system_message=(
94
+ "You are a text analyzer. You will be given a text and return the number of characters, "
95
+ "the number of words, and the number of occurrences of a specific character."
96
+ ),
97
+ )
98
+ ```
99
+
100
+ ### Step 3: Run Your Application
101
+
102
+ ```python
103
+ import railtracks as rt
104
+
105
+ result = rt.call(
106
+ TextAnalyzer,
107
+ rt.llm.MessageHistory([
108
+ rt.llm.UserMessage("Hello world! This is a test of the RailTracks framework.")
109
+ ])
110
+ )
111
+ print(result)
112
+ ```
113
+
114
+ ### Step 4: \[Optional] Visualize the Run
115
+
116
+ ```bash
117
+ railtracks init
118
+ railtracks viz
119
+ ```
120
+
121
+ > *(Insert example visualization image here)*
122
+
123
+ And just like that, you're up and running. The possibilities are endless.
124
+
125
+ ---
126
+
127
+ ## Contributing
128
+
129
+ We welcome contributions of all kinds! Check out our [contributing guide](./CONTRIBUTING.md) to get started.
@@ -0,0 +1,100 @@
1
+ # RailTracks
2
+
3
+ ## Overview
4
+
5
+ **RailTracks** is a lightweight framework for building agentic systems; modular, intelligent agents that can be composed to solve complex tasks more effectively than any single module could.
6
+
7
+ The framework supports the entire lifecycle of agentic development: building, testing, debugging, and deploying. Its core principle is modularity, your systems are constructed from reusable, modular components.
8
+
9
+ ---
10
+
11
+ ## Why RailTracks?
12
+
13
+ Many frameworks for building LLM-powered applications focus on pipelines, chains, or prompt orchestration. While effective for simple use cases, they quickly become brittle or overly complex when handling asynchronous tasks, multi-step reasoning, and heterogeneous agents.
14
+
15
+ **RailTracks was designed from the ground up with the developer in mind to support real-world agentic systems**, with an emphasis on:
16
+
17
+ * **Programmatic structure without rigidity** – Unlike declarative workflows (e.g., LangChain), RailTracks encourages clean Pythonic control flow.
18
+ * **Agent-first abstraction** – Inspired by real-world coordination, RailTracks focuses on defining smart agents that collaborate via tools—not just chaining LLM calls.
19
+ * **Automatic Parallelism** – All executions are automatically parallelized where possible, freeing you from managing threading or async manually.
20
+ * **Transparent Execution** – Includes integrated logging, history tracing, and built-in visualizations to show exactly how your system behaves.
21
+ * **Minimal API** – The small configurable API makes life a breeze compared to other tools. No magic.
22
+ * **Visual Insights** – Graph-based visualizations help you understand data flow and agent interactions at a glance.
23
+ * **Pluggable Models** – Use any LLM provider: OpenAI, open-weight models, or your own local inference engine.
24
+
25
+ Where frameworks like LangGraph emphasize pipelines, RailTracks aims to be the developer-friendly sweet spot: powerful enough for complex systems, but simple enough to understand, extend, and debug.
26
+
27
+ ---
28
+
29
+ ## Quick Start
30
+
31
+ Build your first agentic system in just a few steps.
32
+
33
+ ### Step 1: Install the Library
34
+
35
+ ```bash
36
+ # Core library
37
+ pip install railtracks
38
+
39
+ # [Optional] CLI support for development and visualization
40
+ pip install railtracks-cli
41
+ ```
42
+
43
+ ### Step 2: Define Your Modular Components
44
+
45
+ ```python
46
+ import railtracks as rt
47
+
48
+ def number_of_chars(text: str) -> int:
49
+ return len(text)
50
+
51
+ def number_of_words(text: str) -> int:
52
+ return len(text.split())
53
+
54
+ def number_of_characters(text: str, character_of_interest: str) -> int:
55
+ return text.count(character_of_interest)
56
+
57
+ TotalNumberChars = rt.function_node(number_of_chars)
58
+ TotalNumberWords = rt.function_node(number_of_words)
59
+ CharacterCount = rt.function_node(number_of_characters)
60
+
61
+ TextAnalyzer = rt.agent_node(
62
+ tool_nodes={TotalNumberChars, TotalNumberWords, CharacterCount},
63
+ llm=rt.llm.OpenAILLM("gpt-4o"),
64
+ system_message=(
65
+ "You are a text analyzer. You will be given a text and return the number of characters, "
66
+ "the number of words, and the number of occurrences of a specific character."
67
+ ),
68
+ )
69
+ ```
70
+
71
+ ### Step 3: Run Your Application
72
+
73
+ ```python
74
+ import railtracks as rt
75
+
76
+ result = rt.call(
77
+ TextAnalyzer,
78
+ rt.llm.MessageHistory([
79
+ rt.llm.UserMessage("Hello world! This is a test of the RailTracks framework.")
80
+ ])
81
+ )
82
+ print(result)
83
+ ```
84
+
85
+ ### Step 4: \[Optional] Visualize the Run
86
+
87
+ ```bash
88
+ railtracks init
89
+ railtracks viz
90
+ ```
91
+
92
+ > *(Insert example visualization image here)*
93
+
94
+ And just like that, you're up and running. The possibilities are endless.
95
+
96
+ ---
97
+
98
+ ## Contributing
99
+
100
+ We welcome contributions of all kinds! Check out our [contributing guide](./CONTRIBUTING.md) to get started.
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["flit_core >=3.2,<4"]
3
+ build-backend = "flit_core.buildapi"
4
+
5
+ [project]
6
+ name = "railtracks"
7
+ authors = [
8
+ { name = "Logan Underwood", email = "logan@railtown.ai" },
9
+ { name = "Levi Varsanyi", email = "levi@railtown.ai" },
10
+ { name = "Jaime Bueza", email = "jaime@railtown.ai" },
11
+ { name = "Amir Refaee", email = "amir@railtown.ai" },
12
+ { name = "Aryan Ballani", email = "aryan@railtown.ai" },
13
+ { name = "Tristan Brown", email = "tristan@railtown.ai" }
14
+ ]
15
+ readme = "README.md"
16
+ license = { file = "LICENSE" }
17
+ dynamic = ["version", "description"]
18
+ dependencies = [
19
+ "colorama >= 0.4.6",
20
+ "litellm[proxy] >= 1.70.2",
21
+ "mcp >= 1.9.0",
22
+ "openai < 1.100.0",
23
+ "pydantic >= 2.5.3, <3",
24
+ "python-dotenv >= 1.0.0",
25
+ "PyYAML >= 6.0"
26
+ ]
27
+
28
+ [project.optional-dependencies]
29
+ chat = [
30
+ "fastapi >= 0.104.0"
31
+ ]
32
+ # For each Integration package depenedcies go here.
33
+ rag = [
34
+ "litellm[proxy] >= 1.70.2",
35
+ "openai < 1.100.0"
36
+ ]
37
+ # the integrations submodule will be list a of the above deps
38
+ integrations = [
39
+ # currently empty
40
+ ]
41
+ all = [
42
+ "railtracks[chat,rag,integrations]"
43
+ ]
44
+
45
+ core = [
46
+ "railtracks[chat]"
47
+ ]
48
+
49
+ [project.urls]
50
+ railtracks = "https://railtracks.org"
51
+ repository = "https://github.com/RailtownAI/railtracks"
52
+ ui-repository = "https://github.com/RailtownAI/railtracks-visualizer"
53
+ railtown = "https://railtown.ai"
54
+
55
+ [tool.flit.module]
56
+ name = "railtracks"
57
+
58
+ [tool.pytest.ini_options]
59
+ asyncio_mode = "auto"
@@ -0,0 +1,50 @@
1
+ # -------------------------------------------------------------
2
+ # Copyright (c) Railtown AI. All rights reserved.
3
+ # Licensed under the MIT License. See LICENSE in project root for information.
4
+ # -------------------------------------------------------------
5
+ """Railtown AI RailTracks Framework for building resilient agentic systems"""
6
+
7
+ from __future__ import annotations
8
+
9
+ from dotenv import load_dotenv
10
+
11
+ __all__ = [
12
+ "Session",
13
+ "session",
14
+ "call",
15
+ "broadcast",
16
+ "call_batch",
17
+ "ExecutionInfo",
18
+ "ExecutorConfig",
19
+ "llm",
20
+ "context",
21
+ "set_config",
22
+ "context",
23
+ "function_node",
24
+ "agent_node",
25
+ "integrations",
26
+ "prebuilt",
27
+ "MCPStdioParams",
28
+ "MCPHttpParams",
29
+ "connect_mcp",
30
+ "create_mcp_server",
31
+ "ToolManifest",
32
+ ]
33
+
34
+
35
+ from railtracks.built_nodes.easy_usage_wrappers import (
36
+ agent_node,
37
+ function_node,
38
+ )
39
+
40
+ from . import context, integrations, llm, prebuilt
41
+ from ._session import ExecutionInfo, Session, session
42
+ from .context.central import set_config
43
+ from .interaction import broadcast, call, call_batch
44
+ from .nodes.manifest import ToolManifest
45
+ from .rt_mcp import MCPHttpParams, MCPStdioParams, connect_mcp, create_mcp_server
46
+ from .utils.config import ExecutorConfig
47
+
48
+ load_dotenv()
49
+ # Only change the MAJOR.MINOR if you need to. Do not change the PATCH. (vMAJOR.MINOR.PATCH).
50
+ __version__ = "1.1.2"