openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
20 lines (19 loc) • 811 B
JavaScript
//#region extensions/deepinfra/provider-policy-api.ts
/**
* Passthrough normalization for DeepInfra provider config.
*
* DeepInfra's OpenAI-compatible base URL is `https://api.deepinfra.com/v1/openai`
* with the `/v1` segment mid-path, not at the end. The generic
* openai-completions config normalizer strips a trailing `/v1` and re-appends
* one, which is idempotent for providers like OpenRouter (`.../api/v1`) but
* doubles to `.../v1/openai/v1` here and breaks inference (404).
*
* Shipping this bundled policy surface short-circuits the fallback normalizer
* chain (see `src/plugins/provider-runtime.ts:normalizeProviderConfigWithPlugin`)
* and preserves the DeepInfra-declared baseUrl as-is.
*/
function normalizeConfig(params) {
return params.providerConfig;
}
//#endregion
export { normalizeConfig };