Skip to content
1 min read · 160 words

@nhtio/adk/batteries/llm/anthropic_messages/validation

Runtime validation schema and wrapper for Anthropic Messages adapter options.

Remarks

Schema and call-site wrapper for validating AnthropicMessagesAdapterOptions. Used at construction time and at the start of every iteration against the merged options shape. Throws E_INVALID_ANTHROPIC_MESSAGES_OPTIONS on failure, matching the hard-fail policy of the sibling HTTP batteries.

Note the deliberate .unknown(...) asymmetry: the top level is .unknown(false) so option typos fail loud, but provider-owned passthrough blocks are .unknown(true) so SDK-supported additions can pass through without a library bump.

Variables

VariableDescription
anthropicMessagesOptionsSchemaValidator schema for AnthropicMessagesAdapterOptions. Used by validateOptions at construction time and again at the start of every iteration after options have been merged. Rejects unknown top-level keys so typos fail loud.

Functions

FunctionDescription
validateOptionsValidates arbitrary input against anthropicMessagesOptionsSchema and returns resolved options. Throws E_INVALID_ANTHROPIC_MESSAGES_OPTIONS with validator details on failure.