Definition
Namespace:Telerik.Blazor.Components.DatAInsightsComposer
Assembly:Telerik.Blazor.DatAInsightsComposer.dll
Syntax:
public class TelerikDatAInsightsComposer : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentTelerikDatAInsightsComposer
Implements:
Inherited Members
Constructors
public TelerikDatAInsightsComposer()
Properties
Optional declarative settings markup (<ComponentConfigSettings>) that disables
specific Grid/Chart properties so they're pruned from the JSON schema sent to the model.
[Parameter]
public RenderFragment? DatAInsightsComposerComponentConfigSettings { get; set; }
Dataset(s) available to this renderer instance.
- Multiple entries with no Data: metadata-only candidates shown as a hint before a dataset has been chosen; the host performs selection via OnPromptSubmit and replaces this instance with one bound to a single, resolved dataset.
- A single entry with Data populated: the resolved dataset backing the current generated component instance. Its Fields describe the shape of Data and are sent to the AI; the data rows themselves are only used locally for rendering and are never sent to the AI.
[Parameter]
public IEnumerable<DatasetDescriptor>? Datasets { get; set; }
Sets the overall height of the component using CSS units. Use pixels ("400px"), viewport units ("50vh"), or other CSS values to control vertical space.
[Parameter]
public string? Height { get; set; }
Defines the id HTML attribute of the component.
[Parameter]
public string? Id { get; set; }
Maximum number of characters allowed in the prompt input.
[Parameter]
public int? MaxPromptLength { get; set; }
Raised when the user saves the current configuration. Set IsCancelled to reject the save.
DatAInsightsComposerConfirmEventArgs.History can be edited to change the history that is kept.
[Parameter]
public EventCallback<DatAInsightsComposerConfirmEventArgs> OnConfirm { get; set; }
Raised once per generated ComponentConfig before its data is bound to the
Grid/Chart, letting the host process the raw dataset itself (e.g. via DataSourceRequest/
DataSourceResult) by setting ProcessedData. When left unset
(or when no handler is attached), the renderer falls back to its built-in processing driven by
ComponentConfig's DataSource settings.
[Parameter]
public EventCallback<DatAInsightsComposerDataProcessEventArgs> OnDataProcess { get; set; }
Raised when the user clicks Discard on a generated result that is not saved yet. Set IsCancelled
to keep the result. DatAInsightsComposerDiscardEventArgs.History holds the current history.
[Parameter]
public EventCallback<DatAInsightsComposerDiscardEventArgs> OnDiscard { get; set; }
Raised when the AI generates or refines a valid component configuration. The argument contains the prompt that produced the config and the serialized JSON.
[Parameter]
public EventCallback<DatAInsightsComposerGenerateEventArgs> OnGenerate { get; set; }
Raised when a history item is created (a generated result is accepted).
[Parameter]
public EventCallback<DatAInsightsComposerHistoryItemCreateEventArgs> OnHistoryItemCreate { get; set; }
Raised when a history item is restored.
[Parameter]
public EventCallback<DatAInsightsComposerHistoryItemRestoreEventArgs> OnHistoryItemRestore { get; set; }
Raised every time the user clicks the stop button while a prompt is being processed, before anything is
stopped. Set IsCancelled to true to
keep the request running. Otherwise the in-flight request is cancelled, including
CancellationToken.
[Parameter]
public EventCallback<DatAInsightsComposerPromptCancelEventArgs> OnPromptCancel { get; set; }
Raised every time the user clicks the generate button of the prompt box, for the initial generation
as well as for every refinement, before the AI request starts. Set
IsCancelled to true to skip the default
prompt processing. The host page can use it, for example, to perform dataset selection and replace the
component instance with one that has data.
[Parameter]
public EventCallback<DatAInsightsComposerPromptSubmitEventArgs> OnPromptSubmit { get; set; }
Raised when the user clicks the Remove button in the generated report header. The event arguments contain the current component configuration, type, and associated dataset.
[Parameter]
public EventCallback<DatAInsightsComposerRemoveEventArgs> OnRemove { get; set; }
The current prompt text. Can be set to pre-populate or read the active prompt.
[Parameter]
public string Prompt { get; set; }
Raised when the prompt changes. Enables @bind-Prompt.
[Parameter]
public EventCallback<string> PromptChanged { get; set; }
Placeholder text for the initial prompt textarea.
[Parameter]
public string? PromptPlaceholder { get; set; }
Placeholder text for the refine/modify prompt textarea.
[Parameter]
public string? RefinePromptPlaceholder { get; set; }
Specifies if the list with datasets is visible.
[Parameter]
public bool ShowDatasetsList { get; set; }
Specifies if the panel with datasets is visible.
[Parameter]
public bool ShowDatasetsPanel { get; set; }
The heading shown above the prompt textarea. Defaults to "What would you like to explore?".
[Parameter]
public string? Title { get; set; }
Methods
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Overrides:
public void Dispose()
Returns a deep-cloned snapshot of the current state, safe to keep or persist.
protected override void OnParametersSet()
Overrides:
Refreshes the component
public void Refresh()
Restores a state previously returned by GetState(). Only the active component is displayed for now; the other components are ignored until multi-component display is supported.
public Task SetStateAsync(DatAInsightsComposerState state)