struct ChatGPT::PostData

Included Modules

Defined in:

chatgpt/post_data.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(model : String = "gpt-4o", messages : Array(Hash(String, String)) = [] of Hash(String, String), n : Int32 = 1, temperature : Float64 = 1.0, top_p : Float64 = 1.0) #

[View source]

Instance Method Detail

def add_message(role : String, content : String) #

[View source]
def count_user_messages #

[View source]
def messages : Array(Hash(String, String)) #

[View source]
def messages=(messages : Array(Hash(String, String))) #

[View source]
def model : String #

[View source]
def model=(model : String) #

[View source]
def n : Int32 #

[View source]
def n=(n : Int32) #

[View source]
def temperature : Float64 #

[View source]
def temperature=(temperature : Float64) #

[View source]
def top_p : Float64 #

[View source]
def top_p=(top_p : Float64) #

[View source]
def user_messages #

[View source]