Compare commits

...

6 Commits

Author SHA1 Message Date
Jared Van Bortel
ec13ba2818
docs: update list of supported localdocs formats (#1944)
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
2024-02-07 17:09:29 -05:00
Jared Van Bortel
2020c23edf
chat: set version to 2.7.0 (#1940)
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
2024-02-07 10:51:57 -05:00
Adam Treat
260a56c748 Don't show the download button if we are not connected to an online network.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
2024-02-07 09:40:49 -06:00
Adam Treat
4258bb1f8a Fix issue 1918 for accessibility of screen readers.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
2024-02-07 10:37:31 -05:00
Adam Treat
490404dbb2 Fix issue 1925, scrollbar missing on main conversation.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
2024-02-07 10:08:35 -05:00
Jared Van Bortel
513a214eca database: limit supported extensions to txt, pdf, md, rst
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
2024-02-07 08:56:25 -06:00
7 changed files with 26 additions and 31 deletions

View File

@ -61,17 +61,7 @@ The general technique this plugin uses is called [Retrieval Augmented Generation
These document chunks help your LLM respond to queries with knowledge about the contents of your data. These document chunks help your LLM respond to queries with knowledge about the contents of your data.
The number of chunks and the size of each chunk can be configured in the LocalDocs plugin settings tab. The number of chunks and the size of each chunk can be configured in the LocalDocs plugin settings tab.
LocalDocs supports the following file types: LocalDocs currently supports plain text files (`.txt`, `.md`, and `.rst`) and PDF files (`.pdf`).
```json
["txt", "doc", "docx", "pdf", "rtf", "odt", "html", "htm", "xls", "xlsx", "csv", "ods", "ppt", "pptx", "odp", "xml", "json", "log", "md", "org", "tex", "asc", "wks",
"wpd", "wps", "wri", "xhtml", "xht", "xslt", "yaml", "yml", "dtd", "sgml", "tsv", "strings", "resx",
"plist", "properties", "ini", "config", "bat", "sh", "ps1", "cmd", "awk", "sed", "vbs", "ics", "mht",
"mhtml", "epub", "djvu", "azw", "azw3", "mobi", "fb2", "prc", "lit", "lrf", "tcr", "pdb", "oxps",
"xps", "pages", "numbers", "key", "keynote", "abw", "zabw", "123", "wk1", "wk3", "wk4", "wk5", "wq1",
"wq2", "xlw", "xlr", "dif", "slk", "sylk", "wb1", "wb2", "wb3", "qpw", "wdb", "wks", "wku", "wr1",
"wrk", "xlk", "xlt", "xltm", "xltx", "xlsm", "xla", "xlam", "xll", "xld", "xlv", "xlw", "xlc", "xlm",
"xlt", "xln"]
```
#### Troubleshooting and FAQ #### Troubleshooting and FAQ
*My LocalDocs plugin isn't using my documents* *My LocalDocs plugin isn't using my documents*

View File

@ -17,8 +17,8 @@ if(APPLE)
endif() endif()
set(APP_VERSION_MAJOR 2) set(APP_VERSION_MAJOR 2)
set(APP_VERSION_MINOR 6) set(APP_VERSION_MINOR 7)
set(APP_VERSION_PATCH 3) set(APP_VERSION_PATCH 0)
set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}") set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}")
# Include the binary directory for the generated header file # Include the binary directory for the generated header file

View File

@ -890,15 +890,7 @@ void Database::scanDocuments(int folder_id, const QString &folder_path)
qDebug() << "scanning folder for documents" << folder_path; qDebug() << "scanning folder for documents" << folder_path;
#endif #endif
static const QList<QString> extensions { "txt", "doc", "docx", "pdf", "rtf", "odt", "html", "htm", static const QList<QString> extensions { "txt", "pdf", "md", "rst" };
"xls", "xlsx", "csv", "ods", "ppt", "pptx", "odp", "xml", "json", "log", "md", "org", "tex", "asc", "wks",
"wpd", "wps", "wri", "xhtml", "xht", "xslt", "yaml", "yml", "dtd", "sgml", "tsv", "strings", "resx",
"plist", "properties", "ini", "config", "bat", "sh", "ps1", "cmd", "awk", "sed", "vbs", "ics", "mht",
"mhtml", "epub", "djvu", "azw", "azw3", "mobi", "fb2", "prc", "lit", "lrf", "tcr", "pdb", "oxps",
"xps", "pages", "numbers", "key", "keynote", "abw", "zabw", "123", "wk1", "wk3", "wk4", "wk5", "wq1",
"wq2", "xlw", "xlr", "dif", "slk", "sylk", "wb1", "wb2", "wb3", "qpw", "wdb", "wks", "wku", "wr1",
"wrk", "xlk", "xlt", "xltm", "xltx", "xlsm", "xla", "xlam", "xll", "xld", "xlv", "xlw", "xlc", "xlm",
"xlt", "xln" };
QDir dir(folder_path); QDir dir(folder_path);
Q_ASSERT(dir.exists()); Q_ASSERT(dir.exists());

View File

@ -9,6 +9,7 @@
#include <QResource> #include <QResource>
#include <QSettings> #include <QSettings>
#include <QUrl> #include <QUrl>
#include <QNetworkInformation>
#include <fstream> #include <fstream>
#ifndef GPT4ALL_OFFLINE_INSTALLER #ifndef GPT4ALL_OFFLINE_INSTALLER
@ -39,6 +40,10 @@ LLM::LLM()
#endif #endif
m_compatHardware = minimal; m_compatHardware = minimal;
QNetworkInformation::loadDefaultBackend();
connect(QNetworkInformation::instance(), &QNetworkInformation::reachabilityChanged,
this, &LLM::isNetworkOnlineChanged);
} }
bool LLM::hasSettingsAccess() const bool LLM::hasSettingsAccess() const
@ -100,3 +105,11 @@ QString LLM::systemTotalRAMInGBString() const
{ {
return QString::fromStdString(getSystemTotalRAMInGBString()); return QString::fromStdString(getSystemTotalRAMInGBString());
} }
bool LLM::isNetworkOnline() const
{
if (!QNetworkInformation::instance())
return false;
return QNetworkInformation::instance()->reachability() == QNetworkInformation::Reachability::Online;
}

View File

@ -6,6 +6,8 @@
class LLM : public QObject class LLM : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool isNetworkOnline READ isNetworkOnline NOTIFY isNetworkOnlineChanged)
public: public:
static LLM *globalInstance(); static LLM *globalInstance();
@ -17,10 +19,10 @@ public:
Q_INVOKABLE static bool fileExists(const QString &path); Q_INVOKABLE static bool fileExists(const QString &path);
Q_INVOKABLE qint64 systemTotalRAMInGB() const; Q_INVOKABLE qint64 systemTotalRAMInGB() const;
Q_INVOKABLE QString systemTotalRAMInGBString() const; Q_INVOKABLE QString systemTotalRAMInGBString() const;
Q_INVOKABLE bool isNetworkOnline() const;
Q_SIGNALS: Q_SIGNALS:
void chatListModelChanged(); void isNetworkOnlineChanged();
void modelListChanged();
private: private:
bool m_compatHardware; bool m_compatHardware;

View File

@ -369,7 +369,7 @@ Window {
highlighted: comboBox.highlightedIndex === index highlighted: comboBox.highlightedIndex === index
} }
Accessible.role: Accessible.ComboBox Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("List of available models") Accessible.name: comboBox.currentModelName
Accessible.description: qsTr("The top item is the current model") Accessible.description: qsTr("The top item is the current model")
onActivated: function (index) { onActivated: function (index) {
currentChat.stopGenerating() currentChat.stopGenerating()
@ -869,6 +869,7 @@ Window {
MyButton { MyButton {
id: downloadButton id: downloadButton
visible: LLM.isNetworkOnline
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 40 Layout.topMargin: 40
text: qsTr("Download models") text: qsTr("Download models")
@ -904,10 +905,7 @@ Window {
model: chatModel model: chatModel
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
parent: listView.parent policy: ScrollBar.AsNeeded
anchors.top: listView.top
anchors.left: listView.right
anchors.bottom: listView.bottom
} }
Accessible.role: Accessible.List Accessible.role: Accessible.List
@ -960,7 +958,7 @@ Window {
} }
Accessible.role: Accessible.Paragraph Accessible.role: Accessible.Paragraph
Accessible.name: name Accessible.name: text
Accessible.description: name === qsTr("Response: ") ? "The response by the model" : "The prompt by the user" Accessible.description: name === qsTr("Response: ") ? "The response by the model" : "The prompt by the user"
topPadding: 20 topPadding: 20

View File

@ -131,7 +131,7 @@ Drawer {
} }
} }
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: qsTr("Select the current chat") Accessible.name: text
Accessible.description: qsTr("Select the current chat or edit the chat when in edit mode") Accessible.description: qsTr("Select the current chat or edit the chat when in edit mode")
} }
Row { Row {