CouncilEx.Provider.Adapters.Anthropic (CouncilEx v0.1.0)

Copy Markdown View Source

Provider.Adapter for Anthropic Messages API.

Wire format:

  • Endpoint: <base_url>/v1/messages
  • Auth: x-api-key: <api_key> + anthropic-version: <version> headers (NOT Authorization: Bearer).
  • SSE: typed events (event: content_block_delta\ndata: {...}\n\n).
  • System prompt separated from messages array (Anthropic doesn't accept role: "system" in messages).

Summary

Functions

Variant used by Provider.Instructor when the originating request had response_schema set: a missing _respond block becomes a permanent :respond_tool_not_called error rather than a fallback to text extraction.

Functions

parse_complete_response_for_schema(body)

@spec parse_complete_response_for_schema(map()) ::
  {:ok, map()} | {:error, CouncilEx.Error.t()}

Variant used by Provider.Instructor when the originating request had response_schema set: a missing _respond block becomes a permanent :respond_tool_not_called error rather than a fallback to text extraction.