Skip to content

Commit

Permalink
Move to a brave search specific settings page.
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Treat <[email protected]>
  • Loading branch information
manyoso committed Aug 13, 2024
1 parent 74b2489 commit 9eaa706
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gpt4all-chat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ qt_add_qml_module(chat
qml/AddCollectionView.qml
qml/AddModelView.qml
qml/ApplicationSettings.qml
qml/BraveSearchSettings.qml
qml/ChatDrawer.qml
qml/ChatView.qml
qml/CollectionsDrawer.qml
Expand All @@ -156,7 +157,6 @@ qt_add_qml_module(chat
qml/ThumbsDownDialog.qml
qml/Toast.qml
qml/ToastManager.qml
qml/ToolSettings.qml
qml/MyBusyIndicator.qml
qml/MyButton.qml
qml/MyCheckBox.qml
Expand Down
2 changes: 1 addition & 1 deletion gpt4all-chat/bravesearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BraveSearch : public Tool {
ToolEnums::Error error() const override { return m_error; }
QString errorString() const override { return m_errorString; }

QString name() const override { return tr("Brave web search"); }
QString name() const override { return tr("Brave Web Search"); }
QString description() const override { return tr("Search the web using brave"); }
QString function() const override { return "brave_search"; }
QJsonObject paramSchema() const override;
Expand Down
2 changes: 1 addition & 1 deletion gpt4all-chat/localdocssearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LocalDocsSearch : public Tool {
ToolEnums::Error error() const override { return m_error; }
QString errorString() const override { return m_errorString; }

QString name() const override { return tr("LocalDocs search"); }
QString name() const override { return tr("LocalDocs Search"); }
QString description() const override { return tr("Search the local docs"); }
QString function() const override { return "localdocs_search"; }
QJsonObject paramSchema() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MySettingsTab {

showRestoreDefaultsButton: true

title: qsTr("Tools")
title: qsTr("Brave Web Search")
contentItem: ColumnLayout {
id: root
spacing: 30
Expand All @@ -27,7 +27,7 @@ MySettingsTab {
color: theme.grayRed900
font.pixelSize: theme.fontSizeLarge
font.bold: true
text: qsTr("Brave Search")
text: qsTr("Brave Web Search")
}

Rectangle {
Expand All @@ -37,6 +37,33 @@ MySettingsTab {
}
}

RowLayout {
MySettingsLabel {
id: usageModeLabel
text: qsTr("Usage Mode")
helpText: qsTr("When and how the brave search tool is executed.")
}
MyComboBox {
id: usageModeBox
Layout.minimumWidth: 400
Layout.maximumWidth: 400
Layout.alignment: Qt.AlignRight
// NOTE: indices match values of UsageMode enum, keep them in sync
model: ListModel {
ListElement { name: qsTr("Never") }
ListElement { name: qsTr("Model decides") }
ListElement { name: qsTr("Ask for confirmation before executing") }
ListElement { name: qsTr("Force usage for every response when possible") }
}
Accessible.name: usageModeLabel.text
Accessible.description: usageModeLabel.helpText
onActivated: {
}
Component.onCompleted: {
}
}
}

RowLayout {
MySettingsLabel {
id: apiKeyLabel
Expand All @@ -51,7 +78,8 @@ MySettingsTab {
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.alignment: Qt.AlignRight
Layout.minimumWidth: 200
Layout.minimumWidth: 400
Layout.maximumWidth: 400
onEditingFinished: {
MySettings.braveSearchAPIKey = apiKeyField.text;
}
Expand Down
4 changes: 2 additions & 2 deletions gpt4all-chat/qml/SettingsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Rectangle {
title: qsTr("LocalDocs")
}
ListElement {
title: qsTr("Tools")
title: qsTr("Brave Web Search")
}
}

Expand Down Expand Up @@ -158,7 +158,7 @@ Rectangle {

MySettingsStack {
tabs: [
Component { ToolSettings { } }
Component { BraveSearchSettings { } }
]
}
}
Expand Down

0 comments on commit 9eaa706

Please sign in to comment.