#ifndef GENAI_TEXT_SESSION_H
#define GENAI_TEXT_SESSION_H

#include <string>

#include "_chatmodelconfig.h"
#include "chat.h"
#include "config.h"
#include "genainlpserviceproxy.h"

class _GenAiTextSession {
public:
    _GenAiTextSession();

    int init();

    void destroy();

    void setResultCallback(const ChatResultCallback &callback, void *userData);

    void setChatModelConfig(const ChatModelConfig &config);

    void chat(const std::string &question);

    void chatWithHistoryMessages(const ChatMessage &message);

    void setChatSystemPrompt(const std::string &message);

    void setChatSystemPromptId(PromptId promptId);

    void stopChat();

    void clearChatMessage();

private:
    bool initServer();
    int initSession();

private:
    kyai::genai::nlp::GenAiNlpServiceProxy serviceProxy_;
    int sessionId_{0};
    ChatModelConfig modelConfig_{};
};

#endif  // GENAI_TEXT_SESSION_H
