pub fn parse_response(raw: &str, usage: Usage) -> Result<AskResponse, AskError>Expand description
Pull sql and explanation out of the model’s reply.
We accept three shapes — strict JSON object, JSON wrapped in a fenced code block, or “almost JSON” with leading/trailing prose — because real LLM output drifts even with strict instructions. The fence/prose tolerance matches what real callers do (better-sqlite3, rusqlite, etc.) when interfacing with model output.
Public as of Phase 7g.7 so the WASM SDK can call this on the
model-text portion of an LLM API response that JS retrieved (per
Q9 the WASM module never makes the HTTP call itself; the JS
caller hands the raw response back through db.askParse()).