diff --git a/3rdparty/antlr4.tar.gz b/3rdparty/antlr4.tar.gz index be079df3..6bd874db 100644 Binary files a/3rdparty/antlr4.tar.gz and b/3rdparty/antlr4.tar.gz differ diff --git a/src/grand-search/CMakeLists.txt b/src/grand-search/CMakeLists.txt index ba0fdcf1..02e7a229 100644 --- a/src/grand-search/CMakeLists.txt +++ b/src/grand-search/CMakeLists.txt @@ -18,9 +18,9 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64" ) - message(${CMAKE_SYSTEM_PROCESSOR} ": disable ai search") + message("${CMAKE_SYSTEM_PROCESSOR} : disable ai search") else() - message(${CMAKE_SYSTEM_PROCESSOR} ": enable ai search") + message("${CMAKE_SYSTEM_PROCESSOR} : enable ai search") ADD_DEFINITIONS(-DENABLE_AI_SEARCH) endif() @@ -152,6 +152,8 @@ set(GUISRC gui/searchconfig/llmwidget/modelmanagebutton.h gui/searchconfig/llmwidget/downloader.h gui/searchconfig/llmwidget/downloader.cpp + gui/searchconfig/llmwidget/embeddingpluginwidget.cpp + gui/searchconfig/llmwidget/embeddingpluginwidget.h gui/searchconfig/hyperlinklabel/hyperlinklabel.cpp gui/searchconfig/hyperlinklabel/hyperlinklabel.h gui/searchconfig/comboboxwidget/comboboxwidget.h diff --git a/src/grand-search/gui/searchconfig/indexwidget.cpp b/src/grand-search/gui/searchconfig/indexwidget.cpp index 2b8061e3..cadf60e0 100644 --- a/src/grand-search/gui/searchconfig/indexwidget.cpp +++ b/src/grand-search/gui/searchconfig/indexwidget.cpp @@ -28,12 +28,10 @@ IndexWidget::IndexWidget(QWidget *parent) m_mainLayout->addWidget(m_groupLabel); #ifdef ENABLE_AI_SEARCH - // 目前非amd64架构,用不了AI搜索 m_intelligent = new IntelligentRetrievalWidget(this); m_mainLayout->addWidget(m_intelligent); -#endif - m_mainLayout->addSpacing(10); +#endif m_mainLayout->addWidget(m_blackListWidget); } diff --git a/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.cpp b/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.cpp index fb33ac90..bc49b010 100644 --- a/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.cpp +++ b/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.cpp @@ -7,6 +7,7 @@ #include "autoindexstatus.h" #include "gui/searchconfig/switchwidget/switchwidget.h" #include "gui/searchconfig/llmwidget/llmwidget.h" +#include "gui/searchconfig/llmwidget/embeddingpluginwidget.h" #include "business/config/searchconfig.h" #include "global/searchconfigdefine.h" #include "global/builtinsearch.h" @@ -105,24 +106,6 @@ IntelligentRetrievalWidget::IntelligentRetrievalWidget(QWidget *parent) m_indexLayout->addWidget(bkg); } - // model - { - RoundedBackground *bkg = new RoundedBackground(m_indexWidget); - bkg->setMinimumSize(CHECKBOXITEMWIDTH, SWITCHWIDGETHEIGHT); - bkg->setTopRound(true); - bkg->setBottomRound(true); - - QVBoxLayout *vl = new QVBoxLayout(bkg); - bkg->setLayout(vl); - vl->setContentsMargins(0, 2, 0, 5); - m_llmWidget = new LLMWidget(bkg); - m_llmWidget->setText(tr("UOS AI LLM"),tr("After installing the UOS AI large model, you can use the AI intelligent search function without an internet connection.")); - m_llmWidget->checkInstallStatus(); - vl->addWidget(m_llmWidget); - m_indexLayout->addSpacing(10); - m_indexLayout->addWidget(bkg); - } - // full text { m_indexLayout->addSpacing(10); @@ -151,6 +134,42 @@ IntelligentRetrievalWidget::IntelligentRetrievalWidget(QWidget *parent) m_indexLayout->addWidget(m_fullTextLabel); } + // plugin + { + RoundedBackground *bkg = new RoundedBackground(m_indexWidget); + bkg->setMinimumSize(CHECKBOXITEMWIDTH, SWITCHWIDGETHEIGHT); + bkg->setTopRound(true); + bkg->setBottomRound(true); + + QVBoxLayout *vl = new QVBoxLayout(bkg); + bkg->setLayout(vl); + vl->setContentsMargins(0, 2, 0, 5); + m_embWidget = new EmbeddingPluginWidget(bkg); + m_embWidget->setText(tr("Embedding Plugins"),tr("After installing the model, you can use services such as AI Search and UOS AI Assistant..")); + m_embWidget->checkInstallStatus(); + vl->addWidget(m_embWidget); + m_indexLayout->addSpacing(10); + m_indexLayout->addWidget(bkg); + } + + // model + { + RoundedBackground *bkg = new RoundedBackground(m_indexWidget); + bkg->setMinimumSize(CHECKBOXITEMWIDTH, SWITCHWIDGETHEIGHT); + bkg->setTopRound(true); + bkg->setBottomRound(true); + + QVBoxLayout *vl = new QVBoxLayout(bkg); + bkg->setLayout(vl); + vl->setContentsMargins(0, 2, 0, 5); + m_llmWidget = new LLMWidget(bkg); + m_llmWidget->setText(tr("UOS AI LLM"),tr("After installing the UOS AI large model, you can use the AI intelligent search function without an internet connection.")); + m_llmWidget->checkInstallStatus(); + vl->addWidget(m_llmWidget); + m_indexLayout->addSpacing(10); + m_indexLayout->addWidget(bkg); + connect(m_embWidget, &EmbeddingPluginWidget::pluginStateChanged, m_llmWidget, &LLMWidget::pluginStateChanged); + } #ifdef VECTOR_SEARCH // 超链接 m_vectorDetail = new QLabel; @@ -184,6 +203,8 @@ void IntelligentRetrievalWidget::updateState() this->updateIndexStatusContent(this->getIndexStatus()); } + m_embWidget->checkInstallStatus(); + #ifdef VECTOR_SEARCH if (isVectorSupported()) { bool checked = cfg->getConfig(GRANDSEARCH_SEMANTIC_GROUP, GRANDSEARCH_CLASS_GENERALFILE_SEMANTIC_VECTOR, true).toBool(); @@ -300,24 +321,15 @@ void IntelligentRetrievalWidget::checkChanged() } // 检测是否安装大模型,未安装就提醒弹窗 - if (on && !this->isQueryLangSupported()) { - DDialog *warningDlg = new DDialog(); - warningDlg->setWindowFlags((warningDlg->windowFlags() | Qt::WindowType::WindowStaysOnTopHint)); - warningDlg->setFixedWidth(380); - warningDlg->setIcon(QIcon(":icons/dde-grand-search-setting.svg")); - warningDlg->setMessage(QString(tr("To use AI smart search, you need to install the UOS AI large model. Please install the model."))); - warningDlg->addButton(tr("Not yet"), false, DDialog::ButtonNormal); - warningDlg->addButton(tr("Install the model"), true, DDialog::ButtonRecommend); - connect(warningDlg, &DDialog::accepted, warningDlg, [&] { - m_llmWidget->onClickedStatusBtn(); - //QDBusInterface iface("com.home.appstore.client", "/com/home/appstore/client", "com.home.appstore.client"); - //iface.call("openBusinessUri", ""); - }); - connect(warningDlg, &DDialog::finished, warningDlg, [&] { - warningDlg->deleteLater(); - }); - warningDlg->moveToCenter(); - warningDlg->exec(); + if (on && (!m_llmWidget->isInstalled() || !m_embWidget->isInstalled())) { + DDialog warningDlg; + warningDlg.setWindowFlags((warningDlg.windowFlags() | Qt::WindowType::WindowStaysOnTopHint)); + warningDlg.setFixedWidth(380); + warningDlg.setIcon(QIcon(":icons/dde-grand-search-setting.svg")); + warningDlg.setMessage(QString(tr("To use AI Smart Search, you need to install the Embedding Plugins and UOS AI LLM first."))); + warningDlg.addButton(tr("OK"), true, DDialog::ButtonNormal); + warningDlg.moveToCenter(); + warningDlg.exec(); } } #ifdef VECTOR_SEARCH diff --git a/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.h b/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.h index 376ff9d0..ae7c0313 100644 --- a/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.h +++ b/src/grand-search/gui/searchconfig/intelligentretrieval/intelligentretrievalwidget.h @@ -14,6 +14,7 @@ namespace GrandSearch { class SwitchWidget; class LLMWidget; +class EmbeddingPluginWidget; class DetailCheckBox; class AutoIndexStatus; class IntelligentRetrievalWidget : public Dtk::Widget::DWidget @@ -56,6 +57,7 @@ protected slots: SwitchWidget *m_fullTextIndex = nullptr; QLabel *m_fullTextLabel = nullptr; LLMWidget *m_llmWidget = nullptr; + EmbeddingPluginWidget *m_embWidget = nullptr; AutoIndexStatus *m_indexStatus = nullptr; QTimer m_timer; bool m_ignoreSigal = false; diff --git a/src/grand-search/gui/searchconfig/llmwidget/embeddingpluginwidget.cpp b/src/grand-search/gui/searchconfig/llmwidget/embeddingpluginwidget.cpp new file mode 100644 index 00000000..2387ea62 --- /dev/null +++ b/src/grand-search/gui/searchconfig/llmwidget/embeddingpluginwidget.cpp @@ -0,0 +1,134 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "embeddingpluginwidget.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +DWIDGET_USE_NAMESPACE +using namespace GrandSearch; + +static constexpr char PLUGINSNAME[] = "uos-ai-rag"; + +EmbeddingPluginWidget::EmbeddingPluginWidget(QWidget *parent) : DWidget(parent) +{ + initUI(); +} + +void EmbeddingPluginWidget::setText(const QString &theme, const QString &summary) +{ + m_pLabelTheme->setText(theme); + m_pLabelSummary->setText(summary); +} + +bool EmbeddingPluginWidget::isInstalled() +{ + return m_pManageModel->property("modelStatus").toInt() != Uninstall; +} + +void EmbeddingPluginWidget::checkInstallStatus() +{ + QProcess m_pProcess; + m_pProcess.start("dpkg-query", QStringList() << "-W" << QString("-f='${db:Status-Status}\n'") << PLUGINSNAME); + m_pProcess.waitForFinished(); + QByteArray reply = m_pProcess.readAllStandardOutput(); + bool installStatus = (reply == "'installed\n'" ? true : false); + m_pManageModel->setProperty("modelStatus", installStatus ? Install : Uninstall); + m_pManageModel->setVisible(!installStatus); + + m_pLabelStatus->setText(installStatus ? tr("Installed") : tr("Not Installed")); + + emit pluginStateChanged(installStatus); +} + +void EmbeddingPluginWidget::paintEvent(QPaintEvent *e) +{ + DPalette pl = m_pLabelSummary->palette(); + QColor color = DGuiApplicationHelper::instance()->applicationPalette().color(DPalette::BrightText); + if (!isActiveWindow()) + color.setAlphaF(0.4); + else + color.setAlphaF(0.6); + pl.setColor(QPalette::Text, color); + m_pLabelSummary->setPalette(pl); + + pl = m_pLabelStatus->palette(); + if (m_pManageModel->property("modelStatus").toInt() == Install) { + color = QColor(21, 190, 76); + color.setAlphaF(1); + } else + color.setAlphaF(0.6); + + if (!isActiveWindow()) + color.setAlphaF(0.4); + + pl.setColor(QPalette::Text, color); + m_pLabelStatus->setPalette(pl); + + DWidget::paintEvent(e); +} + +void EmbeddingPluginWidget::initUI() +{ + m_pLabelTheme = new DLabel; + DFontSizeManager::instance()->bind(m_pLabelTheme, DFontSizeManager::T6, QFont::Medium); + m_pLabelTheme->setElideMode(Qt::ElideRight); + + m_pLabelStatus = new DLabel(tr("Not Installed")); + m_pLabelStatus->setForegroundRole(QPalette::Text); + DFontSizeManager::instance()->bind(m_pLabelStatus, DFontSizeManager::T8, QFont::Medium); + + auto topLayout = new QHBoxLayout(); + topLayout->setContentsMargins(0, 0, 0, 0); + topLayout->addWidget(m_pLabelTheme, 0, Qt::AlignLeft); + topLayout->addStretch(); + topLayout->addWidget(m_pLabelStatus, 0, Qt::AlignRight); + + m_pLabelSummary = new DLabel; + m_pLabelSummary->setForegroundRole(QPalette::Text); + DFontSizeManager::instance()->bind(m_pLabelSummary, DFontSizeManager::T8, QFont::Normal); + m_pLabelSummary->setElideMode(Qt::ElideRight); + + m_pManageModel = new ModelManageButton(tr("Install"), this); + QPixmap pixmap = QApplication::style()->standardIcon(QStyle::SP_ArrowDown).pixmap(QSize(10, 10)); + QPainter painter(&pixmap); + painter.setCompositionMode(QPainter::CompositionMode_SourceIn); + painter.fillRect(pixmap.rect(), DGuiApplicationHelper::instance()->applicationPalette().textTips()); + m_pManageModel->setIcon(pixmap); + m_pManageModel->setProperty("modelStatus", Uninstall); + DFontSizeManager::instance()->bind(m_pManageModel, DFontSizeManager::T8, QFont::Medium); + m_pManageModel->updateRectSize(); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->setContentsMargins(10, 8, 10, 6); + mainLayout->setSpacing(5); + mainLayout->addLayout(topLayout); + mainLayout->addWidget(m_pLabelSummary, 0, Qt::AlignLeft); + mainLayout->addWidget(m_pManageModel, 0, Qt::AlignLeft); + + setLayout(mainLayout); + + connect(m_pManageModel, &ModelManageButton::clicked, this, &EmbeddingPluginWidget::openAppStore); +} + +void EmbeddingPluginWidget::openAppStore() +{ + qInfo() << "open app store" << PLUGINSNAME; + QDBusMessage msg = QDBusMessage::createMethodCall("com.home.appstore.client", "/com/home/appstore/client", + "com.home.appstore.client", "openBusinessUri"); + QVariantList list; + list.append(QString("app_detail_info/%0").arg(PLUGINSNAME)); + msg.setArguments(list); + + QDBusConnection::sessionBus().asyncCall(msg, 100); + return; +} diff --git a/src/grand-search/gui/searchconfig/llmwidget/embeddingpluginwidget.h b/src/grand-search/gui/searchconfig/llmwidget/embeddingpluginwidget.h new file mode 100644 index 00000000..b101e030 --- /dev/null +++ b/src/grand-search/gui/searchconfig/llmwidget/embeddingpluginwidget.h @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef EMBEDDINGPLUGINWIDGET_H +#define EMBEDDINGPLUGINWIDGET_H + +#include "modelmanagebutton.h" + +#include +#include + +namespace GrandSearch { +class EmbeddingPluginWidget : public Dtk::Widget::DWidget +{ + Q_OBJECT +public: + explicit EmbeddingPluginWidget(QWidget *parent = nullptr); + void setText(const QString &theme, const QString &summary); + bool isInstalled(); + void checkInstallStatus(); +public slots: + void openAppStore(); +protected: + void paintEvent(QPaintEvent* e) Q_DECL_OVERRIDE; +private: + void initUI(); +signals: + void pluginStateChanged(bool); + +private: + Dtk::Widget::DLabel *m_pLabelTheme = nullptr; + Dtk::Widget::DLabel *m_pLabelSummary = nullptr; + Dtk::Widget::DLabel *m_pLabelStatus = nullptr; + ModelManageButton *m_pManageModel = nullptr; +}; + +} +#endif // EMBEDDINGPLUGINWIDGET_H diff --git a/src/grand-search/gui/searchconfig/llmwidget/llmwidget.cpp b/src/grand-search/gui/searchconfig/llmwidget/llmwidget.cpp index 6e73b1d3..9e57a8b0 100644 --- a/src/grand-search/gui/searchconfig/llmwidget/llmwidget.cpp +++ b/src/grand-search/gui/searchconfig/llmwidget/llmwidget.cpp @@ -25,8 +25,7 @@ using namespace GrandSearch; static constexpr char MODELNAME[] = "yourong1.5B-Instruct-GGUF"; LLMWidget::LLMWidget(DWidget *parent) - : DWidget(parent), - m_pProcess(new QProcess) + : DWidget(parent) { initUI(); initConnect(); @@ -44,10 +43,6 @@ LLMWidget::LLMWidget(DWidget *parent) LLMWidget::~LLMWidget() { - if (m_pProcess) { - m_pProcess->terminate(); - m_pProcess->deleteLater(); - } } void LLMWidget::initUI() @@ -60,7 +55,7 @@ void LLMWidget::initUI() m_spinner->setFixedSize(12, 12); m_spinner->hide(); - m_pLabelStatus = new DLabel(tr("NotInstalled")); + m_pLabelStatus = new DLabel(tr("Not Installed")); m_pLabelStatus->setForegroundRole(QPalette::Text); DFontSizeManager::instance()->bind(m_pLabelStatus, DFontSizeManager::T8, QFont::Medium); @@ -108,9 +103,6 @@ void LLMWidget::initConnect() { connect(m_pManageModel, &DCommandLinkButton::clicked, this, &LLMWidget::onClickedStatusBtn); connect(m_pMenu, &QMenu::triggered, this, &LLMWidget::onMoreMenuTriggered); - - connect(m_pProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(onProcessFinished(int, QProcess::ExitStatus))); - } void LLMWidget::paintEvent(QPaintEvent* e) @@ -164,6 +156,18 @@ void LLMWidget::onClickedStatusBtn() } } +bool LLMWidget::isInstalled() +{ + return m_pManageModel->property("modelStatus").toInt() != Uninstall; +} + +void LLMWidget::pluginStateChanged(bool enable) +{ + m_pluginInstalled = enable; + if (m_downloader.isNull() || m_downloader->isFinished()) + checkInstallStatus(); +} + void LLMWidget::onMoreMenuTriggered(const QAction *action) { if (action == m_uninstallAction) { @@ -175,20 +179,6 @@ void LLMWidget::onMoreMenuTriggered(const QAction *action) void LLMWidget::onInstall() { - //git下载 -// if (!m_pProcess->atEnd()) return; -// if (m_pProcess->state() == QProcess::Running) -// m_pProcess->waitForFinished(); - -// QString program = "git"; -// QStringList arguments; -// arguments << "clone" << "https://www.modelscope.cn/uniontech-yourong/yourong1.5B-Instruct-GGUF.git"; - -// m_pProcess->setWorkingDirectory(m_installPath); -// m_pProcess->start(program, arguments); - -// onDealInstalledModel(); - //http请求下载 QDir destinationDir(m_installPath + "/." + MODELNAME); @@ -341,7 +331,7 @@ void LLMWidget::checkInstallStatus() bool LLMWidget::onCloseEvent() { - if (m_pProcess->state() == QProcess::Running || (m_downloader && !m_downloader->isFinished())) { + if (m_downloader && !m_downloader->isFinished()) { DDialog dlg(this); dlg.setIcon(QIcon(":icons/dde-grand-search-setting.svg")); dlg.setMaximumWidth(380); @@ -376,17 +366,23 @@ bool LLMWidget::onCloseEvent() } void LLMWidget::changeInstallStatus() -{ +{ int modelStatus = m_pManageModel->property("modelStatus").toInt(); switch (modelStatus) { case Install: { m_pManageModel->setText(tr("UnInstall Model")); m_pLabelStatus->setText(tr("Installed")); + m_pManageModel->setEnabled(true); break; } case Uninstall: { m_pManageModel->setText(tr("Install Model")); m_pLabelStatus->setText(tr("Not Installed")); + m_pManageModel->setEnabled(m_pluginInstalled); + if (m_pluginInstalled) + m_pManageModel->setToolTip(""); + else + m_pManageModel->setToolTip(tr("Please install the \"Embedding Plugins\" first before installing this model.")); break; } default: @@ -394,7 +390,6 @@ void LLMWidget::changeInstallStatus() } m_spinner->hide(); m_spinner->stop(); - m_pManageModel->setEnabled(true); m_pManageModel->updateRectSize(); } diff --git a/src/grand-search/gui/searchconfig/llmwidget/llmwidget.h b/src/grand-search/gui/searchconfig/llmwidget/llmwidget.h index 33e86165..0e43fd3a 100644 --- a/src/grand-search/gui/searchconfig/llmwidget/llmwidget.h +++ b/src/grand-search/gui/searchconfig/llmwidget/llmwidget.h @@ -9,7 +9,6 @@ #include "modelmanagebutton.h" #include "dcommandlinkbutton.h" -#include #include #include @@ -18,13 +17,6 @@ #include namespace GrandSearch { - -enum ModelStatus { - None = 0, - Install, - Uninstall, - InstallAndUpdate -}; class Downloader; class LLMWidget: public Dtk::Widget::DWidget { @@ -37,14 +29,14 @@ class LLMWidget: public Dtk::Widget::DWidget void setText(const QString &theme, const QString &summary); bool onCloseEvent(); void onClickedStatusBtn(); - + bool isInstalled(); +public slots: + void pluginStateChanged(bool enable); private: void initUI(); void initConnect(); void onInstall(); void onUninstall(); - void beginTimer(const int &time); - void checkStatusOntime(); void changeInstallStatus(); bool onDealInstalledModel(); @@ -67,12 +59,12 @@ private slots: QAction *m_updateAction = nullptr; QAction *m_uninstallAction = nullptr; - QProcess *m_pProcess = nullptr; QString m_installPath; QString m_baseUrl; QStringList m_modelFileList; QSharedPointer m_downloader; double m_lastProgress = 0.0; + bool m_pluginInstalled = false; }; } diff --git a/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.cpp b/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.cpp index ad67d6aa..518aa554 100644 --- a/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.cpp +++ b/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.cpp @@ -37,12 +37,8 @@ void ModelManageButton::paintEvent(QPaintEvent* e) QPainter pa(this); pa.setRenderHint(QPainter::Antialiasing, true); DPalette parentPb = DGuiApplicationHelper::instance()->applicationPalette(); - QColor textColor = parentPb.color(DPalette::Normal, DPalette::Highlight); - - bool isDarkType = false; - if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) - isDarkType = true; - + QColor textColor = parentPb.color(DPalette::Normal, DPalette::Highlight); + bool isDarkType = DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType; if (isDarkType) textColor.setAlphaF(0.7); diff --git a/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.h b/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.h index fed3ac1f..0f14c50d 100644 --- a/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.h +++ b/src/grand-search/gui/searchconfig/llmwidget/modelmanagebutton.h @@ -9,6 +9,13 @@ namespace GrandSearch { +enum ModelStatus { + None = 0, + Install, + Uninstall, + InstallAndUpdate +}; + class ModelManageButton : public DTK_WIDGET_NAMESPACE::DPushButton { Q_OBJECT diff --git a/translations/dde-grand-search_zh_CN.ts b/translations/dde-grand-search_zh_CN.ts index a7688205..7a9aabb1 100644 --- a/translations/dde-grand-search_zh_CN.ts +++ b/translations/dde-grand-search_zh_CN.ts @@ -144,6 +144,25 @@ 确 定 + + GrandSearch::EmbeddingPluginWidget + + + Installed + 已安装 + + + + + Not Installed + 未安装 + + + + Install + 安装 + + GrandSearch::EntranceWidget @@ -258,177 +277,183 @@ GrandSearch::IntelligentRetrievalWidget - + When turned on, you can try to search for local documents using natural language descriptions, such as "last week's documents". 开启后您可以尝试使用自然语言描述搜索本地文件,例如搜索“上周的文档”。 - + Intelligent full text search 智能全文检索 - + Automatic index update 自动更新索引 - + AI Smart Search AI智能搜索 - + UOS AI LLM UOS AI大模型 - + After installing the UOS AI large model, you can use the AI intelligent search function without an internet connection. 安装UOS AI大模型后,无需联网即可使用AI智能搜索功能 - + Full Text Search 全文检索 - + When turned on, full text search can be used in the file manager and grand search. 开启后,在系统文件管理器和全局搜索内均可使用全文检索功能 - + + Embedding Plugins + 向量化模型插件 + + + + After installing the model, you can use services such as AI Search and UOS AI Assistant.. + 安装该模型后,可以使用AI搜索、UOS AI助手等服务。 + + + When enabled, you can search the text of articles using disjointed and incomplete keywords. 开启后您可以使用不连贯、不完整的关键词搜索文章文本内容。 - + Please install %0 in <a href="%0">the app store</a> before turning on this configuration. 请先到 <a href="%0">应用商店</a> 安装%0模型后再开启该配置。 - - + + Intelligent search indexing is being updated, which may take up more resources, please keep the power access. 正在更新智能搜索索引编制,可能占用较多资源,请保持电源接入。 - - + + Smart Search indexing update is complete. Last update time: %0 智能搜索索引编制更新完成。上次更新时间:%0 - + Indexing error! 索引编制出错! - - To use AI smart search, you need to install the UOS AI large model. Please install the model. - 使用AI智能搜索需要安装UOS AI大模型,请安装模型 + + To use AI Smart Search, you need to install the Embedding Plugins and UOS AI LLM first. + 使用AI智能搜索需要先安装“向量化模型插件”和“统信有容大模型”。 - - Not yet - 暂不使用 - - - - Install the model - 安装模型 + + OK + 确 定 GrandSearch::LLMWidget - - NotInstalled - 未安装 - - - - + + Install Model 安装模型 - + Update model 更新模型 - + Uninstall model 卸载模型 - + Installing 安装中 - + Are you sure you want to delete this model? 确定卸载UOS AI大模型? - + After uninstallation, functions such as AI Search and UOS AI Assistant will not work properly. 卸载后将导致AI搜索、UOS AI助手等功能无法正常使用。 - + Cancel button 暂不卸载 - + Confirm button 确定卸载 - + Installing 正在安装 - + Installing the UOS AI Large Language Model 正在安装UOS AI大模型 - + Exiting will cause the installation to fail, do you still want to exit? 退出将导致安装失败,仍要退出吗? - + Exit button 退 出 - + Continue button 继续安装 - + UnInstall Model 卸载模型 - + Installed 已安装 - + + Please install the "Embedding Plugins" first before installing this model. + 安装此模型前请先安装“向量化模型插件”。 + + + + Not Installed 未安装