Skip to main content

generate_chart_spec

Function generate_chart_spec 

Source
pub async fn generate_chart_spec(
    app_config: &ApplicationConfiguration,
    task_lm: TaskLMSpec,
    input: &ChartSpecGenerationInput,
) -> ChatbotResult<String>
Expand description

Generate a Vega-Lite chart specification from a teacher’s prompt using an LLM with structured JSON output. The result is validated against the Vega-Lite v6 JSON Schema; on failure the validation errors are sent back to the model for one repair round. Returns the specification pretty-printed as a JSON string.