Skip to content

Commit 2364799

Browse files
fixed model name definition and some minor UI issues
1 parent 9becf15 commit 2364799

3 files changed

Lines changed: 27 additions & 48 deletions

File tree

src/main/java/io/github/jeddict/ai/settings/AIAssistancePanel.form

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,7 @@
167167
<Component class="javax.swing.JTextField" name="providerLocationField">
168168
<Properties>
169169
<Property name="horizontalAlignment" type="int" value="2"/>
170-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
171-
<ResourceString bundle="io/github/jeddict/ai/settings/Bundle.properties" key="AIAssistancePanel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
172-
</Property>
173-
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
174-
<ResourceString bundle="io/github/jeddict/ai/settings/Bundle.properties" key="AIAssistancePanel.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
175-
</Property>
170+
<Property name="toolTipText" type="java.lang.String" value="Base URL of the API endpoint"/>
176171
<Property name="alignmentX" type="float" value="0.0"/>
177172
<Property name="alignmentY" type="float" value="0.0"/>
178173
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@@ -326,12 +321,7 @@
326321
</FontInfo>
327322
</Property>
328323
<Property name="horizontalAlignment" type="int" value="2"/>
329-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
330-
<ResourceString bundle="io/github/jeddict/ai/settings/Bundle.properties" key="AIAssistancePanel.modelLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
331-
</Property>
332-
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
333-
<ResourceString bundle="io/github/jeddict/ai/settings/Bundle.properties" key="AIAssistancePanel.modelLabel.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
334-
</Property>
324+
<Property name="text" type="java.lang.String" value="Model:"/>
335325
<Property name="alignmentY" type="float" value="0.0"/>
336326
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
337327
<Dimension value="[32767, 32767]"/>
@@ -463,25 +453,21 @@
463453
<Color blue="64" green="64" red="64" type="rgb"/>
464454
</Property>
465455
<Property name="horizontalAlignment" type="int" value="2"/>
466-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
467-
<ResourceString bundle="io/github/jeddict/ai/settings/Bundle.properties" key="AIAssistancePanel.modelHelp.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
468-
</Property>
456+
<Property name="text" type="java.lang.String" value="Model description if available"/>
469457
<Property name="verticalAlignment" type="int" value="3"/>
470458
<Property name="alignmentY" type="float" value="0.0"/>
471459
<Property name="horizontalTextPosition" type="int" value="2"/>
472460
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
473-
<Dimension value="[32767, 32]"/>
461+
<Dimension value="[32767, 64]"/>
462+
</Property>
463+
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
464+
<Dimension value="[177, 364]"/>
474465
</Property>
475466
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
476-
<Dimension value="[300, 32]"/>
467+
<Dimension value="[300, 64]"/>
477468
</Property>
478469
<Property name="verticalTextPosition" type="int" value="3"/>
479470
</Properties>
480-
<AccessibilityProperties>
481-
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
482-
<ResourceString bundle="io/github/jeddict/ai/settings/Bundle.properties" key="AIAssistancePanel.modelHelp.AccessibleContext.accessibleName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
483-
</Property>
484-
</AccessibilityProperties>
485471
</Component>
486472
</SubComponents>
487473
</Container>
@@ -512,9 +498,7 @@
512498
<Component class="javax.swing.JLabel" name="optionsLabel">
513499
<Properties>
514500
<Property name="horizontalAlignment" type="int" value="2"/>
515-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
516-
<ResourceString bundle="io/github/jeddict/ai/settings/Bundle.properties" key="AIAssistancePanel.optionsLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
517-
</Property>
501+
<Property name="text" type="java.lang.String" value="Options"/>
518502
<Property name="alignmentX" type="float" value="1.0"/>
519503
<Property name="alignmentY" type="float" value="0.0"/>
520504
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">

src/main/java/io/github/jeddict/ai/settings/AIAssistancePanel.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
284284
providerLocationPane.add(providerLocationLabel);
285285

286286
providerLocationField.setHorizontalAlignment(javax.swing.JTextField.LEFT);
287-
providerLocationField.setText(org.openide.util.NbBundle.getMessage(AIAssistancePanel.class, "AIAssistancePanel.text")); // NOI18N
288-
providerLocationField.setToolTipText(org.openide.util.NbBundle.getMessage(AIAssistancePanel.class, "AIAssistancePanel.toolTipText")); // NOI18N
287+
providerLocationField.setToolTipText("Base URL of the API endpoint");
289288
providerLocationField.setAlignmentX(0.0F);
290289
providerLocationField.setAlignmentY(0.0F);
291290
providerLocationField.setMaximumSize(new java.awt.Dimension(32767, 32));
@@ -361,8 +360,7 @@ public void focusLost(java.awt.event.FocusEvent evt) {
361360

362361
modelLabel.setFont(modelLabel.getFont());
363362
modelLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
364-
org.openide.awt.Mnemonics.setLocalizedText(modelLabel, org.openide.util.NbBundle.getMessage(AIAssistancePanel.class, "AIAssistancePanel.modelLabel.text")); // NOI18N
365-
modelLabel.setToolTipText(org.openide.util.NbBundle.getMessage(AIAssistancePanel.class, "AIAssistancePanel.modelLabel.toolTipText")); // NOI18N
363+
org.openide.awt.Mnemonics.setLocalizedText(modelLabel, "Model:");
366364
modelLabel.setAlignmentY(0.0F);
367365
modelLabel.setMaximumSize(new java.awt.Dimension(32767, 32767));
368366
modelLabel.setMinimumSize(new java.awt.Dimension(300, 17));
@@ -426,15 +424,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
426424
modelHelp.setFont(modelHelp.getFont());
427425
modelHelp.setForeground(new java.awt.Color(100, 100, 100));
428426
modelHelp.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
429-
org.openide.awt.Mnemonics.setLocalizedText(modelHelp, org.openide.util.NbBundle.getMessage(AIAssistancePanel.class, "AIAssistancePanel.modelHelp.text")); // NOI18N
427+
org.openide.awt.Mnemonics.setLocalizedText(modelHelp, "Model description if available");
430428
modelHelp.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
431429
modelHelp.setAlignmentY(0.0F);
432430
modelHelp.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
433-
modelHelp.setMaximumSize(new java.awt.Dimension(32767, 32));
434-
modelHelp.setPreferredSize(new java.awt.Dimension(300, 32));
431+
modelHelp.setMaximumSize(new java.awt.Dimension(32767, 64));
432+
modelHelp.setMinimumSize(new java.awt.Dimension(177, 364));
433+
modelHelp.setPreferredSize(new java.awt.Dimension(300, 64));
435434
modelHelp.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
436435
modelHelpPane.add(modelHelp);
437-
modelHelp.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(AIAssistancePanel.class, "AIAssistancePanel.modelHelp.AccessibleContext.accessibleName")); // NOI18N
438436

439437
modelChildPane.add(modelHelpPane);
440438

@@ -449,7 +447,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
449447
activationPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
450448

451449
optionsLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
452-
org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, org.openide.util.NbBundle.getMessage(AIAssistancePanel.class, "AIAssistancePanel.optionsLabel.text")); // NOI18N
450+
org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, "Options");
453451
optionsLabel.setAlignmentX(1.0F);
454452
optionsLabel.setAlignmentY(0.0F);
455453
optionsLabel.setMaximumSize(new java.awt.Dimension(32767, 30));
@@ -1105,7 +1103,7 @@ private void excludeJavadocCommentsCheckBoxActionPerformed(java.awt.event.Action
11051103
private void modelComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modelComboBoxActionPerformed
11061104
String selectedContext = (String) modelComboBox.getSelectedItem();
11071105
if (selectedContext != null && getModel(selectedContext) != null) {
1108-
modelHelp.setText(getModel(selectedContext).getDescription());
1106+
modelHelp.setText("<html><p>" + getModel(selectedContext).getDescription() + "</p></html>");
11091107
} else {
11101108
modelHelp.setText("");
11111109
}
@@ -1411,9 +1409,6 @@ private List<String> getModelList(GenAIProvider selectedProvider) {
14111409
&& !providerLocationField.getText().isEmpty()) {
14121410
GroqModelFetcher fetcher = new GroqModelFetcher();
14131411
models = fetcher.fetchModels(providerLocationField.getText(), new String(apiKeyField.getPassword()));
1414-
} else if (selectedProvider == GenAIProvider.PERPLEXITY) {
1415-
PerplexityModelFetcher fetcher = new PerplexityModelFetcher();
1416-
models = fetcher.getModels();
14171412
}
14181413

14191414
if (models == null) {

src/main/java/io/github/jeddict/ai/settings/GenAIModel.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,44 +193,44 @@ public class GenAIModel {
193193
"sonar",
194194
new GenAIModel(
195195
PERPLEXITY,
196-
"Lightweight, cost-effective search model",
197-
"Quick facts, news updates, simple Q&A, high-volume applications",
196+
"sonar",
197+
"Lightweight, cost-effective search model (quick facts, news updates, simple Q&A, high-volume applications)",
198198
1, 1
199199
)
200200
);
201201
MODELS.put(
202202
"sonar-pro",
203203
new GenAIModel(
204204
PERPLEXITY,
205-
"Advanced search with deeper content understanding",
206-
"Complex queries, competitive analysis, detailed research",
205+
"sonar-pro",
206+
"Advanced search with deeper content understanding (complex queries, competitive analysis, detailed research)",
207207
3, 15
208208
)
209209
);
210210
MODELS.put(
211211
"sonar-reasoning",
212212
new GenAIModel(
213213
PERPLEXITY,
214-
"Quick problem-solving with step-by-step logic and search",
215-
"Logic puzzles, math problems, transparent reasoning",
214+
"sonar-reasoning",
215+
"Quick problem-solving with step-by-step logic and search (logic puzzles, math problems, transparent reasoning)",
216216
1, 5
217217
)
218218
);
219219
MODELS.put(
220220
"sonar-reasoning-pro",
221221
new GenAIModel(
222222
PERPLEXITY,
223-
"Enhanced multi-step reasoning with web search",
224-
"Complex problem-solving, research analysis, strategic planning",
223+
"sonar-reasoning-pro",
224+
"Enhanced multi-step reasoning with web search (complex problem-solving, research analysis, strategic planning)",
225225
2, 8
226226
)
227227
);
228228
MODELS.put(
229229
"sonar-deep-research",
230230
new GenAIModel(
231231
PERPLEXITY,
232-
"Exhaustive research and detailed report generation with search",
233-
"Academic research, market analysis, comprehensive reports",
232+
"sonar-deep-research",
233+
"Exhaustive research and detailed report generation with search (academic research, market analysis, comprehensive reports)",
234234
2, 8
235235
)
236236
);

0 commit comments

Comments
 (0)