mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
f4fb3df437
Signed-off-by: Adam Treat <treat.adam@gmail.com>
43 lines
952 B
C++
43 lines
952 B
C++
#ifndef SERVER_H
|
|
#define SERVER_H
|
|
|
|
#include "chatllm.h"
|
|
#include "sourceexcerpt.h"
|
|
|
|
#include <QHttpServerRequest>
|
|
#include <QHttpServerResponse>
|
|
#include <QObject>
|
|
#include <QList>
|
|
#include <QString>
|
|
|
|
class Chat;
|
|
class 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);
|
|
void handleSourceExcerptsChanged(const QList<SourceExcerpt> &sourceExcerpts) { m_sourceExcerpts = sourceExcerpts; }
|
|
void handleCollectionListChanged(const QList<QString> &collectionList) { m_collections = collectionList; }
|
|
|
|
private:
|
|
Chat *m_chat;
|
|
QHttpServer *m_server;
|
|
QList<SourceExcerpt> m_sourceExcerpts;
|
|
QList<QString> m_collections;
|
|
};
|
|
|
|
#endif // SERVER_H
|