import { InlineAssistantResult } from './types'; /** * React hook for inline assistant generation with streaming support. * * This hook enables generating content (like panel titles or descriptions) inline * without opening the assistant sidebar. Each hook instance creates its own chat * conversation, so all generations from the same instance are grouped together. * Generated content is ephemeral - it won't appear in the user's chat history * but will be tracked in the admin UI for analytics. * * Uses the full BaseMultiStepAgent infrastructure for tool execution and multi-step workflows. * * The implementation is lazy-loaded on first use to reduce initial bundle size. * * @example * ```typescript * function PanelEditor() { * const { generate, isGenerating, content, error, reset } = useInlineAssistant(); * const [title, setTitle] = useState(''); * * const handleGenerate = () => { * generate({ * prompt: 'Generate a panel title for CPU metrics', * origin: 'grafana/panel-editor/title', * systemPrompt: 'Generate only the title text, no explanation', * onComplete: (text) => setTitle(text.trim()), * onError: (err) => console.error(err) * }); * }; * * return ( *