Skip to main content
All Code_block objects have a field, api, that is a JSON representaition of the code block’s attributes. These attributes define the behaviour of the code block when it is rendered as a node in the workspace. Example of attributes fields defining two receivers with textbox controls and one transmitter:
{
    [..] # other fields not relevant to the attributes
    "attributes": [
        {"kind": "string",
         "name": "template prompt",
         "value": "<some text here>",
         "hidden": false,
         "control":
            {"kind": "textbox",
            "rows": 20,
            "regex": ".*",
            "max_len": 3024,
            "min_len": 0,
            "placeholder": ""},
        "direction": "RECEIVER"},
        {"kind": "string",
         "name": "user prompt", 
         "value": null, 
         "hidden": false,
         "control":
            {"kind": "textbox",
            "rows": 20,
            "regex": ".*", 
            "max_len": 3024, 
            "min_len": 0, 
            "placeholder": ""}, 
         "direction": "RECEIVER"},
        {"kind": "string",
         "name": "processed prompt", 
         "value": null, 
         "hidden": false, 
         "control": null, 
         "direction": "TRANSMITTER"}
        ]
}