Skip to content

Commit 6cb8e76

Browse files
committed
Fix ai assistant settings, fix formatting issues
1 parent cd6a607 commit 6cb8e76

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

src/pages/aiAssistant/assistant.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,20 @@ export default function openAIAssistantPage() {
3838
let currentController = null;
3939
let aiTabInstance;
4040

41-
if (!settings.value.aiApiKey) {
42-
alert("Error", "Please set your AI Assistant API Key in Settings before using the assistant.");
43-
return;
44-
}
45-
if (!settings.value.aiModel) {
46-
alert("Error", "Please set your AI Assistant model in Settings before using the assistant.");
47-
return;
48-
}
41+
if (!settings.value.aiApiKey) {
42+
alert(
43+
"Error",
44+
"Please set your AI Assistant API Key in Settings before using the assistant.",
45+
);
46+
return;
47+
}
48+
if (!settings.value.aiModel) {
49+
alert(
50+
"Error",
51+
"Please set your AI Assistant model in Settings before using the assistant.",
52+
);
53+
return;
54+
}
4955

5056
const agentCheckpointer = new CordovaSqliteSaver();
5157
const model = new ChatGoogleGenerativeAI({

src/settings/appSettings.js

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,24 @@ export default function otherSettings() {
7272
select: [appSettings.CONSOLE_LEGACY, appSettings.CONSOLE_ERUDA],
7373
},
7474
{
75-
key: "aiApiKey",
76-
text: "AI Assistant API Key",
77-
placeholder: "Enter your API key",
78-
promptType: "text",
79-
promptOptions: {
80-
required: true
81-
},
82-
value: values.aiApiKey
75+
key: "aiApiKey",
76+
text: strings["AI Assistant API Key"],
77+
value: values.aiApiKey,
78+
prompt: strings["AI Assistant API Key"],
79+
promptType: "textarea",
80+
promptOptions: {
81+
required: true,
82+
},
8383
},
8484
{
85-
key: "aiModel",
86-
text: "AI Assistant Model",
87-
placeholder: "Enter your model",
88-
promptType: "text",
89-
promptOptions: {
90-
required: true
91-
},
92-
value: values.aiModel
85+
key: "aiModel",
86+
text: strings["AI Assistant Model"],
87+
value: values.aiModel,
88+
prompt: strings["AI Assistant Model"],
89+
promptType: "textarea",
90+
promptOptions: {
91+
required: true,
92+
},
9393
},
9494
{
9595
key: "keyboardMode",
@@ -253,16 +253,9 @@ export default function otherSettings() {
253253
} catch (error) {
254254
helpers.error(error);
255255
}
256+
break;
256257
}
257258

258-
case "aiApiKey":
259-
await appSettings.update({ aiApiKey: value });
260-
break;
261-
262-
case "aiModel":
263-
await appSettings.update({ aiModel: value });
264-
break;
265-
266259
case "rememberFiles":
267260
if (!value) {
268261
delete localStorage.files;

0 commit comments

Comments
 (0)