Class: CachedRegistryFetcher
Makaio Framework / services-core / CachedRegistryFetcher
Class: CachedRegistryFetcher
Section titled “Class: CachedRegistryFetcher”Defined in: ../../../packages/services/core/src/model-registry/cached-registry-fetcher.ts:18
Decorator that adds disk/persistent caching around a fetcher.
On success: caches the result for future use. On failure: returns cached data if available, otherwise rethrows so the next fetcher in a fallback chain can be tried.
Example
Section titled “Example”const cached = new CachedRegistryFetcher( new CdnRegistryFetcher('https://example.com/model-registry.yaml'), new FileRegistryCache(path.join(makaioHome, 'cache', 'model-registry.json')),);Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CachedRegistryFetcher(
inner,cache):CachedRegistryFetcher
Defined in: ../../../packages/services/core/src/model-registry/cached-registry-fetcher.ts:27
Creates a new CachedRegistryFetcher.
Parameters
Section titled “Parameters”The fetcher to wrap with caching
The cache implementation for persistence
Returns
Section titled “Returns”CachedRegistryFetcher
Methods
Section titled “Methods”fetch()
Section titled “fetch()”fetch():
Promise<{$schema:"makaio/model-registry/v2";labs:Record<string, {models:object[];name:string; }>;providers:Record<string, {models:Record<string, {canonicalModel?:string;contextWindowSize?:number;family?:string;friendlyName?:string;labId?:undefined;metadata?: {capabilities?: {parallelToolCalls?: … | … | …;pdfUpload?: … | … | …;speechToText?: … | …;structuredOutput?: … | … | …;textToSpeech?: … | …;toolCalling?: … | … | …;vision?: … | … | …; };description?:string;includedInSubscription?:boolean;maxOutputTokens?:number;pricing?: {request?: … | …;token?: … | …; }; };name?:undefined;supportedReasoningLevels?: {extra-high?:string|number;high?:string|number;low?:string|number;medium?:string|number;none?:string|number; }; }>;name:string; }>;updatedAt:string; }>
Defined in: ../../../packages/services/core/src/model-registry/cached-registry-fetcher.ts:37
Fetch from the inner fetcher with cache fallback.
Returns
Section titled “Returns”Promise<{ $schema: "makaio/model-registry/v2"; labs: Record<string, { models: object[]; name: string; }>; providers: Record<string, { models: Record<string, { canonicalModel?: string; contextWindowSize?: number; family?: string; friendlyName?: string; labId?: undefined; metadata?: { capabilities?: { parallelToolCalls?: … | … | …; pdfUpload?: … | … | …; speechToText?: … | …; structuredOutput?: … | … | …; textToSpeech?: … | …; toolCalling?: … | … | …; vision?: … | … | …; }; description?: string; includedInSubscription?: boolean; maxOutputTokens?: number; pricing?: { request?: … | …; token?: … | …; }; }; name?: undefined; supportedReasoningLevels?: { extra-high?: string | number; high?: string | number; low?: string | number; medium?: string | number; none?: string | number; }; }>; name: string; }>; updatedAt: string; }>
Registry from inner fetcher (fresh) or cache (stale fallback)
Throws
Section titled “Throws”Error if inner fetch fails and no cached data exists