UNPKG

agentfootprint

Version:

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

20 lines • 1.17 kB
/** Pure Messages projection shared by body construction and replay checks. */ import type { LLMMessage, LLMToolSchema } from '../../provider-contract/types.js'; import type { AnthropicMessageParam, AnthropicTool } from './anthropicMessagesWire.js'; /** * Framework messages → Anthropic messages. * * `role: 'system'` is DROPPED: this wire takes the system prompt as a separate * top-level field (`LLMRequest.systemPrompt`). That is why every adapter on it * carries only `['user', 'assistant']` in messages. A `role: 'tool'` result * becomes a `tool_result` block on a user turn, coalesced with the results of * the same batch. An `assistant` turn with no thinking blocks, no text and no * tool calls is DROPPED too — the API refuses empty content anywhere but a * final prefill. * * ONE owner: `anthropic()`, `browserAnthropic()` and `invokeModelGateway()` * all build their messages here. */ export declare function toAnthropicMessages(messages: readonly LLMMessage[], indexMap?: number[]): AnthropicMessageParam[]; export declare function toAnthropicTool(schema: LLMToolSchema): AnthropicTool; //# sourceMappingURL=anthropicMessageProjection.d.ts.map