Hiyve Components - v1.0.0
    Preparing search index...
    • Syncs mood analysis data to the cloud AI context.

      Parameters

      Returns void

      Call this hook in a component that has access to both mood analysis state and the cloud provider. It:

      • Converts emotion types to sentiment classifications
      • Enriches transcription entries with mood data for caption display
      • Batches and deduplicates mood pushes to the AI context
      • Triggers sync whenever new transcriptions arrive
      import { useMoodCloudSync } from '@hiyve/react-intelligence';
      import { useMoodAnalysisSafe } from '@hiyve/react-intelligence';
      import { useTranscription, useRecording } from '@hiyve/react';

      function AIPanel({ userId, roomName }) {
      const { responseId } = useRecording();
      const { transcriptions, enrichTranscription } = useTranscription();
      const moodAnalysis = useMoodAnalysisSafe();

      useMoodCloudSync({
      roomName,
      userId,
      responseId,
      moodStates: moodAnalysis?.moodStates ?? null,
      moodEnabled: !!moodAnalysis?.enabled && !!moodAnalysis?.ready,
      transcriptionCount: transcriptions?.length ?? 0,
      enrichTranscription,
      });
      }