@effect-uai/anthropic
v0.3.0
Published
Anthropic Messages API provider for @effect-uai/core.
Readme
@effect-uai/anthropic
Anthropic Messages API provider for @effect-uai/core.
Implements the LanguageModel contract against Anthropic's Messages
API with SSE streaming, including extended thinking surfaced as
reasoning_delta events.
Install
pnpm add @effect-uai/anthropic @effect-uai/core effectESM-only. Requires [email protected] and @effect-uai/core as peers.
Usage
import { Config, Effect, Layer } from "effect"
import { FetchHttpClient } from "effect/unstable/http"
import { layer as anthropicLayer } from "@effect-uai/anthropic"
const provider = Layer.unwrap(
Effect.gen(function* () {
const apiKey = yield* Config.redacted("ANTHROPIC_API_KEY")
return anthropicLayer({ apiKey })
}),
)
const layer = Layer.provide(provider, FetchHttpClient.layer)The layer registers both the provider-typed Anthropic tag and the
generic LanguageModel tag.
Docs
https://effect-uai.betalyra.com/providers/anthropic/
License
MIT
