Ollama

build-request

defn

(Fn [(Ref LLMRequest a)] String)

                        (build-request req)
                    

builds the JSON request body for the Ollama chat API.

build-stream-request

defn

(Fn [(Ref LLMRequest a)] String)

                        (build-stream-request req)
                    

builds a streaming Ollama chat request.

endpoint

defn

(Fn [a] String)

                        (endpoint _config)
                    

returns the chat API endpoint path.

headers

defn

(Fn [a, Int] (Map String (Array String)))

                        (headers _config body-len)
                    

returns the HTTP headers for an Ollama request.

parse-delta

defn

(Fn [(Ref String a)] (Maybe String))

                        (parse-delta line)
                    

extracts content from an Ollama streaming NDJSON line.

parse-response

defn

(Fn [(Ref String a)] (Result LLMResponse String))

                        (parse-response body)
                    

parses an Ollama chat API response.