Module: OmniAI::OpenAI::Chat::URLSerializer
- Defined in:
- lib/omniai/openai/chat/url_serializer.rb
Overview
Overrides media serialize / deserialize.
Class Method Summary collapse
Class Method Details
.serialize(url, direction:) ⇒ Hash
12 13 14 15 16 17 18 19 |
# File 'lib/omniai/openai/chat/url_serializer.rb', line 12 def self.serialize(url, direction:, **) type = url.image? ? "image" : "file" { type: "#{direction}_#{type}", "#{type}_url": url.uri, } end |