Module: OmniAI::Anthropic::Chat::URLSerializer

Defined in:
lib/omniai/anthropic/chat/url_serializer.rb

Overview

Overrides url serialize / deserialize.

Class Method Summary collapse

Class Method Details

.serialize(url) ⇒ Hash

Parameters:

  • url (OmniAI::Chat::Media)

Returns:

  • (Hash)


10
11
12
13
14
15
16
17
18
# File 'lib/omniai/anthropic/chat/url_serializer.rb', line 10

def self.serialize(url, *)
  {
    type: url.kind, # i.e. 'image' / 'video' / 'audio' / 'document' / ...
    source: {
      type: "url",
      url: url.uri,
    },
  }
end