mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:20:43 +00:00
* 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
22 lines
907 B
TypeScript
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;
|
|
}
|