Anthropic::Messages::Response
Constructors
new(id : String, type : String, role : String, content : Array(ResponseContentBlock), model : String, stop_reason : StopReason | Nil, stop_sequence : String | Nil, usage : Usage)
SourceInstance methods
content
Sourceid
Sourcemodel
Sourcerequest_id
Request ID extracted from HTTP response headers (not part of JSON body). Set by Messages::API after parsing the response.
Request ID extracted from HTTP response headers (not part of JSON body). Set by Messages::API after parsing the response.
role
Sourcerole_enum
Returns a typed enum for the role if it's a known value. Returns nil for unknown/future role values (forward compatibility). Case-insensitive: handles "assistant", "Assistant", etc.
stop_reason
Sourcestop_sequence
Sourcetext
Sourcetool_use_blocks
Sourcetype
Sourceusage
Source