/*
 * 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 "error.h"
#include "result.h"

//
#include "_chatresult.h"

const char *chat_result_get_assistant_message(ChatResult *result) {
    if (result == nullptr) {
        return nullptr;
    }
    return result->assistantMessage_.c_str();
}

const char *chat_result_get_reasoning_message(ChatResult *result) {
    if (result == nullptr) {
        return nullptr;
    }
    return result->reasoningMessage_.c_str();
}

const char *chat_result_get_finish_reason_message(ChatResult *result) {
    if (result == nullptr) {
        return nullptr;
    }
    return result->finishReasonMessage_.c_str();
}

int chat_result_get_error_code(ChatResult *result) {
    if (result == nullptr) {
        return NLP_INPUT_INVALID;
    }
    return result->errorCode_;
}

const char *chat_result_get_error_message(ChatResult *result) {
    if (result == nullptr) {
        return nullptr;
    }
    return result->errorMessage_.c_str();
}

bool chat_result_get_is_end(ChatResult *result) {
    if (result == nullptr) {
        return true;
    }
    return result->isEnd_;
}