13 lines
903 B
JavaScript
13 lines
903 B
JavaScript
import { modelRegistry, officialModelRecord } from './official-model-registry.mjs';
|
|
|
|
// Retained exact Anthropic view. The registry owns the reviewed options and
|
|
// conditional combinations, so old helpers and new UI use the same facts.
|
|
export function officialModelParameters(model) {
|
|
const entry = officialModelRecord({ model, providerId: 'anthropic', protocol: 'anthropic-messages' });
|
|
if (!entry) return null;
|
|
const field = key => entry.fields[key]?.value;
|
|
const source = key => modelRegistry.sources.find(value => value.id === entry.fields[key]?.source);
|
|
return { model, modes: field('modes'), efforts: field('efforts'), defaultMode: field('defaultMode'), defaultEffort: field('defaultEffort'), modeEfforts: field('modeEfforts') ?? {},
|
|
sourceUrl: source('modes')?.url, effortSourceUrl: source('efforts')?.url, checkedAt: source('modes')?.checkedAt, source: 'official_model_spec' };
|
|
}
|