Skip to content

struct OpenAI::ChatCompletionRequest
inherits Struct #

Included modules

JSON::Serializable

Constructors#

.new(messages : Array(ChatCompletionMessage), model : String, frequency_penalty : Float64 | Nil = nil, logit_bias : Hash(String, Int32) | Nil = nil, logprobs : Bool | Nil = nil, top_logprobs : Int32 | Nil = nil, max_tokens : Int32 | Nil = nil, n : Int32 | Nil = nil, presence_penalty : Int32 | Nil = nil, response_format : ResponseFormat | Nil = nil, seed : Int32 | Nil = nil, stop : Array(String) | Nil = nil, stream : Bool | Nil = nil, temperature : Float64 | Nil = nil, top_p : Float32 | Nil = nil, tools : Array(Tool) | Nil = nil, tool_choice : String | ToolChoice | Nil = nil, user : String | Nil = nil, function_call : String | Function | Nil = nil, functions : Array(FunctionDefinition) | Nil = nil)#

View source

.new(pull : JSON::PullParser)#

View source

Methods#

#clone#

View source

#copy_with(messages _messages = @messages, model _model = @model, frequency_penalty _frequency_penalty = @frequency_penalty, logit_bias _logit_bias = @logit_bias, logprobs _logprobs = @logprobs, top_logprobs _top_logprobs = @top_logprobs, max_tokens _max_tokens = @max_tokens, n _n = @n, presence_penalty _presence_penalty = @presence_penalty, response_format _response_format = @response_format, seed _seed = @seed, stop _stop = @stop, stream _stream = @stream, temperature _temperature = @temperature, top_p _top_p = @top_p, tools _tools = @tools, tool_choice _tool_choice = @tool_choice, user _user = @user, function_call _function_call = @function_call, functions _functions = @functions)#

View source

#frequency_penalty : Float64 | ::Nil#

#function_call : String | Function | Nil#

#functions : Array(FunctionDefinition) | ::Nil#

#logit_bias : Hash(String, Int32) | ::Nil#

#logprobs : Bool | ::Nil#

#max_tokens : Int32 | ::Nil#

#messages : Array(ChatCompletionMessage)#

#model : String#

#n : Int32 | ::Nil#

#presence_penalty : Int32 | ::Nil#

#response_format : ResponseFormat | ::Nil#

#seed : Int32 | ::Nil#

#stop : Array(String) | ::Nil#

#stream : Bool | ::Nil#

#temperature : Float64 | ::Nil#

#tool_choice : String | ToolChoice | Nil#

#tools : Array(Tool) | ::Nil#

#top_logprobs : Int32 | ::Nil#

#top_p : Float32 | ::Nil#

#user : String | ::Nil#