Class: Rasti::AI::OpenAI::ToolSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/rasti/ai/open_ai/tool_serializer.rb

Class Method Summary collapse

Class Method Details

.serialize(tool_class) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/rasti/ai/open_ai/tool_serializer.rb', line 7

def serialize(tool_class)
  {
    type: 'function',
    function: serialize_function(tool_class)
  }

rescue => ex
  raise Errors::ToolSerializationError.new(tool_class), cause: ex
end