Gemini

build-request

defn

(Fn [(Ref LLMRequest a)] String)

                        (build-request req)
                    

builds the JSON request body for the Gemini generateContent API.

build-stream-request

defn

(Fn [(Ref LLMRequest a)] String)

                        (build-stream-request req)
                    

builds a streaming Gemini generateContent request.

endpoint

defn

(Fn [a, (Ref String b)] String)

                        (endpoint _config model)
                    

returns the generateContent endpoint path for the given model.

headers

defn

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

                        (headers config body-len)
                    

returns the HTTP headers for a Gemini request.

parse-delta

defn

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

                        (parse-delta line)
                    

extracts text from a Gemini streaming SSE data line.

parse-response

defn

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

                        (parse-response body)
                    

parses a Gemini generateContent API response.

stream-endpoint

defn

(Fn [a, (Ref String b)] String)

                        (stream-endpoint _config model)
                    

returns the streamGenerateContent endpoint path for the given model. The ?alt=sse parameter enables Server-Sent Events streaming.