flowcept 0.9.15__py3-none-any.whl → 0.9.17__py3-none-any.whl
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/agents/agents_utils.py +15 -0
- flowcept/flowceptor/adapters/mlflow/interception_event_handler.py +5 -2
- flowcept/flowceptor/adapters/mlflow/mlflow_interceptor.py +4 -3
- flowcept/flowceptor/adapters/tensorboard/tensorboard_interceptor.py +6 -1
- flowcept/version.py +1 -1
- {flowcept-0.9.15.dist-info → flowcept-0.9.17.dist-info}/METADATA +3 -2
- {flowcept-0.9.15.dist-info → flowcept-0.9.17.dist-info}/RECORD +11 -11
- resources/sample_settings.yaml +1 -1
- {flowcept-0.9.15.dist-info → flowcept-0.9.17.dist-info}/WHEEL +0 -0
- {flowcept-0.9.15.dist-info → flowcept-0.9.17.dist-info}/entry_points.txt +0 -0
- {flowcept-0.9.15.dist-info → flowcept-0.9.17.dist-info}/licenses/LICENSE +0 -0
flowcept/agents/agents_utils.py
CHANGED
|
@@ -166,6 +166,21 @@ def build_llm_model(
|
|
|
166
166
|
from flowcept.agents.llms.gemini25 import Gemini25LLM
|
|
167
167
|
|
|
168
168
|
llm = Gemini25LLM(**_model_kwargs)
|
|
169
|
+
elif _service_provider == "openai":
|
|
170
|
+
from langchain_openai import ChatOpenAI
|
|
171
|
+
|
|
172
|
+
api_key = os.environ.get("OPENAI_API_KEY", AGENT.get("api_key"))
|
|
173
|
+
base_url = os.environ.get("OPENAI_BASE_URL", AGENT.get("llm_server_url") or None) # optional
|
|
174
|
+
org = os.environ.get("OPENAI_ORG_ID", AGENT.get("organization", None)) # optional
|
|
175
|
+
|
|
176
|
+
init_kwargs = {"api_key": api_key}
|
|
177
|
+
if base_url:
|
|
178
|
+
init_kwargs["base_url"] = base_url
|
|
179
|
+
if org:
|
|
180
|
+
init_kwargs["organization"] = org
|
|
181
|
+
|
|
182
|
+
# IMPORTANT: use the merged kwargs so `model` and temps flow through
|
|
183
|
+
llm = ChatOpenAI(**init_kwargs, **_model_kwargs)
|
|
169
184
|
|
|
170
185
|
else:
|
|
171
186
|
raise Exception("Currently supported providers are sambanova, openai, azure, and google.")
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"""Event handler module."""
|
|
2
2
|
|
|
3
|
+
from pathlib import Path
|
|
3
4
|
from watchdog.events import FileSystemEventHandler
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class InterceptionEventHandler(FileSystemEventHandler):
|
|
7
8
|
"""Event handler class."""
|
|
8
9
|
|
|
9
|
-
def __init__(self, interceptor_instance, callback_function):
|
|
10
|
+
def __init__(self, interceptor_instance, file_path_to_watch, callback_function):
|
|
10
11
|
super().__init__()
|
|
12
|
+
self.file_path_to_watch = file_path_to_watch
|
|
11
13
|
self.callback_function = callback_function
|
|
12
14
|
self.interceptor_instance = interceptor_instance
|
|
13
15
|
|
|
14
16
|
def on_modified(self, event):
|
|
15
17
|
"""Get on modified."""
|
|
16
|
-
|
|
18
|
+
if Path(event.src_path).resolve() == Path(self.file_path_to_watch).resolve():
|
|
19
|
+
self.callback_function(self.interceptor_instance)
|
|
@@ -84,7 +84,7 @@ class MLFlowInterceptor(BaseInterceptor):
|
|
|
84
84
|
def observe(self):
|
|
85
85
|
"""Observe it."""
|
|
86
86
|
self.logger.debug("Observing")
|
|
87
|
-
event_handler = InterceptionEventHandler(self, self.__class__.callback)
|
|
87
|
+
event_handler = InterceptionEventHandler(self, self.settings.file_path, self.__class__.callback)
|
|
88
88
|
while not os.path.isfile(self.settings.file_path):
|
|
89
89
|
self.logger.warning(
|
|
90
90
|
f"I can't watch the file {self.settings.file_path},"
|
|
@@ -95,6 +95,7 @@ class MLFlowInterceptor(BaseInterceptor):
|
|
|
95
95
|
sleep(self.settings.watch_interval_sec)
|
|
96
96
|
|
|
97
97
|
self._observer = PollingObserver()
|
|
98
|
-
|
|
98
|
+
watch_dir = os.path.dirname(self.settings.file_path) or "."
|
|
99
|
+
self._observer.schedule(event_handler, watch_dir, recursive=True)
|
|
99
100
|
self._observer.start()
|
|
100
|
-
self.logger.info(f"Watching {self.settings.file_path}")
|
|
101
|
+
self.logger.info(f"Watching directory {watch_dir} with file {self.settings.file_path} ")
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Tensorboard interceptor module."""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from time import sleep
|
|
5
6
|
|
|
6
7
|
from tbparse import SummaryReader
|
|
@@ -29,6 +30,8 @@ class TensorboardInterceptor(BaseInterceptor):
|
|
|
29
30
|
def __init__(self, plugin_key="tensorboard"):
|
|
30
31
|
super().__init__(plugin_key)
|
|
31
32
|
self._observer: PollingObserver = None
|
|
33
|
+
if not Path(self.settings.file_path).is_dir():
|
|
34
|
+
raise Exception("Tensorboard Observer must observe directories.")
|
|
32
35
|
self.state_manager = InterceptorStateManager(self.settings)
|
|
33
36
|
self.state_manager.reset()
|
|
34
37
|
self.log_metrics = set(self.settings.log_metrics)
|
|
@@ -108,13 +111,15 @@ class TensorboardInterceptor(BaseInterceptor):
|
|
|
108
111
|
|
|
109
112
|
def observe(self):
|
|
110
113
|
"""Observe it."""
|
|
111
|
-
|
|
114
|
+
self.logger.debug("Observing")
|
|
115
|
+
event_handler = InterceptionEventHandler(self, self.settings.file_path, self.__class__.callback)
|
|
112
116
|
while not os.path.isdir(self.settings.file_path):
|
|
113
117
|
self.logger.debug(f"I can't watch the file {self.settings.file_path}, as it does not exist.")
|
|
114
118
|
self.logger.debug(f"\tI will sleep for {self.settings.watch_interval_sec} s to see if it appears.")
|
|
115
119
|
sleep(self.settings.watch_interval_sec)
|
|
116
120
|
|
|
117
121
|
self._observer = PollingObserver()
|
|
122
|
+
|
|
118
123
|
self._observer.schedule(event_handler, self.settings.file_path, recursive=True)
|
|
119
124
|
self._observer.start()
|
|
120
125
|
self.logger.debug(f"Watching {self.settings.file_path}")
|
flowcept/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flowcept
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.17
|
|
4
4
|
Summary: Capture and query workflow provenance data using data observability
|
|
5
5
|
Author: Oak Ridge National Laboratory
|
|
6
6
|
License-Expression: MIT
|
|
@@ -9,7 +9,7 @@ Keywords: agentic-ai,agentic-workflows,ai,big-data,dask,data-analytics,data-inte
|
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Requires-Python: >=3.
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
13
|
Requires-Dist: msgpack
|
|
14
14
|
Requires-Dist: numpy
|
|
15
15
|
Requires-Dist: omegaconf
|
|
@@ -169,6 +169,7 @@ Flowcept captures and queries workflow provenance at runtime with minimal code c
|
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
[](https://flowcept.readthedocs.io/)
|
|
172
|
+
[](https://workflowscommunity.slack.com/archives/C06L5GYJKQS)
|
|
172
173
|
[](https://github.com/ORNL/flowcept/actions/workflows/create-release-n-publish.yml)
|
|
173
174
|
[](https://pypi.org/project/flowcept)
|
|
174
175
|
[](https://github.com/ORNL/flowcept/actions/workflows/run-tests.yml)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
flowcept/__init__.py,sha256=tvVZKyymdqv3qOsgpAyDppBlUiBc0ag4QF21IcS-mVk,2449
|
|
2
2
|
flowcept/cli.py,sha256=d3hogRpuMwQFIqw_fsYD4y074o3AFslBjlkRvTthOVM,25702
|
|
3
3
|
flowcept/configs.py,sha256=DBkYx0CAaDSl8x2EJY1665PFY80eCp9PEriYH-BNwL4,8781
|
|
4
|
-
flowcept/version.py,sha256=
|
|
4
|
+
flowcept/version.py,sha256=CCisSYx_UPtct6ynMdnfePrYgGtXK-iQk7gTD4nsAVs,307
|
|
5
5
|
flowcept/agents/__init__.py,sha256=8eeD2CiKBtHiDsWdrHK_UreIkKlTq4dUbhHDyzw372o,175
|
|
6
6
|
flowcept/agents/agent_client.py,sha256=UiBQkC9WE2weLZR2OTkEOEQt9-zqQOkPwRA17HfI-jk,2027
|
|
7
|
-
flowcept/agents/agents_utils.py,sha256=
|
|
7
|
+
flowcept/agents/agents_utils.py,sha256=MXrzAFwCnBQF7s28QLN3OzWEIryOl-a0zeVQIbzNxD4,7330
|
|
8
8
|
flowcept/agents/dynamic_schema_tracker.py,sha256=TsmXRRkyUkqB-0bEgmeqSms8xj1tMMJeYvjoaO2mtwI,6829
|
|
9
9
|
flowcept/agents/flowcept_agent.py,sha256=1sidjnNMdG0S6lUKBvml7ZfIb6o3u7zc6HNogsJbl9g,871
|
|
10
10
|
flowcept/agents/flowcept_ctx_manager.py,sha256=-WmkddzzFY2dnU9LbZaoY4-5RcSAQH4FziEJgcC5LEI,7083
|
|
@@ -74,13 +74,13 @@ flowcept/flowceptor/adapters/dask/dask_dataclasses.py,sha256=6LTG-kdcc6AUuVINvkq
|
|
|
74
74
|
flowcept/flowceptor/adapters/dask/dask_interceptor.py,sha256=uBQpLluYXzlT1gBDfTe4_WueC_fWBEs5Xr8ntpOmljE,5869
|
|
75
75
|
flowcept/flowceptor/adapters/dask/dask_plugins.py,sha256=s1ENAi9N61PC_6RiFvOYhJsgWzSm_lFWm3w87V-R1YY,2473
|
|
76
76
|
flowcept/flowceptor/adapters/mlflow/__init__.py,sha256=3mzHrvh1XQOy68qx1A3so9Nq27tIb0i2mSXfv3F6gZg,25
|
|
77
|
-
flowcept/flowceptor/adapters/mlflow/interception_event_handler.py,sha256
|
|
77
|
+
flowcept/flowceptor/adapters/mlflow/interception_event_handler.py,sha256=eR9vrPtSFEonJK7GQE1WTp1KVomV188uwRUqRRbFT9Q,682
|
|
78
78
|
flowcept/flowceptor/adapters/mlflow/mlflow_dao.py,sha256=dPEgCduiw14_pzT5WCjuokwaN7p5Tu7UvWS2rtGh4qk,4589
|
|
79
79
|
flowcept/flowceptor/adapters/mlflow/mlflow_dataclasses.py,sha256=vbijpDW6npHdsA9-28otXw94O4a9R-PWtq3xlJapsyY,690
|
|
80
|
-
flowcept/flowceptor/adapters/mlflow/mlflow_interceptor.py,sha256=
|
|
80
|
+
flowcept/flowceptor/adapters/mlflow/mlflow_interceptor.py,sha256=gufzv2OSVuLkFoo5In7aRzAZOFptwH6R9TTSsqO5vb8,3911
|
|
81
81
|
flowcept/flowceptor/adapters/tensorboard/__init__.py,sha256=LrcR4WCIlBwwHIUSteQ8k8JBdCJTFqLvvgAfnoLeREw,30
|
|
82
82
|
flowcept/flowceptor/adapters/tensorboard/tensorboard_dataclasses.py,sha256=lSfDd6TucVNzGxbm69BYyCVgMr2p9iUEQjnsS4jIfeI,554
|
|
83
|
-
flowcept/flowceptor/adapters/tensorboard/tensorboard_interceptor.py,sha256
|
|
83
|
+
flowcept/flowceptor/adapters/tensorboard/tensorboard_interceptor.py,sha256=-uGtCDE8YJ-hbZKII_l3HVXNMKiw_MjrfAdcdt6ex70,5104
|
|
84
84
|
flowcept/flowceptor/consumers/__init__.py,sha256=foxtVEb2ZEe9g1slfYIKM4tIFv-He1l7XS--SYs7nlQ,28
|
|
85
85
|
flowcept/flowceptor/consumers/base_consumer.py,sha256=hrZ3VFV7pJBMXZsvh7Q2Y36b_ifcnbJkgwe2MiuZL70,3324
|
|
86
86
|
flowcept/flowceptor/consumers/consumer_utils.py,sha256=E6R07zIKNXJTCxvL-OCrCKNYRpqtwRiXiZx0D2BKidk,5893
|
|
@@ -94,9 +94,9 @@ flowcept/instrumentation/flowcept_loop.py,sha256=nF7Sov-DCDapyYvS8zx-1ZFrnjc3CPg
|
|
|
94
94
|
flowcept/instrumentation/flowcept_task.py,sha256=EmKODpjl8usNklKSVmsKYyCa6gC_QMqKhAr3DKaw44s,8199
|
|
95
95
|
flowcept/instrumentation/flowcept_torch.py,sha256=kkZQRYq6cDBpdBU6J39_4oKRVkhyF3ODlz8ydV5WGKw,23455
|
|
96
96
|
flowcept/instrumentation/task_capture.py,sha256=1g9EtLdqsTB0RHsF-eRmA2Xh9l_YqTd953d4v89IC24,8287
|
|
97
|
-
resources/sample_settings.yaml,sha256
|
|
98
|
-
flowcept-0.9.
|
|
99
|
-
flowcept-0.9.
|
|
100
|
-
flowcept-0.9.
|
|
101
|
-
flowcept-0.9.
|
|
102
|
-
flowcept-0.9.
|
|
97
|
+
resources/sample_settings.yaml,sha256=4Hfj7qnthQdfWoCQYRLEF5Jm3zfOFmNbko249tIizPY,6881
|
|
98
|
+
flowcept-0.9.17.dist-info/METADATA,sha256=8YvAYyHRt02C-TWstfldJrTL9pEX2ijrEn-ygpkVgJY,33056
|
|
99
|
+
flowcept-0.9.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
100
|
+
flowcept-0.9.17.dist-info/entry_points.txt,sha256=i8q67WE0201rVxYI2lyBtS52shvgl93x2Szp4q8zMlw,47
|
|
101
|
+
flowcept-0.9.17.dist-info/licenses/LICENSE,sha256=r5-2P6tFTuRGWT5TiX32s1y0tnp4cIqBEC1QjTaXe2k,1086
|
|
102
|
+
flowcept-0.9.17.dist-info/RECORD,,
|
resources/sample_settings.yaml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
flowcept_version: 0.9.
|
|
1
|
+
flowcept_version: 0.9.17 # 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.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|