/*
 * Copyright (C) 2024 KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

#pragma once

// #include <kylin-ai/ai-engine/embeddingengine.h>
#include "../ondeviceembeddingengine/ondeviceembeddingengine.h"

class EmbeddingEngineP
    : public ai_engine::core_ai::embedding::AbstractEmbeddingEngine {
public:
    EmbeddingEngineP();
    ~EmbeddingEngineP();

    std::string engineName() const;
    bool isCloud() const;
    bool isBuiltInEngine() const;
    std::string modelInfo() const;

    void setEmbeddingResultCallback(
        ai_engine::core_ai::embedding::EmbeddingResultCallback callback);

    ///[0] 文本向量化
    ai_engine::result::AiEngineBaseResult initTextEmbeddingModule();
    ai_engine::result::AiEngineBaseResult destroyTextEmbeddingModule();
    ai_engine::result::AiEngineBaseResult
    embeddingText(const std::string &text);
    ///[0]

    ///[1] 图像向量化
    ai_engine::result::AiEngineBaseResult initImageEmbeddingModule();
    ai_engine::result::AiEngineBaseResult destroyImageEmbeddingModule();
    ai_engine::result::AiEngineBaseResult
    embeddingImageFromImageFile(const std::string &filePath);
    ai_engine::result::AiEngineBaseResult
    embeddingImageFromBase64ImageData(const std::string &fileData);
    ai_engine::result::AiEngineBaseResult
    embeddingTextWithImageModel(const std::string &text);
    ///[1]

private:
    ai_engine::core_ai::embedding::OndeviceEmbeddingEngine *p;
};
