UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

28 lines (27 loc) • 1.25 kB
/** * thinkingModeFor — the thinking mode a provider DECLARES for one model. * * Pattern: capability declaration (the `thinkingHandlerFor` / * `cacheStrategyFor` twin). The adapter knows which thinking request * each model on its wire takes and declares it * (`LLMProvider.thinkingMode`); a wrapper forwards the field. Never * derived from `provider.name`. * Role: the ONE place the agent reads that declaration, so a malformed one * is refused at build, by provider name, instead of meaning "no claim". */ import type { LLMProvider } from '../provider-contract/types.js'; import type { ThinkingMode } from './types.js'; /** * The mode `provider` declares for `model`, or `undefined` when it declares * none (it makes no per-model claim; requests carry `thinking: { budget }` * and the adapter decides). * * @throws TypeError when the declaration is not a function, or answers * something other than `'adaptive'`, `'budget'` or `'none'`. * * @example * ```ts * thinkingModeFor(withRetry(anthropic()), 'claude-opus-5-5'); // 'adaptive' * ``` */ export declare function thinkingModeFor(provider: Pick<LLMProvider, 'name' | 'thinkingMode'>, model: string): ThinkingMode | undefined;