Source: factory.core/ObjDecisionSwitch.py
Manages and executes decision switch logic based on data stored
in a database. It uses a tree-like structure of "decision nodes"
to make decisions.
| Method | Signature | Description |
|---|---|---|
| clean_value | clean_value(value: str | int | float) -> str |
|
| get_prompts | get_prompts(key: str = '') -> str | dict |
Load AI prompts from the YAML file. |
| is_valid_float | is_valid_float(s: str | int | float) -> bool |
|
| evaluate | evaluate(value1: str | int | float, operator: str, value2: str | int | float) -> bool |
Evaluate a condition using the unified |
| read | read(decision_name: str, version: str | None = None) -> None |
|
| create_simulation_data_table | create_simulation_data_table(decision_name: str, table_name: str) -> None |
Create simulation input table for a decision tree. |
| run_bulk | run_bulk(decision_name: str, input_table: str | None = None, rebuild: bool = False) -> dict |
Apply a decision tree to the entire |
| simulate | simulate(decision_name: str, input_guid: str = '', write_back: bool = False) -> None |
Run decision simulation from configured DataTable. |
| get_matched_value | get_matched_value(context: SimulationContext, field: str, run_context: dict[str, str] | None = None) -> str | None |
|
| compute_decision | compute_decision(context: SimulationContext, run_context: dict | None = None) -> str | None |
Import a decision tree CSV as a new version.
Run a decision tree.
List all decision trees.
Set the DataTable for a decision tree.
Email the latest sim report for a decision tree.
Print a long-form guide to the CLI: workflow,