import type { Api, Model as ApiModel } from "./types"; /** User-facing thinking levels, ordered least to most intensive. */ export declare const enum Effort { Minimal = "minimal", Low = "low", Medium = "medium", High = "high", XHigh = "xhigh", Max = "max" } export declare const THINKING_EFFORTS: readonly Effort[]; /** * Static fallback model injected when Cloudflare AI Gateway discovery * returns no results. Ensures the provider always has at least one usable * model entry in the catalog. */ export declare const CLOUDFLARE_FALLBACK_MODEL: ApiModel<"anthropic-messages">; export declare function isGroqCompoundReasoningUnsupported(model: Pick, "provider" | "id">): boolean; /** * Returns a copy of the model with canonical thinking metadata attached. * * This helper belongs to catalog enrichment only. Runtime consumers should * trust `model.thinking` and avoid inferring capabilities on demand. */ export declare function enrichModelThinking(model: ApiModel): ApiModel; /** * Returns a copy of the model with thinking metadata recomputed from the * canonical rules, replacing any existing `thinking`. */ export declare function refreshModelThinking(model: ApiModel): ApiModel; /** * Returns whether the configured transport has an audited user-facing reasoning control. * * Custom OpenAI-compatible endpoints fail closed: declaring a model as reasoning-capable * is not enough to prove that the proxy accepts OpenAI reasoning parameters. Unknown * endpoints must opt in with `compat.supportsReasoningEffort: true`; providers using a * non-OpenAI request shape must also declare `compat.thinkingFormat`. Bundled providers * remain governed by their catalog and compatibility metadata. */ export declare function modelSupportsReasoningControl(model: ApiModel, resolvedBaseUrl?: string): boolean; /** * Apply upstream metadata corrections to a mutable array of models. * * Each model is first normalized through `refreshModelThinking()` so generated * catalogs keep canonical thinking metadata and policy fixes in one pass. */ export declare function applyGeneratedModelPolicies(models: ApiModel[]): void; /** * Link OpenAI model variants to their context promotion targets. * * When a model's context is exhausted, the agent can promote to a sibling * model with a larger context window on the same provider: * - `OpenAI code backend-spark` variants promote to `gpt-5.5`. * * `gpt-5.5` itself is a 1M-context model and is not demoted to `gpt-5.4` * (which has a smaller window), so it has no promotion target. */ export declare function linkOpenAIPromotionTargets(models: ApiModel[]): void; /** * Returns the supported thinking efforts declared on the model metadata. * * Catalog enrichment is responsible for normalizing bundled model metadata up front. * Runtime callers must treat explicit `model.thinking` on custom models as authoritative * so proxy-specific overrides from `models.yml` survive request construction. * * @throws Error when a reasoning-capable model is missing thinking metadata */ export declare function getSupportedEfforts(model: ApiModel): readonly Effort[]; /** * Clamps a requested thinking level against explicit model metadata. * * Non-reasoning models always resolve to `undefined`. */ export declare function clampThinkingLevelForModel(model: ApiModel | undefined, requested: Effort | undefined): Effort | undefined; export declare function requireSupportedEffort(model: ApiModel, effort: Effort): Effort; /** Maps a normalized thinking effort to Google's `thinkingLevel` enum values. */ export declare function mapEffortToGoogleThinkingLevel(model: ApiModel, effort: Effort): "MINIMAL" | "LOW" | "MEDIUM" | "HIGH"; /** Maps a normalized thinking effort to Anthropic adaptive effort values. */ export declare function mapEffortToAnthropicAdaptiveEffort(model: ApiModel, effort: Effort): "low" | "medium" | "high" | "xhigh" | "max"; /** * Returns true for Anthropic models with Opus 4.7 API restrictions: * - Sampling parameters (temperature/top_p/top_k) return 400 error * - Thinking content is omitted by default (needs display: "summarized") */ export declare function hasOpus47ApiRestrictions(modelId: string): boolean; /** * Adaptive thinking `display` is supported starting with Anthropic Opus 4.7. * Older adaptive-thinking models (Opus 4.6, Sonnet 4.6+) reject the field. * Fable (5+) postdates Opus 4.7, accepts `display`, and defaults it to * "omitted" — thinking tokens are billed but no content streams back — so it * must opt in like Opus 4.7+ (issue #2791). * * Shares `hasOpus47ApiRestrictions` version parsing on purpose: the two * predicates describe the same API generation, and a private `claude-opus-(\d+)-(\d+)` * regex silently disagreed with it for single-component aliases (`claude-opus-5` * matched nothing while `claude-opus-5-20260101` matched), so the same model sent * a different thinking shape and beta set depending on which id string was used. * Bedrock region/inference-profile prefixes are handled by the canonical parser. */ export declare function supportsAnthropicAdaptiveThinkingDisplay(modelId: string): boolean;