/** * Per-model API capability gates for the Anthropic first-party provider. * * The Messages API surface is not uniform across the models this repo can be * pointed at, and getting either of these wrong is a hard 400 rather than a * degraded response: * * - Sampling params (`temperature`, `top_p`, `top_k`) were removed on Opus 4.7+ * and Sonnet 5. They are still accepted on Sonnet 4.6, Haiku 4.5 and Opus 4.6 * and older — which are exactly the models `MODEL_ALIASES.sonnet` and * `.haiku` resolve to, so a blanket "never send temperature" is wrong too. * - Structured outputs (`output_config.format`) require a schema with * `additionalProperties: false` on every object node, and are not available * on every model that is otherwise current. * - Adaptive thinking (`thinking: {type: "adaptive"}`) and `output_config.effort` * exist from the 4.6 generation on; Haiku 4.5 still takes `budget_tokens` and * rejects the adaptive shape. * * These helpers are deliberately allow-list shaped: an unrecognised model id * gets the conservative answer (no structured outputs, no sampling params), * because a missing capability degrades quality while a wrongly-claimed one * fails the request outright. * * @module core/llm/model-capabilities */ /** * Does this model still accept `temperature` / `top_p` / `top_k`? * * Removed on Opus 4.7+ and on Sonnet 5+; still accepted on Opus 4.6 and older, * Sonnet 4.6 and older, and every Haiku. */ export declare function acceptsSamplingParams(modelId: string): boolean; /** * Does this model support structured outputs (`output_config.format`)? * * Opus 4.7+, Sonnet 5+ and Haiku 4.5+. Notably NOT Sonnet 4.6, which is what * `MODEL_ALIASES.sonnet` resolves to — sending `output_config.format` there is * a 400, so callers must keep a prompt-based fallback. */ export declare function supportsStructuredOutputs(modelId: string): boolean; /** * Does this model accept `thinking: { type: "adaptive" }` and `output_config.effort`? * * Both arrived with the 4.6 generation (Opus 4.6, Sonnet 4.6) and are on every * newer Opus and Sonnet. Haiku 4.5 predates them and still uses * `thinking: { type: "enabled", budget_tokens }`, so the adaptive shape is * rejected there. Unknown ids get `false` so a caller omits both parameters * rather than sending a request that cannot succeed. */ export declare function supportsAdaptiveThinking(modelId: string): boolean; /** * Rewrite a JSON schema into the shape Anthropic structured outputs require. * * The API rejects a schema whose object nodes do not pin * `additionalProperties: false` and list every property in `required`. The * repo's own `JSONSchemaType` cannot express either, and no caller sets * them, so normalise here rather than asking every call site to remember. * * Returns a deep copy; the caller's schema is never mutated. */ export declare function toStrictJsonSchema(schema: unknown): Record; /** The `output_config` shape callers may pass through `AnalyzeOptions`. */ export interface OutputConfigInput { effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max'; format?: { type: 'json_schema'; schema: unknown; }; } /** * Prepare an `output_config` for one request against one model. * * Strips `format` when the model cannot do structured outputs (so the request * still succeeds and the caller's own JSON extraction handles the response), * and rewrites a surviving schema into the strict shape the API requires. * Returns `undefined` when there is nothing left to send. */ export declare function buildOutputConfig(modelId: string, input: OutputConfigInput | undefined): Record | undefined; //# sourceMappingURL=model-capabilities.d.ts.map