Class: ModelContextProtocol::Server::Content::Image
- Inherits:
-
Data
- Object
- Data
- ModelContextProtocol::Server::Content::Image
- 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
53 54 55 |
# File 'lib/model_context_protocol/server/content.rb', line 53 def annotations @annotations end |
#data ⇒ Object (readonly)
Returns the value of attribute data
53 54 55 |
# File 'lib/model_context_protocol/server/content.rb', line 53 def data @data end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta
53 54 55 |
# File 'lib/model_context_protocol/server/content.rb', line 53 def end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type
53 54 55 |
# File 'lib/model_context_protocol/server/content.rb', line 53 def mime_type @mime_type end |
Instance Method Details
#serialized ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/model_context_protocol/server/content.rb', line 54 def serialized serialized_data = { _meta: , annotations:, data:, mimeType: mime_type, type: "image" }.compact validation_errors = JSON::Validator.fully_validate(schema, serialized_data) if validation_errors.empty? serialized_data else raise ContentValidationError, validation_errors.join(", ") end end |