Class: Vellum::SlimComposioToolDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/slim_composio_tool_definition.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider:, integration:, name:, label:, description:, additional_properties: nil) ⇒ Vellum::SlimComposioToolDefinition

Parameters:

  • provider (String)
  • integration (Vellum::Integration)
  • name (String)
  • label (String)
  • description (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



33
34
35
36
37
38
39
40
41
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 33

def initialize(provider:, integration:, name:, label:, description:, additional_properties: nil)
  @provider = provider
  @integration = integration
  @name = name
  @label = label
  @description = description
  @additional_properties = additional_properties
  @_field_set = { "provider": provider, "integration": integration, "name": name, "label": label, "description": description }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



19
20
21
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 19

def additional_properties
  @additional_properties
end

#descriptionString (readonly)

Returns:

  • (String)


17
18
19
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 17

def description
  @description
end

#integrationVellum::Integration (readonly)

Returns:



11
12
13
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 11

def integration
  @integration
end

#labelString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 15

def label
  @label
end

#nameString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 13

def name
  @name
end

#providerString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 9

def provider
  @provider
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::SlimComposioToolDefinition

Parameters:

  • json_object (String)

Returns:



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 46

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  provider = parsed_json["provider"]
  unless parsed_json["integration"].nil?
    integration = parsed_json["integration"].to_json
    integration = Vellum::Integration.from_json(json_object: integration)
  else
    integration = nil
  end
  name = parsed_json["name"]
  label = parsed_json["label"]
  description = parsed_json["description"]
  new(
    provider: provider,
    integration: integration,
    name: name,
    label: label,
    description: description,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


80
81
82
83
84
85
86
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 80

def self.validate_raw(obj:)
  obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
  Vellum::Integration.validate_raw(obj: obj.integration)
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
  obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


71
72
73
# File 'lib/vellum_ai/types/slim_composio_tool_definition.rb', line 71

def to_json
  @_field_set&.to_json
end