#ifndef SERVICES_ASSISTANT_MODEL_INFERENCE_INTERFACE_H
#define SERVICES_ASSISTANT_MODEL_INFERENCE_INTERFACE_H

#include <future>
#include <string>

#include "assistant/intentdialoguemanager/dialoguemessage.h"

class ModelInferenceInterface {
public:
    virtual ~ModelInferenceInterface() = default;

    // 调用对话模型
    virtual std::future<bool> callChatModelInference(const std::string& modelInput) = 0;

    // 调用意图模型
    virtual DialogueData::CallSuccessIdentifier callIntentionModelInference(const std::string& modelInput) = 0;

    // TODO 意图模型可以留下这个接口，因为意图模型的名称和回调函数名称是一致的
    virtual std::string intentModelName() = 0;

    void setChatModelCallback(const DialogueCallback::ChatModelCallback& callback) { chatModelCallback_ = callback; }

    virtual int getCurrentModelMaxTokens() = 0;

    virtual bool isCloudModel() = 0;
    virtual bool isChatModelConfigured() = 0;
    virtual bool isIntentModelNotLoaded() = 0;

    virtual void stopChat() = 0;

protected:
    void callChatModelCallback(const DialogueCallback::ChatData& chatData) {
        if (chatModelCallback_ != nullptr) {
            chatModelCallback_(chatData);
        }
    }

protected:
    DialogueCallback::ChatModelCallback chatModelCallback_{nullptr};
};

#endif  // SERVICES_ASSISTANT_MODEL_INFERENCE_INTERFACE_H
