@grafana/assistant 0.1.16 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +10 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -663,6 +663,8 @@ An AI-powered text input component that uses the inline assistant to generate co
663
663
  - `onError?: (error: Error) => void` - Callback if an error occurs during generation
664
664
  - `onDelta?: (delta: string) => void` - Callback for streaming tokens as they are received during generation
665
665
  - `disabled?: boolean` - Whether the input is disabled
666
+ - `autoGenerate?: boolean` - When true, automatically generates content on mount if value is empty (uses `systemPrompt` as the generation prompt)
667
+ - `streaming?: boolean` - When true, streams generated text into the input in real-time. When false (default), shows a placeholder until generation completes
666
668
  - `className?: string` - Additional CSS class name
667
669
  - `data-testid?: string` - Test ID for testing
668
670
 
@@ -682,8 +684,10 @@ function PanelEditor() {
682
684
  origin="grafana/panel-editor/title"
683
685
  systemPrompt="Generate a concise, descriptive panel title. Return only the title text."
684
686
  placeholder="Ask AI to generate a title..."
687
+ autoGenerate
688
+ streaming
685
689
  onComplete={(text) => {
686
- setTitle(text); // Update state to display the generated text
690
+ setTitle(text);
687
691
  console.log('Generated:', text);
688
692
  }}
689
693
  />
@@ -706,6 +710,8 @@ An AI-powered textarea component that uses the inline assistant to generate long
706
710
  - `onError?: (error: Error) => void` - Callback if an error occurs during generation
707
711
  - `onDelta?: (delta: string) => void` - Callback for streaming tokens as they are received during generation
708
712
  - `disabled?: boolean` - Whether the textarea is disabled
713
+ - `autoGenerate?: boolean` - When true, automatically generates content on mount if value is empty (uses `systemPrompt` as the generation prompt)
714
+ - `streaming?: boolean` - When true, streams generated text into the textarea in real-time. When false (default), shows a placeholder until generation completes
709
715
  - `rows?: number` - Number of rows for the textarea (defaults to 4)
710
716
  - `className?: string` - Additional CSS class name
711
717
  - `data-testid?: string` - Test ID for testing
@@ -727,8 +733,10 @@ function DashboardEditor() {
727
733
  systemPrompt="Generate a clear dashboard description in 2-3 sentences."
728
734
  placeholder="Ask AI to generate a description... (Cmd/Ctrl+Enter to send)"
729
735
  rows={6}
736
+ autoGenerate
737
+ streaming
730
738
  onComplete={(text) => {
731
- setDescription(text); // Update state to display the generated text
739
+ setDescription(text);
732
740
  console.log('Generated:', text);
733
741
  }}
734
742
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/assistant",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Type definitions and helper functions for Grafana Assistant",
5
5
  "repository": {
6
6
  "type": "git",