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

31
gpt4all-chat/server.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef SERVER_H
#define SERVER_H
#include "chatllm.h"
#include <QObject>
#include <QtHttpServer/QHttpServer>
class Server : public ChatLLM
{
Q_OBJECT
public:
Server(Chat *parent);
virtual ~Server();
public Q_SLOTS:
void start();
Q_SIGNALS:
void requestServerNewPromptResponsePair(const QString &prompt);
private Q_SLOTS:
QHttpServerResponse handleCompletionRequest(const QHttpServerRequest &request, bool isChat);
private:
Chat *m_chat;
QHttpServer *m_server;
};
#endif // SERVER_H