New to KendoReactStart a free 30-day trial

Props for the GridAIPrompt component, which provides AI-powered prompt and output functionality in a grid toolbar.

Definition

Package:@progress/kendo-react-grid

Syntax:

tsx
<GridAIPrompt
  promptValue="Summarize this data"
  outputs={[{ text: "Summary...", ... }]}
  streaming={true}
  onPromptRequest={handlePrompt}
  suggestionsList={["Summarize", "Explain", "Generate chart"]}
/>

Properties

Name of the currently active view.

Example:
ts
activeView="prompt"

enableSpeechToText?

boolean | SpeechToTextButtonProps

Enables the speech-to-text functionality for the input of the GridToolbarAIAssistant.

Example:
jsx
<GridToolbarAIAssistant enableSpeechToText={true} />

generateButton?

CustomComponent​<ButtonProps>

Custom component to render the generate button.

Example:
ts
generateButton={CustomGenerateButton}

loading?

boolean

Indicates whether the prompt is currently loading.

Example:
ts
loading={true}

onActiveViewChange?

(viewName: string) => void

Callback fired when the active view changes.

Parameters:viewNamestring

The name of the new active view.

Example:
ts
onActiveViewChange={(view) => setActiveView(view)}

onCancel?

() => void

Callback fired when the user cancels the current operation.

Example:
ts
onCancel={() => cancelPrompt()}

onClose?

() => void

Callback fired when the user closes the current operation.

Example:
ts
onClose={() => closePrompt()}

onCopy?

() => void

Callback fired when the user clicks the Copy button in the output card.

Example:
ts
onCopy={() => copyToClipboard()}

onOutputRating?

() => void

Callback fired when the user rates the output.

Example:
ts
onOutputRating={() => handleRating()}

onPromptRequest?

(prompt: string) => void

Callback fired when the user submits a prompt request.

Parameters:promptstring

The prompt text submitted by the user.

Example:
ts
onPromptRequest={(prompt) => sendPrompt(prompt)}

outputCard?

AIPromptCardInterface

Configuration for the output card displaying AI results.

Example:
ts
outputCard={{ title: "AI Result", content: "..." }}

outputs?

AIPromptOutputInterface[]

List of AI-generated outputs to display.

Example:
ts
outputs={[{ text: "AI output 1" }, { text: "AI output 2" }]}

promptInput?

CustomComponent​<TextAreaProps>

Custom component to render the prompt input field.

Example:
ts
promptInput={CustomTextArea}

Placeholder text for the prompt input field.

Example:
ts
promptPlaceHolder="Type your question here..."

Current value of the prompt input field.

Example:
ts
promptValue="Describe the selected rows"

streaming?

boolean

Indicates whether the prompt is currently streaming or processing.

Example:
ts
streaming={true}

List of prompt suggestions to display to the user.

Example:
ts
suggestionsList={["Summarize", "Explain", "Generate chart"]}

toolbarItems?

AIPromptToolbarItemInterface[]

Array of toolbar items to display, can include prompt or output view defaults.

Example:
ts
toolbarItems={[promptViewDefaults, outputViewDefaults]}