flowcept 0.9.9__py3-none-any.whl → 0.9.10__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/__init__.py CHANGED
@@ -41,6 +41,11 @@ def __getattr__(name):
41
41
 
42
42
  return FlowceptLoop
43
43
 
44
+ elif name == "FlowceptLightweightLoop":
45
+ from flowcept.instrumentation.flowcept_loop import FlowceptLightweightLoop
46
+
47
+ return FlowceptLightweightLoop
48
+
44
49
  elif name == "telemetry_flowcept_task":
45
50
  from flowcept.instrumentation.flowcept_task import telemetry_flowcept_task
46
51
 
@@ -74,6 +79,7 @@ __all__ = [
74
79
  "TaskQueryAPI",
75
80
  "flowcept_task",
76
81
  "FlowceptLoop",
82
+ "FlowceptLightweightLoop",
77
83
  "FlowceptTask",
78
84
  "telemetry_flowcept_task",
79
85
  "lightweight_flowcept_task",
@@ -39,9 +39,10 @@ def main():
39
39
  st.caption(
40
40
  "💡 Quick help\n"
41
41
  "Ask about workflow metrics, plots, or summaries.\n\n"
42
- "Inputs used, outputs generated.\n"
43
- "Commands: @record <note> add @show records list reset context clear • save context save.\n"
44
- "Tip: set result = df to run ad-hoc Python on the in-memory DataFrame."
42
+ "I have an internal DataFrame in my context to which you can ask direct questions."
43
+ "Tasks inputs are mapped to `used.*` fields, and outputs to `generated.*`\n"
44
+ "Commands: `@record <note>`; \n `@show records`; \n `reset context` ; `save context` \n"
45
+ "Tip: Inputs like `result = df[some valid df query]` will run direct queries to the df in context."
45
46
  )
46
47
 
47
48
  user_input = st.chat_input("Send a message")
@@ -104,25 +104,6 @@ def reset_records() -> ToolResult:
104
104
  except Exception as e:
105
105
  return ToolResult(code=499, result=str(e))
106
106
 
107
- @mcp_flowcept.tool()
108
- def show_records() -> ToolResult:
109
- """
110
- Lists all recorded user guidance.
111
- """
112
- try:
113
- ctx = mcp_flowcept.get_context()
114
- custom_guidance: List = ctx.request_context.lifespan_context.custom_guidance
115
- if not custom_guidance:
116
- message = "There is no recorded user guidance."
117
- else:
118
- message = "This is the list of custom guidance I have in my memory:"
119
- message += "\n".join(f"- {msg}" for msg in custom_guidance)
120
-
121
- return ToolResult(code=201, result=message)
122
- except Exception as e:
123
- return ToolResult(code=499, result=str(e))
124
-
125
-
126
107
 
127
108
  @mcp_flowcept.tool()
128
109
  def prompt_handler(message: str) -> ToolResult:
flowcept/cli.py CHANGED
@@ -106,7 +106,7 @@ def stream_messages(messages_file_path: Optional[str] = None, keys_to_show: List
106
106
  Listen to Flowcept's message stream and optionally echo/save messages.
107
107
 
108
108
  Parameters.
109
- ----------
109
+ -----------
110
110
  messages_file_path : str, optional
111
111
  If provided, append each message as JSON (one per line) to this file.
112
112
  If the file already exists, a new timestamped file is created instead.
@@ -350,7 +350,7 @@ def agent_client(tool_name: str, kwargs: str = None):
350
350
  """Agent Client.
351
351
 
352
352
  Parameters.
353
- ----------
353
+ -----------
354
354
  tool_name : str
355
355
  Name of the tool
356
356
  kwargs : str, optional
@@ -35,3 +35,23 @@ class Status(str, Enum):
35
35
  def get_finished_statuses():
36
36
  """Get finished status."""
37
37
  return [Status.FINISHED, Status.ERROR]
38
+
39
+
40
+ class MimeType(Enum):
41
+ """MimeTypes used in Flowcept."""
42
+
43
+ JPEG = "image/jpeg"
44
+ PNG = "image/png"
45
+ GIF = "image/gif"
46
+ BMP = "image/bmp"
47
+ TIFF = "image/tiff"
48
+ WEBP = "image/webp"
49
+ SVG = "image/svg+xml"
50
+
51
+ # Documents
52
+ PDF = "application/pdf"
53
+
54
+ # Data formats
55
+ JSON = "application/json"
56
+ CSV = "text/csv"
57
+ JSONL = "application/x-ndjson" # standard for JSON Lines
flowcept/configs.py CHANGED
@@ -86,8 +86,8 @@ MQ_PASSWORD = settings["mq"].get("password", None)
86
86
  MQ_HOST = os.getenv("MQ_HOST", settings["mq"].get("host", "localhost"))
87
87
  MQ_PORT = int(os.getenv("MQ_PORT", settings["mq"].get("port", "6379")))
88
88
  MQ_URI = os.getenv("MQ_URI", settings["mq"].get("uri", None))
89
- MQ_BUFFER_SIZE = settings["mq"].get("buffer_size", None)
90
- MQ_INSERTION_BUFFER_TIME = settings["mq"].get("insertion_buffer_time_secs", None)
89
+ MQ_BUFFER_SIZE = settings["mq"].get("buffer_size", 1)
90
+ MQ_INSERTION_BUFFER_TIME = settings["mq"].get("insertion_buffer_time_secs", 1)
91
91
  MQ_TIMING = settings["mq"].get("timing", False)
92
92
  MQ_CHUNK_SIZE = int(settings["mq"].get("chunk_size", -1))
93
93
 
@@ -44,7 +44,7 @@ class Flowcept(object):
44
44
  def __init__(
45
45
  self,
46
46
  interceptors: List[str] = None,
47
- bundle_exec_id=None,
47
+ bundle_exec_id: str = None,
48
48
  campaign_id: str = None,
49
49
  workflow_id: str = None,
50
50
  workflow_name: str = None,
@@ -68,7 +68,7 @@ class Flowcept(object):
68
68
  Examples: "instrumentation", "dask", "mlflow", ...
69
69
  The order of interceptors matters — place the outer-most interceptor first,
70
70
 
71
- bundle_exec_id : Any, optional
71
+ bundle_exec_id : str, optional
72
72
  Identifier for grouping interceptors in a bundle, essential for the correct initialization and stop of
73
73
  interceptors. If not provided, a unique ID is assigned.
74
74
 
@@ -101,9 +101,9 @@ class Flowcept(object):
101
101
  self.buffer = None
102
102
  self._check_safe_stops = check_safe_stops
103
103
  if bundle_exec_id is None:
104
- self._bundle_exec_id = id(self)
104
+ self.bundle_exec_id = str(id(self))
105
105
  else:
106
- self._bundle_exec_id = bundle_exec_id
106
+ self.bundle_exec_id = str(bundle_exec_id)
107
107
 
108
108
  self.enabled = True
109
109
  self.is_started = False
@@ -154,7 +154,7 @@ class Flowcept(object):
154
154
  Flowcept.current_workflow_id = self.current_workflow_id
155
155
 
156
156
  interceptor_inst = BaseInterceptor.build(interceptor)
157
- interceptor_inst.start(bundle_exec_id=self._bundle_exec_id, check_safe_stops=self._check_safe_stops)
157
+ interceptor_inst.start(bundle_exec_id=self.bundle_exec_id, check_safe_stops=self._check_safe_stops)
158
158
  self._interceptor_instances.append(interceptor_inst)
159
159
  if isinstance(interceptor_inst._mq_dao.buffer, AutoflushBuffer):
160
160
  Flowcept.buffer = self.buffer = interceptor_inst._mq_dao.buffer.current_buffer
@@ -297,7 +297,7 @@ class Flowcept(object):
297
297
 
298
298
  from flowcept.flowceptor.consumers.document_inserter import DocumentInserter
299
299
 
300
- doc_inserter = DocumentInserter(check_safe_stops=self._check_safe_stops, bundle_exec_id=self._bundle_exec_id)
300
+ doc_inserter = DocumentInserter(check_safe_stops=self._check_safe_stops, bundle_exec_id=self.bundle_exec_id)
301
301
  doc_inserter.start()
302
302
  self._db_inserters.append(doc_inserter)
303
303
 
@@ -316,7 +316,7 @@ class Flowcept(object):
316
316
  if len(self._db_inserters):
317
317
  self.logger.info("Stopping DB Inserters...")
318
318
  for db_inserter in self._db_inserters:
319
- db_inserter.stop(bundle_exec_id=self._bundle_exec_id)
319
+ db_inserter.stop(bundle_exec_id=self.bundle_exec_id)
320
320
 
321
321
  Flowcept.buffer = self.buffer = None
322
322
  self.is_started = False
@@ -346,8 +346,7 @@ class Flowcept(object):
346
346
  - The method tests the liveness of the MQ service using `MQDao`.
347
347
  - If `MONGO_ENABLED` is True, it also checks the liveness of the MongoDB service
348
348
  using `MongoDBDAO`.
349
- - Logs errors if any service is not ready, and logs success when both services are
350
- operational.
349
+ - Logs errors if any service is not ready, and logs success when both services are operational.
351
350
 
352
351
  Examples
353
352
  --------
@@ -49,6 +49,7 @@ class FlowceptLoop:
49
49
  ----------
50
50
  items : Union[Sized, Iterator, int]
51
51
  The items to iterate over. Can be:
52
+
52
53
  - A sized iterable (e.g., list, range).
53
54
  - An integer (interpreted as ``range(items)``).
54
55
  - An iterator (requires ``items_length`` if length cannot be inferred).
@@ -216,8 +217,7 @@ class FlowceptLightweightLoop:
216
217
 
217
218
  The `FlowceptLightweightLoop` class supports iterating over a collection of items or a numeric
218
219
  range while capturing metadata for each iteration and for the loop as a whole.
219
- This is particularly useful in scenarios where tracking and instrumentation of loop executions
220
- is required.
220
+ This is particularly useful in scenarios where tracking and instrumentation of loop executions is required.
221
221
 
222
222
  Parameters
223
223
  ----------
@@ -269,6 +269,7 @@ class FlowceptLightweightLoop:
269
269
  ----------
270
270
  items : Union[Sized, Iterator]
271
271
  The items to iterate over. Must either be:
272
+
272
273
  - A sized iterable (with ``__len__``).
273
274
  - An explicit iterator (length must be given by ``items_length``).
274
275
  loop_name : str, optional
flowcept/version.py CHANGED
@@ -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.9"
7
+ __version__ = "0.9.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flowcept
3
- Version: 0.9.9
3
+ Version: 0.9.10
4
4
  Summary: Capture and query workflow provenance data using data observability
5
5
  Author: Oak Ridge National Laboratory
6
6
  License-Expression: MIT
@@ -56,6 +56,7 @@ Requires-Dist: tensorflow; extra == 'all'
56
56
  Requires-Dist: tomli; extra == 'all'
57
57
  Requires-Dist: watchdog; extra == 'all'
58
58
  Provides-Extra: analytics
59
+ Requires-Dist: matplotlib; extra == 'analytics'
59
60
  Requires-Dist: plotly; extra == 'analytics'
60
61
  Requires-Dist: scipy; extra == 'analytics'
61
62
  Requires-Dist: seaborn; extra == 'analytics'
@@ -1,7 +1,7 @@
1
- flowcept/__init__.py,sha256=urpwIEJeikV0P6ORXKsM5Lq4o6wCwhySS9A487BYGy4,2241
2
- flowcept/cli.py,sha256=eVnUrmZtVhZ1ldRMGB1QsqBzNC1Pf2CX33efnlaZ4gs,22842
3
- flowcept/configs.py,sha256=aXgBkBpTs4_4MpvAe76aQ5lXl1gTmgk92bFiNqMQXPM,8382
4
- flowcept/version.py,sha256=ueMAMza92zxBIjD4eZdTMYArVaKDr6QL5eZ23IZjyd4,306
1
+ flowcept/__init__.py,sha256=BjvLyDiPpsnSZMFXwmwcL-cpTURe2lCEV2M2aoR0GP4,2440
2
+ flowcept/cli.py,sha256=Wmj83BaQz4dkHvfLV4wLQJcgFgf7cQZJk0-l9xSKlEk,22844
3
+ flowcept/configs.py,sha256=EfH23b8ix0rQ7kFD9fd2Q33bOnhyIv3CctbJ8FpkVCc,8376
4
+ flowcept/version.py,sha256=mvKXD-9NFAU6Je2DYjAL5IfbuFKjy3TnoVI0gK5tiq0,307
5
5
  flowcept/agents/__init__.py,sha256=8eeD2CiKBtHiDsWdrHK_UreIkKlTq4dUbhHDyzw372o,175
6
6
  flowcept/agents/agent_client.py,sha256=UiBQkC9WE2weLZR2OTkEOEQt9-zqQOkPwRA17HfI-jk,2027
7
7
  flowcept/agents/agents_utils.py,sha256=Az5lvWTsBHs_3sWWwy7jSdDjNn-PvZ7KmYd79wxvdyU,6666
@@ -9,7 +9,7 @@ flowcept/agents/dynamic_schema_tracker.py,sha256=TsmXRRkyUkqB-0bEgmeqSms8xj1tMMJ
9
9
  flowcept/agents/flowcept_agent.py,sha256=1sidjnNMdG0S6lUKBvml7ZfIb6o3u7zc6HNogsJbl9g,871
10
10
  flowcept/agents/flowcept_ctx_manager.py,sha256=-WmkddzzFY2dnU9LbZaoY4-5RcSAQH4FziEJgcC5LEI,7083
11
11
  flowcept/agents/gui/__init__.py,sha256=Qw9YKbAzgZqBjMQGnF7XWmfUo0fivtkDISQRK3LA3gU,113
12
- flowcept/agents/gui/agent_gui.py,sha256=44G6AXM9zJbVcJUziZcU5aA6mVDwtvgO8H58nTCFC0M,2855
12
+ flowcept/agents/gui/agent_gui.py,sha256=VpwhQamzFKBfrmibxOIc-8wXtZnd2Cq7tbKahZZOp7c,2995
13
13
  flowcept/agents/gui/audio_utils.py,sha256=piA_dc36io1sYqLF6QArS4AMl-cfDa001jGhYz5LkB4,4279
14
14
  flowcept/agents/gui/gui_utils.py,sha256=cQVhOgnfxJNUVZyXyO8f40nB1yaKAKVtBrwQmJjL0B0,14933
15
15
  flowcept/agents/llms/__init__.py,sha256=kzOaJic5VhMBnGvy_Fr5C6sRKVrRntH1ZnYz7f5_4-s,23
@@ -19,7 +19,7 @@ flowcept/agents/prompts/__init__.py,sha256=7ICsNhLYzvPS1esG3Vg519s51b1c4yN0WegJU
19
19
  flowcept/agents/prompts/general_prompts.py,sha256=b0QhnF-ytIE1_WWrgpamC4VybjS8KuS051DgVVt8r2U,3961
20
20
  flowcept/agents/prompts/in_memory_query_prompts.py,sha256=iRaGySybNxZf5vuQ3n9cb14VNk6bMQ0z3tn2mVVke0E,19817
21
21
  flowcept/agents/tools/__init__.py,sha256=Xqz2E4-LL_7DDcm1XYJFx2f5RdAsjeTpOJb_DPC7xyc,27
22
- flowcept/agents/tools/general_tools.py,sha256=yOxNb7ZgrP93Ky85cdjiZkCZSH_1biB0pA2K1e9bzFQ,5038
22
+ flowcept/agents/tools/general_tools.py,sha256=JSMG_UGdRKcQfC4_ixzDXDHW92UX5i0UsLTzFq0fmZg,4402
23
23
  flowcept/agents/tools/in_memory_queries/__init__.py,sha256=K8-JI_lXUgquKkgga8Nef8AntGg_logQtjjQjaEE7yI,39
24
24
  flowcept/agents/tools/in_memory_queries/in_memory_queries_tools.py,sha256=GcfAiUBhQ1DU3QKk0kAy9TSq8XmZw691Xs0beZoO76A,25984
25
25
  flowcept/agents/tools/in_memory_queries/pandas_agent_utils.py,sha256=xyrZupR86qoUptnnQ7PeF0LTzSOquEK2cjc0ghT1KBs,9018
@@ -34,7 +34,7 @@ flowcept/commons/query_utils.py,sha256=3tyK5VYA10iDtmtzNwa8OQGn93DBxsu6rTjHDphft
34
34
  flowcept/commons/settings_factory.py,sha256=bMTjgXRfb5HsL2lPnLfem-9trqELbNWE04Ie7lSlxYM,1731
35
35
  flowcept/commons/task_data_preprocess.py,sha256=-ceLexv2ZfZOAYF43DPagGwQPgt_L_lNKuK8ZCpnzXs,13914
36
36
  flowcept/commons/utils.py,sha256=gF6ENWlTpR2ZSw3yVNPNBTVzSpcgy-WuzYzwWSXXsug,9252
37
- flowcept/commons/vocabulary.py,sha256=_GzHJ1wSYJlLsu_uu1Am6N3zvc59S4FCuT5yp7lynPw,713
37
+ flowcept/commons/vocabulary.py,sha256=0psC4NulNFn88mjTcoT_aT4QxX8ljMFgTOF3FxzM40A,1118
38
38
  flowcept/commons/daos/__init__.py,sha256=RO51svfHOg9naN676zuQwbj_RQ6IFHu-RALeefvtwwk,23
39
39
  flowcept/commons/daos/keyvalue_dao.py,sha256=g7zgC9hVC1NTllwUAqGt44YqdqYUgAKgPlX8_G4BRGw,3599
40
40
  flowcept/commons/daos/redis_conn.py,sha256=gFyW-5yf6B8ExEYopCmbap8ki-iEwuIw-KH9f6o7UGQ,1495
@@ -54,7 +54,7 @@ flowcept/commons/flowcept_dataclasses/telemetry.py,sha256=9_5ONCo-06r5nKHXmi5HfI
54
54
  flowcept/commons/flowcept_dataclasses/workflow_object.py,sha256=cauWtXHhBv9lHS-q6cb7yUsNiwQ6PkZPuSinR1TKcqU,6161
55
55
  flowcept/flowcept_api/__init__.py,sha256=T1ty86YlocQ5Z18l5fUqHj_CC6Unq_iBv0lFyiI7Ao8,22
56
56
  flowcept/flowcept_api/db_api.py,sha256=hKXep-n50rp9cAzV0ljk2QVEF8O64yxi3ujXv5_Ibac,9723
57
- flowcept/flowcept_api/flowcept_controller.py,sha256=jfssXUvG55RVXJBziq-lXekt7Dog3mAalo5Zsp_7_to,16060
57
+ flowcept/flowcept_api/flowcept_controller.py,sha256=ubx2a56iRqpjlSdRlUT2-tMifjjpgswZeR55vhpq4qQ,16064
58
58
  flowcept/flowcept_api/task_query_api.py,sha256=SrwB0OCVtbpvCPECkE2ySM10G_g8Wlk5PJ8h-0xEaNc,23821
59
59
  flowcept/flowcept_webserver/__init__.py,sha256=8411GIXGddKTKoHUvbo_Rq6svosNG7tG8VzvUEBd7WI,28
60
60
  flowcept/flowcept_webserver/app.py,sha256=VUV8_JZbIbx9u_1O7m7XtRdhZb_7uifUa-iNlPhmZws,658
@@ -90,13 +90,13 @@ flowcept/flowceptor/consumers/agent/base_agent_context_manager.py,sha256=5fBPYs-
90
90
  flowcept/instrumentation/__init__.py,sha256=M5bTmg80E4QyN91gUX3qfw_nbtJSXwGWcKxdZP3vJz0,34
91
91
  flowcept/instrumentation/flowcept_agent_task.py,sha256=XN9JU4LODca0SgojUm4F5iU_V8tuWkOt1fAKcoOAG34,10757
92
92
  flowcept/instrumentation/flowcept_decorator.py,sha256=X4Lp_FSsoL08K8ZhRM4mC0OjKupbQtbMQR8zxy3ezDY,1350
93
- flowcept/instrumentation/flowcept_loop.py,sha256=jea_hYPuXg5_nOWf-nNb4vx8A__OBM4m96_92-J51o4,15670
93
+ flowcept/instrumentation/flowcept_loop.py,sha256=CZ7iuivE_UwAMSgga6cDMjGOALfwvSNA1DMVPDXtXv8,15667
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=2IxbkbpFEymoUk-qcR70wsdXX2Y2cVP31cVWDVy0BNg,6779
98
- flowcept-0.9.9.dist-info/METADATA,sha256=NoHey7ehIO4kN0PrOCbz4z-TQ1Susn_yFOTsbd464uk,32439
99
- flowcept-0.9.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
100
- flowcept-0.9.9.dist-info/entry_points.txt,sha256=i8q67WE0201rVxYI2lyBtS52shvgl93x2Szp4q8zMlw,47
101
- flowcept-0.9.9.dist-info/licenses/LICENSE,sha256=r5-2P6tFTuRGWT5TiX32s1y0tnp4cIqBEC1QjTaXe2k,1086
102
- flowcept-0.9.9.dist-info/RECORD,,
97
+ resources/sample_settings.yaml,sha256=-EA2RrZ2enmtOnCtmLu6Kk4T_QoRxqqvVU69go6fSYo,6780
98
+ flowcept-0.9.10.dist-info/METADATA,sha256=poIzrnThG0t4-4nG9d-dP7pGOfXalW3-Sw2pyysIoqM,32488
99
+ flowcept-0.9.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
100
+ flowcept-0.9.10.dist-info/entry_points.txt,sha256=i8q67WE0201rVxYI2lyBtS52shvgl93x2Szp4q8zMlw,47
101
+ flowcept-0.9.10.dist-info/licenses/LICENSE,sha256=r5-2P6tFTuRGWT5TiX32s1y0tnp4cIqBEC1QjTaXe2k,1086
102
+ flowcept-0.9.10.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
- flowcept_version: 0.9.9 # Version of the Flowcept package. This setting file is compatible with this version.
1
+ flowcept_version: 0.9.10 # 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.