gpt4all/gpt4all-chat/server.h
Jared Van Bortel f2e5c931fe rename ChatLLM to LlamaCppModel
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
2024-08-08 15:14:58 -04:00

43 lines
943 B
C++

#ifndef SERVER_H
#define SERVER_H
#include "llamacpp_model.h"
#include "database.h"
#include <QHttpServerRequest>
#include <QHttpServerResponse>
#include <QObject>
#include <QList>
#include <QString>
class Chat;
class QHttpServer;
class Server : public LlamaCppModel
{
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 handleDatabaseResultsChanged(const QList<ResultInfo> &results) { m_databaseResults = results; }
void handleCollectionListChanged(const QList<QString> &collectionList) { m_collections = collectionList; }
private:
Chat *m_chat;
QHttpServer *m_server;
QList<ResultInfo> m_databaseResults;
QList<QString> m_collections;
};
#endif // SERVER_H