docs: add ai controller documentation#5473
Conversation
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-5473.fly.dev Built from 4a1b56e |
e5fcc24 to
a1bb498
Compare
rolfsmeds
left a comment
There was a problem hiding this comment.
- Could mention somewhere on AI-Powered Charts page that it can be combined with Dashboard (link) to create persistable, end-user configurable AI-generated dashboards.
- The Building Apps > AI > Quick Start Guide could link to AI charts & grids pages in the Next Possible Steps section.
- Grid docs page should link to AI-Powered Grid page somewhere (e.g. below Related Components table)
- Charts docs should link to AI-Powered Charts page somewhere (it's such a big deal that I think we should create a new sub-page for it that repeats the basic example and links to the AI Grid page)
- File Attachments page should linkn to
UploadManagerdocs. - On the LLM Providers page, one sentence explaining what AI frameworks are, and how they relate to LLM models, would be good for the non-initiated.
- In the Basic Usage example,
getLLMProviderseems superfluous as it just initializes one class. Would be better for understandability to just initialize the Mock provider right there instead of a separate method.
|
|
||
| * **Orchestrator** -- [classname]`AIOrchestrator` is a non-visual coordination engine that connects UI components to an LLM provider. It has no DOM element and should not be added to a layout. | ||
| * **Provider** -- [classname]`LLMProvider` is the interface for communicating with LLM frameworks. Create a provider by instantiating [classname]`SpringAILLMProvider` or [classname]`LangChain4JLLMProvider` directly. You can also implement this interface to connect to any other LLM framework. | ||
| * **Provider** -- plugs the orchestrator into any LLM framework. Spring AI and LangChain4j are built in via [classname]`SpringAILLMProvider` and [classname]`LangChain4JLLMProvider`; add others by implementing the [classname]`LLMProvider` interface. |
There was a problem hiding this comment.
Maybe better to use the term LLM Provider here?
There was a problem hiding this comment.
Updated to use "LLM Provider".
| @@ -8,8 +8,6 @@ order: 40 | |||
|
|
|||
| = Tool Calling & Programmatic Prompts | |||
|
|
|||
There was a problem hiding this comment.
One sentence explainer of what tools are would be good for the non-initiated. Maybe also mention (and link to) Controllers, as they are related.
There was a problem hiding this comment.
Added:
- an intro paragraph at the top of the page
- note that controllers are the framework-agnostic alternative
- the link
| } | ||
|
|
||
| @Override | ||
| public String getSchema() { |
There was a problem hiding this comment.
Should we also mention here that you can get the schema automagically through a query, so that you don't have to paste everything here in a hardcoded string and remember to update it whenever it changes?
Should also clearly indicate that you can add whatever free-form additional information here e.g. explaining the fields etc.
There was a problem hiding this comment.
Added a paragraph after the JdbcDatabaseProvider example explaining that getSchema() can return whatever helps the LLM. It includes building the description at runtime and adding free-form info.
| = [since:com.vaadin:vaadin@V25.2]#AI-Powered Grid# | ||
|
|
||
|
|
||
| [classname]`GridAIController` populates a [classname]`Grid` with data from the application database based on natural-language requests. Backed by a <<controllers#database-provider,[classname]`DatabaseProvider`>>, the controller lets the LLM inspect the database schema and run SQL queries that drive the grid. |
There was a problem hiding this comment.
Link to Grid docs page.
Explain what Grid is ("table or datagrid component") for those ending up here from Google without familiarity with Vaadin.
There was a problem hiding this comment.
Added the link and a description of the Grid.
| [source,java] | ||
| ---- | ||
| controller.addStateChangeListener(state -> | ||
| sessionStore.save(sessionId, state)); |
There was a problem hiding this comment.
Can we assume everyone is familiar with sessionStore? If not, should briefly explain and mention other alternatives.
There was a problem hiding this comment.
Added a follow-up sentence after the listener snippet noting that it is a placeholder for the developer's own storage.
| = [since:com.vaadin:vaadin@V25.2]#AI-Powered Chart# | ||
|
|
||
|
|
||
| [classname]`ChartAIController` creates and updates a [classname]`Chart` visualization based on natural-language requests. Backed by a <<controllers#database-provider,[classname]`DatabaseProvider`>>, the controller lets the LLM inspect the database schema, write SQL queries for one or more series, and update the Highcharts configuration independently of the data. |
There was a problem hiding this comment.
Added the link.
| [source,java] | ||
| ---- | ||
| controller.addStateChangeListener(state -> | ||
| sessionStore.save(sessionId, state)); |
There was a problem hiding this comment.
Same as for Grid: can we assume everybody knows sessionStore?
There was a problem hiding this comment.
Added a follow-up sentence here too.
a144bc5 to
6633c77
Compare
Added a "Combining with Dashboard" section at the end of the page, with a link to the Dashboard component docs.
Added links to the "Next Possible Steps" section.
Added a bullet to the sub-pages list linking to AI-Powered Grid.
Created a dedicated sub-page under the Charts section. It repeats the basic example and links to the full AI-Powered Chart page, as well as to AI-Powered Grid.
Added links to the Upload component docs.
Added an opening sentence.
Removed `getLLMProvider(). |
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
a744646 to
280fbb4
Compare
No description provided.