LLMRequest

a chat request to an LLM provider.

Build with LLM.chat-request, LLM.chat-request-with-tools, LLM.chat-request-json, or LLM.chat-request-with-schema rather than constructing directly.

  • model: provider-specific model identifier
  • messages: the conversation history
  • max-tokens: maximum output tokens
  • temperature: sampling temperature (0.0 to 2.0)
  • tools: tool definitions (empty array if none)
  • format-mode: format-text, format-json, or format-json-schema
  • format-schema: JSON schema for structured output (used when mode is format-json-schema)

copy

instantiate

(Fn [(Ref LLMRequest a)] LLMRequest)

copies a LLMRequest.

delete

instantiate

(Fn [LLMRequest] ())

deletes a LLMRequest. Should usually not be called manually.

format-mode

instantiate

(Fn [(Ref LLMRequest a)] (Ref Int a))

gets the format-mode property of a LLMRequest.

format-schema

instantiate

(Fn [(Ref LLMRequest a)] (Ref JSON a))

gets the format-schema property of a LLMRequest.

init

instantiate

(Fn [String, (Array Message), Int, Double, (Array ToolDef), Int, JSON] LLMRequest)

creates a LLMRequest.

max-tokens

instantiate

(Fn [(Ref LLMRequest a)] (Ref Int a))

gets the max-tokens property of a LLMRequest.

messages

instantiate

(Fn [(Ref LLMRequest a)] (Ref (Array Message) a))

gets the messages property of a LLMRequest.

model

instantiate

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

gets the model property of a LLMRequest.

prn

instantiate

(Fn [(Ref LLMRequest a)] String)

converts a LLMRequest to a string.

set-format-mode

instantiate

(Fn [LLMRequest, Int] LLMRequest)

sets the format-mode property of a LLMRequest.

set-format-mode!

instantiate

(Fn [(Ref LLMRequest a), Int] ())

sets the format-mode property of a LLMRequest in place.

set-format-schema

instantiate

(Fn [LLMRequest, JSON] LLMRequest)

sets the format-schema property of a LLMRequest.

set-format-schema!

instantiate

(Fn [(Ref LLMRequest a), JSON] ())

sets the format-schema property of a LLMRequest in place.

set-max-tokens

instantiate

(Fn [LLMRequest, Int] LLMRequest)

sets the max-tokens property of a LLMRequest.

set-max-tokens!

instantiate

(Fn [(Ref LLMRequest a), Int] ())

sets the max-tokens property of a LLMRequest in place.

set-messages

instantiate

(Fn [LLMRequest, (Array Message)] LLMRequest)

sets the messages property of a LLMRequest.

set-messages!

instantiate

(Fn [(Ref LLMRequest a), (Array Message)] ())

sets the messages property of a LLMRequest in place.

set-model

instantiate

(Fn [LLMRequest, String] LLMRequest)

sets the model property of a LLMRequest.

set-model!

instantiate

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

sets the model property of a LLMRequest in place.

set-temperature

instantiate

(Fn [LLMRequest, Double] LLMRequest)

sets the temperature property of a LLMRequest.

set-temperature!

instantiate

(Fn [(Ref LLMRequest a), Double] ())

sets the temperature property of a LLMRequest in place.

set-tools

instantiate

(Fn [LLMRequest, (Array ToolDef)] LLMRequest)

sets the tools property of a LLMRequest.

set-tools!

instantiate

(Fn [(Ref LLMRequest a), (Array ToolDef)] ())

sets the tools property of a LLMRequest in place.

str

instantiate

(Fn [(Ref LLMRequest a)] String)

converts a LLMRequest to a string.

temperature

instantiate

(Fn [(Ref LLMRequest a)] (Ref Double a))

gets the temperature property of a LLMRequest.

tools

instantiate

(Fn [(Ref LLMRequest a)] (Ref (Array ToolDef) a))

gets the tools property of a LLMRequest.

update-format-mode

instantiate

(Fn [LLMRequest, (Ref (Fn [Int] Int a) b)] LLMRequest)

updates the format-mode property of a LLMRequest using a function f.

update-format-schema

instantiate

(Fn [LLMRequest, (Ref (Fn [JSON] JSON a) b)] LLMRequest)

updates the format-schema property of a LLMRequest using a function f.

update-max-tokens

instantiate

(Fn [LLMRequest, (Ref (Fn [Int] Int a) b)] LLMRequest)

updates the max-tokens property of a LLMRequest using a function f.

update-messages

instantiate

(Fn [LLMRequest, (Ref (Fn [(Array Message)] (Array Message) a) b)] LLMRequest)

updates the messages property of a LLMRequest using a function f.

update-model

instantiate

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

updates the model property of a LLMRequest using a function f.

update-temperature

instantiate

(Fn [LLMRequest, (Ref (Fn [Double] Double a) b)] LLMRequest)

updates the temperature property of a LLMRequest using a function f.

update-tools

instantiate

(Fn [LLMRequest, (Ref (Fn [(Array ToolDef)] (Array ToolDef) a) b)] LLMRequest)

updates the tools property of a LLMRequest using a function f.