mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 14:03:49 +00:00
Make model generation deterministic by sorting providers and models
This commit is contained in:
parent
04fa79ebe0
commit
bf6da8c72f
2 changed files with 6385 additions and 6381 deletions
|
|
@ -662,11 +662,15 @@ import type { Model } from "./types.js";
|
|||
export const MODELS = {
|
||||
`;
|
||||
|
||||
// Generate provider sections
|
||||
for (const [providerId, models] of Object.entries(providers)) {
|
||||
// Generate provider sections (sorted for deterministic output)
|
||||
const sortedProviderIds = Object.keys(providers).sort();
|
||||
for (const providerId of sortedProviderIds) {
|
||||
const models = providers[providerId];
|
||||
output += `\t${JSON.stringify(providerId)}: {\n`;
|
||||
|
||||
for (const model of Object.values(models)) {
|
||||
const sortedModelIds = Object.keys(models).sort();
|
||||
for (const modelId of sortedModelIds) {
|
||||
const model = models[modelId];
|
||||
output += `\t\t"${model.id}": {\n`;
|
||||
output += `\t\t\tid: "${model.id}",\n`;
|
||||
output += `\t\t\tname: "${model.name}",\n`;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue