clef-decision-workflow / workflow.json
akhaliq's picture
akhaliq HF Staff
Fix 401: load example image from public CC0 dataset linoyts/repo-to-space-example-inputs
de4a1eb verified
Raw History Blame Contribute Delete
4.39 kB
{
"schema_version": "2",
"name": "Clef Decision Workflow",
"runtime": {
"default": "client"
},
"references": [
{
"id": "ref_state",
"label": "State",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"width": 300,
"x": 60,
"y": 60,
"data": {
"out": "A user uploaded this photo to a restaurant review listing."
}
},
{
"id": "ref_questions",
"label": "Questions (JSON schema)",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"width": 300,
"x": 60,
"y": 340,
"data": {
"out": "{\n \"category\": {\n \"type\": \"choice\",\n \"instructions\": \"What does the photo mainly show?\",\n \"criteria\": {\n \"food\": \"A dish or drink\",\n \"interior\": \"The inside of a venue\",\n \"people\": \"People or portraits\",\n \"other\": \"Anything else\"\n }\n },\n \"appetizing\": {\n \"type\": \"score\",\n \"instructions\": \"How appetizing is the photo?\",\n \"criteria\": [\"Unappetizing\", \"Neutral\", \"Appetizing\", \"Very appetizing\"]\n },\n \"safe\": {\n \"type\": \"noul\",\n \"instructions\": \"Is the photo safe to publish on the listing?\"\n }\n}"
}
},
{
"id": "ref_image",
"label": "Image (optional)",
"role": "reference",
"asset_type": "image",
"inputs": [{"id": "in", "label": "Image", "type": "image"}],
"outputs": [{"id": "out", "label": "Image", "type": "image"}],
"width": 300,
"x": 60,
"y": 640,
"data": {
"out": {
"name": "gourmet_burger.jpg",
"url": "https://huggingface.co/datasets/linoyts/repo-to-space-example-inputs/resolve/main/gourmet_burger.jpg",
"mime": "image/jpeg"
}
}
}
],
"operators": [
{
"id": "op_decide",
"label": "Clef · decide",
"role": "operator",
"kind": "fn",
"fn": "decide",
"inputs": [
{"id": "in_state", "label": "state", "type": "text", "required": true},
{"id": "in_questions", "label": "questions", "type": "text", "required": true},
{"id": "in_image", "label": "image", "type": "image"}
],
"outputs": [
{"id": "out_0", "label": "report", "type": "html", "output_index": 0},
{"id": "out_1", "label": "response", "type": "json", "output_index": 1}
],
"width": 260,
"x": 480,
"y": 300,
"data": {}
}
],
"subjects": [
{
"id": "sub_report",
"label": "Decision Report",
"role": "subject",
"asset_type": "html",
"inputs": [{"id": "in", "label": "HTML", "type": "html"}],
"outputs": [{"id": "out", "label": "HTML", "type": "html"}],
"width": 380,
"x": 860,
"y": 100,
"data": {}
},
{
"id": "sub_json",
"label": "SystemOne Response",
"role": "subject",
"asset_type": "json",
"inputs": [{"id": "in", "label": "JSON", "type": "json"}],
"outputs": [{"id": "out", "label": "JSON", "type": "json"}],
"width": 380,
"x": 860,
"y": 480,
"data": {}
}
],
"edges": [
{
"id": "e1",
"from_node_id": "ref_state",
"from_port_id": "out",
"to_node_id": "op_decide",
"to_port_id": "in_state",
"type": "text"
},
{
"id": "e2",
"from_node_id": "ref_questions",
"from_port_id": "out",
"to_node_id": "op_decide",
"to_port_id": "in_questions",
"type": "text"
},
{
"id": "e3",
"from_node_id": "ref_image",
"from_port_id": "out",
"to_node_id": "op_decide",
"to_port_id": "in_image",
"type": "image"
},
{
"id": "e4",
"from_node_id": "op_decide",
"from_port_id": "out_0",
"to_node_id": "sub_report",
"to_port_id": "in",
"type": "html"
},
{
"id": "e5",
"from_node_id": "op_decide",
"from_port_id": "out_1",
"to_node_id": "sub_json",
"to_port_id": "in",
"type": "json"
}
],
"view": {
"default": "canvas"
}
}