Message stream events as data, and the fold that turns them back into the message a non-streaming call would have returned.
Message stream events as data, and the fold that turns them back into the message a non-streaming call would have returned.
(accumulate)(accumulate message)(accumulate message {:keys [type index] :as event})A reducing function that folds event payloads into a message. Use it with reduce and an init of nil, or with transduce. Unknown event types are ignored.
A reducing function that folds event payloads into a message. Use it with reduce and an init of nil, or with transduce. Unknown event types are ignored.
Fold a content block delta into its block. Dispatches on the delta's :type; a type with no method leaves the block unchanged.
Fold a content block delta into its block. Dispatches on the delta's :type; a type with no method leaves the block unchanged.
(payloads)A transducer from the lines of a Messages SSE stream to event payloads such as {:type "content_block_delta" :index 0 :delta {...}}. Pings are dropped, and an error event is thrown as the ex-info it describes.
A transducer from the lines of a Messages SSE stream to event payloads
such as {:type "content_block_delta" :index 0 :delta {...}}. Pings are
dropped, and an error event is thrown as the ex-info it describes.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 |