@@ -21,6 +21,7 @@ import {
2121 Fab ,
2222 IconButton ,
2323 Stack ,
24+ Switch ,
2425 TextField ,
2526 ToggleButton ,
2627 ToggleButtonGroup ,
@@ -50,6 +51,7 @@ export default function AIChat() {
5051
5152 const [ attachedFiles , setAttachedFiles ] = useState ( [ ] ) ;
5253 const [ additionalInstructions , setAdditionalInstructions ] = useState ( "" ) ;
54+ const [ includeRanking , setIncludeRanking ] = useState ( false ) ;
5355 const [ criteriaMode , setCriteriaMode ] = useState ( "manual" ) ;
5456 const [ manualCriteria , setManualCriteria ] = useState ( [
5557 { key : "" , value : "" } ,
@@ -132,7 +134,8 @@ export default function AIChat() {
132134 const evaluationResult = await evaluateDocuments (
133135 criteriaFile ,
134136 criteriaJson ,
135- additionalInstructions
137+ additionalInstructions ,
138+ includeRanking
136139 ) ;
137140 console . log ( "Evaluation result:" , evaluationResult ) ;
138141
@@ -151,6 +154,7 @@ export default function AIChat() {
151154 const handleNew = ( ) => {
152155 setAttachedFiles ( [ ] ) ;
153156 setAdditionalInstructions ( "" ) ;
157+ setIncludeRanking ( false ) ;
154158 setManualCriteria ( [ { key : "" , value : "" } ] ) ;
155159 setCsvFile ( null ) ;
156160 setCriteriaMode ( "manual" ) ;
@@ -1009,6 +1013,59 @@ This is a mock evaluation for development purposes.`;
10091013 } ,
10101014 } }
10111015 />
1016+
1017+ < Box
1018+ sx = { {
1019+ display : "flex" ,
1020+ alignItems : "center" ,
1021+ justifyContent : "space-between" ,
1022+ mt : 2 ,
1023+ p : 1.5 ,
1024+ background : ( theme ) => theme . palette . background . paper ,
1025+ borderRadius : "12px" ,
1026+ } }
1027+ >
1028+ < Box
1029+ sx = { { display : "flex" , alignItems : "center" , gap : 0.5 } }
1030+ >
1031+ < Typography
1032+ variant = "body2"
1033+ sx = { { color : ( theme ) => theme . palette . text . primary } }
1034+ >
1035+ Include ranking
1036+ </ Typography >
1037+ < Tooltip
1038+ title = "Enable this to include document ranking in the evaluation results"
1039+ placement = "top"
1040+ arrow
1041+ >
1042+ < InfoOutlined
1043+ sx = { {
1044+ fontSize : 16 ,
1045+ color : ( theme ) => theme . palette . text . disabled ,
1046+ cursor : "pointer" ,
1047+ "&:hover" : {
1048+ color : ( theme ) => theme . palette . text . secondary ,
1049+ } ,
1050+ } }
1051+ />
1052+ </ Tooltip >
1053+ </ Box >
1054+ < Switch
1055+ checked = { includeRanking }
1056+ onChange = { ( e ) => setIncludeRanking ( e . target . checked ) }
1057+ sx = { {
1058+ "& .MuiSwitch-switchBase.Mui-checked" : {
1059+ color : ( theme ) => theme . palette . success . main ,
1060+ } ,
1061+ "& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track" :
1062+ {
1063+ backgroundColor : ( theme ) =>
1064+ theme . palette . success . main ,
1065+ } ,
1066+ } }
1067+ />
1068+ </ Box >
10121069 </ Box >
10131070 </ Stack >
10141071 ) }
0 commit comments