struct OpenRouter::Message

Defined in:

openrouter/types/message.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(role : Role, content : String, name : String | Nil = nil, tool_call_id : String | Nil = nil) #

Initialize for user/assistant/system messages


[View source]

Class Method Detail

def self.from_json(json : JSON::Any) #

[View source]

Instance Method Detail

def content : String #

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

[View source]
def name : String | Nil #

[View source]
def name=(name : String | Nil) #

[View source]
def role : Role | Nil #

Common fields


[View source]
def role=(role : Role | Nil) #

Common fields


[View source]
def to_json(io : IO) #

[View source]
def to_json(json : JSON::Builder) #

[View source]
def tool_call_id : String | Nil #

Optional fields for specific roles


[View source]
def tool_call_id=(tool_call_id : String | Nil) #

Optional fields for specific roles


[View source]
def tool_calls : Array(ToolCall) | Nil #

[View source]
def tool_calls=(tool_calls : Array(ToolCall) | Nil) #

[View source]