{ "_meta": { "description": "D6 fixtures for claude-sdk-python / gen-ui-tool-based", "sourceFile": "d5-all.json", "copiedFrom": "langgraph-python", "created": "2026-05-21" }, "fixtures": [ { "match": { "userMessage": "3D axis visualization (model airplane)", "toolCallId": "call_d5_open_gen_ui_3d_axis_001", "context": "claude-sdk-python" }, "response": { "content": "Generated. The sandboxed UI is rendered above." } }, { "match": { "userMessage": "3D axis visualization (model airplane)", "context": "claude-sdk-python" }, "response": { "toolCalls": [ { "id": "call_d5_open_gen_ui_3d_axis_001", "name": "generateSandboxedUi", "arguments": "{\"initialHeight\":480,\"placeholderMessages\":[\"Composing 3D axis scene\u2026\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.wrap{padding:16px}h1{font-size:14px;margin:0 0 8px}svg{display:block;background:#1e293b;border-radius:8px}\",\"html\":\"

3D axis visualization (pitch / yaw / roll)

X pitchY yawZ roll
\"}" } ] } }, { "match": { "userMessage": "How a neural network works", "toolCallId": "call_d5_open_gen_ui_neural_001", "context": "claude-sdk-python" }, "response": { "content": "Generated. The sandboxed UI is rendered above." } }, { "match": { "userMessage": "How a neural network works", "context": "claude-sdk-python" }, "response": { "toolCalls": [ { "id": "call_d5_open_gen_ui_neural_001", "name": "generateSandboxedUi", "arguments": "{\"initialHeight\":480,\"placeholderMessages\":[\"Composing neural network forward pass\u2026\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.wrap{padding:16px}h1{font-size:14px;margin:0 0 8px}svg{display:block;background:#1e293b;border-radius:8px}circle{fill:#6366f1}\",\"html\":\"

Forward pass: input \u2192 hidden \u2192 output

\"}" } ] } }, { "match": { "userMessage": "Quicksort visualization", "toolCallId": "call_d5_open_gen_ui_quicksort_001", "context": "claude-sdk-python" }, "response": { "content": "Generated. The sandboxed UI is rendered above." } }, { "match": { "userMessage": "Quicksort visualization", "context": "claude-sdk-python" }, "response": { "toolCalls": [ { "id": "call_d5_open_gen_ui_quicksort_001", "name": "generateSandboxedUi", "arguments": "{\"initialHeight\":480,\"placeholderMessages\":[\"Composing quicksort animation\u2026\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.wrap{padding:16px}h1{font-size:14px;margin:0 0 8px}svg{display:block;background:#1e293b;border-radius:8px}rect{fill:#64748b}\",\"html\":\"

Quicksort: partition around pivot

\"}" } ] } }, { "match": { "userMessage": "Fourier: square wave from sines", "toolCallId": "call_d5_open_gen_ui_fourier_001", "context": "claude-sdk-python" }, "response": { "content": "Generated. The sandboxed UI is rendered above." } }, { "match": { "userMessage": "Fourier: square wave from sines", "context": "claude-sdk-python" }, "response": { "toolCalls": [ { "id": "call_d5_open_gen_ui_fourier_001", "name": "generateSandboxedUi", "arguments": "{\"initialHeight\":480,\"placeholderMessages\":[\"Composing Fourier series animation\u2026\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.wrap{padding:16px}h1{font-size:14px;margin:0 0 8px}svg{display:block;background:#1e293b;border-radius:8px}\",\"html\":\"

Fourier series: square wave

\"}" } ] } }, { "match": { "userMessage": "Calculator (calls evaluateExpression)", "toolCallId": "call_d5_open_gen_ui_calc_001", "context": "claude-sdk-python" }, "response": { "content": "Generated. The sandboxed UI is rendered above." } }, { "match": { "userMessage": "Calculator (calls evaluateExpression)", "context": "claude-sdk-python" }, "response": { "toolCalls": [ { "id": "call_d5_open_gen_ui_calc_001", "name": "generateSandboxedUi", "arguments": "{\"initialHeight\":480,\"placeholderMessages\":[\"Composing calculator UI\u2026\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.wrap{padding:16px;max-width:240px}.display{background:#1e293b;padding:8px;border-radius:8px;margin-bottom:8px;font-family:monospace;text-align:right}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}button{padding:10px;background:#334155;border:0;color:#e2e8f0;border-radius:6px;font-size:14px}\",\"html\":\"
0
\",\"jsFunctions\":\"(function(){var expr='';var display=document.getElementById('d');document.querySelectorAll('.grid button').forEach(function(btn){btn.addEventListener('click',async function(){if(btn.id==='eq'){var res=await Websandbox.connection.remote.evaluateExpression({expression:expr});if(res&&res.ok){display.textContent=String(res.value);expr=String(res.value);}else{display.textContent='err';expr='';}}else{expr+=btn.textContent;display.textContent=expr;}});});})();\"}" } ] } }, { "match": { "userMessage": "Ping the host (calls notifyHost)", "toolCallId": "call_d5_open_gen_ui_ping_001", "context": "claude-sdk-python" }, "response": { "content": "Generated. The sandboxed UI is rendered above." } }, { "match": { "userMessage": "Ping the host (calls notifyHost)", "context": "claude-sdk-python" }, "response": { "toolCalls": [ { "id": "call_d5_open_gen_ui_ping_001", "name": "generateSandboxedUi", "arguments": "{\"initialHeight\":320,\"placeholderMessages\":[\"Composing host-ping card\u2026\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.card{padding:24px;background:#1e293b;border-radius:12px;margin:16px;text-align:center}button{padding:10px 20px;background:#6366f1;border:0;color:#fff;border-radius:8px;font-size:14px;cursor:pointer}.out{margin-top:12px;font-size:12px;color:#94a3b8}\",\"html\":\"

Notify the host

awaiting click\u2026
\",\"jsFunctions\":\"document.getElementById('hi').addEventListener('click',async function(){var out=document.getElementById('out');out.textContent='sending\u2026';var res=await Websandbox.connection.remote.notifyHost({message:'Hello from sandbox'});out.textContent=res&&res.ok?'host replied at '+res.receivedAt:'failed';});\"}" } ] } }, { "match": { "userMessage": "Inline expression evaluator", "toolCallId": "call_d5_open_gen_ui_inline_001", "context": "claude-sdk-python" }, "response": { "content": "Generated. The sandboxed UI is rendered above." } }, { "match": { "userMessage": "Inline expression evaluator", "context": "claude-sdk-python" }, "response": { "toolCalls": [ { "id": "call_d5_open_gen_ui_inline_001", "name": "generateSandboxedUi", "arguments": "{\"initialHeight\":320,\"placeholderMessages\":[\"Composing expression evaluator\u2026\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.card{padding:16px;background:#1e293b;border-radius:12px;margin:16px}input{width:100%;padding:8px;background:#0f172a;border:1px solid #334155;color:#e2e8f0;border-radius:6px;box-sizing:border-box}button{margin-top:8px;padding:8px 16px;background:#6366f1;border:0;color:#fff;border-radius:6px;cursor:pointer}.out{margin-top:8px;font-size:12px;color:#94a3b8}\",\"html\":\"

Inline expression evaluator

awaiting input\u2026
\",\"jsFunctions\":\"(function(){var input=document.getElementById('in');var out=document.getElementById('out');var go=document.getElementById('go');async function run(){var expr=input.value;out.textContent='evaluating\u2026';var res=await Websandbox.connection.remote.evaluateExpression({expression:expr});out.textContent=res&&res.ok?'= '+res.value:'error: '+res.error;}go.addEventListener('click',run);input.addEventListener('keydown',function(e){if(e.key==='Enter')run();});})();\"}" } ] } }, { "match": { "userMessage": "request the gen-ui interrupt", "turnIndex": 0, "context": "claude-sdk-python" }, "response": { "content": "The agent paused at a gen-UI interrupt and rendered a choice component for the user. Choose to continue." } }, { "match": { "userMessage": "confirm the gen-ui choice", "turnIndex": 0, "context": "claude-sdk-python" }, "response": { "content": "Gen-UI interrupt resolved. The agent received the user's choice and resumed, completing the workflow." } }, { "match": { "userMessage": "render an open gen-ui element", "turnIndex": 0, "context": "claude-sdk-python" }, "response": { "content": "The open gen-UI element was rendered. The LLM produced an arbitrary-shape JSON payload and the renderer materialized it as a UI block." } }, { "match": { "userMessage": "continue the advanced gen-ui flow", "turnIndex": 0, "context": "claude-sdk-python" }, "response": { "content": "The advanced gen-UI flow continued with the second-step component. The chained payloads from turns 1 and 2 form the complete advanced gen-UI sequence." } } ] }