Clojure wrapper for the beta Messages API.
Clojure wrapper for the beta Messages API.
(beta-tool-runner-handle runner)(beta-tool-runner-handle client params)(beta-tool-runner-handle client params opts)Create a Clojure handle around the SDK's blocking BetaToolRunner.
The handle's :messages and :streaming operations return lazy sequences;
:set-next-params! accepts a normal request map, and :last-tool-response
returns a translated message-param map or nil. The one-argument form wraps
an existing SDK runner; the other forms create one through the beta
Messages service.
Create a Clojure handle around the SDK's blocking `BetaToolRunner`. The handle's `:messages` and `:streaming` operations return lazy sequences; `:set-next-params!` accepts a normal request map, and `:last-tool-response` returns a translated message-param map or nil. The one-argument form wraps an existing SDK runner; the other forms create one through the beta Messages service.
(count-beta-tokens client req)(count-beta-tokens client req opts)Count beta Messages input tokens without creating a message. Request maps support cache-control, context-management, mcp-servers, response-format, output-type, effort, task-budget, output-format, speed, user-profile-id, extra-headers, extra-query, and extra-body. Returns :input-tokens and, when present, nested :context-management data.
Count beta Messages input tokens without creating a message. Request maps support cache-control, context-management, mcp-servers, response-format, output-type, effort, task-budget, output-format, speed, user-profile-id, extra-headers, extra-query, and extra-body. Returns :input-tokens and, when present, nested :context-management data.
(create-beta-message client req)(create-beta-message client req opts)Send a beta Messages request and return a generic Clojure map response.
Request maps support context-management, diagnostics, speed, and tool-choice
disable-parallel-tool-use options. Tool specs support response-inclusion,
input-examples, eager-input-streaming, caching, and dated :version options.
System text and text content blocks accept citation-list :citations; document
content blocks accept boolean or {:enabled ...} citation configuration.
Custom tools accept optional :description and :input-schema; an omitted schema
defaults to the SDK's object schema.
Send a beta Messages request and return a generic Clojure map response.
Request maps support context-management, diagnostics, speed, and tool-choice
disable-parallel-tool-use options. Tool specs support response-inclusion,
input-examples, eager-input-streaming, caching, and dated :version options.
System text and text content blocks accept citation-list `:citations`; document
content blocks accept boolean or `{:enabled ...}` citation configuration.
Custom tools accept optional :description and :input-schema; an omitted schema
defaults to the SDK's object schema.(list-beta-batches-lazy client)(list-beta-batches-lazy client opts)Lazily list beta message batches; accepts the same options as list-beta-batches.
Lazily list beta message batches; accepts the same options as `list-beta-batches`.
(run-beta-tools client params)(run-beta-tools client params opts)Run beta Messages with local tool functions until no tool is requested.
Options include :max-iterations, :on-message, and :on-turn. :on-turn
receives each assistant response and the current params, and returns params
for the next iteration, allowing tools and request settings to change. Tool
specs support response-inclusion, input-examples, eager-input-streaming,
caching, and dated :version options.
Run beta Messages with local tool functions until no tool is requested. Options include `:max-iterations`, `:on-message`, and `:on-turn`. `:on-turn` receives each assistant response and the current params, and returns params for the next iteration, allowing tools and request settings to change. Tool specs support response-inclusion, input-examples, eager-input-streaming, caching, and dated :version options.
(stream-beta-message-handle client req on-event)(stream-beta-message-handle client req on-event opts)Start a beta Messages SSE stream on a worker thread and return a
cancellable handle. on-event receives normalized event maps.
Start a beta Messages SSE stream on a worker thread and return a cancellable handle. `on-event` receives normalized event maps.
(stream-beta-message-queue client req)(stream-beta-message-queue client req opts)Start a bounded pull stream of normalized beta Messages events.
Start a bounded pull stream of normalized beta Messages events.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |