import { useMemo } from "react";
import { mapOllamaMessagesToMessageBubbleData } from "./mapOllamaMessages";
/**
 * 将 Ollama `/api/chat` 的 messages 转为 MessageBubbleData[]（与 {@link mapOllamaMessagesToMessageBubbleData} 一致，带 memo）。
 */ export function useOllamaMessageBubbleData(messages, mapOptions, mapMessage) {
    var _ref = mapOptions !== null && mapOptions !== void 0 ? mapOptions : {}, baseTime = _ref.baseTime, timeStepMs = _ref.timeStepMs, bumpUpdateAtOnLastMessage = _ref.bumpUpdateAtOnLastMessage, getMessageId = _ref.getMessageId, toolRoleAs = _ref.toolRoleAs, appendToolCallsToContent = _ref.appendToolCallsToContent, preserveRawInExtra = _ref.preserveRawInExtra, appendThinkingToContent = _ref.appendThinkingToContent, appendImagesPlaceholder = _ref.appendImagesPlaceholder, preserveOllamaRawInExtra = _ref.preserveOllamaRawInExtra;
    return useMemo(function() {
        return mapOllamaMessagesToMessageBubbleData(messages, mapOptions, mapMessage);
    }, [
        messages,
        baseTime,
        timeStepMs,
        bumpUpdateAtOnLastMessage,
        getMessageId,
        toolRoleAs,
        appendToolCallsToContent,
        preserveRawInExtra,
        appendThinkingToContent,
        appendImagesPlaceholder,
        preserveOllamaRawInExtra,
        mapMessage
    ]);
}
