Module: OmniAI::Anthropic::Chat::FunctionSerializer
- Defined in:
- lib/omniai/anthropic/chat/function_serializer.rb
Overview
Overrides function serialize / deserialize.
Class Method Summary collapse
Class Method Details
.deserialize(data) ⇒ OmniAI::Chat::Function
21 22 23 24 25 26 |
# File 'lib/omniai/anthropic/chat/function_serializer.rb', line 21 def self.deserialize(data, *) name = data["name"] arguments = data["input"] OmniAI::Chat::Function.new(name:, arguments:) end |
.serialize(function) ⇒ Hash
11 12 13 14 15 16 |
# File 'lib/omniai/anthropic/chat/function_serializer.rb', line 11 def self.serialize(function, *) { name: function.name, input: function.arguments, } end |