gpt4all/gpt4all-chat/localdocs.h

54 lines
1.7 KiB
C
Raw Normal View History

2023-05-18 22:59:10 +00:00
#ifndef LOCALDOCS_H
#define LOCALDOCS_H
#include "localdocsmodel.h"
#include "database.h"
2023-05-18 22:59:10 +00:00
#include <QObject>
2023-05-18 22:59:10 +00:00
class LocalDocs : public QObject
{
Q_OBJECT
Q_PROPERTY(LocalDocsModel *localDocsModel READ localDocsModel NOTIFY localDocsModelChanged)
2023-05-24 00:26:31 +00:00
Q_PROPERTY(int chunkSize READ chunkSize WRITE setChunkSize NOTIFY chunkSizeChanged)
Q_PROPERTY(int retrievalSize READ retrievalSize WRITE setRetrievalSize NOTIFY retrievalSizeChanged)
2023-05-18 22:59:10 +00:00
public:
static LocalDocs *globalInstance();
LocalDocsModel *localDocsModel() const { return m_localDocsModel; }
2023-05-21 19:13:28 +00:00
Q_INVOKABLE void addFolder(const QString &collection, const QString &path);
Q_INVOKABLE void removeFolder(const QString &collection, const QString &path);
void requestRetrieve(const QString &uid, const QList<QString> &collections, const QString &text);
2023-05-18 22:59:10 +00:00
2023-05-24 00:26:31 +00:00
int chunkSize() const;
void setChunkSize(int chunkSize);
int retrievalSize() const;
void setRetrievalSize(int retrievalSize);
2023-05-18 22:59:10 +00:00
Q_SIGNALS:
void requestAddFolder(const QString &collection, const QString &path);
void requestRemoveFolder(const QString &collection, const QString &path);
void requestRetrieveFromDB(const QString &uid, const QList<QString> &collections, const QString &text, int retrievalSize);
2023-05-24 00:26:31 +00:00
void requestChunkSizeChange(int chunkSize);
void receivedResult(const QString &uid, const QList<ResultInfo> &result);
void localDocsModelChanged();
2023-05-24 00:26:31 +00:00
void chunkSizeChanged();
void retrievalSizeChanged();
2023-05-18 22:59:10 +00:00
private:
2023-05-24 00:26:31 +00:00
int m_chunkSize;
int m_retrievalSize;
LocalDocsModel *m_localDocsModel;
2023-05-18 22:59:10 +00:00
Database *m_database;
private:
explicit LocalDocs();
~LocalDocs() {}
friend class MyLocalDocs;
};
#endif // LOCALDOCS_H