/*
 * Copyright 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 "imageembeddingsession.h"

int _ImageEmbeddingSession::connect() {
    // 先init 与runtime 的连接
    return image_embedding_processor_proxy_.connect();
}
int _ImageEmbeddingSession::init() {
    return image_embedding_processor_proxy_.initEngine();
}

EmbeddingResult* _ImageEmbeddingSession::embeddingText(
    const std::string& text) {
    return image_embedding_processor_proxy_.embeddingText(text);
}

EmbeddingResult* _ImageEmbeddingSession::embeddingImage(
    const std::string& file_path) {
    return image_embedding_processor_proxy_.embeddingImage(file_path);
}

EmbeddingResult* _ImageEmbeddingSession::embeddingBase64Image(
    const std::string& file_data) {
    return image_embedding_processor_proxy_.embeddingBase64Image(file_data);
}
void _ImageEmbeddingSession::embeddingTextAsync(
    const std::string& text, ImageEmbeddingResultCallback callback,
    void* callback_user_data) {
    image_embedding_processor_proxy_.embeddingTextAsync(text, callback,
                                                        callback_user_data);
}
void _ImageEmbeddingSession::embeddingImageAsync(
    const std::string& file_path, ImageEmbeddingResultCallback callback,
    void* callback_user_data) {
    image_embedding_processor_proxy_.embeddingImageAsync(file_path, callback,
                                                         callback_user_data);
}

void _ImageEmbeddingSession::embeddingBase64ImageAsync(
    const std::string& file_data, ImageEmbeddingResultCallback callback,
    void* callback_user_data) {
    image_embedding_processor_proxy_.embeddingBase64ImageAsync(
        file_data, callback, callback_user_data);
}

std::string _ImageEmbeddingSession::getModelInfo() {
    return image_embedding_processor_proxy_.getModelInfo();
}