MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / normalizeBaseUrl

Function normalizeBaseUrl

src/setup/gateways.ts:188–192  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

186 if (url) s = url[1]!;
187 return s.replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
188}
189
190/**
191 * Normalize an OpenAI-compatible base URL so the SDK can append `/chat/completions`.
192 *
193 * The base URL must be the root (e.g. `https://integrate.api.nvidia.com/v1`). Users very
194 * commonly paste a deeper path instead — the model-list URL (`…/v1/models`) or the full
195 * chat URL (`…/v1/chat/completions`) — and then EVERY request hits `…/v1/models/chat/completions`

Callers 2

gateways.test.tsFile · 0.90
buildCustomEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected