LLMResponse
a parsed response from an LLM provider.
content: the text content of the response (may be empty if the model called tools instead)stop-reason: provider-specific reason the generation endedinput-tokens: tokens consumed by the promptoutput-tokens: tokens generatedtool-calls: tool calls the model wants to make (empty if none)
content
(Fn [(Ref LLMResponse a)] (Ref String a))
gets the content property of a LLMResponse.
delete
(Fn [LLMResponse] ())
deletes a LLMResponse. Should usually not be called manually.
init
(Fn [String, String, Int, Int, (Array ToolCall)] LLMResponse)
creates a LLMResponse.
input-tokens
(Fn [(Ref LLMResponse a)] (Ref Int a))
gets the input-tokens property of a LLMResponse.
output-tokens
(Fn [(Ref LLMResponse a)] (Ref Int a))
gets the output-tokens property of a LLMResponse.
set-content
(Fn [LLMResponse, String] LLMResponse)
sets the content property of a LLMResponse.
set-content!
(Fn [(Ref LLMResponse a), String] ())
sets the content property of a LLMResponse in place.
set-input-tokens
(Fn [LLMResponse, Int] LLMResponse)
sets the input-tokens property of a LLMResponse.
set-input-tokens!
(Fn [(Ref LLMResponse a), Int] ())
sets the input-tokens property of a LLMResponse in place.
set-output-tokens
(Fn [LLMResponse, Int] LLMResponse)
sets the output-tokens property of a LLMResponse.
set-output-tokens!
(Fn [(Ref LLMResponse a), Int] ())
sets the output-tokens property of a LLMResponse in place.
set-stop-reason
(Fn [LLMResponse, String] LLMResponse)
sets the stop-reason property of a LLMResponse.
set-stop-reason!
(Fn [(Ref LLMResponse a), String] ())
sets the stop-reason property of a LLMResponse in place.
set-tool-calls
(Fn [LLMResponse, (Array ToolCall)] LLMResponse)
sets the tool-calls property of a LLMResponse.
set-tool-calls!
(Fn [(Ref LLMResponse a), (Array ToolCall)] ())
sets the tool-calls property of a LLMResponse in place.
stop-reason
(Fn [(Ref LLMResponse a)] (Ref String a))
gets the stop-reason property of a LLMResponse.
tool-calls
(Fn [(Ref LLMResponse a)] (Ref (Array ToolCall) a))
gets the tool-calls property of a LLMResponse.
update-content
(Fn [LLMResponse, (Ref (Fn [String] String a) b)] LLMResponse)
updates the content property of a LLMResponse using a function f.
update-input-tokens
(Fn [LLMResponse, (Ref (Fn [Int] Int a) b)] LLMResponse)
updates the input-tokens property of a LLMResponse using a function f.
update-output-tokens
(Fn [LLMResponse, (Ref (Fn [Int] Int a) b)] LLMResponse)
updates the output-tokens property of a LLMResponse using a function f.
update-stop-reason
(Fn [LLMResponse, (Ref (Fn [String] String a) b)] LLMResponse)
updates the stop-reason property of a LLMResponse using a function f.
update-tool-calls
(Fn [LLMResponse, (Ref (Fn [(Array ToolCall)] (Array ToolCall) a) b)] LLMResponse)
updates the tool-calls property of a LLMResponse using a function f.