MCPcopy
hub / github.com/coder/mux / normalizeModelPreference

Function normalizeModelPreference

src/browser/utils/messages/buildSendMessageOptions.ts:25–29  ·  view source on GitHub ↗
(rawModel: unknown, fallbackModel: string)

Source from the content-addressed store, hash-verified

23
24/** Normalize a preferred model string for routing while preserving explicit gateway choices. */
25export function normalizeModelPreference(rawModel: unknown, fallbackModel: string): string {
26 const trimmed =
27 typeof rawModel === "string" && rawModel.trim().length > 0 ? rawModel.trim() : null;
28 return normalizeSelectedModel(trimmed ?? fallbackModel);
29}
30
31/**
32 * Construct SendMessageOptions from normalized inputs.

Callers 3

useSendMessageOptionsFunction · 0.90

Calls 1

normalizeSelectedModelFunction · 0.90

Tested by

no test coverage detected