Files
openclaw/extensions/deepinfra/provider-policy-api.ts
Peter Steinberger 0294aebe6f feat(providers): add DeepInfra provider plugin (#73038)
* feat(providers): add DeepInfra provider plugin

* feat(deepinfra): add media provider surfaces

* fix(deepinfra): satisfy provider boundary checks

* docs: add gitcrawl maintainer skill

* test: include deepinfra in live media sweeps

* fix: remove stale tts contract import
2026-04-28 01:12:54 +01:00

22 lines
907 B
TypeScript

import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-types";
/**
* 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.
*/
export function normalizeConfig(params: {
provider: string;
providerConfig: ModelProviderConfig;
}): ModelProviderConfig {
return params.providerConfig;
}