Class: ModelContextProtocol::Server::Content::Audio
- Inherits:
-
Data
- Object
- Data
- ModelContextProtocol::Server::Content::Audio
- Defined in:
- lib/model_context_protocol/server/content.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
Instance Method Summary collapse
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations
104 105 106 |
# File 'lib/model_context_protocol/server/content.rb', line 104 def annotations @annotations end |
#data ⇒ Object (readonly)
Returns the value of attribute data
104 105 106 |
# File 'lib/model_context_protocol/server/content.rb', line 104 def data @data end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta
104 105 106 |
# File 'lib/model_context_protocol/server/content.rb', line 104 def @meta end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type
104 105 106 |
# File 'lib/model_context_protocol/server/content.rb', line 104 def mime_type @mime_type end |
Instance Method Details
#serialized ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/model_context_protocol/server/content.rb', line 105 def serialized serialized_data = { _meta: , annotations:, data:, mimeType: mime_type, type: "audio" }.compact validation_errors = JSON::Validator.fully_validate(schema, serialized_data) if validation_errors.empty? serialized_data else raise ContentValidationError, validation_errors.join(", ") end end |