struct OpenRouter::Message
- OpenRouter::Message
- Struct
- Value
- Object
Defined in:
openrouter/types/message.crConstructors
-
.new(role : Role, content : String, name : String | Nil = nil, tool_call_id : String | Nil = nil, tool_calls : Array(ToolCall) | Nil = nil)
Initialize for user/assistant/system messages
Class Method Summary
Instance Method Summary
- #content : String
- #content=(content : String)
- #name : String | Nil
- #name=(name : String | Nil)
-
#role : Role | Nil
Common fields
-
#role=(role : Role | Nil)
Common fields
- #to_json(io : IO)
- #to_json(json : JSON::Builder)
-
#tool_call_id : String | Nil
Optional fields for specific roles
-
#tool_call_id=(tool_call_id : String | Nil)
Optional fields for specific roles
- #tool_calls : Array(ToolCall) | Nil
- #tool_calls=(tool_calls : Array(ToolCall) | Nil)
Constructor Detail
def self.new(role : Role, content : String, name : String | Nil = nil, tool_call_id : String | Nil = nil, tool_calls : Array(ToolCall) | Nil = nil)
#
Initialize for user/assistant/system messages