LLM::OpenAI::Message
Inherits JSON::Serializable < Reference < Object
Represents a message in a request to the LLM
Constructors
new(pull : JSON::PullParser)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
role
Sourcerole=(role : String)
Sourceto_protocol_json(builder : JSON::Builder)
Used to encode message for sending to LLM. Can't use regular
to_json since we need to handle some special cases for the protocol
but we want to serialize whole entry for saving / restoring.
This starts the object and calls protocol_fields_to_json.
Do not override!