class RubyLLM::MCP::Content

def initialize(text: nil, attachments: nil) # rubocop:disable Lint/MissingSuper

rubocop:disable Lint/MissingSuper
def initialize(text: nil, attachments: nil) # rubocop:disable Lint/MissingSuper
  @text = text
  @attachments = []
  # Handle MCP::Attachment objects directly without processing
  if attachments.is_a?(Array) && attachments.all? { |a| a.is_a?(MCP::Attachment) }
    @attachments = attachments
  elsif attachments
    # Let parent class process other types of attachments
    process_attachments(attachments)
  end
end

def to_s

to return audio or image attachments.
This is a workaround to allow the content object to be passed as the tool call
def to_s
  text.to_s
end