recon-driven sql composer; pick → compose → execute; llm out of structural sql

This commit is contained in:
2026-06-03 11:01:02 -03:00
parent 61494362a3
commit 29c620b2c2
27 changed files with 1516 additions and 249 deletions

View File

@@ -252,7 +252,8 @@ export function useRunStream() {
t_started: elapsed(),
})
const detail = d.tool === 'execute_sql' ? (d.input?.sql || '') :
d.tool === 'text_to_sql' ? (d.input?.question || '') :
d.tool === 'pick_for_question' ? (d.input?.question || '') :
d.tool === 'compose_sql' && d.input?.pick ? `metric=${d.input.pick.metric}` :
JSON.stringify(d.input)
push('debug', d.tool, `${detail}`)
})
@@ -271,14 +272,14 @@ export function useRunStream() {
push('error', d.tool, `${d.error}`)
return
}
if (d.tool === 'text_to_sql' && d.output?.sql) {
if (d.tool === 'compose_sql' && d.output?.sql) {
push('info', d.tool, `${d.output.sql}`)
} else if (d.tool === 'pick_for_question' && d.output?.pick) {
push('info', d.tool, `${d.output.pick.metric} (${(d.output.pick.group_by || []).join(', ') || 'no group_by'})`)
} else if (d.tool === 'execute_sql') {
const label = d.output?.dimension ? `${d.output.dimension}: ` :
d.output?.label ? `${d.output.label}: ` : ''
push('info', d.tool, `${label}${d.output?.row_count} rows`)
} else if (d.tool === 'generate_pair') {
push('info', d.tool, `✓ a=${d.output?.a?.label} · b=${d.output?.b?.label}`)
} else {
push('info', d.tool, '✓')
}

View File

@@ -84,10 +84,10 @@ function subEvents(nodeId: string): ToolCall[] {
}
function shortPreview(call: ToolCall): string {
if (call.tool === 'text_to_sql' && call.output?.sql) return call.output.sql
if (call.tool === 'compose_sql' && call.output?.sql) return call.output.sql
if (call.tool === 'execute_sql' && call.input?.sql) return call.input.sql
if (call.tool === 'generate_pair' && call.output) {
return `A: ${call.output.a?.label}\n${call.output.a?.sql}\n\nB: ${call.output.b?.label}\n${call.output.b?.sql}`
if (call.tool === 'pick_for_question' && call.output?.pick) {
return JSON.stringify(call.output.pick, null, 2)
}
return ''
}