TaskState

The TaskState contains several inputs, outputs, and a bound module. An example is like:

set_topics_state = TaskState(
    name="set_topics_state",
    module_type='JsonRWFunctionModule',
    config=dict(
        filename=f"${{f'{demo_root}/data/app/curriculum/{{language}}/topics.json'}}",
        mode="read",
        var_type="dict",
        var_name="level2topics",
    ),
    outputs={
        "topics": ValueType(
            type="str",
            value="${level2topics[level] if level in level2topics else ['']}",
        ),
    },
),

where the the in-line expression can be used in the config and the value of the outputs

Last updated