/*
 * 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/>.
 */

#include "embeddingengineP.h"

#include <string>
EmbeddingEngineP::EmbeddingEngineP()
    : p(new ai_engine::core_ai::embedding::OndeviceEmbeddingEngine()) {}

EmbeddingEngineP::~EmbeddingEngineP() { delete p; }

std::string EmbeddingEngineP::engineName() const{
    return p->engineName();
}
bool EmbeddingEngineP::isCloud() const { return p->isCloud(); };
bool EmbeddingEngineP::isBuiltInEngine() const { return p->isBuiltInEngine(); }
std::string EmbeddingEngineP::modelInfo() const { return p->modelInfo(); }

void EmbeddingEngineP::setEmbeddingResultCallback(
    ai_engine::core_ai::embedding::EmbeddingResultCallback callback) {
    p->setEmbeddingResultCallback(callback);
}

///[0] 文本向量化
ai_engine::result::AiEngineBaseResult
EmbeddingEngineP::initTextEmbeddingModule() {
    return p->initTextEmbeddingModule();
}
ai_engine::result::AiEngineBaseResult
EmbeddingEngineP::destroyTextEmbeddingModule() {
    return p->destroyTextEmbeddingModule();
}
ai_engine::result::AiEngineBaseResult EmbeddingEngineP::embeddingText(
    const std::string &text) {
    return p->embeddingText(text);
};
///[0]

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