(->client {:keys [project location]})(->config {:keys [system-instruction response-schema]})Create config for content generation. Options:
:system-instruction - string with default system instructions
attached to the client for every requst:response-schema - JSON schema for the response, intended
for single-shot mode. See vortex.schema for converting Malli schemas to
GenAI's formatCreate config for content generation. Options: - `:system-instruction` - string with default system instructions attached to the client for every requst - `:response-schema` - JSON schema for the response, intended for single-shot mode. See `vortex.schema` for converting Malli schemas to GenAI's format
(->content {:keys [role text]})(create {:keys [project location model system-instruction response-schema]})Create a GenAI (aka Vertex aka Gemini on Vertex) client. Required opts:
project - your GCP projectmodel - model name, as per API docs e.g gemini-2.5-flashOptional:
system-instruction - system instructions for the
model. Set global instructions for all uses of the modelresponse-schema - forces the model to reply using structured data,
uses Malli schema for definitionNOTE: response schema will force
model to reply using JSON, this is required for generate-content
call (one-shot reply with structured data) but you don't want it for
send-message (an ogoing chat, where usually you want text
replies).
NOTE: chat doesn't support tool calling or other
grounding features yet.
Create a GenAI (aka Vertex aka Gemini on Vertex) client. Required opts: - `project` - your GCP project - `model` - model name, as per API docs e.g `gemini-2.5-flash` Optional: - `system-instruction` - system instructions for the model. Set global instructions for all uses of the model - `response-schema` - forces the model to reply using structured data, uses Malli schema for definition NOTE: response schema will force model to reply using JSON, this is required for `generate-content` call (one-shot reply with structured data) but you don't want it for `send-message` (an ogoing chat, where usually you want text replies). NOTE: chat doesn't support tool calling or other grounding features yet.
(generate-content* client {:keys [model config input]})(history->contents history)Convert a persisted history vec into a java.util.List<Content>.
Convert a persisted history vec into a java.util.List<Content>.
(generate-content client {:keys [input]})One-shot generate content using the client, with pre-baked system instructions and schema
One-shot generate content using the client, with pre-baked system instructions and schema
(send-message client {:keys [message history context]})Send message to a chat session, requires history, chat context
Send message to a chat session, requires history, chat context
(invoke-chat client {:keys [model contents config]})Multi-turn SDK call. Sends contents (a List<Content>) and returns the raw
GenerateContentResponse.
Multi-turn SDK call. Sends `contents` (a List<Content>) and returns the raw `GenerateContentResponse`.
(invoke-generate client {:keys [model input config]})One-shot SDK call. Sends input (a String) and returns the raw
GenerateContentResponse.
One-shot SDK call. Sends `input` (a String) and returns the raw `GenerateContentResponse`.
(send-message* client {:keys [model config context history message]})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |