flowcept 0.9.3__tar.gz → 0.9.5__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 (206) hide show
  1. {flowcept-0.9.3 → flowcept-0.9.5}/PKG-INFO +4 -1
  2. {flowcept-0.9.3 → flowcept-0.9.5}/docs/api-reference.rst +52 -24
  3. {flowcept-0.9.3 → flowcept-0.9.5}/docs/architecture.rst +1 -1
  4. {flowcept-0.9.3 → flowcept-0.9.5}/docs/prov_capture.rst +5 -3
  5. {flowcept-0.9.3 → flowcept-0.9.5}/docs/prov_storage.rst +6 -0
  6. {flowcept-0.9.3 → flowcept-0.9.5}/pyproject.toml +1 -1
  7. {flowcept-0.9.3 → flowcept-0.9.5}/resources/sample_settings.yaml +1 -1
  8. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/flowcept_ctx_manager.py +2 -0
  9. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/prompts/general_prompts.py +3 -2
  10. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/prompts/in_memory_query_prompts.py +10 -1
  11. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/tools/general_tools.py +15 -0
  12. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/tools/in_memory_queries/in_memory_queries_tools.py +6 -5
  13. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/tools/in_memory_queries/pandas_agent_utils.py +1 -1
  14. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_api/flowcept_controller.py +1 -1
  15. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/instrumentation/flowcept_loop.py +91 -20
  16. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/version.py +1 -1
  17. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/checks.yml +0 -0
  18. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/create-release-n-publish.yml +0 -0
  19. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run-llm-tests.yml +0 -0
  20. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run-tests-all-dbs.yml +0 -0
  21. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run-tests-in-container.yml +0 -0
  22. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run-tests-kafka.yml +0 -0
  23. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run-tests-py313.yml +0 -0
  24. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run-tests-simple.yml +0 -0
  25. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run-tests.yml +0 -0
  26. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/run_examples.sh +0 -0
  27. {flowcept-0.9.3 → flowcept-0.9.5}/.github/workflows/version_bumper.py +0 -0
  28. {flowcept-0.9.3 → flowcept-0.9.5}/.gitignore +0 -0
  29. {flowcept-0.9.3 → flowcept-0.9.5}/.readthedocs.yaml +0 -0
  30. {flowcept-0.9.3 → flowcept-0.9.5}/CONTRIBUTING.md +0 -0
  31. {flowcept-0.9.3 → flowcept-0.9.5}/LICENSE +0 -0
  32. {flowcept-0.9.3 → flowcept-0.9.5}/Makefile +0 -0
  33. {flowcept-0.9.3 → flowcept-0.9.5}/README.md +0 -0
  34. {flowcept-0.9.3 → flowcept-0.9.5}/deployment/Dockerfile +0 -0
  35. {flowcept-0.9.3 → flowcept-0.9.5}/deployment/compose-grafana.yml +0 -0
  36. {flowcept-0.9.3 → flowcept-0.9.5}/deployment/compose-kafka.yml +0 -0
  37. {flowcept-0.9.3 → flowcept-0.9.5}/deployment/compose-mofka.yml +0 -0
  38. {flowcept-0.9.3 → flowcept-0.9.5}/deployment/compose-mongo.yml +0 -0
  39. {flowcept-0.9.3 → flowcept-0.9.5}/deployment/compose.yml +0 -0
  40. {flowcept-0.9.3 → flowcept-0.9.5}/docs/cli-reference.rst +0 -0
  41. {flowcept-0.9.3 → flowcept-0.9.5}/docs/conf.py +0 -0
  42. {flowcept-0.9.3 → flowcept-0.9.5}/docs/contributing.rst +0 -0
  43. {flowcept-0.9.3 → flowcept-0.9.5}/docs/img/architecture-diagram.png +0 -0
  44. {flowcept-0.9.3 → flowcept-0.9.5}/docs/img/flowcept-logo-dark.png +0 -0
  45. {flowcept-0.9.3 → flowcept-0.9.5}/docs/img/flowcept-logo.png +0 -0
  46. {flowcept-0.9.3 → flowcept-0.9.5}/docs/index.rst +0 -0
  47. {flowcept-0.9.3 → flowcept-0.9.5}/docs/quick_start.rst +0 -0
  48. {flowcept-0.9.3 → flowcept-0.9.5}/docs/schemas.rst +0 -0
  49. {flowcept-0.9.3 → flowcept-0.9.5}/docs/setup.rst +0 -0
  50. {flowcept-0.9.3 → flowcept-0.9.5}/docs/task_schema.rst +0 -0
  51. {flowcept-0.9.3 → flowcept-0.9.5}/docs/telemetry_capture.rst +0 -0
  52. {flowcept-0.9.3 → flowcept-0.9.5}/docs/workflow_schema.rst +0 -0
  53. {flowcept-0.9.3 → flowcept-0.9.5}/examples/agents/a2a/README.md +0 -0
  54. {flowcept-0.9.3 → flowcept-0.9.5}/examples/agents/a2a/agent1.py +0 -0
  55. {flowcept-0.9.3 → flowcept-0.9.5}/examples/agents/a2a/agent2.py +0 -0
  56. {flowcept-0.9.3 → flowcept-0.9.5}/examples/agents/aec_agent_context_manager.py +0 -0
  57. {flowcept-0.9.3 → flowcept-0.9.5}/examples/agents/aec_agent_mock.py +0 -0
  58. {flowcept-0.9.3 → flowcept-0.9.5}/examples/agents/aec_prompts.py +0 -0
  59. {flowcept-0.9.3 → flowcept-0.9.5}/examples/agents/opt_driver_mock.py +0 -0
  60. {flowcept-0.9.3 → flowcept-0.9.5}/examples/consumers/ping_pong_example.py +0 -0
  61. {flowcept-0.9.3 → flowcept-0.9.5}/examples/consumers/simple_consumer.py +0 -0
  62. {flowcept-0.9.3 → flowcept-0.9.5}/examples/consumers/simple_publisher.py +0 -0
  63. {flowcept-0.9.3 → flowcept-0.9.5}/examples/convergence_loop_example.py +0 -0
  64. {flowcept-0.9.3 → flowcept-0.9.5}/examples/dask_example.py +0 -0
  65. {flowcept-0.9.3 → flowcept-0.9.5}/examples/distributed_consumer_example.py +0 -0
  66. {flowcept-0.9.3 → flowcept-0.9.5}/examples/instrumented_loop_example.py +0 -0
  67. {flowcept-0.9.3 → flowcept-0.9.5}/examples/instrumented_simple_example.py +0 -0
  68. {flowcept-0.9.3 → flowcept-0.9.5}/examples/llm_complex/README.md +0 -0
  69. {flowcept-0.9.3 → flowcept-0.9.5}/examples/llm_complex/custom_provenance_id_mapping.yaml +0 -0
  70. {flowcept-0.9.3 → flowcept-0.9.5}/examples/llm_complex/llm_dataprep.py +0 -0
  71. {flowcept-0.9.3 → flowcept-0.9.5}/examples/llm_complex/llm_main_example.py +0 -0
  72. {flowcept-0.9.3 → flowcept-0.9.5}/examples/llm_complex/llm_model.py +0 -0
  73. {flowcept-0.9.3 → flowcept-0.9.5}/examples/llm_complex/llm_test_runner.py +0 -0
  74. {flowcept-0.9.3 → flowcept-0.9.5}/examples/mlflow_example.py +0 -0
  75. {flowcept-0.9.3 → flowcept-0.9.5}/examples/mqtt_example.py +0 -0
  76. {flowcept-0.9.3 → flowcept-0.9.5}/examples/single_layer_perceptron_example.py +0 -0
  77. {flowcept-0.9.3 → flowcept-0.9.5}/examples/start_here.py +0 -0
  78. {flowcept-0.9.3 → flowcept-0.9.5}/examples/tensorboard_example.py +0 -0
  79. {flowcept-0.9.3 → flowcept-0.9.5}/examples/unmanaged/main.py +0 -0
  80. {flowcept-0.9.3 → flowcept-0.9.5}/examples/unmanaged/simple_task.py +0 -0
  81. {flowcept-0.9.3 → flowcept-0.9.5}/notebooks/analytics.ipynb +0 -0
  82. {flowcept-0.9.3 → flowcept-0.9.5}/notebooks/dask.ipynb +0 -0
  83. {flowcept-0.9.3 → flowcept-0.9.5}/notebooks/dask_from_CLI.ipynb +0 -0
  84. {flowcept-0.9.3 → flowcept-0.9.5}/notebooks/mlflow.ipynb +0 -0
  85. {flowcept-0.9.3 → flowcept-0.9.5}/notebooks/reset_dask_nb_exec_counts.py +0 -0
  86. {flowcept-0.9.3 → flowcept-0.9.5}/notebooks/tensorboard.ipynb +0 -0
  87. {flowcept-0.9.3 → flowcept-0.9.5}/resources/mofka/bedrock_setup.sh +0 -0
  88. {flowcept-0.9.3 → flowcept-0.9.5}/resources/mofka/consumer.py +0 -0
  89. {flowcept-0.9.3 → flowcept-0.9.5}/resources/mofka/mofka-requirements.yaml +0 -0
  90. {flowcept-0.9.3 → flowcept-0.9.5}/resources/mofka/mofka_config.json +0 -0
  91. {flowcept-0.9.3 → flowcept-0.9.5}/resources/simple_redis_consumer.py +0 -0
  92. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/__init__.py +0 -0
  93. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/__init__.py +0 -0
  94. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/agent_client.py +0 -0
  95. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/agents_utils.py +0 -0
  96. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/dynamic_schema_tracker.py +0 -0
  97. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/flowcept_agent.py +0 -0
  98. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/gui/__init__.py +0 -0
  99. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/gui/agent_gui.py +0 -0
  100. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/gui/gui_utils.py +0 -0
  101. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/llms/__init__.py +0 -0
  102. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/llms/claude_gcp.py +0 -0
  103. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/llms/gemini25.py +0 -0
  104. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/prompts/__init__.py +0 -0
  105. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/tools/__init__.py +0 -0
  106. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/agents/tools/in_memory_queries/__init__.py +0 -0
  107. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/analytics/__init__.py +0 -0
  108. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/analytics/analytics_utils.py +0 -0
  109. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/analytics/data_augmentation.py +0 -0
  110. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/analytics/plot.py +0 -0
  111. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/cli.py +0 -0
  112. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/__init__.py +0 -0
  113. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/autoflush_buffer.py +0 -0
  114. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/__init__.py +0 -0
  115. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/docdb_dao/__init__.py +0 -0
  116. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py +0 -0
  117. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/docdb_dao/lmdb_dao.py +0 -0
  118. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/docdb_dao/mongodb_dao.py +0 -0
  119. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/keyvalue_dao.py +0 -0
  120. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/mq_dao/__init__.py +0 -0
  121. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/mq_dao/mq_dao_base.py +0 -0
  122. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/mq_dao/mq_dao_kafka.py +0 -0
  123. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/mq_dao/mq_dao_mofka.py +0 -0
  124. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/mq_dao/mq_dao_redis.py +0 -0
  125. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/daos/redis_conn.py +0 -0
  126. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/flowcept_dataclasses/__init__.py +0 -0
  127. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/flowcept_dataclasses/base_settings_dataclasses.py +0 -0
  128. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/flowcept_dataclasses/task_object.py +0 -0
  129. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/flowcept_dataclasses/telemetry.py +0 -0
  130. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/flowcept_dataclasses/workflow_object.py +0 -0
  131. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/flowcept_logger.py +0 -0
  132. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/query_utils.py +0 -0
  133. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/settings_factory.py +0 -0
  134. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/task_data_preprocess.py +0 -0
  135. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/utils.py +0 -0
  136. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/commons/vocabulary.py +0 -0
  137. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/configs.py +0 -0
  138. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_api/__init__.py +0 -0
  139. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_api/db_api.py +0 -0
  140. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_api/task_query_api.py +0 -0
  141. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_webserver/__init__.py +0 -0
  142. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_webserver/app.py +0 -0
  143. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_webserver/resources/__init__.py +0 -0
  144. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_webserver/resources/query_rsrc.py +0 -0
  145. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowcept_webserver/resources/task_messages_rsrc.py +0 -0
  146. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/__init__.py +0 -0
  147. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/__init__.py +0 -0
  148. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/base_interceptor.py +0 -0
  149. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/brokers/__init__.py +0 -0
  150. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/brokers/mqtt_interceptor.py +0 -0
  151. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/dask/__init__.py +0 -0
  152. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/dask/dask_dataclasses.py +0 -0
  153. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/dask/dask_interceptor.py +0 -0
  154. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/dask/dask_plugins.py +0 -0
  155. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/instrumentation_interceptor.py +0 -0
  156. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/interceptor_state_manager.py +0 -0
  157. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/mlflow/__init__.py +0 -0
  158. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/mlflow/interception_event_handler.py +0 -0
  159. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/mlflow/mlflow_dao.py +0 -0
  160. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/mlflow/mlflow_dataclasses.py +0 -0
  161. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/mlflow/mlflow_interceptor.py +0 -0
  162. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/tensorboard/__init__.py +0 -0
  163. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/tensorboard/tensorboard_dataclasses.py +0 -0
  164. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/adapters/tensorboard/tensorboard_interceptor.py +0 -0
  165. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/consumers/__init__.py +0 -0
  166. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/consumers/agent/__init__.py +0 -0
  167. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/consumers/agent/base_agent_context_manager.py +0 -0
  168. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/consumers/base_consumer.py +0 -0
  169. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/consumers/consumer_utils.py +0 -0
  170. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/consumers/document_inserter.py +0 -0
  171. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/flowceptor/telemetry_capture.py +0 -0
  172. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/instrumentation/__init__.py +0 -0
  173. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/instrumentation/flowcept_agent_task.py +0 -0
  174. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/instrumentation/flowcept_decorator.py +0 -0
  175. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/instrumentation/flowcept_task.py +0 -0
  176. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/instrumentation/flowcept_torch.py +0 -0
  177. {flowcept-0.9.3 → flowcept-0.9.5}/src/flowcept/instrumentation/task_capture.py +0 -0
  178. {flowcept-0.9.3 → flowcept-0.9.5}/tests/__init__.py +0 -0
  179. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/__init__.py +0 -0
  180. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/dask_test_utils.py +0 -0
  181. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/test_broker.py +0 -0
  182. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/test_dask.py +0 -0
  183. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/test_dask_with_context_mgmt.py +0 -0
  184. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/test_file_observer.py +0 -0
  185. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/test_mlflow.py +0 -0
  186. {flowcept-0.9.3 → flowcept-0.9.5}/tests/adapters/test_tensorboard.py +0 -0
  187. {flowcept-0.9.3 → flowcept-0.9.5}/tests/api/__init__.py +0 -0
  188. {flowcept-0.9.3 → flowcept-0.9.5}/tests/api/db_api_test.py +0 -0
  189. {flowcept-0.9.3 → flowcept-0.9.5}/tests/api/flowcept_api_test.py +0 -0
  190. {flowcept-0.9.3 → flowcept-0.9.5}/tests/api/sample_data.json +0 -0
  191. {flowcept-0.9.3 → flowcept-0.9.5}/tests/api/sample_data_with_telemetry_and_rai.json +0 -0
  192. {flowcept-0.9.3 → flowcept-0.9.5}/tests/api/task_query_api_test.py +0 -0
  193. {flowcept-0.9.3 → flowcept-0.9.5}/tests/doc_db_inserter/__init__.py +0 -0
  194. {flowcept-0.9.3 → flowcept-0.9.5}/tests/doc_db_inserter/doc_db_inserter_test.py +0 -0
  195. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/__init__.py +0 -0
  196. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/flowcept_explicit_tasks.py +0 -0
  197. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/flowcept_loop_test.py +0 -0
  198. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/flowcept_task_decorator_test.py +0 -0
  199. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/ml_tests/__init__.py +0 -0
  200. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/ml_tests/dl_trainer.py +0 -0
  201. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/ml_tests/ml_decorator_dask_test.py +0 -0
  202. {flowcept-0.9.3 → flowcept-0.9.5}/tests/instrumentation_tests/ml_tests/ml_decorator_test.py +0 -0
  203. {flowcept-0.9.3 → flowcept-0.9.5}/tests/misc_tests/__init__.py +0 -0
  204. {flowcept-0.9.3 → flowcept-0.9.5}/tests/misc_tests/log_test.py +0 -0
  205. {flowcept-0.9.3 → flowcept-0.9.5}/tests/misc_tests/singleton_test.py +0 -0
  206. {flowcept-0.9.3 → flowcept-0.9.5}/tests/misc_tests/telemetry_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flowcept
3
- Version: 0.9.3
3
+ Version: 0.9.5
4
4
  Summary: Capture and query workflow provenance data using data observability
5
5
  Author: Oak Ridge National Laboratory
6
6
  License-Expression: MIT
@@ -25,6 +25,7 @@ Requires-Dist: gitpython; extra == 'all'
25
25
  Requires-Dist: google-genai; extra == 'all'
26
26
  Requires-Dist: jupyterlab; extra == 'all'
27
27
  Requires-Dist: langchain-community; extra == 'all'
28
+ Requires-Dist: langchain-openai; extra == 'all'
28
29
  Requires-Dist: lmdb; extra == 'all'
29
30
  Requires-Dist: mcp[cli]; extra == 'all'
30
31
  Requires-Dist: mlflow-skinny; extra == 'all'
@@ -85,11 +86,13 @@ Provides-Extra: kafka
85
86
  Requires-Dist: confluent-kafka<=2.8.0; extra == 'kafka'
86
87
  Provides-Extra: llm-agent
87
88
  Requires-Dist: langchain-community; extra == 'llm-agent'
89
+ Requires-Dist: langchain-openai; extra == 'llm-agent'
88
90
  Requires-Dist: mcp[cli]; extra == 'llm-agent'
89
91
  Requires-Dist: streamlit; extra == 'llm-agent'
90
92
  Provides-Extra: llm-google
91
93
  Requires-Dist: google-genai; extra == 'llm-google'
92
94
  Requires-Dist: langchain-community; extra == 'llm-google'
95
+ Requires-Dist: langchain-openai; extra == 'llm-google'
93
96
  Requires-Dist: mcp[cli]; extra == 'llm-google'
94
97
  Requires-Dist: streamlit; extra == 'llm-google'
95
98
  Provides-Extra: lmdb
@@ -1,37 +1,27 @@
1
1
  API Reference
2
2
  =============
3
3
 
4
- .. toctree::
5
- :maxdepth: 3
6
- :caption: Contents:
4
+ .. autosummary::
5
+ :toctree: generated/
6
+ :recursive:
7
7
 
8
+ flowcept.Flowcept
9
+ flowcept.flowcept_api.db_api.DBAPI
10
+ flowcept.TaskObject
11
+ flowcept.WorkflowObject
12
+ flowcept.FlowceptTask
13
+ flowcept.FlowceptLoop
14
+ flowcept.FlowceptLightweightLoop
8
15
 
9
- Public API documentation.
10
-
11
- Core components
12
- ---------------
16
+ Main Flowcept Object
17
+ --------------------
13
18
 
14
19
  .. autoclass:: flowcept.Flowcept
15
20
  :members:
21
+ :special-members: __init__
22
+ :exclude-members: __weakref__, __dict__, __module__
16
23
 
17
24
 
18
- Main Message Objects
19
- ---------------------
20
-
21
- .. autoclass:: flowcept.TaskObject
22
- :members:
23
-
24
- .. autoclass:: flowcept.WorkflowObject
25
- :members:
26
-
27
- FlowceptTask object
28
- -------------------
29
-
30
- .. autoclass:: flowcept.FlowceptTask
31
- :members:
32
- :special-members: __init__
33
- :undoc-members:
34
- :show-inheritance:
35
25
 
36
26
  Flowcept.db: Querying the Database
37
27
  ----------------------------------
@@ -58,4 +48,42 @@ Typical usage:
58
48
  .. autoclass:: flowcept.flowcept_api.db_api.DBAPI
59
49
  :members:
60
50
  :undoc-members:
51
+ :show-inheritance:
52
+
53
+
54
+ Main Message Objects
55
+ ---------------------
56
+
57
+ .. autoclass:: flowcept.TaskObject
58
+ :members:
59
+
60
+ .. autoclass:: flowcept.WorkflowObject
61
+ :members:
62
+
63
+ FlowceptTask object
64
+ -------------------
65
+
66
+ .. autoclass:: flowcept.FlowceptTask
67
+ :members:
68
+ :special-members: __init__
69
+ :undoc-members:
70
+ :show-inheritance:
71
+
72
+ FlowceptLoop object
73
+ -------------------
74
+
75
+ .. autoclass:: flowcept.FlowceptLoop
76
+ :members:
77
+ :special-members: __init__
78
+ :undoc-members:
79
+ :show-inheritance:
80
+
81
+
82
+ FlowceptLightweightLoop object
83
+ ------------------------------
84
+
85
+ .. autoclass:: flowcept.FlowceptLightweightLoop
86
+ :members:
87
+ :special-members: __init__
88
+ :undoc-members:
61
89
  :show-inheritance:
@@ -1,5 +1,5 @@
1
1
  Flowcept Architecture
2
- ===================
2
+ ======================
3
3
 
4
4
  .. toctree::
5
5
  :maxdepth: 2
@@ -435,18 +435,20 @@ Requires an active workflow (``with Flowcept(...)`` or ``Flowcept().start()``).
435
435
  with Flowcept(workflow_name="custom_tasks"):
436
436
  # Context-managed publish
437
437
  with FlowceptTask(activity_id="download", used={"url": "https://..."}) as t:
438
- data = b"..."
439
- t.add_generated({"bytes": len(data)})
438
+ data = b"..." # Some binary data
439
+ t.end(data=data, generated={"bytes": len(data)})
440
440
 
441
441
  # Or publish explicitly
442
442
  task = FlowceptTask(activity_id="parse", used={"bytes": len(data)})
443
- task.add_generated({"records": 42})
443
+ task.end({"records": 42})
444
444
  task.send() # publishes to MQ
445
445
 
446
446
  **Notes**:
447
447
 
448
448
  - Use **context** (``with FlowceptTask(...)``) *or* call ``send()`` explicitly.
449
449
  - Flows publish to the MQ; persistence/queries require a DB (e.g., MongoDB).
450
+ - See also: `Consumer example <https://flowcept.readthedocs.io/en/latest/prov_storage.html#example-extending-the-base-consumer>`_
451
+ - See also: `Ping pong example via PubSub with Flowcept <https://github.com/ORNL/flowcept/blob/main/examples/consumers/ping_pong_example.py>`_
450
452
 
451
453
  References & Examples
452
454
  ---------------------
@@ -84,6 +84,12 @@ This can serve as a template for building custom provenance consumers.
84
84
  consumer = MyConsumer()
85
85
  consumer.start(daemon=False)
86
86
 
87
+ **Notes**:
88
+
89
+ - See also: `Explicit publish example <file:///Users/rsr/Documents/GDrive/ORNL/dev/flowcept/docs/_build/html/prov_capture.html#custom-task-creation-fully-customizable>`_
90
+ - See also: `Ping pong example via PubSub with Flowcept <https://github.com/ORNL/flowcept/blob/main/examples/consumers/ping_pong_example.py>`_
91
+
92
+
87
93
 
88
94
  Document Inserter
89
95
  -----------------
@@ -65,7 +65,7 @@ mlflow = ["mlflow-skinny", "SQLAlchemy", "alembic", "watchdog", "cryptography"]
65
65
  nvidia = ["nvidia-ml-py"]
66
66
  mqtt = ["paho-mqtt"]
67
67
  tensorboard = ["tensorboard", "tensorflow", "tbparse"]
68
- llm_agent = ["mcp[cli]", "langchain_community", "streamlit"]
68
+ llm_agent = ["mcp[cli]", "langchain_community", "streamlit", "langchain_openai"]
69
69
  llm_google = ["flowcept[llm_agent]", "google-genai"]
70
70
 
71
71
  dev = [
@@ -1,4 +1,4 @@
1
- flowcept_version: 0.9.3 # Version of the Flowcept package. This setting file is compatible with this version.
1
+ flowcept_version: 0.9.5 # Version of the Flowcept package. This setting file is compatible with this version.
2
2
 
3
3
  project:
4
4
  debug: true # Toggle debug mode. This will add a property `debug: true` to all saved data, making it easier to retrieve/delete them later.
@@ -37,6 +37,7 @@ class FlowceptAppContext(BaseAppContext):
37
37
  tasks_schema: Dict | None # TODO: we dont need to keep the tasks_schema in context, just in the manager's memory.
38
38
  value_examples: Dict | None
39
39
  tracker_config: Dict | None
40
+ custom_guidance: List[str] | None
40
41
 
41
42
 
42
43
  class FlowceptAgentContextManager(BaseAgentContextManager):
@@ -156,6 +157,7 @@ class FlowceptAgentContextManager(BaseAgentContextManager):
156
157
  df=pd.DataFrame(),
157
158
  tasks_schema={},
158
159
  value_examples={},
160
+ custom_guidance=[],
159
161
  tracker_config=self.tracker_config,
160
162
  )
161
163
  DEBUG = True # TODO debugging!
@@ -24,8 +24,9 @@ ROUTING_PROMPT = (
24
24
  "Given the following user message, classify it into one of the following routes:\n"
25
25
  "- small_talk: if it's casual conversation or some random word (e.g., 'hausdn', 'a', hello, how are you, what can you do, what's your name)\n"
26
26
  "- plot: if user is requesting plots (e.g., plot, chart, visualize)\n"
27
- "- in_context_query: if the user asks questions about tasks or data in running workflow (or a workflow that ran recently) or if the user mentions the in-memory 'df' or a dataframe.\n"
28
- "- historical_prov_query: if the user wants to query historical provenance data\n"
27
+ #"- in_context_query: if the user asks questions about tasks or data in running workflow (or a workflow that ran recently) or if the user mentions the in-memory 'df' or a dataframe.\n"
28
+ "- in_context_query: if the user is querying the provenance data questions about tasks or data in running workflow (or a workflow that ran recently) or if the user mentions the in-memory 'df' or a dataframe.\n"
29
+ #"- historical_prov_query: if the user wants to query historical provenance data\n"
29
30
  "- in_chat_query: if the user appears to be asking about something that has said recently in this chat.\n"
30
31
  "- unknown: if you don't know.\n"
31
32
  "Respond with only the route label."
@@ -220,7 +220,15 @@ OUTPUT_FORMATTING = """
220
220
  """
221
221
 
222
222
 
223
- def generate_pandas_code_prompt(query: str, dynamic_schema, example_values):
223
+ def generate_pandas_code_prompt(query: str, dynamic_schema, example_values, custom_user_guidances):
224
+ if custom_user_guidances is not None and isinstance(custom_user_guidances, list) and len(custom_user_guidances):
225
+ concatenated_guidance = "\n".join(f"- {msg}" for msg in custom_user_guidances)
226
+ custom_user_guidance_prompt = (f"You MUST consider the following guidance from the user:\n"
227
+ f"{concatenated_guidance}"
228
+ "------------------------------------------------------"
229
+ )
230
+ else:
231
+ custom_user_guidance_prompt = ""
224
232
  prompt = (
225
233
  f"{ROLE}"
226
234
  f"{JOB}"
@@ -228,6 +236,7 @@ def generate_pandas_code_prompt(query: str, dynamic_schema, example_values):
228
236
  f"{get_df_schema_prompt(dynamic_schema, example_values)}" # main tester
229
237
  f"{QUERY_GUIDELINES}" # main tester
230
238
  f"{FEW_SHOTS}" # main tester
239
+ f"{custom_user_guidance_prompt}"
231
240
  f"{OUTPUT_FORMATTING}"
232
241
  "User Query:"
233
242
  f"{query}"
@@ -1,4 +1,5 @@
1
1
  import json
2
+ from typing import List
2
3
 
3
4
  from flowcept.agents.agents_utils import build_llm_model, ToolResult
4
5
  from flowcept.agents.flowcept_ctx_manager import mcp_flowcept
@@ -59,6 +60,16 @@ def check_llm() -> str:
59
60
  return response
60
61
 
61
62
 
63
+ @mcp_flowcept.tool()
64
+ def record_guidance(message: str) -> ToolResult:
65
+ ctx = mcp_flowcept.get_context()
66
+ message = message.replace("@record", "")
67
+ custom_guidance: List = ctx.request_context.lifespan_context.custom_guidance
68
+ custom_guidance.append(message)
69
+
70
+ return ToolResult(code=201, result=f"Ok. I recorded in my memory: {message}")
71
+
72
+
62
73
  @mcp_flowcept.tool()
63
74
  def prompt_handler(message: str) -> ToolResult:
64
75
  """
@@ -79,6 +90,10 @@ def prompt_handler(message: str) -> ToolResult:
79
90
  if key in message:
80
91
  return run_df_query(llm=None, query=message, plot=False)
81
92
 
93
+ if "@record" in message:
94
+ return record_guidance(message)
95
+
96
+
82
97
  llm = build_llm_model()
83
98
 
84
99
  prompt = ROUTING_PROMPT + message
@@ -87,6 +87,7 @@ def run_df_query(llm, query: str, plot=False) -> ToolResult:
87
87
  df: pd.DataFrame = ctx.request_context.lifespan_context.df
88
88
  schema = ctx.request_context.lifespan_context.tasks_schema
89
89
  value_examples = ctx.request_context.lifespan_context.value_examples
90
+ custom_user_guidance = ctx.request_context.lifespan_context.custom_guidance
90
91
  if df is None or not len(df):
91
92
  return ToolResult(code=404, result="Current df is empty or null.")
92
93
 
@@ -99,13 +100,13 @@ def run_df_query(llm, query: str, plot=False) -> ToolResult:
99
100
  return run_df_code(user_code=query, df=df)
100
101
 
101
102
  if plot:
102
- return generate_plot_code(llm, query, schema, value_examples, df)
103
+ return generate_plot_code(llm, query, schema, value_examples, df, custom_user_guidance=custom_user_guidance)
103
104
  else:
104
- return generate_result_df(llm, query, schema, value_examples, df)
105
+ return generate_result_df(llm, query, schema, value_examples, df, custom_user_guidance=custom_user_guidance)
105
106
 
106
107
 
107
108
  @mcp_flowcept.tool()
108
- def generate_plot_code(llm, query, dynamic_schema, value_examples, df) -> ToolResult:
109
+ def generate_plot_code(llm, query, dynamic_schema, value_examples, df, custom_user_guidance=None) -> ToolResult:
109
110
  """
110
111
  Generate DataFrame and plotting code from a natural language query using an LLM.
111
112
 
@@ -221,7 +222,7 @@ def generate_plot_code(llm, query, dynamic_schema, value_examples, df) -> ToolRe
221
222
 
222
223
 
223
224
  @mcp_flowcept.tool()
224
- def generate_result_df(llm, query: str, dynamic_schema, example_values, df, attempt_fix=True, summarize=True):
225
+ def generate_result_df(llm, query: str, dynamic_schema, example_values, df, custom_user_guidance=None, attempt_fix=True, summarize=True):
225
226
  """
226
227
  Generate a result DataFrame from a natural language query using an LLM.
227
228
 
@@ -297,7 +298,7 @@ def generate_result_df(llm, query: str, dynamic_schema, example_values, df, atte
297
298
  if llm is None:
298
299
  llm = build_llm_model()
299
300
  try:
300
- prompt = generate_pandas_code_prompt(query, dynamic_schema, example_values)
301
+ prompt = generate_pandas_code_prompt(query, dynamic_schema, example_values, custom_user_guidance)
301
302
  response = llm(prompt)
302
303
  except Exception as e:
303
304
  return ToolResult(code=400, result=str(e), extra=prompt)
@@ -77,7 +77,7 @@ def normalize_output(result):
77
77
  raise TypeError(f"Unsupported result type: {type(result)}")
78
78
 
79
79
  if not len(_df):
80
- raise ValueError("Result DataFrame is Empty.")
80
+ return pd.DataFrame()
81
81
 
82
82
  return _df
83
83
 
@@ -25,7 +25,7 @@ from flowcept.flowceptor.adapters.base_interceptor import BaseInterceptor
25
25
 
26
26
 
27
27
  class Flowcept(object):
28
- """Flowcept Controller class."""
28
+ """Main Flowcept controller class."""
29
29
 
30
30
  _db = None
31
31
  # TODO: rename current_workflow_id to workflow_id. This will be a major refactor
@@ -18,26 +18,6 @@ class FlowceptLoop:
18
18
  while capturing metadata for each iteration and for the loop as a whole. This is particularly
19
19
  useful in scenarios where tracking and instrumentation of loop executions is required.
20
20
 
21
- Parameters
22
- ----------
23
- items : typing.Union[Sized, int, Iterator]
24
- The items to iterate over. Must either be an iterable with a `__len__` method or an integer
25
- representing the range of iteration.
26
- loop_name : str, optional
27
- A descriptive name for the loop (default is "loop").
28
- item_name : str, optional
29
- The name used for each item in the telemetry (default is "item").
30
- parent_task_id : str, optional
31
- The ID of the parent task associated with the loop, if applicable (default is None).
32
- workflow_id : str, optional
33
- The workflow ID to associate with this loop. If not provided, it will be generated or
34
- inferred from the current workflow context.
35
-
36
- Raises
37
- ------
38
- Exception
39
- If `items` is not an iterable with a `__len__` method or an integer.
40
-
41
21
  Notes
42
22
  -----
43
23
  This class integrates with the `Flowcept` system for telemetry and tracking, ensuring
@@ -57,6 +37,52 @@ class FlowceptLoop:
57
37
  items_length=0,
58
38
  capture_enabled=True,
59
39
  ):
40
+ """
41
+ Initialize a FlowceptLoop instance for tracking iterations.
42
+
43
+ This constructor wraps an iterable, numeric range, or explicit iterator into a
44
+ loop context where each iteration is instrumented with provenance and optional
45
+ telemetry. If instrumentation is disabled, the loop behaves like a normal
46
+ Python iterator with minimal overhead.
47
+
48
+ Parameters
49
+ ----------
50
+ items : Union[Sized, Iterator, int]
51
+ The items to iterate over. Can be:
52
+ - A sized iterable (e.g., list, range).
53
+ - An integer (interpreted as ``range(items)``).
54
+ - An iterator (requires ``items_length`` if length cannot be inferred).
55
+ loop_name : str, optional
56
+ A descriptive name for the loop. Used in provenance as the loop's activity
57
+ identifier. Default is ``"loop"``.
58
+ item_name : str, optional
59
+ The key name under which each iteration's item is recorded in provenance.
60
+ Default is ``"item"``.
61
+ parent_task_id : str, optional
62
+ The identifier of a parent task, if this loop is nested within another task.
63
+ Default is ``None``.
64
+ workflow_id : str, optional
65
+ Identifier for the workflow this loop belongs to. If not provided, it is
66
+ inherited from the current Flowcept context or generated as a UUID.
67
+ items_length : int, optional
68
+ Explicit number of items if ``items`` is an iterator without a defined length.
69
+ Default is ``0``.
70
+ capture_enabled : bool, optional
71
+ Whether to enable provenance/telemetry capture. If ``False``, the loop runs
72
+ without instrumentation. Default is ``True``.
73
+
74
+ Raises
75
+ ------
76
+ Exception
77
+ If ``items`` is not a supported type (sized iterable, integer, or iterator).
78
+
79
+ Notes
80
+ -----
81
+ - Each iteration is recorded with ``used`` (inputs) and optional ``generated``
82
+ values, plus telemetry if enabled.
83
+ - Iteration metadata is finalized at the end of each iteration and sent to the
84
+ active Flowcept interceptor.
85
+ """
60
86
  self._current_iteration_task = {}
61
87
  if not (INSTRUMENTATION_ENABLED and capture_enabled):
62
88
  # These do_nothing functions help reduce overhead if no instrumentation is needed
@@ -232,6 +258,51 @@ class FlowceptLightweightLoop:
232
258
  items_length=0,
233
259
  capture_enabled=True,
234
260
  ):
261
+ """
262
+ Initialize a FlowceptLightweightLoop instance for tracking iterations.
263
+
264
+ This constructor provides a lower-overhead loop wrapper compared to
265
+ ``FlowceptLoop``. Iterations are pre-registered as task objects, and capture
266
+ primarily updates ``used`` and ``generated`` fields as the loop progresses.
267
+
268
+ Parameters
269
+ ----------
270
+ items : Union[Sized, Iterator]
271
+ The items to iterate over. Must either be:
272
+ - A sized iterable (with ``__len__``).
273
+ - An explicit iterator (length must be given by ``items_length``).
274
+ loop_name : str, optional
275
+ A descriptive name for the loop. Used in provenance as the loop's activity
276
+ identifier. Default is ``"loop"``.
277
+ item_name : str, optional
278
+ The key name under which each iteration's item is recorded in provenance.
279
+ Default is ``"item"``.
280
+ parent_task_id : str, optional
281
+ The identifier of a parent task, if this loop is nested within another task.
282
+ Default is ``None``.
283
+ workflow_id : str, optional
284
+ Identifier for the workflow this loop belongs to. If not provided, it is
285
+ inherited from the current Flowcept context or generated as a UUID.
286
+ items_length : int, optional
287
+ Explicit number of items if ``items`` is an iterator without a defined length.
288
+ Default is ``0``.
289
+ capture_enabled : bool, optional
290
+ Whether to enable provenance/telemetry capture. If ``False``, the loop runs
291
+ without instrumentation. Default is ``True``.
292
+
293
+ Raises
294
+ ------
295
+ Exception
296
+ If ``items`` is neither a sized iterable nor an iterator.
297
+
298
+ Notes
299
+ -----
300
+ - This class is designed for high-performance scenarios with many iterations.
301
+ - Iteration tasks are pre-allocated, and provenance capture is batched via
302
+ the Flowcept interceptor.
303
+ - Compared to ``FlowceptLoop``, this class avoids per-iteration telemetry
304
+ overhead unless explicitly enabled.
305
+ """
235
306
  if isinstance(items, Iterator):
236
307
  self._iterator = items
237
308
  else:
@@ -4,4 +4,4 @@
4
4
  # The expected format is: <Major>.<Minor>.<Patch>
5
5
  # This file is supposed to be automatically modified by the CI Bot.
6
6
  # See .github/workflows/version_bumper.py
7
- __version__ = "0.9.3"
7
+ __version__ = "0.9.5"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes