@@ -71,14 +71,14 @@ const clearSampling = () => {
7171 return
7272}
7373
74- const finishSampling = () => {
75- const latestResponse : any = samplingResults .value . at ( - 1 )
74+ const finishSampling = (index : number ) => {
75+ const bestResponse : any = samplingResults .value [ index ]
7676 const response = {
7777 model: chatbotStore .model ,
78- role: latestResponse ?.role || ' assistant' ,
78+ role: bestResponse ?.role || ' assistant' ,
7979 content: {
8080 type: ' text' ,
81- text: latestResponse ?.content || ` No response from model ${chatbotStore .model } `
81+ text: bestResponse ?.content || ` No response from model ${chatbotStore .model } `
8282 }
8383 }
8484 sendResponse (samplingChannel .value , response )
@@ -123,14 +123,38 @@ listenSampling(handleProgress)
123123 auto-grow
124124 :error-messages =" jsonError"
125125 ></v-textarea >
126- <v-textarea
127- v-if =" samplingResults.length > 0"
128- variant =" solo"
129- :model-value =" json2Str(samplingResults)"
130- outlined
131- readonly
132- auto-grow
133- ></v-textarea >
126+ <v-data-iterator :items =" samplingResults" :items-per-page =" -1" >
127+ <template #default =" { items } " >
128+ <template v-for =" (item , index ) in items " :key =" index " >
129+ <v-card >
130+ <v-card-text >
131+ <v-textarea
132+ variant =" plain"
133+ :model-value =" json2Str(item.raw)"
134+ outlined
135+ readonly
136+ auto-grow
137+ ></v-textarea >
138+ </v-card-text >
139+ <v-divider ></v-divider >
140+ <v-card-actions >
141+ <v-spacer ></v-spacer >
142+ <v-icon-btn
143+ v-tooltip:start =" $t('sampling.confirm')"
144+ icon =" mdi-hand-okay"
145+ color =" success"
146+ variant =" plain"
147+ rounded =" lg"
148+ @click =" finishSampling(index)"
149+ ></v-icon-btn >
150+ </v-card-actions >
151+ </v-card >
152+ <br />
153+ </template >
154+ </template >
155+ </v-data-iterator >
156+ <!-- <v-textarea v-if="samplingResults.length > 0" variant="solo" :model-value="json2Str(samplingResults)" outlined
157+ readonly auto-grow></v-textarea> -->
134158 </v-card-text >
135159 <v-card-actions >
136160 <v-spacer ></v-spacer >
@@ -151,15 +175,8 @@ listenSampling(handleProgress)
151175 rounded =" lg"
152176 @click =" tryCompletions"
153177 ></v-icon-btn >
154- <v-icon-btn
155- v-if =" samplingResults.length > 0"
156- v-tooltip:top =" $t('sampling.confirm')"
157- icon =" mdi-hand-okay"
158- color =" success"
159- variant =" plain"
160- rounded =" lg"
161- @click =" finishSampling"
162- ></v-icon-btn >
178+ <!-- <v-icon-btn v-if="samplingResults.length > 0" v-tooltip:top="$t('sampling.confirm')" icon="mdi-hand-okay"
179+ color="success" variant="plain" rounded="lg" @click="finishSampling"></v-icon-btn> -->
163180 </v-card-actions >
164181 </v-card >
165182 </v-dialog >
0 commit comments