Class DatasourcePromptAssist
- All Implemented Interfaces:
PromptAssist
PromptAssist that browses schema across all available datasources — first a datasource
list, then tables within a chosen datasource, then columns within a chosen table.
Query format. The query is resolved against the known names rather than split on
.: the longest datasource name the query continues with a . selects the datasource, then
the longest table name the remainder continues with a . selects the table, and what is
left filters that table's columns. A query that names no datasource filters the datasource list;
one that names a datasource but no table filters that datasource's tables. The drill-in mechanism
routes <datasource>. and <datasource>.<table>. nextQuery values back through this
same path without special-casing. Resolving against the known names is what keeps names that
contain dots working, including the <schema>.<table> form a datasource reports when
'include schema in table name' is set.
Literal contract. Options carry a path shaped <datasource> for a
datasource reference, <datasource>.<table> for a table reference, and
<datasource>.<table>.<column> for a column reference — or, when a table is schema-qualified,
<datasource>.<schema>.<table> and <datasource>.<schema>.<table>.<column>. The
assist never includes a prefix in path; the framework prepends this assist's id to build the token actually spliced into the prompt, e.g.
@datasource:my_db.users.email.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PromptAssist
PromptAssist.Option -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSelf-description appended to the embedded agent's system prompt.id()label()Fetch the rows to show forquery.Separator the embedded controller places between this assist'sPromptAssist.label()and its query when building the routing prefix, and that the assist itself should use inside itsPromptAssist.Option.DrillIn.nextQueryvalues.
-
Constructor Details
-
DatasourcePromptAssist
public DatasourcePromptAssist()
-
-
Method Details
-
label
- Specified by:
labelin interfacePromptAssist- Returns:
- a short friendly label for this assist to show in the UI.
-
separator
Description copied from interface:PromptAssistSeparator the embedded controller places between this assist'sPromptAssist.label()and its query when building the routing prefix, and that the assist itself should use inside itsPromptAssist.Option.DrillIn.nextQueryvalues.Default is
"/".- Specified by:
separatorin interfacePromptAssist- Returns:
- a non-empty separator string the controller uses both to recognize the routing prefix
this assist owns and to re-prefix child
PromptAssist.Option.DrillIns on the way back out.
-
id
- Specified by:
idin interfacePromptAssist- Returns:
- the machine identifier owning this assist's
@<id>:token namespace. Lowercase[a-z0-9-]+, short (e.g."tag","opc"). - See Also:
-
agentContext
Description copied from interface:PromptAssistSelf-description appended to the embedded agent's system prompt. The embed concatenates the fragments from every mounted assist into a single addendum so each provider documents its own token shape and reference-body schema in one place, decoupled from any specific agent's translation rules. Fragments are expected to be Markdown; the embed adds a heading for each assist usingPromptAssist.label()and joins them with blank lines.The embed's framing already tells the model every token is shaped
@<id>:<path>and announces this assist's@<id>:prefix in its section heading, so the fragment should not restate the generic shape. It should cover:- the grammar of the
<path>portion, with a concrete example token; - the schema of the
<reference token="...">body</reference>body the embed will attach when one of those tokens appears — the line names (Path:,Type:, …) the agent should look for and what they mean; - a one-line statement of what the reference represents semantically (so the agent can reason about it without knowing this assist exists).
- Specified by:
agentContextin interfacePromptAssist- Returns:
- the Markdown fragment, or
Optional.empty()when the assist has nothing to contribute (e.g. unit-test stubs).
- the grammar of the
-
options
Description copied from interface:PromptAssistFetch the rows to show forquery.- Specified by:
optionsin interfacePromptAssist- Parameters:
query- the text the user has typed past the trigger character, or thePromptAssist.Option.DrillIn.nextQueryof a row the user just selected. Empty when the user has just typed the trigger and has not yet typed anything else.- Returns:
- the rows to render. The framework discards stale results silently, so an implementation that completes after a newer query has been issued does not need to special-case the race.
-