Interface ChartAITools.Callbacks
- All Superinterfaces:
Serializable
- Enclosing class:
ChartAITools
Callback interface that chart tool consumers must implement to provide
chart state access and mutation operations.
A ToolException thrown from a callback relays its message to the
LLM so it can correct its next attempt; any other exception is replaced
with a generic error message.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the set of available chart IDs.Returns the current state of a chart as a JSON string holding the Highcharts configuration the LLM has set and the SQL queries used to populate the chart series.voidupdateConfiguration(String chartId, String configJson) Updates the chart's Highcharts configuration (type, title, tooltip, axes, legend, etc.).voidupdateData(String chartId, List<String> queries) Validates and executes SQL SELECT queries that populate the chart series data.
-
Method Details
-
getState
Returns the current state of a chart as a JSON string holding the Highcharts configuration the LLM has set and the SQL queries used to populate the chart series. The LLM gets the state as is, so the configuration must not include values from the query results, such as series names, axis categories or points. Should throw if the chart is not found.- Parameters:
chartId- the chart ID- Returns:
- the chart state as a JSON string containing the configuration the LLM has set and the SQL queries
-
updateConfiguration
Updates the chart's Highcharts configuration (type, title, tooltip, axes, legend, etc.). The configuration should not include series data, as that is managed separately viaupdateData(String, List). Changes are applied when the LLM request completes. Should throw if the chart is not found.- Parameters:
chartId- the chart IDconfigJson- the Highcharts configuration as a JSON string, excluding series data
-
updateData
Validates and executes SQL SELECT queries that populate the chart series data. Each query corresponds to one chart series. Should throw if the chart is not found or if any query is invalid.- Parameters:
chartId- the chart IDqueries- SQL SELECT queries, one per chart series
-
getChartIds
Returns the set of available chart IDs.- Returns:
- the chart IDs, never
null
-