Class: ActiveMcp::Message::Audio
- Inherits:
-
Object
- Object
- ActiveMcp::Message::Audio
- Defined in:
- lib/active_mcp/message/audio.rb
Instance Method Summary collapse
-
#initialize(role:, data:, mime_type:) ⇒ Audio
constructor
A new instance of Audio.
- #to_h ⇒ Object
Constructor Details
#initialize(role:, data:, mime_type:) ⇒ Audio
Returns a new instance of Audio.
4 5 6 7 8 |
# File 'lib/active_mcp/message/audio.rb', line 4 def initialize(role:, data:, mime_type:) @role = role @data = data @mime_type = mime_type end |
Instance Method Details
#to_h ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/active_mcp/message/audio.rb', line 10 def to_h { role: @role, content: { type: "audio", data: Base64.strict_encode64(@data), mimeType: @mime_type } } end |