2023-04-09 03:28:39 +00:00
|
|
|
#ifndef LLM_H
|
|
|
|
#define LLM_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2023-05-01 00:28:07 +00:00
|
|
|
|
|
|
|
#include "chat.h"
|
2023-05-01 21:13:20 +00:00
|
|
|
#include "chatlistmodel.h"
|
2023-04-09 03:28:39 +00:00
|
|
|
|
|
|
|
class LLM : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-04-18 15:42:16 +00:00
|
|
|
Q_PROPERTY(QList<QString> modelList READ modelList NOTIFY modelListChanged)
|
2023-05-01 16:41:03 +00:00
|
|
|
Q_PROPERTY(bool isRecalc READ isRecalc NOTIFY recalcChanged)
|
2023-05-01 21:13:20 +00:00
|
|
|
Q_PROPERTY(ChatListModel *chatListModel READ chatListModel NOTIFY chatListModelChanged)
|
2023-04-25 15:20:51 +00:00
|
|
|
|
2023-04-09 03:28:39 +00:00
|
|
|
public:
|
|
|
|
static LLM *globalInstance();
|
|
|
|
|
2023-04-18 15:42:16 +00:00
|
|
|
QList<QString> modelList() const;
|
2023-05-01 16:41:03 +00:00
|
|
|
bool isRecalc() const;
|
2023-05-01 21:13:20 +00:00
|
|
|
ChatListModel *chatListModel() const { return m_chatListModel; }
|
2023-05-01 18:24:16 +00:00
|
|
|
|
|
|
|
Q_INVOKABLE bool checkForUpdates() const;
|
2023-05-01 00:28:07 +00:00
|
|
|
|
2023-04-09 03:28:39 +00:00
|
|
|
Q_SIGNALS:
|
2023-04-18 15:42:16 +00:00
|
|
|
void modelListChanged();
|
2023-05-01 16:41:03 +00:00
|
|
|
void recalcChanged();
|
|
|
|
void responseChanged();
|
2023-05-01 21:13:20 +00:00
|
|
|
void chatListModelChanged();
|
2023-04-09 03:28:39 +00:00
|
|
|
|
2023-05-01 21:13:20 +00:00
|
|
|
private Q_SLOTS:
|
2023-05-02 00:27:07 +00:00
|
|
|
void connectChat(Chat*);
|
|
|
|
void disconnectChat(Chat*);
|
2023-05-01 18:24:16 +00:00
|
|
|
|
|
|
|
private:
|
2023-05-01 21:13:20 +00:00
|
|
|
ChatListModel *m_chatListModel;
|
2023-04-09 03:28:39 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
explicit LLM();
|
|
|
|
~LLM() {}
|
|
|
|
friend class MyLLM;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LLM_H
|