| 1059 | export type ConfigProvidersResult = Types.DeepMutable<Schema.Schema.Type<typeof ConfigProvidersResult>> |
| 1060 | |
| 1061 | export function toPublicInfo(provider: Info): Info { |
| 1062 | return JSON.parse( |
| 1063 | JSON.stringify(provider, (_, value) => { |
| 1064 | if (typeof value === "function" || typeof value === "symbol" || value === undefined) return undefined |
| 1065 | if (typeof value === "bigint") return value.toString() |
| 1066 | return value |
| 1067 | }), |
| 1068 | ) |
| 1069 | } |
| 1070 | |
| 1071 | export function defaultModelIDs<T extends { models: Record<string, { id: string }> }>(providers: Record<string, T>) { |
| 1072 | return mapValues(providers, (item) => sort(Object.values(item.models))[0].id) |