UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

24 lines (23 loc) 890 B
import { ContentSearchResult } from "./useSearchContent"; export interface UseAskContentProps { query: string; sourceTypes?: ("entity" | "comment" | "message")[]; spaceId?: string; conversationId?: string; limit?: number; } export interface UseAskContentReturn { /** Answer text — grows as token events arrive */ answer: string; /** Hydrated source records — set once after streaming completes */ sources: ContentSearchResult[]; /** True while the SSE stream is open and tokens are arriving */ streaming: boolean; /** True from the ask() call until the first token arrives (or an error occurs) */ loading: boolean; error: string | null; ask: (props: UseAskContentProps) => void; /** Aborts any in-flight stream and resets all state */ reset: () => void; } export default function useAskContent(): UseAskContentReturn;