Class: ModelContextProtocol::Server::Content::Text
- Inherits:
-
Data
- Object
- Data
- ModelContextProtocol::Server::Content::Text
- Defined in:
- lib/model_context_protocol/server/content.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations
7 8 9 |
# File 'lib/model_context_protocol/server/content.rb', line 7 def annotations @annotations end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta
7 8 9 |
# File 'lib/model_context_protocol/server/content.rb', line 7 def end |
#text ⇒ Object (readonly)
Returns the value of attribute text
7 8 9 |
# File 'lib/model_context_protocol/server/content.rb', line 7 def text @text end |
Instance Method Details
#serialized ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/model_context_protocol/server/content.rb', line 8 def serialized serialized_data = { _meta: , annotations:, text:, type: "text" }.compact validation_errors = JSON::Validator.fully_validate(schema, serialized_data) if validation_errors.empty? serialized_data else raise ContentValidationError, validation_errors.join(", ") end end |