struct

ChatGPT::PostData

Inherits JSON::Serializable / Struct / Value / Object

Constructors

new(pull : JSON::PullParser)
Source
new(model : String = "gpt-5.1", messages : Array(Hash(String, String)) = [] of Hash(String, String), temperature : Float64 = 1.0, top_p : Float64 = 1.0, max_output_tokens : Int32 | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

add_message(role : String, content : String)
Source
count_user_messages
Source
max_output_tokens
Source
max_output_tokens=(max_output_tokens : Int32 | Nil)
Source
messages
Source
messages=(messages : Array(Hash(String, String)))
Source
model
Source
model=(model : String)
Source
temperature
Source
temperature=(temperature : Float64)
Source
top_p
Source
top_p=(top_p : Float64)
Source
user_messages
Source