gpt4all/gpt4all-chat/localdocssearch.h
Adam Treat 01f67c74ea Begin converting the localdocs to a tool.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
2024-08-14 07:43:48 -04:00

37 lines
802 B
C++

#ifndef LOCALDOCSSEARCH_H
#define LOCALDOCSSEARCH_H
#include "tool.h"
#include <QObject>
#include <QString>
class LocalDocsWorker : public QObject {
Q_OBJECT
public:
LocalDocsWorker();
virtual ~LocalDocsWorker() {}
QString response() const { return m_response; }
void request(const QList<QString> &collections, const QString &text, int count);
Q_SIGNALS:
void requestRetrieveFromDB(const QList<QString> &collections, const QString &text, int count, QString &jsonResponse);
void finished();
private:
QString m_response;
};
class LocalDocsSearch : public Tool {
Q_OBJECT
public:
LocalDocsSearch() : Tool() {}
virtual ~LocalDocsSearch() {}
QString run(const QJsonObject &parameters, qint64 timeout = 2000) override;
};
#endif // LOCALDOCSSEARCH_H