Liking cljdoc? Tell your friends :D

hyperphor.ellum.providers.openai


api-getclj

(api-get path params)
source

api-keyclj

(api-key)
source

api-postclj

(api-post path body)
source

api-post-streamclj

(api-post-stream path body)
source

base-urlclj

source

completeclj

(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
sourceraw docstring

complete-streamclj

(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.
sourceraw docstring

default-modelclj

source

list-modelsclj

(list-models)
source

normalize-modelsclj

(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.
sourceraw docstring

normalize-responseclj

(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.
sourceraw docstring

run-responseclj

(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.
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