Kaizen
Browse modulesInsightsinsights/ask-anthropicInterfaces

Interface: CreateAnthropicReportDrafterOptions

Defined in: server/insights/ask/anthropic/index.ts:44

The Anthropic-backed ReportDrafter.

Ships as its own subpath (@the-kaizen-labs/taproot/insights/ask-anthropic) so @anthropic-ai/sdk stays an OPTIONAL peer: nothing in @the-kaizen-labs/taproot/insights/server imports this file, and this file never statically imports the SDK. It depends on the minimal structural interfaces declared below — AnthropicMessagesClient and friends — rather than on the package's own types, so the whole module type-checks with the SDK absent from node_modules.

Why text, not tool use

The definition's filter tree is recursive, which rules out a provider's strict structured-output / strict-tool mode (recursive schemas are unsupported there). Reading a tool_use block would also force the structural client interface to describe an arbitrary JSON input, which the real SDK types as unknown and therefore could not satisfy. So the adapter puts the derived JSON Schema in the system prompt, asks for one JSON object in the reply text, and lets AskService re-validate. A consumer who wants tool use can write their own ReportDrafter — that is what the port is for.

Request shape

Deliberately minimal: model, max_tokens, system, messages. No thinking, no temperature/top_p/top_k, no tool_choice — those are per-model-generation parameters (several are rejected outright on current models), and model is caller configuration, so the adapter must not assume a generation.

Properties

apiKey?

optional apiKey?: string;

Defined in: server/insights/ask/anthropic/index.ts:66

API key for the lazily-constructed default client. Ignored when client is supplied. When both are omitted the SDK resolves credentials from the environment (ANTHROPIC_API_KEY).


client?

optional client?: AnthropicMessagesClient;

Defined in: server/insights/ask/anthropic/index.ts:60

A pre-built client. Supply this to control credentials, base URL, retries, timeouts, or a per-request/per-tenant key. When omitted the adapter lazily constructs one from apiKey the first time it drafts.


enumValueLimit?

optional enumValueLimit?: number;

Defined in: server/insights/ask/anthropic/index.ts:70

Per-field enum allowlist cap sent to the model.


maxTokens?

optional maxTokens?: number;

Defined in: server/insights/ask/anthropic/index.ts:68

Output cap for the reply. Defaults to DEFAULT_MAX_TOKENS.


model

model: string;

Defined in: server/insights/ask/anthropic/index.ts:54

The model id, e.g. "claude-opus-4-8" (most capable) or "claude-sonnet-5" / "claude-haiku-4-5" for cheaper drafting.

Required, with no default, on purpose. A default here would silently change every consumer's drafting behaviour — cost, latency, and output shape — on a taproot upgrade. Pin it in consumer config and change it deliberately.

On this page