Optional configuration for endpoint and callbacks
State and actions for note generation
Manages the fetch lifecycle (loading, success, error) and handles cancellation on unmount. Follows the same state pattern as useAnalysis from the search-panel module.
import { useNoteGeneration } from '@hiyve/react-intelligence';
function PostMeetingView({ responseId, roomName, userName }) {
const { generateNote, loading, saved, error } = useNoteGeneration({
onSuccess: (fileId) => console.log('Note saved:', fileId),
});
useEffect(() => {
if (responseId) {
generateNote({
responseId,
prompt: 'Generate a meeting summary...',
roomName,
userId: userName,
userName,
title: 'Meeting Notes',
});
}
}, [responseId, roomName, userName, generateNote]);
if (loading) return <p>Generating note...</p>;
if (saved) return <p>Note saved!</p>;
if (error) return <p>Error: {error.message}</p>;
return null;
}
Hook for generating AI-powered meeting notes via a server endpoint.