Skip to content

struct OpenAI::ChatCompletionMessage
inherits Struct #

A message used to generate a chat completion

Included modules

JSON::Serializable

Constructors#

.new(content : String | Nil = nil, role : ChatMessageRole | Nil = nil, name : String | Nil = nil, tool_calls : Array(ToolCall) | Nil = nil, function_call : FunctionCall | Nil = nil, tool_call_id : String | Nil = nil)#

View source

.new(pull : JSON::PullParser)#

View source

Methods#

#clone#

View source

#content : String | ::Nil#

#copy_with(content _content = @content, role _role = @role, name _name = @name, tool_calls _tool_calls = @tool_calls, function_call _function_call = @function_call, tool_call_id _tool_call_id = @tool_call_id)#

View source

#function_call : FunctionCall | ::Nil#

#name : String | ::Nil#

#role : ChatMessageRole | ::Nil#

#tool_call_id : String | ::Nil#

#tool_calls : Array(ToolCall) | ::Nil#