Draft
Conversation
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-5473.fly.dev Built from e7d1cb7 |
jouni
reviewed
Apr 14, 2026
|
|
||
| = [since:com.vaadin:vaadin@V25.2]#AI-Powered Chart# | ||
|
|
||
| ifdef::flow[] |
Member
There was a problem hiding this comment.
I don't see any point with these conditionals.
Suggested change
| ifdef::flow[] |
|
|
||
| [classname]`ChartAIController` manages a single chart. To expose several charts to the same orchestrator -- for example in a dashboard -- implement a custom [classname]`AIController` that builds its tool list from [classname]`ChartAITools.createAll()` with a [classname]`ChartAITools.Callbacks` implementation that returns a stable ID per chart. | ||
|
|
||
| endif::flow[] |
|
|
||
| = [since:com.vaadin:vaadin@V25.2]#AI-Powered Grid# | ||
|
|
||
| ifdef::flow[] |
|
|
||
| [classname]`GridAIController` manages a single grid. To coordinate several grids from the same orchestrator, implement a custom [classname]`AIController` that builds its tool list from [classname]`GridAITools.createAll()` with a custom [classname]`GridAITools.Callbacks` implementation. The callbacks -- [methodname]`getGridIds()`, [methodname]`getState(gridId)`, and [methodname]`updateData(gridId, query)` -- let the LLM address each grid by its ID. | ||
|
|
||
| endif::flow[] |
|
|
||
| = [since:com.vaadin:vaadin@V25.2]#Controllers# | ||
|
|
||
| ifdef::flow[] |
| [TIP] | ||
| Return only the tables, columns, and relationships the LLM needs. A smaller, well-described schema produces better queries, uses fewer tokens, and reduces the chance of leaking sensitive columns. | ||
|
|
||
| endif::flow[] |
| :feature-flag: com.vaadin.experimental.aiComponents | ||
| include::{articles}/_preview-banner.adoc[opts=optional] | ||
|
|
||
| ifdef::flow[] |
| section_outline::[] | ||
|
|
||
|
|
||
| endif::flow[] |
|
|
||
| = Tool Calling & Programmatic Prompts | ||
|
|
||
| ifdef::flow[] |
| [IMPORTANT] | ||
| [methodname]`prompt()` requires an active UI context. If called from a background thread or outside a Vaadin request, it throws an [classname]`IllegalStateException`. Always call [methodname]`prompt()` from within a UI event handler or wrap the call in `ui.access()`. | ||
|
|
||
| endif::flow[] |
tomivirkki
reviewed
Apr 15, 2026
Comment on lines
+125
to
+128
| ChartState saved = sessionStore.load(sessionId); | ||
| if (saved != null) { | ||
| controller.restoreState(saved); | ||
| } |
Member
There was a problem hiding this comment.
I think this step isn't necessary, the chart's own state survives the serialization and doesn't need to be explicitly restored. Same thing with Grid
tomivirkki
reviewed
Apr 15, 2026
| [source,java] | ||
| ---- | ||
| controller.addStateChangeListener(state -> | ||
| sessionStore.save(sessionId, state)); |
Member
There was a problem hiding this comment.
Maybe sessionStore isn't ideal here since the primary use-case for state persistence is to restore the state across separate sessions (e.g. when a user logs in later and the original component no longer exists)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.