2023-04-08 23:28:39 -04:00
|
|
|
#ifndef LLM_H
|
|
|
|
#define LLM_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2023-04-30 20:28:07 -04:00
|
|
|
|
2023-05-01 17:13:20 -04:00
|
|
|
#include "chatlistmodel.h"
|
2023-04-08 23:28:39 -04:00
|
|
|
|
|
|
|
class LLM : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-05-01 17:13:20 -04:00
|
|
|
Q_PROPERTY(ChatListModel *chatListModel READ chatListModel NOTIFY chatListModelChanged)
|
2023-05-04 15:31:41 -04:00
|
|
|
Q_PROPERTY(int32_t threadCount READ threadCount WRITE setThreadCount NOTIFY threadCountChanged)
|
2023-04-25 11:20:51 -04:00
|
|
|
|
2023-04-08 23:28:39 -04:00
|
|
|
public:
|
|
|
|
static LLM *globalInstance();
|
|
|
|
|
2023-05-01 17:13:20 -04:00
|
|
|
ChatListModel *chatListModel() const { return m_chatListModel; }
|
2023-05-04 15:31:41 -04:00
|
|
|
int32_t threadCount() const;
|
|
|
|
void setThreadCount(int32_t n_threads);
|
2023-05-01 14:24:16 -04:00
|
|
|
|
|
|
|
Q_INVOKABLE bool checkForUpdates() const;
|
2023-04-30 20:28:07 -04:00
|
|
|
|
2023-04-08 23:28:39 -04:00
|
|
|
Q_SIGNALS:
|
2023-05-01 17:13:20 -04:00
|
|
|
void chatListModelChanged();
|
2023-05-04 15:31:41 -04:00
|
|
|
void threadCountChanged();
|
2023-04-08 23:28:39 -04:00
|
|
|
|
2023-05-01 17:13:20 -04:00
|
|
|
private Q_SLOTS:
|
2023-05-04 15:31:41 -04:00
|
|
|
void aboutToQuit();
|
2023-05-01 14:24:16 -04:00
|
|
|
|
|
|
|
private:
|
2023-05-01 17:13:20 -04:00
|
|
|
ChatListModel *m_chatListModel;
|
2023-05-04 15:31:41 -04:00
|
|
|
int32_t m_threadCount;
|
2023-04-08 23:28:39 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
explicit LLM();
|
|
|
|
~LLM() {}
|
|
|
|
friend class MyLLM;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LLM_H
|