Gemini
build-request
(Fn [(Ref LLMRequest a)] String)
(build-request req)
builds the JSON request body for the Gemini generateContent API.
build-stream-request
(Fn [(Ref LLMRequest a)] String)
(build-stream-request req)
builds a streaming Gemini generateContent request.
endpoint
(Fn [a, (Ref String b)] String)
(endpoint _config model)
returns the generateContent endpoint path for the given model.
headers
(Fn [(Ref ProviderConfig a), Int] (Map String (Array String)))
(headers config body-len)
returns the HTTP headers for a Gemini request.
parse-delta
(Fn [(Ref String a)] (Maybe String))
(parse-delta line)
extracts text from a Gemini streaming SSE data line.
parse-response
(Fn [(Ref String a)] (Result LLMResponse String))
(parse-response body)
parses a Gemini generateContent API response.
stream-endpoint
(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.