Skip to content

Commit 7acb096

Browse files
committed
fix: sorting bug in AIChatService
1 parent 0f2641b commit 7acb096

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/src/modules/puterai/AIChatService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ class AIChatService extends BaseService {
563563
// Calculate the sorted list
564564
const models = this.detail_model_list;
565565

566-
sorted_models = models.sort((a, b) => {
566+
sorted_models = models.toSorted((a, b) => {
567567
return Math.sqrt(
568568
Math.pow(a.cost.input - target_model.cost.input, 2) +
569569
Math.pow(a.cost.output - target_model.cost.output, 2)

0 commit comments

Comments
 (0)