def of_json
import cswap-bend-cli@0.1.0.0/profile.bend as Profileimport Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/policy/safe.bend as SF
105# A stored profile over the algorithm of the built-in it replaces.
106def of_json(+name: String, +j: Json.Json, +base: SF.Algo) -> Prof:
107 Prof{name, algo_of(Json.get("strategy", j), base), num_text(Json.get("threshold", j)), models_text(Json.get("models", j)),
108 num_text(Json.get("cooldown_s", j)), num_text(Json.get("interval_s", j))}