Liking cljdoc? Tell your friends :D

vortex.client


->clientclj

(->client {:keys [project location]})

->configclj

(->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 format
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 format
raw docstring

->contentclj

(->content {:keys [role text]})

createclj

(create {:keys [project location model system-instruction response-schema]})

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.

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.
raw docstring

generate-content*clj

(generate-content* client {:keys [model config input]})

history->contentsclj

(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>.
raw docstring

IGenAIcljprotocol

generate-contentclj

(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-messageclj

(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-chatclj

(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`.
raw docstring

invoke-generateclj

(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`.
raw docstring

send-message*clj

(send-message* client {:keys [model config context history message]})

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close