@@ -22,6 +22,8 @@ export function Component(): JSX.Element {
22
22
const [ promptTemplatePrefix , setPromptTemplatePrefix ] = useState < string > ( "" ) ;
23
23
const [ promptTemplateSuffix , setPromptTemplateSuffix ] = useState < string > ( "" ) ;
24
24
const [ temperature , setTemperature ] = useState < number > ( 0.3 ) ;
25
+ const [ minimumRerankerScore , setMinimumRerankerScore ] = useState < number > ( 0 ) ;
26
+ const [ minimumSearchScore , setMinimumSearchScore ] = useState < number > ( 0 ) ;
25
27
const [ retrievalMode , setRetrievalMode ] = useState < RetrievalMode > ( RetrievalMode . Hybrid ) ;
26
28
const [ retrieveCount , setRetrieveCount ] = useState < number > ( 3 ) ;
27
29
const [ useSemanticRanker , setUseSemanticRanker ] = useState < boolean > ( true ) ;
@@ -92,6 +94,8 @@ export function Component(): JSX.Element {
92
94
exclude_category : excludeCategory . length === 0 ? undefined : excludeCategory ,
93
95
top : retrieveCount ,
94
96
temperature : temperature ,
97
+ minimum_reranker_score : minimumRerankerScore ,
98
+ minimum_search_score : minimumSearchScore ,
95
99
retrieval_mode : retrievalMode ,
96
100
semantic_ranker : useSemanticRanker ,
97
101
semantic_captions : useSemanticCaptions ,
@@ -134,6 +138,13 @@ export function Component(): JSX.Element {
134
138
setTemperature ( newValue ) ;
135
139
} ;
136
140
141
+ const onMinimumSearchScoreChange = ( _ev ?: React . SyntheticEvent < HTMLElement , Event > , newValue ?: string ) => {
142
+ setMinimumSearchScore ( parseFloat ( newValue || "0" ) ) ;
143
+ } ;
144
+
145
+ const onMinimumRerankerScoreChange = ( _ev ?: React . SyntheticEvent < HTMLElement , Event > , newValue ?: string ) => {
146
+ setMinimumRerankerScore ( parseFloat ( newValue || "0" ) ) ;
147
+ } ;
137
148
const onRetrieveCountChange = ( _ev ?: React . SyntheticEvent < HTMLElement , Event > , newValue ?: string ) => {
138
149
setRetrieveCount ( parseInt ( newValue || "3" ) ) ;
139
150
} ;
@@ -259,6 +270,25 @@ export function Component(): JSX.Element {
259
270
snapToStep
260
271
/>
261
272
273
+ < SpinButton
274
+ className = { styles . askSettingsSeparator }
275
+ label = "Minimum search score"
276
+ min = { 0 }
277
+ step = { 0.01 }
278
+ defaultValue = { minimumSearchScore . toString ( ) }
279
+ onChange = { onMinimumSearchScoreChange }
280
+ />
281
+
282
+ < SpinButton
283
+ className = { styles . askSettingsSeparator }
284
+ label = "Minimum reranker score"
285
+ min = { 1 }
286
+ max = { 4 }
287
+ step = { 0.1 }
288
+ defaultValue = { minimumRerankerScore . toString ( ) }
289
+ onChange = { onMinimumRerankerScoreChange }
290
+ />
291
+
262
292
< SpinButton
263
293
className = { styles . askSettingsSeparator }
264
294
label = "Retrieve this many search results:"
0 commit comments