Skip to content

Commit 9eaa706

Browse files
committed
Move to a brave search specific settings page.
Signed-off-by: Adam Treat <treat.adam@gmail.com>
1 parent 74b2489 commit 9eaa706

File tree

5 files changed

+36
-8
lines changed

5 files changed

+36
-8
lines changed

gpt4all-chat/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ qt_add_qml_module(chat
138138
qml/AddCollectionView.qml
139139
qml/AddModelView.qml
140140
qml/ApplicationSettings.qml
141+
qml/BraveSearchSettings.qml
141142
qml/ChatDrawer.qml
142143
qml/ChatView.qml
143144
qml/CollectionsDrawer.qml
@@ -156,7 +157,6 @@ qt_add_qml_module(chat
156157
qml/ThumbsDownDialog.qml
157158
qml/Toast.qml
158159
qml/ToastManager.qml
159-
qml/ToolSettings.qml
160160
qml/MyBusyIndicator.qml
161161
qml/MyButton.qml
162162
qml/MyCheckBox.qml

gpt4all-chat/bravesearch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class BraveSearch : public Tool {
4848
ToolEnums::Error error() const override { return m_error; }
4949
QString errorString() const override { return m_errorString; }
5050

51-
QString name() const override { return tr("Brave web search"); }
51+
QString name() const override { return tr("Brave Web Search"); }
5252
QString description() const override { return tr("Search the web using brave"); }
5353
QString function() const override { return "brave_search"; }
5454
QJsonObject paramSchema() const override;

gpt4all-chat/localdocssearch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LocalDocsSearch : public Tool {
3434
ToolEnums::Error error() const override { return m_error; }
3535
QString errorString() const override { return m_errorString; }
3636

37-
QString name() const override { return tr("LocalDocs search"); }
37+
QString name() const override { return tr("LocalDocs Search"); }
3838
QString description() const override { return tr("Search the local docs"); }
3939
QString function() const override { return "localdocs_search"; }
4040
QJsonObject paramSchema() const override;

gpt4all-chat/qml/ToolSettings.qml renamed to gpt4all-chat/qml/BraveSearchSettings.qml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MySettingsTab {
1616

1717
showRestoreDefaultsButton: true
1818

19-
title: qsTr("Tools")
19+
title: qsTr("Brave Web Search")
2020
contentItem: ColumnLayout {
2121
id: root
2222
spacing: 30
@@ -27,7 +27,7 @@ MySettingsTab {
2727
color: theme.grayRed900
2828
font.pixelSize: theme.fontSizeLarge
2929
font.bold: true
30-
text: qsTr("Brave Search")
30+
text: qsTr("Brave Web Search")
3131
}
3232

3333
Rectangle {
@@ -37,6 +37,33 @@ MySettingsTab {
3737
}
3838
}
3939

40+
RowLayout {
41+
MySettingsLabel {
42+
id: usageModeLabel
43+
text: qsTr("Usage Mode")
44+
helpText: qsTr("When and how the brave search tool is executed.")
45+
}
46+
MyComboBox {
47+
id: usageModeBox
48+
Layout.minimumWidth: 400
49+
Layout.maximumWidth: 400
50+
Layout.alignment: Qt.AlignRight
51+
// NOTE: indices match values of UsageMode enum, keep them in sync
52+
model: ListModel {
53+
ListElement { name: qsTr("Never") }
54+
ListElement { name: qsTr("Model decides") }
55+
ListElement { name: qsTr("Ask for confirmation before executing") }
56+
ListElement { name: qsTr("Force usage for every response when possible") }
57+
}
58+
Accessible.name: usageModeLabel.text
59+
Accessible.description: usageModeLabel.helpText
60+
onActivated: {
61+
}
62+
Component.onCompleted: {
63+
}
64+
}
65+
}
66+
4067
RowLayout {
4168
MySettingsLabel {
4269
id: apiKeyLabel
@@ -51,7 +78,8 @@ MySettingsTab {
5178
color: theme.textColor
5279
font.pixelSize: theme.fontSizeLarge
5380
Layout.alignment: Qt.AlignRight
54-
Layout.minimumWidth: 200
81+
Layout.minimumWidth: 400
82+
Layout.maximumWidth: 400
5583
onEditingFinished: {
5684
MySettings.braveSearchAPIKey = apiKeyField.text;
5785
}

gpt4all-chat/qml/SettingsView.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Rectangle {
3535
title: qsTr("LocalDocs")
3636
}
3737
ListElement {
38-
title: qsTr("Tools")
38+
title: qsTr("Brave Web Search")
3939
}
4040
}
4141

@@ -158,7 +158,7 @@ Rectangle {
158158

159159
MySettingsStack {
160160
tabs: [
161-
Component { ToolSettings { } }
161+
Component { BraveSearchSettings { } }
162162
]
163163
}
164164
}

0 commit comments

Comments
 (0)