Class: Vellum::ComposioToolDefinition
- Inherits:
-
Object
- Object
- Vellum::ComposioToolDefinition
- Defined in:
- lib/vellum_ai/types/composio_tool_definition.rb
Overview
Serializer for Composio tool definition response.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #description ⇒ String readonly
- #input_parameters ⇒ Hash{String => Object} readonly
- #integration ⇒ Vellum::Integration readonly
- #label ⇒ String readonly
- #name ⇒ String readonly
- #output_parameters ⇒ Hash{String => Object} readonly
- #provider ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(provider:, integration:, name:, label:, description:, input_parameters:, output_parameters:, additional_properties: nil) ⇒ Vellum::ComposioToolDefinition constructor
- #to_json ⇒ String
Constructor Details
#initialize(provider:, integration:, name:, label:, description:, input_parameters:, output_parameters:, additional_properties: nil) ⇒ Vellum::ComposioToolDefinition
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 40 def initialize(provider:, integration:, name:, label:, description:, input_parameters:, output_parameters:, additional_properties: nil) @provider = provider @integration = integration @name = name @label = label @description = description @input_parameters = input_parameters @output_parameters = output_parameters @additional_properties = additional_properties @_field_set = { "provider": provider, "integration": integration, "name": name, "label": label, "description": description, "input_parameters": input_parameters, "output_parameters": output_parameters } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 24 def additional_properties @additional_properties end |
#description ⇒ String (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 18 def description @description end |
#input_parameters ⇒ Hash{String => Object} (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 20 def input_parameters @input_parameters end |
#integration ⇒ Vellum::Integration (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 12 def integration @integration end |
#label ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 16 def label @label end |
#name ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 14 def name @name end |
#output_parameters ⇒ Hash{String => Object} (readonly)
22 23 24 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 22 def output_parameters @output_parameters end |
#provider ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 10 def provider @provider end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::ComposioToolDefinition
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 55 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"] input_parameters = parsed_json["input_parameters"] output_parameters = parsed_json["output_parameters"] new( provider: provider, integration: integration, name: name, label: label, description: description, input_parameters: input_parameters, output_parameters: output_parameters, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
93 94 95 96 97 98 99 100 101 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 93 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.") obj.input_parameters.is_a?(Hash) != false || raise("Passed value for field obj.input_parameters is not the expected type, validation failed.") obj.output_parameters.is_a?(Hash) != false || raise("Passed value for field obj.output_parameters is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
84 85 86 |
# File 'lib/vellum_ai/types/composio_tool_definition.rb', line 84 def to_json @_field_set&.to_json end |