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 ( *
* setTitle(e.target.value)} /> * * {isGenerating &&
{content}
} *
* ); * } * ``` * * @example * ```typescript * // Using tools with inline assistant * import { lokiQueryHandlerTool } from 'agent/tools'; * * function ComponentWithTools() { * const { generate } = useInlineAssistant(); * * const handleGenerate = async () => { * await generate({ * prompt: 'Query Loki for error logs from the last hour', * origin: 'my-app/component', * tools: [lokiQueryHandlerTool], * onComplete: (text) => console.log('Generated:', text), * }); * }; * * return ; * } * ``` */ export declare function useInlineAssistant(): InlineAssistantResult; //# sourceMappingURL=useInlineAssistant.d.ts.map