Hiyve Components - v1.0.0
    Preparing search index...
    • Hook for AI context operations using the bot-created OpenAI Responses API context.

      Parameters

      • _roomName: string
      • userId: string

        User ID for request validation and usage tracking

      Returns {
          askWithResponseId: (
              responseId: string,
              queryText: string,
              options?: { model?: string; promptKey?: string },
          ) => Promise<AIResponse | null>;
          clearError: () => void;
          error: Error | null;
          loading: boolean;
          updateMoodWithResponseId: (
              responseId: string,
              sentimentContext: SentimentContext,
          ) => Promise<void>;
      }

      • askWithResponseId: (
            responseId: string,
            queryText: string,
            options?: { model?: string; promptKey?: string },
        ) => Promise<AIResponse | null>

        Query against an existing AI context using its responseId.

        const { responseId } = useRecording();
        const result = await askWithResponseId(responseId, 'What were the action items?');
        if (result?.success) {
        console.log(result.content);
        }
      • clearError: () => void
      • error: Error | null
      • loading: boolean
      • updateMoodWithResponseId: (responseId: string, sentimentContext: SentimentContext) => Promise<void>

        Push mood/sentiment data to an AI context.

        Convert emotion types from @hiyve/react-intelligence to sentiment:

        • happy, surprised'positive'
        • angry, fearful, disgusted, sad'negative'
        • neutral'neutral'
        const { responseId } = useRecording();
        await updateMoodWithResponseId(responseId, [
        { participant: 'user@example.com', sentiment: 'positive', confidence: 0.85 }
        ]);
      const { askWithResponseId, updateMoodWithResponseId } = useLiveContext(roomName, userId);
      const { responseId } = useRecording();

      // Query the AI context
      const result = await askWithResponseId(responseId, 'Summarize the discussion');

      // Push mood data
      await updateMoodWithResponseId(responseId, [
      { participant: 'user@example.com', sentiment: 'positive', confidence: 0.85 }
      ]);