Liking cljdoc? Tell your friends :D

vaelii.agents.llm.anthropic

The Anthropic Messages API backend, over java.net.http and cheshire. Beyond the neutral request keys it reads :thinking-display and :fallbacks. See docs/llm.md § The Messages API backend.

The Anthropic Messages API backend, over `java.net.http` and `cheshire`.  Beyond the
neutral request keys it reads `:thinking-display` and `:fallbacks`.  See docs/llm.md
§ The Messages API backend.
raw docstring

api-versionclj

source

available?clj

(available?)
(available? {:keys [credential]})

Is a credential reachable: opts's :credential, else one credentials finds?

Is a credential reachable: `opts`'s `:credential`, else one `credentials` finds?
sourceraw docstring

credentialsclj

(credentials)

The credential to authenticate with, as {:kind :api-key|:bearer :value "…"}, or nil: ANTHROPIC_API_KEY, then ANTHROPIC_AUTH_TOKEN, then an ant auth login profile. The value is never logged, printed or put in an exception. See docs/llm.md § Credentials.

The credential to authenticate with, as `{:kind :api-key|:bearer :value "…"}`, or
nil: `ANTHROPIC_API_KEY`, then `ANTHROPIC_AUTH_TOKEN`, then an `ant auth login`
profile.  The value is never logged, printed or put in an exception.  See docs/llm.md
§ Credentials.
sourceraw docstring

default-modelclj

The model this backend talks to unless told otherwise.

The model this backend talks to unless told otherwise.
sourceraw docstring

fallback-betaclj

Beta flag for the scalar fallbacks: "default" form — routes a policy decline to Anthropic's recommended substitute model by refusal category.

Beta flag for the scalar `fallbacks: "default"` form — routes a policy decline to
Anthropic's recommended substitute model by refusal category.
sourceraw docstring

parse-responseclj

(parse-response m)

The API's JSON message -> the neutral response map (vaelii.agents.llm.protocol).

The API's JSON message -> the neutral response map (`vaelii.agents.llm.protocol`).
sourceraw docstring

providerclj

(provider)
(provider {:keys [credential base-url timeout-ms] :or {timeout-ms 600000}})

An Anthropic-backed Provider.

opts:

:credential {:kind :api-key|:bearer :value "…"} — resolved from the environment by credentials when absent :base-url default https://api.anthropic.com (or ANTHROPIC_BASE_URL) :timeout-ms default 600000; bounds the whole turn, the body included

Throws :llm-no-credential when no credential is reachable.

An Anthropic-backed `Provider`.

`opts`:

  :credential  `{:kind :api-key|:bearer :value "…"}` — resolved from the
               environment by `credentials` when absent
  :base-url    default `https://api.anthropic.com` (or `ANTHROPIC_BASE_URL`)
  :timeout-ms  default 600000; bounds the whole turn, the body included

Throws `:llm-no-credential` when no credential is reachable.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close