Liking cljdoc? Tell your friends :D

llm.sdk.http

Thin, mockable HTTP layer built on hato.

Thin, mockable HTTP layer built on hato.
raw docstring

*http-client*clj

Dynamic var for the HTTP client. Bind to a mock for tests.

Dynamic var for the HTTP client. Bind to a mock for tests.
sourceraw docstring

binary-stream-requestclj

(binary-stream-request {:keys [method url headers body] :as req})

Make a streaming HTTP request and return the raw java.io.InputStream in :body. Used by adapters that speak a binary framing protocol (e.g. AWS event-stream for Bedrock /converse-stream) and need to decode frames themselves.

Make a streaming HTTP request and return the raw java.io.InputStream
in :body. Used by adapters that speak a binary framing protocol
(e.g. AWS event-stream for Bedrock /converse-stream) and need to
decode frames themselves.
sourceraw docstring

decode-bodyclj

(decode-body body)

Parse an HTTP body as JSON when possible. Accepts strings and InputStreams; closes streams it consumes.

Parse an HTTP body as JSON when possible. Accepts strings and
InputStreams; closes streams it consumes.
sourceraw docstring

line-seq-closeableclj

(line-seq-closeable is)

Return a lazy seq of lines and close the underlying stream at EOF or on read failure. If callers abandon the lazy seq before EOF, they still own the usual lazy-resource caveat; sdk/complete's :on-event path consumes it fully.

Return a lazy seq of lines and close the underlying stream at EOF
or on read failure. If callers abandon the lazy seq before EOF, they
still own the usual lazy-resource caveat; sdk/complete's :on-event
path consumes it fully.
sourceraw docstring

requestclj

(request {:keys [method url headers body query-params] :as req})

Make an HTTP request. Returns a map with :status, :body, :headers for every status code (including 4xx/5xx) — callers branch on :status. Body is parsed as JSON if Content-Type is application/json.

Make an HTTP request. Returns a map with :status, :body, :headers
for every status code (including 4xx/5xx) — callers branch on
:status. Body is parsed as JSON if Content-Type is application/json.
sourceraw docstring

sse-requestclj

(sse-request req)

Make an SSE streaming request. Returns a lazy seq of raw SSE line strings. Caller should parse lines with parse-stream-event.

Make an SSE streaming request. Returns a lazy seq of raw SSE line strings.
Caller should parse lines with parse-stream-event.
sourceraw docstring

sse-responseclj

(sse-response {:keys [method url headers body] :as req})

Make an SSE streaming request. Returns a response map. Successful responses carry an open InputStream in :body; non-2xx responses carry a parsed body and have already closed the stream.

Make an SSE streaming request. Returns a response map. Successful
responses carry an open InputStream in :body; non-2xx responses
carry a parsed body and have already closed the stream.
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