mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-17 03:07:24 +00:00
fix: sorting bug in AIChatService
This commit is contained in:
1 parent
0f2641b88f
commit
7acb096add
1 file changed
+1
-1
@@ -563,7 +563,7 @@ class AIChatService extends BaseService {
|
||||
// Calculate the sorted list
|
||||
const models = this.detail_model_list;
|
||||
|
||||
sorted_models = models.sort((a, b) => {
|
||||
sorted_models = models.toSorted((a, b) => {
|
||||
return Math.sqrt(
|
||||
Math.pow(a.cost.input - target_model.cost.input, 2) +
|
||||
Math.pow(a.cost.output - target_model.cost.output, 2)
|
||||
|
||||
Reference in new issue
Block a user