Class: VSM::Tool::Descriptor

Inherits:
Struct
  • Object
show all
Defined in:
lib/vsm/tool/descriptor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



4
5
6
# File 'lib/vsm/tool/descriptor.rb', line 4

def description
  @description
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/vsm/tool/descriptor.rb', line 4

def name
  @name
end

#schemaObject

Returns the value of attribute schema

Returns:

  • (Object)

    the current value of schema



4
5
6
# File 'lib/vsm/tool/descriptor.rb', line 4

def schema
  @schema
end

Instance Method Details

#to_anthropic_toolObject



8
9
10
# File 'lib/vsm/tool/descriptor.rb', line 8

def to_anthropic_tool
  { name:, description:, input_schema: schema }
end

#to_gemini_toolObject



11
12
13
# File 'lib/vsm/tool/descriptor.rb', line 11

def to_gemini_tool
  { name:, description:, parameters: schema }
end

#to_openai_toolObject



5
6
7
# File 'lib/vsm/tool/descriptor.rb', line 5

def to_openai_tool
  { type: "function", function: { name:, description:, parameters: schema } }
end