Method: EasyTalk::Tools::FunctionBuilder.new

Defined in:
lib/easy_talk/tools/function_builder.rb

.new(model) ⇒ Hash

Creates a new function object based on the given model.

Parameters:

  • model (Model)

    The EasyTalk model containing the function details.

Returns:

  • (Hash)

    The function object.



13
14
15
16
17
18
19
20
21
22
# File 'lib/easy_talk/tools/function_builder.rb', line 13

def new(model)
  {
    type: 'function',
    function: {
      name: generate_function_name(model),
      description: generate_function_description(model),
      parameters: model.json_schema
    }
  }
end