OpenAI::ChatMessage
Inherits JSON::Serializable / Struct / Value / Object
Constructors
new(pull : JSON::PullParser)
Sourcenew(role : OpenAI::ChatMessageRole, content : Nil | String = nil, name : Nil | String = nil, function_call : OpenAI::ChatFunctionCall | Nil = nil, tokens : Int32 = 0, tool_calls : Nil | Array(OpenAI::ChatToolCall) = nil, tool_call_id : Nil | String = nil)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
content
The contents of the message. content is required for all messages, and may be null for assistant messages with function calls.
function_call
The name and arguments of a function that should be called, as generated by the model.
name
The name of the author of this message. name is required if role is function, and it should be the name of the function whose response is in the content. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
tokens
Sourcetokens=(tokens : Int32)
Sourcetool_call_id
For Role=tool prompts this should be set to the ID given in the assistant's prior request to call a tool.