680dd161b4
Keep the supplemental OpenAI model available when the bundled snapshot omits it.\nMerge its capabilities at runtime so downstream model resolution can use it. Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
25 lines
838 B
TypeScript
25 lines
838 B
TypeScript
import bundledModelCapabilitiesSnapshotJson from "../../generated/model-capabilities.generated.json"
|
|
|
|
import { SUPPLEMENTAL_MODEL_CAPABILITIES } from "./supplemental-entries"
|
|
import type { ModelCapabilitiesSnapshot } from "./types"
|
|
|
|
function normalizeSnapshot(
|
|
snapshot: ModelCapabilitiesSnapshot | typeof bundledModelCapabilitiesSnapshotJson,
|
|
): ModelCapabilitiesSnapshot {
|
|
return snapshot as ModelCapabilitiesSnapshot
|
|
}
|
|
|
|
const normalizedBundledSnapshot = normalizeSnapshot(bundledModelCapabilitiesSnapshotJson)
|
|
|
|
const bundledModelCapabilitiesSnapshot: ModelCapabilitiesSnapshot = {
|
|
...normalizedBundledSnapshot,
|
|
models: {
|
|
...normalizedBundledSnapshot.models,
|
|
...SUPPLEMENTAL_MODEL_CAPABILITIES,
|
|
},
|
|
}
|
|
|
|
export function getBundledModelCapabilitiesSnapshot(): ModelCapabilitiesSnapshot {
|
|
return bundledModelCapabilitiesSnapshot
|
|
}
|