@dypai-ai/client-sdk - v1.12.0
    Preparing search index...

    Interface UseChatReturn

    Return type of useChat

    interface UseChatReturn {
        chatId: string;
        error: DypaiError | Error | null;
        input: string;
        isLoading: boolean;
        messages: ChatMessage[];
        newChat: () => void;
        sendMessage: (text?: string) => Promise<void>;
        setInput: (value: string) => void;
        setMessages: (messages: ChatMessage[]) => void;
        status: ChatStatus;
        stop: () => void;
    }
    Index

    Properties

    chatId: string

    The chat/session ID

    error: DypaiError | Error | null

    Last error

    input: string

    Current input value (controlled)

    isLoading: boolean

    Whether the assistant is currently responding

    messages: ChatMessage[]

    All messages in the conversation

    newChat: () => void

    Start a new chat session (clears messages and generates new ID)

    sendMessage: (text?: string) => Promise<void>

    Send a message (uses input value if no text provided)

    setInput: (value: string) => void

    Set the input value

    setMessages: (messages: ChatMessage[]) => void

    Replace all messages

    status: ChatStatus

    Current status of the chat

    stop: () => void

    Stop the current streaming response