Interface PublicConfigMessaging

Config options for controlling messaging.

interface PublicConfigMessaging {
    copyPreviousContextOnRequest?: boolean;
    customLoadHistory?: (instance: ChatInstance) => Promise<HistoryItem[]>;
    customSendMessage?: (
        request: MessageRequest,
        requestOptions: CustomSendMessageOptions,
        instance: ChatInstance,
    ) => void | Promise<void>;
    messageLoadingIndicatorTimeoutSecs?: number;
    messageTimeoutSecs?: number;
    skipWelcome?: boolean;
}

Properties

copyPreviousContextOnRequest?: boolean

Indicates if the context from the previous response should be copied on the next request. This is true by default.

customLoadHistory?: (instance: ChatInstance) => Promise<HistoryItem[]>

This is a callback function that is used by web chat to retrieve history data for populating the web chat. If this function is defined, it will be used instead of any other mechanism for fetching history.

customSendMessage?: (
    request: MessageRequest,
    requestOptions: CustomSendMessageOptions,
    instance: ChatInstance,
) => void | Promise<void>

A callback for web chat to use to send messages to the assistant. When this is provided, this will be used as an alternative for its built-in message service. Note that this is not used for human agent communication (except for the event messages to update history).

Web chat will queue up any additional user messages until the Promise from a previous call to customSendMessage has resolved. This does not include event messages. If the Promise rejects, an error indicator will be displayed next to the user's message.

If the request takes longer than PublicConfigMessaging.messageTimeoutSecs than the AbortSignal will be sent.

messageLoadingIndicatorTimeoutSecs?: number

Controls how long AI chat should wait before showing the loading indicator.

messageTimeoutSecs?: number

Changes the timeout used by the message service when making message calls. The timeout is in seconds. The default is 40 seconds. After this time, an error will be shown in the client and an Abort signal will be sent to customSendMessage.

skipWelcome?: boolean

Indicates if web chat should make a request for the welcome message when a new conversation begins. If this is true, then web chat will start with an empty conversation.

MMNEPVFCICPMFPCPTTAAATR