Skip to content

Function: mergeModelMetadata()

Makaio Framework


Makaio Framework / services-core / mergeModelMetadata

mergeModelMetadata(baseMetadata, overlayMetadata): { capabilities?: { parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; }; description?: string; includedInSubscription?: boolean; maxOutputTokens?: number; pricing?: { request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; }; } | undefined

Defined in: ../../../packages/services/core/src/model-registry/merge-utils.ts:81

Merge model metadata with block-level replacement and defensive clone semantics.

Top-level metadata fields merge field-by-field. When an overlay supplies capabilities or pricing, that whole block replaces the base block. Returned metadata is structurally independent from both inputs.

{ capabilities?: { parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; }; description?: string; includedInSubscription?: boolean; maxOutputTokens?: number; pricing?: { request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; }; } | undefined

Metadata supplied by the base model.

{ capabilities?: { parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; }; description?: string; includedInSubscription?: boolean; maxOutputTokens?: number; pricing?: { request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; }; }

Metadata supplied by the base model.

{ parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; } = ...

Provider-scoped capabilities for this model offering.

boolean = ...

Whether multiple tool calls can be issued in a single turn.

boolean = ...

Whether the provider accepts PDF file uploads.

{ modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; } = ...

Speech-to-text capability descriptor.

("batch" | "streaming")[] = ...

Supported transcription modes.

capabilities.speechToText.vocabularyBiasing?
Section titled “capabilities.speechToText.vocabularyBiasing?”

boolean = ...

Whether the model supports vocabulary/terminology biasing. Optional by design because model metadata can be partial, unlike provider runtime capabilities.

boolean = ...

Whether the provider supports structured (JSON schema) output.

{ modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; } = ...

Text-to-speech capability descriptor.

("streaming" | "buffered")[] = ...

Supported synthesis modes.

string[] = ...

Supported output audio formats. Optional because metadata may omit it.

capabilities.textToSpeech.voiceInstructions?
Section titled “capabilities.textToSpeech.voiceInstructions?”

boolean = ...

Whether the model supports style/tone instructions (e.g., gpt-4o-mini-tts). Optional because metadata may omit it.

boolean = ...

Whether the user can select a voice preset. Optional because model metadata may omit it.

boolean = ...

Whether the provider’s API supports tool/function calling.

boolean = ...

Whether the model accepts image inputs.

string = ...

Optional description of the model *

boolean = ...

Whether this model is included in the provider’s subscription plan.

number = ...

Maximum output tokens the provider allows for this model.

{ request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; } = ...

Token pricing for this model offering.

{ multiplier: number; } = ...

Per-request pricing (GitHub Copilot premium requests, etc.).

number = ...

Cost per request in provider billing units (0 = free).

{ cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; } = ...

Per-token pricing (Anthropic direct, OpenAI direct, etc.).

number = ...

Cost per million cache-write input tokens (USD).

number = ...

Cost per million cache-read input tokens (USD).

number = ...

Cost per million input tokens (USD).

number = ...

Cost per million output tokens (USD).


undefined

{ capabilities?: { parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; }; description?: string; includedInSubscription?: boolean; maxOutputTokens?: number; pricing?: { request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; }; } | undefined

Metadata supplied by the overlay model.

{ capabilities?: { parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; }; description?: string; includedInSubscription?: boolean; maxOutputTokens?: number; pricing?: { request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; }; }

Metadata supplied by the overlay model.

{ parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; } = ...

Provider-scoped capabilities for this model offering.

boolean = ...

Whether multiple tool calls can be issued in a single turn.

boolean = ...

Whether the provider accepts PDF file uploads.

{ modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; } = ...

Speech-to-text capability descriptor.

("batch" | "streaming")[] = ...

Supported transcription modes.

capabilities.speechToText.vocabularyBiasing?
Section titled “capabilities.speechToText.vocabularyBiasing?”

boolean = ...

Whether the model supports vocabulary/terminology biasing. Optional by design because model metadata can be partial, unlike provider runtime capabilities.

boolean = ...

Whether the provider supports structured (JSON schema) output.

{ modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; } = ...

Text-to-speech capability descriptor.

("streaming" | "buffered")[] = ...

Supported synthesis modes.

string[] = ...

Supported output audio formats. Optional because metadata may omit it.

capabilities.textToSpeech.voiceInstructions?
Section titled “capabilities.textToSpeech.voiceInstructions?”

boolean = ...

Whether the model supports style/tone instructions (e.g., gpt-4o-mini-tts). Optional because metadata may omit it.

boolean = ...

Whether the user can select a voice preset. Optional because model metadata may omit it.

boolean = ...

Whether the provider’s API supports tool/function calling.

boolean = ...

Whether the model accepts image inputs.

string = ...

Optional description of the model *

boolean = ...

Whether this model is included in the provider’s subscription plan.

number = ...

Maximum output tokens the provider allows for this model.

{ request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; } = ...

Token pricing for this model offering.

{ multiplier: number; } = ...

Per-request pricing (GitHub Copilot premium requests, etc.).

number = ...

Cost per request in provider billing units (0 = free).

{ cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; } = ...

Per-token pricing (Anthropic direct, OpenAI direct, etc.).

number = ...

Cost per million cache-write input tokens (USD).

number = ...

Cost per million cache-read input tokens (USD).

number = ...

Cost per million input tokens (USD).

number = ...

Cost per million output tokens (USD).


undefined

Merged metadata, or undefined when neither side supplies metadata.

{ capabilities?: { parallelToolCalls?: boolean; pdfUpload?: boolean; speechToText?: { modes: ("batch" | "streaming")[]; vocabularyBiasing?: boolean; }; structuredOutput?: boolean; textToSpeech?: { modes: ("streaming" | "buffered")[]; outputFormats?: string[]; voiceInstructions?: boolean; voiceSelection?: boolean; }; toolCalling?: boolean; vision?: boolean; }; description?: string; includedInSubscription?: boolean; maxOutputTokens?: number; pricing?: { request?: { multiplier: number; }; token?: { cacheWritePerMillion?: number; inputCachedPerMillion?: number; inputPerMillion: number; outputPerMillion: number; }; }; }

optional capabilities?: object

Provider-scoped capabilities for this model offering.

optional parallelToolCalls?: boolean

Whether multiple tool calls can be issued in a single turn.

optional pdfUpload?: boolean

Whether the provider accepts PDF file uploads.

optional speechToText?: object

Speech-to-text capability descriptor.

modes: ("batch" | "streaming")[]

Supported transcription modes.

capabilities.speechToText.vocabularyBiasing?
Section titled “capabilities.speechToText.vocabularyBiasing?”

optional vocabularyBiasing?: boolean

Whether the model supports vocabulary/terminology biasing. Optional by design because model metadata can be partial, unlike provider runtime capabilities.

optional structuredOutput?: boolean

Whether the provider supports structured (JSON schema) output.

optional textToSpeech?: object

Text-to-speech capability descriptor.

modes: ("streaming" | "buffered")[]

Supported synthesis modes.

optional outputFormats?: string[]

Supported output audio formats. Optional because metadata may omit it.

capabilities.textToSpeech.voiceInstructions?
Section titled “capabilities.textToSpeech.voiceInstructions?”

optional voiceInstructions?: boolean

Whether the model supports style/tone instructions (e.g., gpt-4o-mini-tts). Optional because metadata may omit it.

optional voiceSelection?: boolean

Whether the user can select a voice preset. Optional because model metadata may omit it.

optional toolCalling?: boolean

Whether the provider’s API supports tool/function calling.

optional vision?: boolean

Whether the model accepts image inputs.

optional description?: string

Optional description of the model *

optional includedInSubscription?: boolean

Whether this model is included in the provider’s subscription plan.

optional maxOutputTokens?: number

Maximum output tokens the provider allows for this model.

optional pricing?: object

Token pricing for this model offering.

optional request?: object

Per-request pricing (GitHub Copilot premium requests, etc.).

multiplier: number

Cost per request in provider billing units (0 = free).

optional token?: object

Per-token pricing (Anthropic direct, OpenAI direct, etc.).

optional cacheWritePerMillion?: number

Cost per million cache-write input tokens (USD).

optional inputCachedPerMillion?: number

Cost per million cache-read input tokens (USD).

inputPerMillion: number

Cost per million input tokens (USD).

outputPerMillion: number

Cost per million output tokens (USD).


undefined