(complete {:keys [model messages system tools max-tokens response-format]
:or {model default-model max-tokens 4096}})Call OpenAI chat completions API. req keys: :model :messages :system :tools :max-tokens :response-format :stream
Call OpenAI chat completions API. req keys: :model :messages :system :tools :max-tokens :response-format :stream
(complete-stream {:keys [model messages system tools max-tokens]
:or {model default-model max-tokens 4096}})Call OpenAI chat completions API with streaming. Returns lazy seq of parsed SSE events.
Call OpenAI chat completions API with streaming. Returns lazy seq of parsed SSE events.
(normalize-models response)Convert a raw OpenAI /models list response to a vector of normalized model maps.
Convert a raw OpenAI /models list response to a vector of normalized model maps.
(normalize-response response)Convert a raw OpenAI chat completions response to the ellum normalized format. A model refusal (message.refusal set, e.g. under structured outputs) is surfaced as :refusal with :stop-reason :refusal, since finish_reason alone doesn't signal it.
Convert a raw OpenAI chat completions response to the ellum normalized format. A model refusal (message.refusal set, e.g. under structured outputs) is surfaced as :refusal with :stop-reason :refusal, since finish_reason alone doesn't signal it.
(run-response input & [{:as params}])Call the OpenAI responses API (newer stateful API). Returns full response body.
Call the OpenAI responses API (newer stateful API). Returns full response body.
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 |