OpenAI
build-request
(Fn [(Ref LLMRequest a)] String)
(build-request req)
builds the JSON request body for the OpenAI chat completions API.
build-stream-request
(Fn [(Ref LLMRequest a)] String)
(build-stream-request req)
builds a streaming OpenAI chat completions request.
headers
(Fn [(Ref ProviderConfig a), Int] (Map String (Array String)))
(headers config body-len)
returns the HTTP headers for an OpenAI request.
parse-delta
(Fn [(Ref String a)] (Maybe String))
(parse-delta line)
extracts the content delta from a streaming SSE data line.
parse-response
(Fn [(Ref String a)] (Result LLMResponse String))
(parse-response body)
parses an OpenAI chat completions response.