intelligent_ui library

The Open Intelligent UI component library (a port of thesysdev/open-intelligent-ui at 9df2e64): components, @functions, @CopyToClipboard, the chat and dashboard prompts, and demo data tools.

Classes

Impure
The impure inputs @Random, @Pick, @Shuffle, @Now and @Today read. A session's clock, random source and time zone apply while run runs its functions; otherwise these process-wide defaults apply, which tests may replace.

Enums

IuiComponent
The Open Intelligent UI components, in the reference library's order. Builders switch over this enum, so a component without one does not compile.

Constants

chatPrompt → const PromptOptions
The chat prompt: no tools, $variables and functions.
optionalIuiComponents → const Set<IuiComponent>
Components a renderer may leave out: they need a map, a web view or a TeX renderer.

Properties

copyToClipboard → ActionSpec
@CopyToClipboard(text): the host copies the text.
final
formatMoney → FunctionSpec
@FormatMoney(amount): an exact Money amount as text, in the session's locale. Add it with library.extend(LibraryExtension(addFunctions: [formatMoney])).
final
intelligentUi → OpenUiLibrary
The Open Intelligent UI library: about 55 components the model arranges itself, 59 @functions, and @CopyToClipboard. Root is Col.
final

Functions

chatPromptFor(OpenUiLibrary library) → PromptOptions
chatPrompt for library: rules and examples that name a component or @call library lacks are left out, and the "Pick the medium" rule names only media it has. For intelligentUi this is chatPrompt itself.
dashboardPrompt({List<OpenUiTool>? tools, OpenUiLibrary? library}) → PromptOptions
The dashboard prompt over tools (the demo data tools by default). Rules and examples are filtered as in chatPromptFor.
demoTools({DateTime now()?}) → List<OpenUiTool>
Demo data tools for Query-backed dashboards: a store's orders, support tickets and website traffic for the days up to today. A day's rows depend only on its date. now defaults to the current time.
formatDecimal(num value, {required int minFraction, required int maxFraction}) → String
en-US Intl.NumberFormat, as toLocaleString("en-US", options) formats for @Format and @Plural.
formatMoneyWith({bool boundOnly = false, bool trimZeroFraction = false}) → FunctionSpec
@FormatMoney with options. boundOnly takes the amount only from a host-bound record ($order.total), never one the model wrote. trimZeroFraction writes ₹1,23,456 for ₹1,23,456.00.
intelligentUiWithout(Set<IuiComponent> omit) → OpenUiLibrary
intelligentUi without omit. Map and MapMarker go together. With nothing to omit this is intelligentUi itself.