ruby-sdk/lib/model_context_protocol/content.rb
Topher Bullock 7175d49108 Internal Release 0.5.0
Bump protocol version to 2025-03-26
Provide fallback value for tool_name
Make configuration per server
Add support for tool annotations
document tool annotations
2025-05-08 17:38:02 -04:00

33 lines
675 B
Ruby

# typed: true
# frozen_string_literal: true
module ModelContextProtocol
module Content
class Text
attr_reader :text, :annotations
def initialize(text, annotations: nil)
@text = text
@annotations = annotations
end
def to_h
{ text:, annotations:, type: "text" }.compact
end
end
class Image
attr_reader :data, :mime_type, :annotations
def initialize(data, mime_type, annotations: nil)
@data = data
@mime_type = mime_type
@annotations = annotations
end
def to_h
{ data:, mime_type:, annotations:, type: "image" }.compact
end
end
end
end