Class GridAITools
java.lang.Object
com.vaadin.flow.component.ai.grid.GridAITools
Factory for creating reusable grid
LLMProvider.ToolSpec instances.
The tools use a gridId parameter to identify which grid to operate
on, allowing a single set of tools to manage multiple grids (e.g., in a
dashboard). Callers provide a GridAITools.Callbacks implementation for state
retrieval and mutation, keeping this class decoupled from Grid.
- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback interface for grid state access and mutation. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<LLMProvider.ToolSpec> createAll(GridAITools.Callbacks callbacks) Creates all grid tools for the given callbacks.static LLMProvider.ToolSpecgetGridState(GridAITools.Callbacks callbacks) Creates a tool that returns the current grid state.static LLMProvider.ToolSpecupdateGridData(GridAITools.Callbacks callbacks) Creates a tool that updates the grid data with a SQL query.
-
Method Details
-
getGridState
Creates a tool that returns the current grid state.- Parameters:
callbacks- the callbacks for grid state access, notnull- Returns:
- the tool definition, never
null
-
updateGridData
Creates a tool that updates the grid data with a SQL query. If the handler throws, the error is returned to the LLM.- Parameters:
callbacks- the callbacks for grid mutation, notnull- Returns:
- the tool definition, never
null
-
createAll
Creates all grid tools for the given callbacks.- Parameters:
callbacks- the callbacks for grid state access and mutation, notnull- Returns:
- a list of all grid tools, never
null
-