|
9 | 9 |
|
10 | 10 | <?import org.jabref.gui.icon.JabRefIconView?>
|
11 | 11 | <?import org.controlsfx.control.SearchableComboBox?>
|
12 |
| -<fx:root spacing="10.0" type="VBox" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.preferences.ai.AiTab"> |
| 12 | + |
| 13 | +<?import com.dlsc.gemsfx.ResizableTextArea?> |
| 14 | +<fx:root |
| 15 | + spacing="10.0" |
| 16 | + type="VBox" |
| 17 | + xmlns="http://javafx.com/javafx/17.0.2-ea" |
| 18 | + xmlns:fx="http://javafx.com/fxml/1" |
| 19 | + fx:controller="org.jabref.gui.preferences.ai.AiTab"> |
13 | 20 | <children>
|
14 |
| - <Label styleClass="titleHeader" text="%AI" /> |
| 21 | + <Label styleClass="titleHeader" |
| 22 | + text="%AI"/> |
15 | 23 |
|
16 |
| - <Label styleClass="sectionHeader" text="%General" /> |
| 24 | + <Label styleClass="sectionHeader" |
| 25 | + text="%General"/> |
17 | 26 |
|
18 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
| 27 | + <HBox alignment="CENTER_LEFT" |
| 28 | + spacing="10.0"> |
19 | 29 | <children>
|
20 |
| - <CheckBox fx:id="enableAi" mnemonicParsing="false" text="%Enable AI functionality (summary generation and chatting) in JabRef" VBox.vgrow="ALWAYS" /> |
21 |
| - <Button fx:id="enableAiHelp" prefWidth="20.0" /> |
| 30 | + <CheckBox |
| 31 | + fx:id="enableAi" |
| 32 | + mnemonicParsing="false" |
| 33 | + text="%Enable AI functionality (summary generation and chatting) in JabRef" |
| 34 | + HBox.hgrow="ALWAYS" |
| 35 | + maxWidth="Infinity"/> |
| 36 | + <Button fx:id="enableAiHelp" |
| 37 | + prefWidth="20.0"/> |
22 | 38 | </children>
|
23 | 39 | </HBox>
|
24 | 40 |
|
25 |
| - <HBox alignment="CENTER_LEFT" layoutX="10.0" layoutY="306.0" spacing="10.0"> |
| 41 | + <HBox alignment="CENTER_LEFT" |
| 42 | + layoutX="10.0" |
| 43 | + layoutY="306.0" |
| 44 | + spacing="10.0"> |
26 | 45 | <children>
|
27 |
| - <Label alignment="BASELINE_CENTER" text="%AI provider" /> |
28 |
| - <ComboBox fx:id="aiProviderComboBox" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" /> |
29 |
| - <Button fx:id="aiProviderHelp" prefWidth="20.0" /> |
| 46 | + <Label alignment="BASELINE_CENTER" |
| 47 | + text="%AI provider"/> |
| 48 | + <ComboBox |
| 49 | + fx:id="aiProviderComboBox" |
| 50 | + maxWidth="1.7976931348623157E308" |
| 51 | + HBox.hgrow="ALWAYS"/> |
| 52 | + <Button fx:id="aiProviderHelp" |
| 53 | + prefWidth="20.0"/> |
30 | 54 | </children>
|
31 | 55 | </HBox>
|
32 | 56 |
|
33 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
| 57 | + <HBox alignment="CENTER_LEFT" |
| 58 | + spacing="10.0"> |
34 | 59 | <children>
|
35 |
| - <Label alignment="BASELINE_CENTER" text="%Chat model" /> |
36 |
| - <ComboBox fx:id="chatModelComboBox" editable="true" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" /> |
37 |
| - <Button fx:id="chatModelHelp" prefWidth="20.0" /> |
| 60 | + <Label alignment="BASELINE_CENTER" |
| 61 | + text="%Chat model"/> |
| 62 | + <ComboBox |
| 63 | + fx:id="chatModelComboBox" |
| 64 | + editable="true" |
| 65 | + maxWidth="1.7976931348623157E308" |
| 66 | + HBox.hgrow="ALWAYS"/> |
| 67 | + <Button fx:id="chatModelHelp" |
| 68 | + prefWidth="20.0"/> |
38 | 69 | </children>
|
39 | 70 | <padding>
|
40 |
| - <Insets left="20.0" /> |
| 71 | + <Insets left="20.0"/> |
41 | 72 | </padding>
|
42 | 73 | </HBox>
|
43 | 74 |
|
44 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
| 75 | + <HBox alignment="CENTER_LEFT" |
| 76 | + spacing="10.0"> |
45 | 77 | <children>
|
46 |
| - <Label alignment="BASELINE_CENTER" text="%API key" /> |
47 |
| - <CustomPasswordField fx:id="apiKeyTextField" HBox.hgrow="ALWAYS" /> |
48 |
| - <Button fx:id="apiKeyHelp" prefWidth="20.0" /> |
| 78 | + <Label alignment="BASELINE_CENTER" |
| 79 | + text="%API key"/> |
| 80 | + <CustomPasswordField |
| 81 | + fx:id="apiKeyTextField" |
| 82 | + HBox.hgrow="ALWAYS"/> |
| 83 | + <Button fx:id="apiKeyHelp" |
| 84 | + prefWidth="20.0"/> |
49 | 85 | </children>
|
50 | 86 | <padding>
|
51 |
| - <Insets left="20.0" /> |
| 87 | + <Insets left="20.0"/> |
52 | 88 | </padding>
|
53 | 89 | </HBox>
|
54 | 90 |
|
55 |
| - <Label styleClass="sectionHeader" text="%Expert settings" /> |
| 91 | + <Label styleClass="sectionHeader" |
| 92 | + text="%Expert settings"/> |
56 | 93 | <VBox>
|
57 | 94 | <children>
|
58 |
| - <Label text="%These parameters affect how the AI will answer your questions." /> |
59 |
| - <Label text="%Leave these fields as is, if you are not sure of their purpose." /> |
| 95 | + <Label text="%These parameters affect how the AI will answer your questions."/> |
| 96 | + <Label text="%Leave these fields as is, if you are not sure of their purpose."/> |
60 | 97 | </children>
|
61 | 98 | </VBox>
|
62 | 99 |
|
63 |
| - <CheckBox fx:id="customizeExpertSettingsCheckbox" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="%Customize expert settings" /> |
| 100 | + <CheckBox |
| 101 | + fx:id="customizeExpertSettingsCheckbox" |
| 102 | + maxWidth="1.7976931348623157E308" |
| 103 | + mnemonicParsing="false" |
| 104 | + text="%Customize expert settings"/> |
64 | 105 |
|
65 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
| 106 | + <HBox alignment="CENTER_LEFT" |
| 107 | + spacing="10.0"> |
66 | 108 | <children>
|
67 |
| - <Label alignment="BASELINE_CENTER" text="%API base URL (used only for LLM)" /> |
68 |
| - <TextField fx:id="apiBaseUrlTextField" disable="true" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" /> |
69 |
| - <Button fx:id="apiBaseUrlHelp" prefWidth="20.0" /> |
| 109 | + <Label alignment="BASELINE_CENTER" |
| 110 | + text="%API base URL (used only for LLM)"/> |
| 111 | + <TextField |
| 112 | + fx:id="apiBaseUrlTextField" |
| 113 | + disable="true" |
| 114 | + maxWidth="1.7976931348623157E308" |
| 115 | + HBox.hgrow="ALWAYS"/> |
| 116 | + <Button fx:id="apiBaseUrlHelp" |
| 117 | + prefWidth="20.0"/> |
70 | 118 | </children>
|
71 | 119 | </HBox>
|
72 | 120 |
|
73 |
| - |
74 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
| 121 | + <HBox alignment="CENTER_LEFT" |
| 122 | + spacing="10.0"> |
75 | 123 | <children>
|
76 |
| - <Label alignment="BASELINE_CENTER" text="%Embedding model" /> |
77 |
| - <SearchableComboBox fx:id="embeddingModelComboBox" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" /> |
78 |
| - <Button fx:id="embeddingModelHelp" prefWidth="20.0" /> |
| 124 | + <Label alignment="BASELINE_CENTER" |
| 125 | + text="%Embedding model"/> |
| 126 | + <SearchableComboBox |
| 127 | + fx:id="embeddingModelComboBox" |
| 128 | + maxWidth="1.7976931348623157E308" |
| 129 | + HBox.hgrow="ALWAYS"/> |
| 130 | + <Button fx:id="embeddingModelHelp" |
| 131 | + prefWidth="20.0"/> |
79 | 132 | </children>
|
80 | 133 | </HBox>
|
81 | 134 |
|
82 | 135 | <Label text="%The size of the embedding model could be smaller than written in the list.">
|
83 |
| - <font> |
84 |
| - <Font name="System Italic" size="13.0" /> |
85 |
| - </font></Label> |
86 |
| - |
87 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
88 |
| - <children> |
89 |
| - <Label maxWidth="1.7976931348623157E308" text="%Instruction for AI (also known as prompt or system message)" HBox.hgrow="ALWAYS" /> |
90 |
| - <Button fx:id="instructionHelp" prefWidth="20.0" /> |
91 |
| - </children> |
92 |
| - </HBox> |
93 |
| - |
94 |
| - <TextArea fx:id="instructionTextArea" wrapText="true" /> |
95 |
| - |
96 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
97 |
| - <children> |
98 |
| - <Label alignment="BASELINE_CENTER" text="%Context window size" /> |
99 |
| - <IntegerInputField fx:id="contextWindowSizeTextField" HBox.hgrow="ALWAYS" /> |
100 |
| - <Button fx:id="contextWindowSizeHelp" prefWidth="20.0" /> |
101 |
| - </children> |
102 |
| - </HBox> |
103 |
| - <HBox alignment="CENTER_LEFT" layoutX="10.0" layoutY="448.0" spacing="10.0"> |
104 |
| - <children> |
105 |
| - <Label alignment="BASELINE_CENTER" text="%Temperature" /> |
106 |
| - <DoubleInputField fx:id="temperatureTextField" HBox.hgrow="ALWAYS" /> |
107 |
| - </children> |
108 |
| - </HBox> |
109 |
| - <VBox> |
110 |
| - <children> |
111 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
112 |
| - <children> |
113 |
| - <Label maxWidth="1.7976931348623157E308" text="%RAG - maximum results count" HBox.hgrow="ALWAYS" /> |
114 |
| - <Button fx:id="ragMaxResultsCountHelp" prefWidth="20.0" /> |
115 |
| - </children> |
116 |
| - </HBox> |
117 |
| - <IntegerInputField fx:id="ragMaxResultsCountTextField" /> |
118 |
| - </children> |
119 |
| - </VBox> |
120 |
| - <VBox> |
121 |
| - <children> |
122 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
123 |
| - <children> |
124 |
| - <Label maxWidth="1.7976931348623157E308" text="%RAG - minimum score" HBox.hgrow="ALWAYS" /> |
125 |
| - <Button fx:id="ragMinScoreHelp" prefWidth="20.0" /> |
126 |
| - </children> |
127 |
| - </HBox> |
128 |
| - <DoubleInputField fx:id="ragMinScoreTextField" /> |
129 |
| - </children> |
130 |
| - </VBox> |
131 |
| - <VBox> |
132 |
| - <children> |
133 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
134 |
| - <children> |
135 |
| - <Label maxWidth="1.7976931348623157E308" text="%Document splitter - chunk size" HBox.hgrow="ALWAYS" /> |
136 |
| - <Button fx:id="documentSplitterChunkSizeHelp" prefWidth="20.0" /> |
137 |
| - </children> |
138 |
| - </HBox> |
139 |
| - <IntegerInputField fx:id="documentSplitterChunkSizeTextField" /> |
140 |
| - </children> |
141 |
| - </VBox> |
142 |
| - <VBox> |
143 |
| - <children> |
144 |
| - <HBox alignment="CENTER_LEFT" spacing="10.0"> |
145 |
| - <children> |
146 |
| - <Label maxWidth="1.7976931348623157E308" text="%Document splitter - overlap size" HBox.hgrow="ALWAYS" /> |
147 |
| - <Button fx:id="documentSplitterOverlapSizeHelp" prefWidth="20.0" /> |
148 |
| - </children> |
149 |
| - </HBox> |
150 |
| - <IntegerInputField fx:id="documentSplitterOverlapSizeTextField" /> |
151 |
| - </children> |
152 |
| - </VBox> |
153 |
| - <Button onAction="#onResetExpertSettingsButtonClick" text="%Reset expert settings to default"> |
154 |
| - <graphic> |
155 |
| - <JabRefIconView glyph="REFRESH"/> |
156 |
| - </graphic> |
157 |
| - </Button> |
| 136 | + <font> |
| 137 | + <Font name="System Italic" |
| 138 | + size="13.0"/> |
| 139 | + </font> |
| 140 | + </Label> |
| 141 | + |
| 142 | + <HBox alignment="CENTER_LEFT" |
| 143 | + spacing="10.0"> |
| 144 | + <children> |
| 145 | + <Label maxWidth="1.7976931348623157E308" |
| 146 | + text="%Instruction for AI (also known as prompt or system message)" |
| 147 | + HBox.hgrow="ALWAYS"/> |
| 148 | + <Button fx:id="instructionHelp" |
| 149 | + prefWidth="20.0"/> |
| 150 | + </children> |
| 151 | + </HBox> |
| 152 | + |
| 153 | + <ResizableTextArea |
| 154 | + fx:id="instructionTextArea" |
| 155 | + wrapText="true"/> |
| 156 | + |
| 157 | + <GridPane hgap="10" vgap="10"> |
| 158 | + <columnConstraints> |
| 159 | + <ColumnConstraints hgrow="ALWAYS" percentWidth="50" /> |
| 160 | + <ColumnConstraints hgrow="ALWAYS" percentWidth="50" /> |
| 161 | + </columnConstraints> |
| 162 | + |
| 163 | + <!-- Context Window Size --> |
| 164 | + <VBox spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="0"> |
| 165 | + <HBox spacing="10" alignment="CENTER_LEFT"> |
| 166 | + <Label HBox.hgrow="ALWAYS" |
| 167 | + maxWidth="Infinity" |
| 168 | + text="%Context window size"/> |
| 169 | + <Button fx:id="contextWindowSizeHelp" |
| 170 | + prefWidth="20.0"/> |
| 171 | + </HBox> |
| 172 | + <IntegerInputField |
| 173 | + fx:id="contextWindowSizeTextField" |
| 174 | + HBox.hgrow="ALWAYS"/> |
| 175 | + </VBox> |
| 176 | + |
| 177 | + <!-- Temperature --> |
| 178 | + <VBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="0"> |
| 179 | + <HBox spacing="10"> |
| 180 | + <Label HBox.hgrow="ALWAYS" |
| 181 | + maxWidth="Infinity" |
| 182 | + text="%Temperature"/> |
| 183 | + <Button fx:id="temperatureHelp" |
| 184 | + prefWidth="20.0"/> |
| 185 | + </HBox> |
| 186 | + <DoubleInputField |
| 187 | + fx:id="temperatureTextField" |
| 188 | + HBox.hgrow="ALWAYS"/> |
| 189 | + </VBox> |
| 190 | + |
| 191 | + <!-- RAG - Maximum Results Count --> |
| 192 | + <VBox spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="1"> |
| 193 | + <HBox spacing="10" alignment="CENTER_LEFT"> |
| 194 | + <Label HBox.hgrow="ALWAYS" |
| 195 | + maxWidth="Infinity" |
| 196 | + text="%RAG - maximum results count"/> |
| 197 | + <Button fx:id="ragMaxResultsCountHelp" |
| 198 | + prefWidth="20.0"/> |
| 199 | + </HBox> |
| 200 | + <IntegerInputField |
| 201 | + fx:id="ragMaxResultsCountTextField" |
| 202 | + HBox.hgrow="ALWAYS"/> |
| 203 | + </VBox> |
| 204 | + |
| 205 | + <!-- RAG - Minimum Score --> |
| 206 | + <VBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="1"> |
| 207 | + <HBox spacing="10" alignment="CENTER_LEFT"> |
| 208 | + <Label HBox.hgrow="ALWAYS" |
| 209 | + maxWidth="Infinity" |
| 210 | + text="%RAG - minimum score"/> |
| 211 | + <Button fx:id="ragMinScoreHelp" |
| 212 | + prefWidth="20.0"/> |
| 213 | + </HBox> |
| 214 | + <DoubleInputField |
| 215 | + fx:id="ragMinScoreTextField" |
| 216 | + HBox.hgrow="ALWAYS"/> |
| 217 | + </VBox> |
| 218 | + |
| 219 | + <!-- Document Splitter - Chunk Size --> |
| 220 | + <VBox spacing="10" GridPane.columnIndex="0" GridPane.rowIndex="2"> |
| 221 | + <HBox spacing="10" alignment="CENTER_LEFT"> |
| 222 | + <Label HBox.hgrow="ALWAYS" |
| 223 | + maxWidth="Infinity" |
| 224 | + text="%Document splitter - chunk size"/> |
| 225 | + <Button fx:id="documentSplitterChunkSizeHelp" |
| 226 | + prefWidth="20.0"/> |
| 227 | + </HBox> |
| 228 | + <IntegerInputField |
| 229 | + fx:id="documentSplitterChunkSizeTextField" |
| 230 | + HBox.hgrow="ALWAYS"/> |
| 231 | + </VBox> |
| 232 | + |
| 233 | + <!-- Document Splitter - Overlap Size --> |
| 234 | + <VBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="2"> |
| 235 | + <HBox spacing="10" alignment="CENTER_LEFT"> |
| 236 | + <Label HBox.hgrow="ALWAYS" |
| 237 | + maxWidth="Infinity" |
| 238 | + text="%Document splitter - overlap size"/> |
| 239 | + <Button fx:id="documentSplitterOverlapSizeHelp" |
| 240 | + prefWidth="20.0"/> |
| 241 | + </HBox> |
| 242 | + <IntegerInputField |
| 243 | + fx:id="documentSplitterOverlapSizeTextField" |
| 244 | + HBox.hgrow="ALWAYS"/> |
| 245 | + </VBox> |
| 246 | + |
| 247 | + </GridPane> |
| 248 | + |
| 249 | + <Button onAction="#onResetExpertSettingsButtonClick" |
| 250 | + text="%Reset expert settings to default"> |
| 251 | + <graphic> |
| 252 | + <JabRefIconView |
| 253 | + glyph="REFRESH"/> |
| 254 | + </graphic> |
| 255 | + </Button> |
158 | 256 | </children>
|
159 | 257 | </fx:root>
|
0 commit comments