import{d as e}from"./io-CH2g3vsv-JJtUIa_U.mjs";function t(e,...t){return e!==void 0&&t.includes(e)}const n=new Set([`jan`,`llama-cpp`,`llama.cpp`,`llamacpp`,`lm-studio`,`lmstudio`,`localai`,`sglang`,`tabby`,`tabbyapi`,`text-generation-webui`,`vllm`]);function r(...e){return e.some(e=>e!==void 0&&n.has(e.toLowerCase()))}function i(e){let{provider:n,endpointClass:i,knownProviderFamily:a,supportsNativeStreamingUsageCompat:o=!1,usesExplicitProxyLikeEndpoint:s=!1}=e,c=i===`default`,l=i!==`default`&&i!==`openai-public`,u=a===`moonshot`||a===`modelstudio`||i===`moonshot-native`||i===`modelstudio-native`,d=i===`zai-native`||c&&t(e.provider,`zai`),f=i===`cerebras-native`||i===`chutes-native`||i===`deepseek-native`||i===`mistral-public`||i===`opencode-native`||i===`xai-native`||d||c&&t(e.provider,`cerebras`,`chutes`,`deepseek`,`opencode`,`xai`),p=e.provider===`openrouter`||i===`openrouter`,m=i===`chutes-native`||i===`mistral-public`||a===`mistral`||c&&t(n,`chutes`),h=r(n,a);return{supportsStore:!f&&a!==`mistral`&&!s,supportsDeveloperRole:!f&&!u&&!l,supportsReasoningEffort:!d&&a!==`mistral`&&i!==`xai-native`&&!s,supportsUsageInStreaming:h||!f&&(!l||o),maxTokensField:m?`max_tokens`:`max_completion_tokens`,thinkingFormat:d?`zai`:p?`openrouter`:`openai`,visibleReasoningDetailTypes:p?[`response.output_text`,`response.text`]:[],supportsStrictMode:!d&&!l}}function a(e){return i(e)}function o(t){let n=e({provider:t.provider,api:`openai-completions`,baseUrl:t.baseUrl,capability:`llm`,transport:`stream`,modelId:t.id,compat:t.compat&&typeof t.compat==`object`?t.compat:void 0});return{capabilities:n,defaults:a({provider:t.provider,...n})}}function s(e){if(!(!e||typeof e!=`object`)){if(`compat`in e){let t=e.compat;return t&&typeof t==`object`?t:void 0}return e}}function c(e){let t=s(e)?.unsupportedToolSchemaKeywords??[];return new Set(t.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean))}function l(e){return e.api===`openai-completions`}function u(e){return e.api===`anthropic-messages`}function d(e){return e.replace(/\/v1\/?$/,``)}function f(e){let t=e.baseUrl??``;if(u(e)&&t){let n=d(t);if(n!==t)return{...e,baseUrl:n}}if(!l(e))return e;let n=e.compat??void 0,r=t?o(e).defaults:void 0;if(!(r&&(!r.supportsDeveloperRole||!r.supportsUsageInStreaming||!r.supportsStrictMode)))return e;let i=n?.supportsDeveloperRole===!0,a=n?.supportsUsageInStreaming!==void 0,s=n?.supportsStrictMode??r?.supportsStrictMode;return n?.supportsDeveloperRole!==void 0&&a&&n?.supportsStrictMode!==void 0?e:{...e,compat:n?{...n,supportsDeveloperRole:i||!1,...a?{}:{supportsUsageInStreaming:r?.supportsUsageInStreaming??!1},supportsStrictMode:s}:{supportsDeveloperRole:!1,supportsUsageInStreaming:r?.supportsUsageInStreaming??!1,supportsStrictMode:r?.supportsStrictMode??!1}}}export{f as n,c as r,o as t};