(->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 in every request/conversation: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 in every request/conversation - `: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]})(context->message context)(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 forces the model to reply using JSON. This is
required for generate-content (one-shot structured data) and also works
for send-message (structured replies on every chat turn). When a schema
is set, send-message parses each reply and stores the resulting map under
the :text key of the model history turn - so for chat-with-schema
:text is an object, not a string. See the README for details. Omit
response-schema if you want plain-text chat 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 forces the model to reply using JSON. This is required for `generate-content` (one-shot structured data) and also works for `send-message` (structured replies on every chat turn). When a schema is set, `send-message` parses each reply and stores the resulting map under the `:text` key of the `model` history turn - so for chat-with-schema `:text` is an object, not a string. See the README for details. Omit `response-schema` if you want plain-text chat 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
structured-responses?]})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 |