@@ -22,6 +22,8 @@ export function Component(): JSX.Element {
2222 const [ promptTemplatePrefix , setPromptTemplatePrefix ] = useState < string > ( "" ) ;
2323 const [ promptTemplateSuffix , setPromptTemplateSuffix ] = useState < string > ( "" ) ;
2424 const [ temperature , setTemperature ] = useState < number > ( 0.3 ) ;
25+ const [ minimumRerankerScore , setMinimumRerankerScore ] = useState < number > ( 0 ) ;
26+ const [ minimumSearchScore , setMinimumSearchScore ] = useState < number > ( 0 ) ;
2527 const [ retrievalMode , setRetrievalMode ] = useState < RetrievalMode > ( RetrievalMode . Hybrid ) ;
2628 const [ retrieveCount , setRetrieveCount ] = useState < number > ( 3 ) ;
2729 const [ useSemanticRanker , setUseSemanticRanker ] = useState < boolean > ( true ) ;
@@ -92,6 +94,8 @@ export function Component(): JSX.Element {
9294 exclude_category : excludeCategory . length === 0 ? undefined : excludeCategory ,
9395 top : retrieveCount ,
9496 temperature : temperature ,
97+ minimum_reranker_score : minimumRerankerScore ,
98+ minimum_search_score : minimumSearchScore ,
9599 retrieval_mode : retrievalMode ,
96100 semantic_ranker : useSemanticRanker ,
97101 semantic_captions : useSemanticCaptions ,
@@ -134,6 +138,13 @@ export function Component(): JSX.Element {
134138 setTemperature ( newValue ) ;
135139 } ;
136140
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+ } ;
137148 const onRetrieveCountChange = ( _ev ?: React . SyntheticEvent < HTMLElement , Event > , newValue ?: string ) => {
138149 setRetrieveCount ( parseInt ( newValue || "3" ) ) ;
139150 } ;
@@ -259,6 +270,25 @@ export function Component(): JSX.Element {
259270 snapToStep
260271 />
261272
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+
262292 < SpinButton
263293 className = { styles . askSettingsSeparator }
264294 label = "Retrieve this many search results:"
0 commit comments