conditionally run processing_script

modified:   app.py
	modified:   research/activity22-odds-or-evens.yaml
	modified:   research/activity24-math-plot.yaml
	modified:   research/activity27-tic-tac-toe.yaml
	modified:   research/guarded_ai.py
This commit is contained in:
Russell Ballestrini 2024-08-24 14:31:46 -04:00
parent 691e4ab054
commit df54e6b4aa
5 changed files with 12 additions and 12 deletions

View file

@ -290,11 +290,15 @@ def simulate_activity(yaml_file_path):
metadata_tmp_keys.append(random_key) # Track temporary keys
# Execute the processing script if it exists
if "processing_script" in step:
if "processing_script" in step and transition.get("run_processing_script", False):
result = execute_processing_script(metadata, step["processing_script"])
metadata["processing_script_result"] = result
metadata_tmp_keys.append("processing_script_result")
# Update metadata with results from the processing script
for key, value in result.get("metadata", {}).items():
metadata[key] = value
print(f"\nMetadata: {json.dumps(metadata, indent=2)}")
# Provide feedback based on the category