#ifndef GEN_AI_NLP_SERVER_H
#define GEN_AI_NLP_SERVER_H

#include <string>

#include "gennlpserviceglue.h"

namespace kyai::genai::nlp {

class GenAiNlpServer {
public:
    static GenAiNlpServer &getInstance();

    ~GenAiNlpServer();

    void init();
    [[nodiscard]] inline bool available() const {
        return connection_ != nullptr;
    }

    [[nodiscard]] inline GDBusConnection *getConnection() const {
        return connection_;
    }

private:
    GenAiNlpServer();
    void init(const std::string &unixPath);
    void destroy() const;

    GDBusConnection *connection_{nullptr};
};

}  // namespace kyai::genai::nlp

#endif  // GEN_AI_NLP_SERVER_H
