Originally created by: SAMAD101
Add an anthropic provider to orko-providers. Anthropic's Messages API is not OpenAI-compatible on the wire, so unlike [#4]/#5 this is a second codec, not a preset. It reuses the transport trait from [#3] unchanged — the codec is pure computation and can be built and unit-tested in parallel with [#3] (only integration needs the transport).
POST https://api.anthropic.com/v1/messages (base URL configurable)x-api-key: $ANTHROPIC_API_KEY (conventional env key), anthropic-version: 2023-06-01, content-type: application/jsonmax_tokens is required — needs a sane default in the preset, overridable via CompletionOptionsRequest side:
system param, not a message role — the codec lifts them out of the transcriptinput_schema (vs OpenAI's nested function.parameters) — straight rename from orko_core::Tool::schema()tool_use content blocks; tool results go back as tool_result blocks inside a user message — codec translates orko-core's message shape to this and backContent parts: text → text blocks; images → {"type": "image", "source": {...}} where source is {type: "base64", media_type, data} or {type: "url", url} — maps 1:1 onto orko_core::MediaSourceResponse/streaming side (SSE):
message_start → content_block_start → content_block_delta* → content_block_stop (per block) → message_delta → message_stoptext_delta deltas → text chunks; input_json_delta deltas carry partial_json for tool arguments — the content-block index + concatenated partial JSON maps directly onto orko_core::ToolCallDelta (tool id/name arrive in the block's content_block_start)message_delta carries stop_reason + usage → map to orko_core::FinishReason / Usage (end_turn, tool_use, max_tokens, refusal, …)anthropic(model) constructor; fallible from_str("anthropic:claude-opus-5")max_tokens, system lifting, no OpenAI compat-D warnings clean; builds with --no-default-features (codec only)Shares the transport trait from [#3]; codec work itself has no dependency on it.