flowcept 0.9.17__tar.gz → 0.9.18__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.
- {flowcept-0.9.17 → flowcept-0.9.18}/.gitignore +1 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/Makefile +1 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/PKG-INFO +8 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/README.md +1 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/pyproject.toml +3 -2
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/sample_settings.yaml +2 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/agents_utils.py +42 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/flowcept_agent.py +4 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/flowcept_ctx_manager.py +99 -36
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/gui/gui_utils.py +21 -3
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/prompts/general_prompts.py +1 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/prompts/in_memory_query_prompts.py +158 -45
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/tools/general_tools.py +20 -3
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/tools/in_memory_queries/in_memory_queries_tools.py +14 -31
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/docdb_dao/lmdb_dao.py +48 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/mq_dao/mq_dao_kafka.py +2 -2
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/mq_dao/mq_dao_redis.py +33 -2
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/flowcept_dataclasses/task_object.py +4 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/configs.py +4 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_api/flowcept_controller.py +5 -1
- flowcept-0.9.18/src/flowcept/flowceptor/adapters/mlflow/interception_event_handler.py +50 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/mlflow/mlflow_interceptor.py +18 -4
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/tensorboard/tensorboard_interceptor.py +1 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/consumers/agent/base_agent_context_manager.py +7 -8
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/instrumentation/flowcept_task.py +147 -51
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/instrumentation/task_capture.py +10 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/version.py +1 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/test_file_observer.py +4 -1
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/test_mlflow.py +42 -6
- flowcept-0.9.18/tests/agent/agent_tests.py +21 -0
- flowcept-0.9.18/tests/conftest.py +16 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/instrumentation_tests/flowcept_explicit_tasks.py +43 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/instrumentation_tests/flowcept_task_decorator_test.py +31 -2
- flowcept-0.9.18/tests/misc_tests/__init__.py +0 -0
- flowcept-0.9.17/src/flowcept/flowceptor/adapters/mlflow/interception_event_handler.py +0 -19
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/checks.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/create-release-n-publish.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run-llm-tests.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run-tests-all-dbs.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run-tests-in-container.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run-tests-kafka.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run-tests-py313.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run-tests-simple.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run-tests.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/run_examples.sh +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.github/workflows/version_bumper.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/.readthedocs.yaml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/CONTRIBUTING.md +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/LICENSE +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/deployment/Dockerfile +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/deployment/compose-grafana.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/deployment/compose-kafka.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/deployment/compose-mofka.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/deployment/compose-mongo.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/deployment/compose.yml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/api-reference.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/architecture.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/cli-reference.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/conf.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/contributing.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/img/PROV-AGENT.svg +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/img/architecture-diagram.png +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/img/flowcept-logo-dark.png +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/img/flowcept-logo.png +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/index.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/large_data.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/prov_capture.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/prov_query.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/prov_storage.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/publications/README.md +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/quick_start.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/schemas.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/setup.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/task_schema.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/telemetry_capture.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/docs/workflow_schema.rst +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/agents/a2a/README.md +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/agents/a2a/agent1.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/agents/a2a/agent2.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/agents/aec_agent_context_manager.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/agents/aec_agent_mock.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/agents/aec_prompts.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/agents/opt_driver_mock.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/consumers/ping_pong_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/consumers/simple_consumer.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/consumers/simple_publisher.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/convergence_loop_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/dask_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/distributed_consumer_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/instrumented_loop_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/instrumented_simple_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_complex/README.md +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_complex/custom_provenance_id_mapping.yaml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_complex/llm_dataprep.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_complex/llm_main_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_complex/llm_model.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_complex/llm_test_runner.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_tutorial/README.md +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_tutorial/analysis.ipynb +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_tutorial/llm_dataprep.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_tutorial/llm_model.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/llm_tutorial/llm_train_campaign.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/mlflow_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/mqtt_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/single_layer_perceptron_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/start_here.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/tensorboard_example.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/unmanaged/main.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/examples/unmanaged/simple_task.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/notebooks/analytics.ipynb +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/notebooks/dask.ipynb +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/notebooks/dask_from_CLI.ipynb +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/notebooks/mlflow.ipynb +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/notebooks/reset_dask_nb_exec_counts.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/notebooks/tensorboard.ipynb +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/mofka/bedrock_setup.sh +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/mofka/consumer.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/mofka/mofka-requirements.yaml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/mofka/mofka_config.json +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/ontology/catalog-v001.xml +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/ontology/prov_agent.owl +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/resources/simple_redis_consumer.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/agent_client.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/dynamic_schema_tracker.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/gui/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/gui/agent_gui.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/gui/audio_utils.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/llms/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/llms/claude_gcp.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/llms/gemini25.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/prompts/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/tools/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/tools/in_memory_queries/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/agents/tools/in_memory_queries/pandas_agent_utils.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/analytics/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/analytics/analytics_utils.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/analytics/data_augmentation.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/analytics/plot.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/cli.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/autoflush_buffer.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/docdb_dao/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/docdb_dao/mongodb_dao.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/keyvalue_dao.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/mq_dao/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/mq_dao/mq_dao_base.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/mq_dao/mq_dao_mofka.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/daos/redis_conn.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/flowcept_dataclasses/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/flowcept_dataclasses/base_settings_dataclasses.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/flowcept_dataclasses/telemetry.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/flowcept_dataclasses/workflow_object.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/flowcept_logger.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/query_utils.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/settings_factory.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/task_data_preprocess.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/utils.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/commons/vocabulary.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_api/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_api/db_api.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_api/task_query_api.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_webserver/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_webserver/app.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_webserver/resources/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_webserver/resources/query_rsrc.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowcept_webserver/resources/task_messages_rsrc.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/base_interceptor.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/brokers/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/brokers/mqtt_interceptor.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/dask/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/dask/dask_dataclasses.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/dask/dask_interceptor.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/dask/dask_plugins.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/instrumentation_interceptor.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/interceptor_state_manager.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/mlflow/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/mlflow/mlflow_dao.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/mlflow/mlflow_dataclasses.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/tensorboard/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/adapters/tensorboard/tensorboard_dataclasses.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/consumers/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/consumers/agent/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/consumers/base_consumer.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/consumers/consumer_utils.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/consumers/document_inserter.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/flowceptor/telemetry_capture.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/instrumentation/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/instrumentation/flowcept_agent_task.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/instrumentation/flowcept_decorator.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/instrumentation/flowcept_loop.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/src/flowcept/instrumentation/flowcept_torch.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/dask_test_utils.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/test_broker.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/test_dask.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/test_dask_with_context_mgmt.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/adapters/test_tensorboard.py +0 -0
- {flowcept-0.9.17/tests/api → flowcept-0.9.18/tests/agent}/__init__.py +0 -0
- {flowcept-0.9.17/tests/doc_db_inserter → flowcept-0.9.18/tests/api}/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/api/db_api_test.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/api/flowcept_api_test.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/api/sample_data.json +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/api/sample_data_with_telemetry_and_rai.json +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/api/task_query_api_test.py +0 -0
- {flowcept-0.9.17/tests/instrumentation_tests → flowcept-0.9.18/tests/doc_db_inserter}/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/doc_db_inserter/doc_db_inserter_test.py +0 -0
- {flowcept-0.9.17/tests/instrumentation_tests/ml_tests → flowcept-0.9.18/tests/instrumentation_tests}/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/instrumentation_tests/flowcept_loop_test.py +0 -0
- {flowcept-0.9.17/tests/misc_tests → flowcept-0.9.18/tests/instrumentation_tests/ml_tests}/__init__.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/instrumentation_tests/ml_tests/dl_trainer.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/instrumentation_tests/ml_tests/ml_decorator_dask_test.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/instrumentation_tests/ml_tests/ml_decorator_test.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/misc_tests/log_test.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/misc_tests/singleton_test.py +0 -0
- {flowcept-0.9.17 → flowcept-0.9.18}/tests/misc_tests/telemetry_test.py +0 -0
|
@@ -115,7 +115,7 @@ services-stop-mofka:
|
|
|
115
115
|
# Run unit tests using pytest
|
|
116
116
|
.PHONY: tests
|
|
117
117
|
tests:
|
|
118
|
-
pytest --ignore=tests/adapters/test_tensorboard.py
|
|
118
|
+
pytest --timeout=300 --ignore=tests/adapters/test_tensorboard.py
|
|
119
119
|
|
|
120
120
|
.PHONY: tests-notebooks
|
|
121
121
|
tests-notebooks:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flowcept
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.18
|
|
4
4
|
Summary: Capture and query workflow provenance data using data observability
|
|
5
5
|
Author: Oak Ridge National Laboratory
|
|
6
6
|
License-Expression: MIT
|
|
@@ -41,6 +41,7 @@ Requires-Dist: pyarrow; extra == 'all'
|
|
|
41
41
|
Requires-Dist: pymongo; extra == 'all'
|
|
42
42
|
Requires-Dist: pymupdf; extra == 'all'
|
|
43
43
|
Requires-Dist: pytest; extra == 'all'
|
|
44
|
+
Requires-Dist: pytest-timeout; extra == 'all'
|
|
44
45
|
Requires-Dist: pyyaml; extra == 'all'
|
|
45
46
|
Requires-Dist: redis; extra == 'all'
|
|
46
47
|
Requires-Dist: requests; extra == 'all'
|
|
@@ -50,6 +51,7 @@ Requires-Dist: seaborn; extra == 'all'
|
|
|
50
51
|
Requires-Dist: sphinx; extra == 'all'
|
|
51
52
|
Requires-Dist: sqlalchemy; extra == 'all'
|
|
52
53
|
Requires-Dist: streamlit; extra == 'all'
|
|
54
|
+
Requires-Dist: tabulate; extra == 'all'
|
|
53
55
|
Requires-Dist: tbparse; extra == 'all'
|
|
54
56
|
Requires-Dist: tensorboard; extra == 'all'
|
|
55
57
|
Requires-Dist: tensorflow; extra == 'all'
|
|
@@ -69,6 +71,7 @@ Requires-Dist: jupyterlab; extra == 'dev'
|
|
|
69
71
|
Requires-Dist: nbmake; extra == 'dev'
|
|
70
72
|
Requires-Dist: pika; extra == 'dev'
|
|
71
73
|
Requires-Dist: pytest; extra == 'dev'
|
|
74
|
+
Requires-Dist: pytest-timeout; extra == 'dev'
|
|
72
75
|
Requires-Dist: pyyaml; extra == 'dev'
|
|
73
76
|
Requires-Dist: ruff; extra == 'dev'
|
|
74
77
|
Requires-Dist: sphinx; extra == 'dev'
|
|
@@ -94,6 +97,7 @@ Requires-Dist: matplotlib; extra == 'llm-agent'
|
|
|
94
97
|
Requires-Dist: mcp[cli]; extra == 'llm-agent'
|
|
95
98
|
Requires-Dist: pymupdf; extra == 'llm-agent'
|
|
96
99
|
Requires-Dist: streamlit; extra == 'llm-agent'
|
|
100
|
+
Requires-Dist: tabulate; extra == 'llm-agent'
|
|
97
101
|
Provides-Extra: llm-agent-audio
|
|
98
102
|
Requires-Dist: gtts; extra == 'llm-agent-audio'
|
|
99
103
|
Requires-Dist: langchain-community; extra == 'llm-agent-audio'
|
|
@@ -105,6 +109,7 @@ Requires-Dist: pymupdf; extra == 'llm-agent-audio'
|
|
|
105
109
|
Requires-Dist: speechrecognition; extra == 'llm-agent-audio'
|
|
106
110
|
Requires-Dist: streamlit; extra == 'llm-agent-audio'
|
|
107
111
|
Requires-Dist: streamlit-mic-recorder; extra == 'llm-agent-audio'
|
|
112
|
+
Requires-Dist: tabulate; extra == 'llm-agent-audio'
|
|
108
113
|
Provides-Extra: llm-google
|
|
109
114
|
Requires-Dist: google-genai; extra == 'llm-google'
|
|
110
115
|
Requires-Dist: langchain-community; extra == 'llm-google'
|
|
@@ -113,6 +118,7 @@ Requires-Dist: matplotlib; extra == 'llm-google'
|
|
|
113
118
|
Requires-Dist: mcp[cli]; extra == 'llm-google'
|
|
114
119
|
Requires-Dist: pymupdf; extra == 'llm-google'
|
|
115
120
|
Requires-Dist: streamlit; extra == 'llm-google'
|
|
121
|
+
Requires-Dist: tabulate; extra == 'llm-google'
|
|
116
122
|
Provides-Extra: lmdb
|
|
117
123
|
Requires-Dist: lmdb; extra == 'lmdb'
|
|
118
124
|
Provides-Extra: ml-dev
|
|
@@ -180,6 +186,7 @@ Flowcept captures and queries workflow provenance at runtime with minimal code c
|
|
|
180
186
|
|
|
181
187
|
|
|
182
188
|
<h4 align="center">
|
|
189
|
+
<a href="https://flowcept.org">Website</a> •
|
|
183
190
|
<a href="https://flowcept.readthedocs.io/">Documentation</a> •
|
|
184
191
|
<a href="./docs/publications">Publications</a>
|
|
185
192
|
</h4>
|
|
@@ -31,6 +31,7 @@ Flowcept captures and queries workflow provenance at runtime with minimal code c
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
<h4 align="center">
|
|
34
|
+
<a href="https://flowcept.org">Website</a> •
|
|
34
35
|
<a href="https://flowcept.readthedocs.io/">Documentation</a> •
|
|
35
36
|
<a href="./docs/publications">Publications</a>
|
|
36
37
|
</h4>
|
|
@@ -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", "langchain_openai", "streamlit", "PyMuPDF", "matplotlib"]
|
|
68
|
+
llm_agent = ["mcp[cli]", "langchain_community", "langchain_openai", "streamlit", "PyMuPDF", "matplotlib", "tabulate"]
|
|
69
69
|
llm_google = ["flowcept[llm_agent]", "google-genai"]
|
|
70
70
|
llm_agent_audio = ["flowcept[llm_agent]", "streamlit-mic-recorder", "SpeechRecognition", "pydub", "gTTS"]
|
|
71
71
|
# System dependency (required for pydub)
|
|
@@ -80,8 +80,9 @@ dev = [
|
|
|
80
80
|
"nbmake",
|
|
81
81
|
"pika",
|
|
82
82
|
"pytest",
|
|
83
|
+
"pytest-timeout",
|
|
83
84
|
"ruff",
|
|
84
|
-
"pyyaml"
|
|
85
|
+
"pyyaml"
|
|
85
86
|
]
|
|
86
87
|
# Torch and some other ml-specific libs, only used for dev purposes, require the following specific versions.
|
|
87
88
|
ml_dev = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
flowcept_version: 0.9.
|
|
1
|
+
flowcept_version: 0.9.18 # 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.
|
|
@@ -94,6 +94,7 @@ agent:
|
|
|
94
94
|
service_provider: '?'
|
|
95
95
|
model_kwargs: {}
|
|
96
96
|
audio_enabled: false
|
|
97
|
+
debug: true
|
|
97
98
|
|
|
98
99
|
databases:
|
|
99
100
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import re
|
|
3
|
+
import unicodedata
|
|
2
4
|
from typing import Union, Dict
|
|
3
5
|
|
|
4
6
|
from flowcept.flowceptor.consumers.agent.base_agent_context_manager import BaseAgentContextManager
|
|
@@ -194,3 +196,43 @@ def build_llm_model(
|
|
|
194
196
|
if tool_task:
|
|
195
197
|
llm.parent_task_id = tool_task.task_id
|
|
196
198
|
return llm
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def normalize_message(user_msg: str) -> str:
|
|
202
|
+
"""
|
|
203
|
+
Normalize a user message into a canonical, comparison-friendly form.
|
|
204
|
+
|
|
205
|
+
The function standardizes text by trimming whitespace, applying Unicode
|
|
206
|
+
normalization, normalizing dash characters, collapsing repeated whitespace,
|
|
207
|
+
removing trailing punctuation that does not affect semantics, and converting
|
|
208
|
+
the result to lowercase.
|
|
209
|
+
|
|
210
|
+
Parameters
|
|
211
|
+
----------
|
|
212
|
+
user_msg : str
|
|
213
|
+
Raw user input message.
|
|
214
|
+
|
|
215
|
+
Returns
|
|
216
|
+
-------
|
|
217
|
+
str
|
|
218
|
+
Normalized message suitable for matching, comparison, or hashing.
|
|
219
|
+
"""
|
|
220
|
+
# 1) Strip leading/trailing whitespace
|
|
221
|
+
user_msg = user_msg.strip()
|
|
222
|
+
|
|
223
|
+
# 2) Unicode normalize to avoid weird characters (like fancy quotes, dashes)
|
|
224
|
+
user_msg = unicodedata.normalize("NFKC", user_msg)
|
|
225
|
+
|
|
226
|
+
# 3) Normalize dashes commonly used in chemistry (C–H, C—H, etc.)
|
|
227
|
+
user_msg = user_msg.replace("–", "-").replace("—", "-")
|
|
228
|
+
|
|
229
|
+
# 4) Collapse multiple spaces / newlines into a single space
|
|
230
|
+
user_msg = re.sub(r"\s+", " ", user_msg)
|
|
231
|
+
|
|
232
|
+
# 5) Remove trailing punctuation that doesn't change semantics
|
|
233
|
+
# e.g., "?", "!", "." at the VERY end
|
|
234
|
+
user_msg = re.sub(r"[?!.\s]+$", "", user_msg)
|
|
235
|
+
|
|
236
|
+
user_msg = user_msg.lower()
|
|
237
|
+
|
|
238
|
+
return user_msg
|
|
@@ -20,11 +20,14 @@ def main():
|
|
|
20
20
|
def run():
|
|
21
21
|
uvicorn.run(mcp_flowcept.streamable_http_app, host=AGENT_HOST, port=AGENT_PORT, lifespan="on")
|
|
22
22
|
|
|
23
|
-
Thread(target=run)
|
|
23
|
+
server_thread = Thread(target=run, daemon=False)
|
|
24
|
+
server_thread.start()
|
|
24
25
|
sleep(2)
|
|
25
26
|
# Wake up tool call
|
|
26
27
|
print(run_tool(check_liveness, host=AGENT_HOST, port=AGENT_PORT)[0])
|
|
27
28
|
|
|
29
|
+
server_thread.join()
|
|
30
|
+
|
|
28
31
|
|
|
29
32
|
if __name__ == "__main__":
|
|
30
33
|
main()
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
from flowcept.agents.dynamic_schema_tracker import DynamicSchemaTracker
|
|
2
2
|
from flowcept.agents.tools.in_memory_queries.pandas_agent_utils import load_saved_df
|
|
3
3
|
from flowcept.commons.flowcept_dataclasses.task_object import TaskObject
|
|
4
|
+
from flowcept.commons.flowcept_logger import FlowceptLogger
|
|
5
|
+
from flowcept.commons.vocabulary import Status
|
|
6
|
+
from flowcept.configs import AGENT
|
|
4
7
|
from mcp.server.fastmcp import FastMCP
|
|
5
8
|
|
|
6
9
|
import json
|
|
@@ -12,11 +15,12 @@ import pandas as pd
|
|
|
12
15
|
|
|
13
16
|
from flowcept.flowceptor.consumers.agent.base_agent_context_manager import BaseAgentContextManager, BaseAppContext
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
from flowcept.agents import agent_client
|
|
17
18
|
from flowcept.commons.task_data_preprocess import summarize_task
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
AGENT_DEBUG = AGENT.get("debug", False)
|
|
22
|
+
|
|
23
|
+
|
|
20
24
|
@dataclass
|
|
21
25
|
class FlowceptAppContext(BaseAppContext):
|
|
22
26
|
"""
|
|
@@ -39,6 +43,39 @@ class FlowceptAppContext(BaseAppContext):
|
|
|
39
43
|
tracker_config: Dict | None
|
|
40
44
|
custom_guidance: List[str] | None
|
|
41
45
|
|
|
46
|
+
def __init__(self):
|
|
47
|
+
self.logger = FlowceptLogger()
|
|
48
|
+
self.reset_context()
|
|
49
|
+
|
|
50
|
+
def reset_context(self):
|
|
51
|
+
"""
|
|
52
|
+
Reset the agent's context to a clean state, initializing a new QA setup.
|
|
53
|
+
"""
|
|
54
|
+
self.tasks = []
|
|
55
|
+
self.task_summaries = []
|
|
56
|
+
self.critical_tasks = []
|
|
57
|
+
self.df = pd.DataFrame()
|
|
58
|
+
self.tasks_schema = {}
|
|
59
|
+
self.value_examples = {}
|
|
60
|
+
self.custom_guidance = []
|
|
61
|
+
self.tracker_config = {}
|
|
62
|
+
|
|
63
|
+
if AGENT_DEBUG:
|
|
64
|
+
from flowcept.commons.flowcept_logger import FlowceptLogger
|
|
65
|
+
|
|
66
|
+
FlowceptLogger().warning("Running agent in DEBUG mode!")
|
|
67
|
+
df_path = "/tmp/current_agent_df.csv"
|
|
68
|
+
if os.path.exists(df_path):
|
|
69
|
+
self.logger.warning("Going to load df into context")
|
|
70
|
+
df = load_saved_df(df_path)
|
|
71
|
+
self.df = df
|
|
72
|
+
if os.path.exists("/tmp/current_tasks_schema.json"):
|
|
73
|
+
with open("/tmp/current_tasks_schema.json") as f:
|
|
74
|
+
self.tasks_schema = json.load(f)
|
|
75
|
+
if os.path.exists("/tmp/value_examples.json"):
|
|
76
|
+
with open("/tmp/value_examples.json") as f:
|
|
77
|
+
self.value_examples = json.load(f)
|
|
78
|
+
|
|
42
79
|
|
|
43
80
|
class FlowceptAgentContextManager(BaseAgentContextManager):
|
|
44
81
|
"""
|
|
@@ -61,7 +98,7 @@ class FlowceptAgentContextManager(BaseAgentContextManager):
|
|
|
61
98
|
"""
|
|
62
99
|
|
|
63
100
|
def __init__(self):
|
|
64
|
-
self.context
|
|
101
|
+
self.context = FlowceptAppContext()
|
|
65
102
|
self.tracker_config = dict(max_examples=3, max_str_len=50)
|
|
66
103
|
self.schema_tracker = DynamicSchemaTracker(**self.tracker_config)
|
|
67
104
|
self.msgs_counter = 0
|
|
@@ -82,7 +119,6 @@ class FlowceptAgentContextManager(BaseAgentContextManager):
|
|
|
82
119
|
bool
|
|
83
120
|
True if the message was handled successfully.
|
|
84
121
|
"""
|
|
85
|
-
print("Received:", msg_obj)
|
|
86
122
|
msg_type = msg_obj.get("type", None)
|
|
87
123
|
if msg_type == "task":
|
|
88
124
|
task_msg = TaskObject.from_dict(msg_obj)
|
|
@@ -90,8 +126,62 @@ class FlowceptAgentContextManager(BaseAgentContextManager):
|
|
|
90
126
|
self.logger.info(f"Going to ignore our own LLM messages: {task_msg}")
|
|
91
127
|
return True
|
|
92
128
|
|
|
93
|
-
self.msgs_counter += 1
|
|
94
129
|
self.logger.debug("Received task msg!")
|
|
130
|
+
if task_msg.subtype == "call_agent_task":
|
|
131
|
+
from flowcept.instrumentation.task_capture import FlowceptTask
|
|
132
|
+
|
|
133
|
+
if task_msg.activity_id == "reset_user_context":
|
|
134
|
+
self.context.reset_context()
|
|
135
|
+
self.msgs_counter = 0
|
|
136
|
+
FlowceptTask(
|
|
137
|
+
agent_id=self.agent_id,
|
|
138
|
+
generated={"msg": "Provenance Agent reset context."},
|
|
139
|
+
subtype="agent_task",
|
|
140
|
+
activity_id="reset_user_context",
|
|
141
|
+
).send()
|
|
142
|
+
return True
|
|
143
|
+
elif task_msg.activity_id == "provenance_query":
|
|
144
|
+
self.logger.info("Received a prov query message!")
|
|
145
|
+
query_text = task_msg.used.get("query")
|
|
146
|
+
from flowcept.agents import ToolResult
|
|
147
|
+
from flowcept.agents.tools.general_tools import prompt_handler
|
|
148
|
+
from flowcept.agents.agent_client import run_tool
|
|
149
|
+
|
|
150
|
+
resp = run_tool(tool_name=prompt_handler, kwargs={"message": query_text})[0]
|
|
151
|
+
|
|
152
|
+
try:
|
|
153
|
+
error = None
|
|
154
|
+
status = Status.FINISHED
|
|
155
|
+
tool_result = ToolResult(**json.loads(resp))
|
|
156
|
+
if tool_result.result_is_str():
|
|
157
|
+
generated = {"text": tool_result.result}
|
|
158
|
+
else:
|
|
159
|
+
generated = tool_result.result
|
|
160
|
+
except Exception as e:
|
|
161
|
+
status = Status.ERROR
|
|
162
|
+
error = f"Could not convert the following into a ToolResult:\n{resp}\nException: {e}"
|
|
163
|
+
generated = {"text": str(resp)}
|
|
164
|
+
FlowceptTask(
|
|
165
|
+
agent_id=self.agent_id,
|
|
166
|
+
generated=generated,
|
|
167
|
+
stderr=error,
|
|
168
|
+
status=status,
|
|
169
|
+
subtype="agent_task",
|
|
170
|
+
activity_id="provenance_query_response",
|
|
171
|
+
).send()
|
|
172
|
+
|
|
173
|
+
return True
|
|
174
|
+
|
|
175
|
+
elif (
|
|
176
|
+
task_msg.subtype == "agent_task"
|
|
177
|
+
and task_msg.agent_id is not None
|
|
178
|
+
and task_msg.agent_id == self.agent_id
|
|
179
|
+
):
|
|
180
|
+
self.logger.info(f"Ignoring agent tasks from myself: {task_msg}")
|
|
181
|
+
return True
|
|
182
|
+
|
|
183
|
+
self.msgs_counter += 1
|
|
184
|
+
|
|
95
185
|
self.context.tasks.append(msg_obj)
|
|
96
186
|
|
|
97
187
|
task_summary = summarize_task(msg_obj, logger=self.logger)
|
|
@@ -136,7 +226,9 @@ class FlowceptAgentContextManager(BaseAgentContextManager):
|
|
|
136
226
|
Perform LLM-based analysis on the current chunk of task messages and send the results.
|
|
137
227
|
"""
|
|
138
228
|
self.logger.debug(f"Going to begin LLM job! {self.msgs_counter}")
|
|
139
|
-
|
|
229
|
+
from flowcept.agents.agent_client import run_tool
|
|
230
|
+
|
|
231
|
+
result = run_tool("analyze_task_chunk")
|
|
140
232
|
if len(result):
|
|
141
233
|
content = result[0].text
|
|
142
234
|
if content != "Error executing tool":
|
|
@@ -146,36 +238,7 @@ class FlowceptAgentContextManager(BaseAgentContextManager):
|
|
|
146
238
|
else:
|
|
147
239
|
self.logger.error(content)
|
|
148
240
|
|
|
149
|
-
def reset_context(self):
|
|
150
|
-
"""
|
|
151
|
-
Reset the agent's context to a clean state, initializing a new QA setup.
|
|
152
|
-
"""
|
|
153
|
-
self.context = FlowceptAppContext(
|
|
154
|
-
tasks=[],
|
|
155
|
-
task_summaries=[],
|
|
156
|
-
critical_tasks=[],
|
|
157
|
-
df=pd.DataFrame(),
|
|
158
|
-
tasks_schema={},
|
|
159
|
-
value_examples={},
|
|
160
|
-
custom_guidance=[],
|
|
161
|
-
tracker_config=self.tracker_config,
|
|
162
|
-
)
|
|
163
|
-
DEBUG = True # TODO debugging!
|
|
164
|
-
if DEBUG:
|
|
165
|
-
self.logger.warning("Running agent in DEBUG mode!")
|
|
166
|
-
df_path = "/tmp/current_agent_df.csv"
|
|
167
|
-
if os.path.exists(df_path):
|
|
168
|
-
self.logger.warning("Going to load df into context")
|
|
169
|
-
df = load_saved_df(df_path)
|
|
170
|
-
self.context.df = df
|
|
171
|
-
if os.path.exists("/tmp/current_tasks_schema.json"):
|
|
172
|
-
with open("/tmp/current_tasks_schema.json") as f:
|
|
173
|
-
self.context.tasks_schema = json.load(f)
|
|
174
|
-
if os.path.exists("/tmp/value_examples.json"):
|
|
175
|
-
with open("/tmp/value_examples.json") as f:
|
|
176
|
-
self.context.value_examples = json.load(f)
|
|
177
|
-
|
|
178
241
|
|
|
179
242
|
# Exporting the ctx_manager and the mcp_flowcept
|
|
180
243
|
ctx_manager = FlowceptAgentContextManager()
|
|
181
|
-
mcp_flowcept = FastMCP("FlowceptAgent",
|
|
244
|
+
mcp_flowcept = FastMCP("FlowceptAgent", lifespan=ctx_manager.lifespan, stateless_http=True)
|
|
@@ -351,10 +351,28 @@ def exec_st_plot_code(code, result_df, st_module):
|
|
|
351
351
|
>>> code = "st.line_chart(result)"
|
|
352
352
|
>>> exec_st_plot_code(code, df, st)
|
|
353
353
|
"""
|
|
354
|
-
|
|
354
|
+
# 1) Make a copy of result_df and rename columns with dots
|
|
355
|
+
plot_df = result_df.copy()
|
|
356
|
+
col_map = {}
|
|
357
|
+
|
|
358
|
+
for col in plot_df.columns:
|
|
359
|
+
if "." in col:
|
|
360
|
+
new_col = col.replace(".", "_")
|
|
361
|
+
col_map[col] = new_col
|
|
362
|
+
plot_df.rename(columns={col: new_col}, inplace=True)
|
|
363
|
+
|
|
364
|
+
# 2) Rewrite the code so column names match the renamed columns
|
|
365
|
+
sanitized_code = code
|
|
366
|
+
for old, new in col_map.items():
|
|
367
|
+
# replace only inside quotes: 'generated.bd_enthalpy' → 'generated_bd_enthalpy'
|
|
368
|
+
sanitized_code = sanitized_code.replace(f"'{old}'", f"'{new}'")
|
|
369
|
+
sanitized_code = sanitized_code.replace(f'"{old}"', f'"{new}"')
|
|
370
|
+
|
|
371
|
+
print("SANITIZED CODE:\n", sanitized_code)
|
|
372
|
+
print(f"Renamed DF columms: {plot_df}")
|
|
355
373
|
exec(
|
|
356
|
-
|
|
357
|
-
{"result":
|
|
374
|
+
sanitized_code,
|
|
375
|
+
{"result": plot_df, "st": st_module, "plt": __import__("matplotlib.pyplot"), "alt": __import__("altair")},
|
|
358
376
|
)
|
|
359
377
|
|
|
360
378
|
|
|
@@ -28,7 +28,7 @@ ROUTING_PROMPT = (
|
|
|
28
28
|
# "- 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"
|
|
29
29
|
# "- historical_prov_query: if the user wants to query historical provenance data\n"
|
|
30
30
|
"- in_chat_query: if the user appears to be asking about something that has said recently in this chat.\n"
|
|
31
|
-
"-
|
|
31
|
+
"- in_context_query: if you don't know.\n"
|
|
32
32
|
"Respond with only the route label."
|
|
33
33
|
"User message is below:\n "
|
|
34
34
|
)
|