mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-17 00:08:39 +00:00
httpserver
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "chatllm.h"
|
||||
#include "chatmodel.h"
|
||||
#include "server.h"
|
||||
|
||||
class Chat : public QObject
|
||||
{
|
||||
@@ -20,11 +21,13 @@ class Chat : public QObject
|
||||
Q_PROPERTY(bool responseInProgress READ responseInProgress NOTIFY responseInProgressChanged)
|
||||
Q_PROPERTY(bool isRecalc READ isRecalc NOTIFY recalcChanged)
|
||||
Q_PROPERTY(QList<QString> modelList READ modelList NOTIFY modelListChanged)
|
||||
Q_PROPERTY(bool isServer READ isServer NOTIFY isServerChanged)
|
||||
QML_ELEMENT
|
||||
QML_UNCREATABLE("Only creatable from c++!")
|
||||
|
||||
public:
|
||||
explicit Chat(QObject *parent = nullptr);
|
||||
explicit Chat(bool isServer, QObject *parent = nullptr);
|
||||
virtual ~Chat();
|
||||
void connectLLM();
|
||||
|
||||
@@ -61,6 +64,10 @@ public:
|
||||
bool deserialize(QDataStream &stream, int version);
|
||||
|
||||
QList<QString> modelList() const;
|
||||
bool isServer() const { return m_isServer; }
|
||||
|
||||
public Q_SLOTS:
|
||||
void serverNewPromptResponsePair(const QString &prompt);
|
||||
|
||||
Q_SIGNALS:
|
||||
void idChanged();
|
||||
@@ -85,6 +92,7 @@ Q_SIGNALS:
|
||||
void generateNameRequested();
|
||||
void modelListChanged();
|
||||
void modelLoadingError(const QString &error);
|
||||
void isServerChanged();
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleResponseChanged();
|
||||
@@ -103,6 +111,7 @@ private:
|
||||
bool m_responseInProgress;
|
||||
qint64 m_creationDate;
|
||||
ChatLLM *m_llmodel;
|
||||
bool m_isServer;
|
||||
};
|
||||
|
||||
#endif // CHAT_H
|
||||
|
Reference in New Issue
Block a user