adapter-anthropic

TextModel over the Anthropic Messages API.

With cargo

cargo add cratefield-adapter-anthropic

What it is

adapter-anthropic.

TextModel port over the Anthropic Messages API for the Cratefield harness โ€” the first text-model adapter (issue #430). Uses the runtime's HttpClient port โ€” no reqwest, no vendor SDK โ€” so it runs unchanged on Workers (worker::Fetch) and natively, and inherits that port's destination vetting, deadline and response-size caps.

From the crate’s own README.

Ports

Implements TextModel

Read more

History

Changelog.

From the crate’s CHANGELOG.md in the harness, as of 0c5560b. 5 versions recorded, newest first. Every published version is on crates.io.

  1. 0.3.3

    crates.ioReleaseDiff

    Other

    • updated the following local packages: cratefield-core
  2. 0.3.2

    crates.ioReleaseDiff

    Other

    • streaming completions (text, reasoning, tool-call and usage deltas) with idle/total timeouts and cancel-on-drop (#869)
3 earlier versions 0.2.1 to 0.3.1
  1. 0.3.1

    crates.ioReleaseDiff

    Other

    • image inputs (Part::Image) for the Anthropic and OpenAI-compatible adapters (#745)

    Added

    • Image input (issue #628): a Turn::user_parts message is sent as the Messages API content-block array, text and inline base64 images in order. Anthropic::supports now reports Capability::Images, and an image prompt over the port's bounds is refused (TextModelError::ImageLimit) before any network call.
  2. 0.3.0

    crates.ioReleaseDiff

    Changed

    • Breaking: requires cratefield-core 0.8 (was 0.7), and so a minor rather than a patch bump: a venture still on core 0.7 does not pick this release up through a caret requirement and end up with two copies of core (#712).

    Other

    • tool calling (ToolSpec, tool_calls, run_tool_loop) across the Anthropic and OpenAI-compatible adapters (#665) (#705)
  3. 0.2.1

    crates.ioRelease

    Other

    • OpenAI-compatible adapter, cached-token usage on every completion, shared TextModel conformance suite (#560) (#567)

One of 76 crates in the harness, all of them MIT and all of them in one repository.