/** * Does this error mean the model rejected `temperature` as unsupported/deprecated? * @param {any} err - the rejection from a provider `_request` (a {@link ProviderError} carries `.status`). * @returns {boolean} */ export function isTemperatureUnsupported(err: any): boolean; /** * Is this a 400 saying `temperature` conflicts with enabled thinking (names both)? * @param {any} err * @returns {boolean} */ export function isTemperatureThinkingConflict(err: any): boolean; /** * Issue a provider request; if it 400s because `temperature` is unsupported AND a temperature was * actually sent, strip it and retry ONCE. Returns whether the temperature was dropped so the caller * can report the EFFECTIVE temperature (the receipt must not claim a value the model ignored). * * @param {object} opts * @param {() => Promise} opts.request - issues the API call (rejects `ProviderError` on 4xx). * @param {() => boolean} opts.hadTemperature - was a temperature actually in the request body? * @param {() => void} opts.stripTemperature - mutate the request body to remove the temperature. * @param {boolean} [opts.thinkingOn] - a thinkingMode 'on' shape is being sent: ALSO treat a 400 naming both temperature and thinking as droppable (thinking wins). Default off ⇒ behavior unchanged. * @param {(reason: 'unsupported'|'thinking') => void} [opts.warnOnce] - emit the one-time degrade warning for that reason (caller dedupes per instance AND reason). * @returns {Promise<{ data: any, temperatureDropped: boolean }>} */ export function requestWithTemperatureFallback({ request, hadTemperature, stripTemperature, thinkingOn, warnOnce }: { request: () => Promise; hadTemperature: () => boolean; stripTemperature: () => void; thinkingOn?: boolean | undefined; warnOnce?: ((reason: "unsupported" | "thinking") => void) | undefined; }): Promise<{ data: any; temperatureDropped: boolean; }>;