fastworkflow 2.8.17__py3-none-any.whl → 2.8.18__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.
- fastworkflow/command_directory.py +1 -3
- fastworkflow/command_routing.py +34 -32
- fastworkflow/model_pipeline_training.py +4 -7
- fastworkflow/workflow.py +1 -1
- {fastworkflow-2.8.17.dist-info → fastworkflow-2.8.18.dist-info}/METADATA +1 -1
- {fastworkflow-2.8.17.dist-info → fastworkflow-2.8.18.dist-info}/RECORD +9 -9
- {fastworkflow-2.8.17.dist-info → fastworkflow-2.8.18.dist-info}/LICENSE +0 -0
- {fastworkflow-2.8.17.dist-info → fastworkflow-2.8.18.dist-info}/WHEEL +0 -0
- {fastworkflow-2.8.17.dist-info → fastworkflow-2.8.18.dist-info}/entry_points.txt +0 -0
@@ -581,9 +581,7 @@ def get_cached_command_directory(workflow_folderpath: str) -> CommandDirectory:
|
|
581
581
|
|
582
582
|
# Fast-path: load JSON if it is newer than any source file
|
583
583
|
if cache_file.exists() and cache_file.stat().st_mtime > latest_src_mtime:
|
584
|
-
|
585
|
-
# If deserialization fails, we'll just rebuild.
|
586
|
-
return CommandDirectory.model_validate_json(cache_file.read_text())
|
584
|
+
return CommandDirectory.model_validate_json(cache_file.read_text())
|
587
585
|
|
588
586
|
# (Re)build and persist
|
589
587
|
directory = CommandDirectory.load(workflow_folderpath)
|
fastworkflow/command_routing.py
CHANGED
@@ -26,6 +26,7 @@ from fastworkflow import ModuleType
|
|
26
26
|
from fastworkflow.command_directory import CommandDirectory, UtteranceMetadata, get_cached_command_directory
|
27
27
|
from fastworkflow.command_context_model import CommandContextModel
|
28
28
|
from fastworkflow.utils import python_utils
|
29
|
+
from fastworkflow.utils.logging import logger
|
29
30
|
|
30
31
|
|
31
32
|
class RoutingDefinition(BaseModel):
|
@@ -237,36 +238,35 @@ class RoutingDefinition(BaseModel):
|
|
237
238
|
in the format 'ContextName/command_name'. This method ensures these qualified names
|
238
239
|
are properly handled when building the routing definition.
|
239
240
|
"""
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
for
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
raise
|
241
|
+
# Use cached command directory to avoid repeated filesystem scanning
|
242
|
+
command_directory = get_cached_command_directory(workflow_folderpath)
|
243
|
+
context_model = CommandContextModel.load(workflow_folderpath)
|
244
|
+
|
245
|
+
# Use dynamically discovered core commands
|
246
|
+
core_commands = command_directory.core_command_names
|
247
|
+
|
248
|
+
resolved_contexts = {}
|
249
|
+
for context_name in context_model._command_contexts:
|
250
|
+
# Get commands for this context from the context model
|
251
|
+
context_commands = context_model.commands(context_name)
|
252
|
+
|
253
|
+
# Add core commands to every context
|
254
|
+
resolved_contexts[context_name] = sorted(set(context_commands) | set(core_commands))
|
255
|
+
|
256
|
+
# Ensure global context '*' also exists with core commands (if not in model)
|
257
|
+
if '*' not in resolved_contexts:
|
258
|
+
resolved_contexts['*'] = sorted(core_commands)
|
259
|
+
# except Exception as e:
|
260
|
+
# # Handle errors gracefully for tests expecting this behavior
|
261
|
+
# # This matches the behavior of the original CommandRouter
|
262
|
+
# if "_commands" not in str(e) and "does not exist" not in str(e):
|
263
|
+
# # Re-raise unexpected errors
|
264
|
+
# raise
|
265
265
|
|
266
266
|
# For missing directories, return an empty definition
|
267
|
-
command_directory = CommandDirectory(workflow_folderpath=workflow_folderpath)
|
268
|
-
context_model = CommandContextModel(_workflow_path=workflow_folderpath, _command_contexts={})
|
269
|
-
resolved_contexts = {"*": []}
|
267
|
+
# command_directory = CommandDirectory(workflow_folderpath=workflow_folderpath)
|
268
|
+
# context_model = CommandContextModel(_workflow_path=workflow_folderpath, _command_contexts={})
|
269
|
+
# resolved_contexts = {"*": []}
|
270
270
|
|
271
271
|
routing_definition = cls(
|
272
272
|
workflow_folderpath=workflow_folderpath,
|
@@ -275,10 +275,12 @@ class RoutingDefinition(BaseModel):
|
|
275
275
|
contexts=resolved_contexts,
|
276
276
|
)
|
277
277
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
278
|
+
# Only save if we were able to build successfully
|
279
|
+
if resolved_contexts != {"*": []}:
|
280
|
+
routing_definition.save()
|
281
|
+
else:
|
282
|
+
logger.error(f"Could not build command_routing_defintion.json for workflow folderpath {workflow_folderpath}")
|
283
|
+
|
282
284
|
return routing_definition
|
283
285
|
|
284
286
|
def scan(self, use_cache=True):
|
@@ -1069,13 +1069,10 @@ def train(workflow: fastworkflow.Workflow):
|
|
1069
1069
|
|
1070
1070
|
|
1071
1071
|
text = "list commands"
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
print(f"Used DistilBERT: {'Yes' if result['used_distil'] else 'No'}")
|
1077
|
-
except ValueError as e:
|
1078
|
-
print(f"Error: {e}")
|
1072
|
+
result = predict_single_sentence(pipeline, text, label_path)
|
1073
|
+
print(f"Predicted label: {result['label']}")
|
1074
|
+
print(f"Confidence: {result['confidence']:.4f}")
|
1075
|
+
print(f"Used DistilBERT: {'Yes' if result['used_distil'] else 'No'}")
|
1079
1076
|
|
1080
1077
|
# End of context loop
|
1081
1078
|
return None
|
fastworkflow/workflow.py
CHANGED
@@ -297,7 +297,7 @@ class Workflow:
|
|
297
297
|
)
|
298
298
|
shutil.rmtree(sessiondb_folderpath, ignore_errors=True)
|
299
299
|
except OSError as e:
|
300
|
-
logger.error(f"Error closing session: {e}")
|
300
|
+
logger.error(f"Error closing session: {e}", stack_info=True)
|
301
301
|
return False
|
302
302
|
|
303
303
|
return True
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastworkflow
|
3
|
-
Version: 2.8.
|
3
|
+
Version: 2.8.18
|
4
4
|
Summary: A framework for rapidly building large-scale, deterministic, interactive workflows with a fault-tolerant, conversational UX
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: fastworkflow,ai,workflow,llm,openai
|
@@ -33,10 +33,10 @@ fastworkflow/cache_matching.py,sha256=WoSQ7QuVGqOnecsIIdwb3A6gBpt0OJdSzx_a51nHoF
|
|
33
33
|
fastworkflow/chat_session.py,sha256=lEpJmU_2a-4pB4QR7wACl8jHWZls1ROtQGgdVObY3BA,12308
|
34
34
|
fastworkflow/cli.py,sha256=SVIvd-GEfwAdWQT7om5DC9MC5wLivP_bXlgMF0T5Cjw,21736
|
35
35
|
fastworkflow/command_context_model.py,sha256=nWxLP3TR7WJr3yWCedqcdFOxo_kwae_mS3VRN2cOmK8,13437
|
36
|
-
fastworkflow/command_directory.py,sha256=
|
36
|
+
fastworkflow/command_directory.py,sha256=apnLv4o-Z2Hpa3B6tFtRb3YAVUimgiIbxQhmjlfM9jY,27014
|
37
37
|
fastworkflow/command_executor.py,sha256=bKqOHBEVhCunE3B-zh6DNLERUiSmEiVJdfEoVVUq-zM,6412
|
38
38
|
fastworkflow/command_interfaces.py,sha256=PWIKlcp0G8nmYl0vkrg1o6QzJL0pxXkfrn1joqTa0eU,460
|
39
|
-
fastworkflow/command_routing.py,sha256=
|
39
|
+
fastworkflow/command_routing.py,sha256=TZ8SahPEEBxmUBx-E2mdUzvVbOUKOW5xLxsQ73QMUgw,15632
|
40
40
|
fastworkflow/docs/context_modules_prd.txt,sha256=9wvs3LgNoIVXAczo1sXBIV4YmFqVhzC2ja1T3K7FG04,2199
|
41
41
|
fastworkflow/examples/fastworkflow.env,sha256=5yQTfQpK99TR5dLwKVOwFatuC1G73Rkng2hv2IjX6cg,645
|
42
42
|
fastworkflow/examples/fastworkflow.passwords.env,sha256=zucqjXFPsp-SRtDBNn_v7h_N1l8uNBcMEHqQoIcQa6M,355
|
@@ -122,7 +122,7 @@ fastworkflow/examples/todo_list/application/todo_manager.py,sha256=0WBtJ04O9tU-l
|
|
122
122
|
fastworkflow/examples/todo_list/context_hierarchy_model.json,sha256=S_MoRhdj2o9_VhAdYpO64VIhlAUwFlWfvSs9T_7FPYA,219
|
123
123
|
fastworkflow/examples/todo_list/startup_action.json,sha256=gj0-B4CqTYCs8OwHKhTu95H4uZbLsDf1th06IFfNXVs,75
|
124
124
|
fastworkflow/mcp_server.py,sha256=Q1_KBwXg5EaJMz232OHNjH1fRg7BuZcJ7T7872qfDco,7783
|
125
|
-
fastworkflow/model_pipeline_training.py,sha256=
|
125
|
+
fastworkflow/model_pipeline_training.py,sha256=St4Qgcf6Yq-xfX2txJ9S2mL1jRTO9g3OMvJ06vnzLQ4,44226
|
126
126
|
fastworkflow/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
127
127
|
fastworkflow/run/__main__.py,sha256=uFENKUAPEJKOH5o7KzYtwkyKSI1sDFEwx1TNodeLVnA,5789
|
128
128
|
fastworkflow/run_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -145,9 +145,9 @@ fastworkflow/utils/parameterize_func_decorator.py,sha256=V6YJnishWRCdwiBQW6P17hm
|
|
145
145
|
fastworkflow/utils/pydantic_model_2_dspy_signature_class.py,sha256=w1pvl8rJq48ulFwaAtBgfXYn_SBIDBgq1aLMUg1zJn8,12875
|
146
146
|
fastworkflow/utils/python_utils.py,sha256=Lt6P8lBMbLuLZaP9gd_7Kl7UvSPLm-NKPN6cPUdn53w,8194
|
147
147
|
fastworkflow/utils/signatures.py,sha256=4ksF-65Q-22ZR_SW8O_cv5RhKKk0ecmWgykoAGKxr-k,19957
|
148
|
-
fastworkflow/workflow.py,sha256=
|
149
|
-
fastworkflow-2.8.
|
150
|
-
fastworkflow-2.8.
|
151
|
-
fastworkflow-2.8.
|
152
|
-
fastworkflow-2.8.
|
153
|
-
fastworkflow-2.8.
|
148
|
+
fastworkflow/workflow.py,sha256=URYIgoBObL4Ota1BMdW4kqmepi6E_tCoZBXCFS33qOw,16453
|
149
|
+
fastworkflow-2.8.18.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
150
|
+
fastworkflow-2.8.18.dist-info/METADATA,sha256=28UVosFRzlnPp1TPTFHUj85hJ1bXPErETU0uOhm5BO0,15387
|
151
|
+
fastworkflow-2.8.18.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
152
|
+
fastworkflow-2.8.18.dist-info/entry_points.txt,sha256=m8HqoPzCyaZLAx-V5X8MJgw3Lx3GiPDlxNEZ7K-Gb-U,54
|
153
|
+
fastworkflow-2.8.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|