class

LLM::OpenAI::Message::Response

Inherits LLM::OpenAI::Message < JSON::Serializable < Reference < Object

Represents a response message from the LLM

Constants

ROLE = "assistant"

Constructors

new(content : Nil | String, reasoning : Nil | String, tool_calls : Nil | Array(JSON::Any) = nil)
Source
new(pull : JSON::PullParser)

Represents a response message from the LLM

Source

Instance methods

content
Source
content=(content : String | Nil)
Source
emit

Emit this message as one or more ChatEvent objects

Source
include_reasoning=(include_reasoning : Bool)

If false don't include reasoning when resending this message to the model

Source
include_reasoning?

If false don't include reasoning when resending this message to the model

Source
reasoning
Source
reasoning=(reasoning : String | Nil)
Source
tool_calls
Source
tool_calls=(tool_calls : Array(JSON::Any) | Nil)
Source
usage

Sidecar to response message so we can keep the usage together with it. Not serialized. Keeping this here as a convenience when parsing for now. Ideally it would better if it was only in the MessagePlus wrapper.

Source
usage=(usage : Usage | Nil)

Sidecar to response message so we can keep the usage together with it. Not serialized. Keeping this here as a convenience when parsing for now. Ideally it would better if it was only in the MessagePlus wrapper.

Source