/** * Conversation call configuration and freeze utilities. Provider routing, * model, reasoning effort, and sampling values are request-header state that * can affect cache reuse; request waterfalls replace them and the loop logs * changed snapshots instead of allowing silent per-call drift. * @module dsh-llm/call-config */ import type { GenerateOptions, LlmResolvedModelInfo } from './types.ts'; import type { ReasoningEffortId } from './brand.ts'; /** Concrete generation settings; omitted controls use the selected route's defaults. */ export interface LlmCallControls { reasoningEffort?: ReasoningEffortId; temperature?: number; maxTokens?: number; stop?: string[]; } /** * Provider, model, reasoning effort, and sampling scalars of one conversation's * requests. Every field maps 1:1 onto the same-named `GenerateOptions` field; * the loop builds requests from the logged header rather than accepting these * per call. */ export interface LlmCallConfig extends LlmCallControls { provider: string; model: string; } /** * Synchronous, pure configuration of one call before defaults and validation. * Compose functions in the desired order; later writes replace earlier ones. * The returned controls cannot change the captured route. Errors reject * preparation before dispatch; only the resolved configuration is recordable. * @param controls - detached, deeply frozen proposed controls, without defaults. * @param model - detached, deeply frozen metadata from the captured adapter generation. * @returns concrete controls; omitted fields receive the route's defaults. */ export type ConfigureCall = (controls: Readonly, model: Readonly) => LlmCallControls; /** * Effective config fields supplied by exact-model adapter resolution rather * than by the caller's request proposal. */ export interface LlmCallConfigAdapterDefaults { reasoningEffort?: true; maxTokens?: true; } /** * Field-wise equality over {@link LlmCallConfig} — the comparison a caller * runs to decide whether a proposed configuration is a real change (worth a * logged header snapshot) or the held one restated. * @param a - one configuration. * @param b - the other. * @returns whether every field (including the `stop` list, element-wise) matches. */ export declare function callConfigEquals(a: LlmCallConfig, b: LlmCallConfig): boolean; /** * Mark one exact request object as assembled by dsh-agent-loop. * @param request - loop-owned request envelope before LLM dispatch. * @returns the same request object marked as created by the process-local agent loop. */ export declare function markAgentLoopRequest(request: T): T; /** * Test whether the exact request object was assembled by dsh-agent-loop. * @param request - request envelope observed at the LLM waterfall. * @returns whether {@link markAgentLoopRequest} recorded this object. */ export declare function isAgentLoopRequest(request: GenerateOptions): boolean; //# sourceMappingURL=call-config.d.ts.map