Module: OmniAI::Google::Chat::ChoiceSerializer
- Defined in:
- lib/omniai/google/chat/choice_serializer.rb
Overview
Overrides choice serialize / deserialize.
Class Method Summary collapse
Class Method Details
.deserialize(data, context:) ⇒ OmniAI::Chat::Choice
19 20 21 22 |
# File 'lib/omniai/google/chat/choice_serializer.rb', line 19 def self.deserialize(data, context:) = OmniAI::Chat::Message.deserialize(data['content'], context:) OmniAI::Chat::Choice.new(message:) end |
.serialize(choice, context:) ⇒ Hash
11 12 13 14 |
# File 'lib/omniai/google/chat/choice_serializer.rb', line 11 def self.serialize(choice, context:) content = choice..serialize(context:) { content: } end |