unsloth/studio/frontend/src/features/data-recipes/learning-recipes/text-to-python.json
Shine1i b80796a7cd feat: enhance markdown note blocks with style options and double-click config access
- Added support for configuring markdown note block styles, including color and opacity.
- Enabled double-click on markdown notes to open their configuration dialog.
- Adjusted layout styles in markdown previews for better interaction control.
- Updated relevant payloads, types, and UI logic to support added styling features.
- Integrated multiple example notes in learning recipes for better visualization.
2026-02-24 03:47:42 +01:00

237 lines
No EOL
7.2 KiB
JSON

{
"recipe": {
"model_providers": [
{
"name": "provider_1",
"endpoint": "https://openrouter.ai/api/v1",
"provider_type": "openai",
"extra_headers": {},
"extra_body": {}
}
],
"mcp_providers": [],
"model_configs": [
{
"alias": "model_1",
"model": "mistralai/ministral-8b-2512",
"provider": "provider_1",
"inference_parameters": {
"temperature": 0.7,
"max_tokens": 2048
}
}
],
"tool_configs": [],
"columns": [
{
"column_type": "sampler",
"name": "domain",
"drop": false,
"sampler_type": "category",
"params": {
"values": [
"Data Processing",
"Web API",
"Automation"
]
}
},
{
"column_type": "sampler",
"name": "task_type",
"drop": false,
"sampler_type": "subcategory",
"params": {
"category": "domain",
"values": {
"Data Processing": [
"CSV cleaning",
"JSON transform",
"deduplicate rows"
],
"Web API": [
"GET endpoint",
"POST validation",
"pagination helper"
],
"Automation": [
"file organizer",
"log parser",
"daily report script"
]
}
}
},
{
"column_type": "llm-text",
"name": "instruction",
"drop": false,
"model_alias": "model_1",
"prompt": "Write one clear Python coding instruction.\nDomain: {{ domain }}\nTask type: {{ task_type }}\n\nKeep it practical and specific.\nReturn only the instruction without any code.",
"with_trace": "none"
},
{
"column_type": "llm-code",
"name": "code_implementation",
"drop": false,
"model_alias": "model_1",
"prompt": "Write Python code for:\n{{ instruction }}\n\nRequirements:\n- runnable script or function\n- include needed imports\n- short comments only where useful\n- no markdown fences",
"code_lang": "python"
},
{
"column_type": "llm-judge",
"name": "code_judge_result",
"drop": false,
"model_alias": "model_1",
"prompt": "Evaluate generated Python code against the instruction.\n\nInstruction:\n{{ instruction }}\n\nCode:\n{{ code_implementation }}",
"scores": [
{
"name": "Correctness",
"description": "Follows instruction and is executable",
"options": {
"0": "bad",
"1": "partial",
"2": "good",
"3": "excellent"
}
}
]
}
],
"processors": []
},
"run": {
"rows": 5,
"preview": true,
"output_formats": [
"jsonl"
]
},
"ui": {
"nodes": [
{
"id": "provider_1",
"x": 1032.6798211423347,
"y": -450.4885376732656,
"width": 400
},
{
"id": "model_1",
"x": 1538.0273166472973,
"y": -483.2003290046642,
"width": 400
},
{
"id": "domain",
"x": 0,
"y": 24,
"width": 400
},
{
"id": "task_type",
"x": 480,
"y": 24,
"width": 400
},
{
"id": "instruction",
"x": 958.8989453654599,
"y": -9.971266983459952,
"width": 400
},
{
"id": "code_implementation",
"x": 1538.788058529745,
"y": -45.56493974435071,
"width": 400
},
{
"id": "code_judge_result",
"x": 2040.9251520522098,
"y": -13.362336454344792,
"width": 400
},
{
"id": "note_1",
"x": 1482.1328175027095,
"y": 242.4370179053253,
"width": 568,
"node_type": "markdown_note",
"name": "note_1",
"markdown": "The **LLM Code** block is where Python code is generated from your instruction/prompt.\n\n##### How it works in this recipe:\n\n- You provide a clear prompt (often using Jinja references from earlier columns)\n- The model returns a response\n- The block extracts code content directly for the output column\n\n##### Current status:\n\n- We are **not** running Python lint/syntax validation in this recipe yet (Soon)\n- Validation support is planned and will be added\n\n##### What this means:\n\n- You may get mostly correct code, but some rows can still have syntax/style issues\n- Keep prompts specific and constrained to reduce bad outputs\n\n##### Tip:\n\n- Ask for one self-contained function/script\n- Ask for required imports\n- Ask for no markdown fences if you want cleaner extraction\n",
"note_color": "#FDE68A",
"note_opacity": "35"
},
{
"id": "note_2",
"x": 2513.2527820497985,
"y": -235.2544980991115,
"width": 471,
"node_type": "markdown_note",
"name": "note_2",
"markdown": "The **LLM Judge** block evaluates generated outputs with rubric-style scores.\n\n##### Important:\n\n- A judge can have **one or many scores**\n- Each score has:\n - a name (for example: `Correctness`)\n - a description\n - options (value + meaning)\n\n##### Example multi-score setup:\n\n- Correctness\n- Readability\n- Efficiency\n\n##### Why use multiple scores:\n\n- You get richer quality signals than a single pass/fail\n- Easier filtering and weighting later in training data prep\n\n##### Practical pattern:\n\n1. Generate code with LLM Code\n2. Judge with 2-4 focused scores\n3. Keep high-quality rows based on score thresholds\n",
"note_color": "#FDE68A",
"note_opacity": "35"
}
],
"edges": [
{
"from": "domain",
"to": "task_type",
"type": "canvas",
"source_handle": "data-out",
"target_handle": "data-in"
},
{
"from": "task_type",
"to": "instruction",
"type": "canvas",
"source_handle": "data-out",
"target_handle": "data-in"
},
{
"from": "provider_1",
"to": "model_1",
"type": "semantic",
"source_handle": "semantic-out",
"target_handle": "semantic-in"
},
{
"from": "instruction",
"to": "code_implementation",
"type": "canvas",
"source_handle": "data-out",
"target_handle": "data-in"
},
{
"from": "model_1",
"to": "instruction",
"type": "semantic",
"source_handle": "semantic-out-bottom",
"target_handle": "data-in-top"
},
{
"from": "model_1",
"to": "code_implementation",
"type": "semantic",
"source_handle": "semantic-out-bottom",
"target_handle": "data-in-top"
},
{
"from": "code_implementation",
"to": "code_judge_result",
"type": "canvas",
"source_handle": "data-out",
"target_handle": "data-in"
},
{
"from": "model_1",
"to": "code_judge_result",
"type": "semantic",
"source_handle": "semantic-out-bottom",
"target_handle": "data-in-top"
}
],
"layout_direction": "LR"
}
}