httpserver

This commit is contained in:
Adam Treat
2023-05-11 16:46:25 -04:00
committed by AT
parent 0f71cb6759
commit 2989b74d43
14 changed files with 583 additions and 43 deletions

View File

@@ -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