vellum_ai 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +24 -0
  4. data/lib/vellum_ai/types/audio_input.rb +75 -0
  5. data/lib/vellum_ai/types/code_executor_input.rb +64 -0
  6. data/lib/vellum_ai/types/document_input.rb +75 -0
  7. data/lib/vellum_ai/types/image_input.rb +75 -0
  8. data/lib/vellum_ai/types/named_scenario_input_audio_variable_value_request.rb +76 -0
  9. data/lib/vellum_ai/types/named_scenario_input_document_variable_value_request.rb +76 -0
  10. data/lib/vellum_ai/types/named_scenario_input_image_variable_value_request.rb +76 -0
  11. data/lib/vellum_ai/types/named_scenario_input_request.rb +64 -0
  12. data/lib/vellum_ai/types/named_scenario_input_video_variable_value_request.rb +76 -0
  13. data/lib/vellum_ai/types/named_test_case_audio_variable_value.rb +75 -0
  14. data/lib/vellum_ai/types/named_test_case_audio_variable_value_request.rb +76 -0
  15. data/lib/vellum_ai/types/named_test_case_document_variable_value.rb +74 -0
  16. data/lib/vellum_ai/types/named_test_case_document_variable_value_request.rb +76 -0
  17. data/lib/vellum_ai/types/named_test_case_image_variable_value.rb +74 -0
  18. data/lib/vellum_ai/types/named_test_case_image_variable_value_request.rb +75 -0
  19. data/lib/vellum_ai/types/named_test_case_variable_value.rb +64 -0
  20. data/lib/vellum_ai/types/named_test_case_variable_value_request.rb +64 -0
  21. data/lib/vellum_ai/types/named_test_case_video_variable_value.rb +74 -0
  22. data/lib/vellum_ai/types/named_test_case_video_variable_value_request.rb +75 -0
  23. data/lib/vellum_ai/types/node_execution_span_attributes.rb +11 -2
  24. data/lib/vellum_ai/types/scenario_input.rb +64 -0
  25. data/lib/vellum_ai/types/scenario_input_audio_variable_value.rb +74 -0
  26. data/lib/vellum_ai/types/scenario_input_document_variable_value.rb +74 -0
  27. data/lib/vellum_ai/types/scenario_input_image_variable_value.rb +74 -0
  28. data/lib/vellum_ai/types/scenario_input_video_variable_value.rb +74 -0
  29. data/lib/vellum_ai/types/span_link.rb +3 -3
  30. data/lib/vellum_ai/types/span_link_type_enum.rb +10 -1
  31. data/lib/vellum_ai/types/test_case_audio_variable_value.rb +84 -0
  32. data/lib/vellum_ai/types/test_case_document_variable_value.rb +84 -0
  33. data/lib/vellum_ai/types/test_case_image_variable_value.rb +84 -0
  34. data/lib/vellum_ai/types/test_case_variable_value.rb +64 -0
  35. data/lib/vellum_ai/types/test_case_video_variable_value.rb +84 -0
  36. data/lib/vellum_ai/types/video_input.rb +75 -0
  37. data/lib/vellum_ai/types/workflow_push_deployment_config_request.rb +9 -2
  38. data/lib/vellum_ai/workflows/client.rb +12 -4
  39. metadata +26 -2
@@ -8,6 +8,10 @@ require_relative "named_test_case_search_results_variable_value_request"
8
8
  require_relative "named_test_case_error_variable_value_request"
9
9
  require_relative "named_test_case_function_call_variable_value_request"
10
10
  require_relative "named_test_case_array_variable_value_request"
11
+ require_relative "named_test_case_audio_variable_value_request"
12
+ require_relative "named_test_case_video_variable_value_request"
13
+ require_relative "named_test_case_image_variable_value_request"
14
+ require_relative "named_test_case_document_variable_value_request"
11
15
 
12
16
  module Vellum
13
17
  class NamedTestCaseVariableValueRequest
@@ -95,6 +99,46 @@ end
95
99
  return Vellum::NamedTestCaseArrayVariableValueRequest.from_json(json_object: struct)
96
100
  else
97
101
  return nil
102
+ end
103
+ rescue StandardError
104
+ # noop
105
+ end
106
+ begin
107
+ Vellum::NamedTestCaseAudioVariableValueRequest.validate_raw(obj: struct)
108
+ unless struct.nil?
109
+ return Vellum::NamedTestCaseAudioVariableValueRequest.from_json(json_object: struct)
110
+ else
111
+ return nil
112
+ end
113
+ rescue StandardError
114
+ # noop
115
+ end
116
+ begin
117
+ Vellum::NamedTestCaseVideoVariableValueRequest.validate_raw(obj: struct)
118
+ unless struct.nil?
119
+ return Vellum::NamedTestCaseVideoVariableValueRequest.from_json(json_object: struct)
120
+ else
121
+ return nil
122
+ end
123
+ rescue StandardError
124
+ # noop
125
+ end
126
+ begin
127
+ Vellum::NamedTestCaseImageVariableValueRequest.validate_raw(obj: struct)
128
+ unless struct.nil?
129
+ return Vellum::NamedTestCaseImageVariableValueRequest.from_json(json_object: struct)
130
+ else
131
+ return nil
132
+ end
133
+ rescue StandardError
134
+ # noop
135
+ end
136
+ begin
137
+ Vellum::NamedTestCaseDocumentVariableValueRequest.validate_raw(obj: struct)
138
+ unless struct.nil?
139
+ return Vellum::NamedTestCaseDocumentVariableValueRequest.from_json(json_object: struct)
140
+ else
141
+ return nil
98
142
  end
99
143
  rescue StandardError
100
144
  # noop
@@ -148,6 +192,26 @@ end
148
192
  rescue StandardError
149
193
  # noop
150
194
  end
195
+ begin
196
+ return Vellum::NamedTestCaseAudioVariableValueRequest.validate_raw(obj: obj)
197
+ rescue StandardError
198
+ # noop
199
+ end
200
+ begin
201
+ return Vellum::NamedTestCaseVideoVariableValueRequest.validate_raw(obj: obj)
202
+ rescue StandardError
203
+ # noop
204
+ end
205
+ begin
206
+ return Vellum::NamedTestCaseImageVariableValueRequest.validate_raw(obj: obj)
207
+ rescue StandardError
208
+ # noop
209
+ end
210
+ begin
211
+ return Vellum::NamedTestCaseDocumentVariableValueRequest.validate_raw(obj: obj)
212
+ rescue StandardError
213
+ # noop
214
+ end
151
215
  raise("Passed value matched no type within the union, validation failed.")
152
216
  end
153
217
  end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_video"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NamedTestCaseVideoVariableValue
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumVideo]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumVideo]
24
+ # @param name [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::NamedTestCaseVideoVariableValue]
27
+ def initialize(type:, value:, name:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @name = name
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "name": name }
33
+ end
34
+ # Deserialize a JSON object to an instance of NamedTestCaseVideoVariableValue
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Vellum::NamedTestCaseVideoVariableValue]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ type = parsed_json["type"]
42
+ unless parsed_json["value"].nil?
43
+ value = parsed_json["value"].to_json
44
+ value = Vellum::VellumVideo.from_json(json_object: value)
45
+ else
46
+ value = nil
47
+ end
48
+ name = parsed_json["name"]
49
+ new(
50
+ type: type,
51
+ value: value,
52
+ name: name,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+ # Serialize an instance of NamedTestCaseVideoVariableValue to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json
60
+ @_field_set&.to_json
61
+ end
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
70
+ Vellum::VellumVideo.validate_raw(obj: obj.value)
71
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_video_request"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NamedTestCaseVideoVariableValueRequest
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumVideoRequest]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumVideoRequest]
24
+ # @param name [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::NamedTestCaseVideoVariableValueRequest]
27
+ def initialize(type:, value:, name:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @name = name
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "name": name }
33
+ end
34
+ # Deserialize a JSON object to an instance of
35
+ # NamedTestCaseVideoVariableValueRequest
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vellum::NamedTestCaseVideoVariableValueRequest]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ type = parsed_json["type"]
43
+ unless parsed_json["value"].nil?
44
+ value = parsed_json["value"].to_json
45
+ value = Vellum::VellumVideoRequest.from_json(json_object: value)
46
+ else
47
+ value = nil
48
+ end
49
+ name = parsed_json["name"]
50
+ new(
51
+ type: type,
52
+ value: value,
53
+ name: name,
54
+ additional_properties: struct
55
+ )
56
+ end
57
+ # Serialize an instance of NamedTestCaseVideoVariableValueRequest to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json
61
+ @_field_set&.to_json
62
+ end
63
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
64
+ # hash and check each fields type against the current object's property
65
+ # definitions.
66
+ #
67
+ # @param obj [Object]
68
+ # @return [Void]
69
+ def self.validate_raw(obj:)
70
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
71
+ Vellum::VellumVideoRequest.validate_raw(obj: obj.value)
72
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
73
+ end
74
+ end
75
+ end
@@ -6,6 +6,8 @@ module Vellum
6
6
  class NodeExecutionSpanAttributes
7
7
  # @return [String]
8
8
  attr_reader :label
9
+ # @return [String]
10
+ attr_reader :filepath
9
11
  # @return [String]
10
12
  attr_reader :node_id
11
13
  # @return [OpenStruct] Additional properties unmapped to the current class definition
@@ -17,14 +19,18 @@ module Vellum
17
19
  OMIT = Object.new
18
20
 
19
21
  # @param label [String]
22
+ # @param filepath [String]
20
23
  # @param node_id [String]
21
24
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
22
25
  # @return [Vellum::NodeExecutionSpanAttributes]
23
- def initialize(label:, node_id:, additional_properties: nil)
26
+ def initialize(label:, filepath: OMIT, node_id:, additional_properties: nil)
24
27
  @label = label
28
+ @filepath = filepath if filepath != OMIT
25
29
  @node_id = node_id
26
30
  @additional_properties = additional_properties
27
- @_field_set = { "label": label, "node_id": node_id }
31
+ @_field_set = { "label": label, "filepath": filepath, "node_id": node_id }.reject do | _k, v |
32
+ v == OMIT
33
+ end
28
34
  end
29
35
  # Deserialize a JSON object to an instance of NodeExecutionSpanAttributes
30
36
  #
@@ -34,9 +40,11 @@ module Vellum
34
40
  struct = JSON.parse(json_object, object_class: OpenStruct)
35
41
  parsed_json = JSON.parse(json_object)
36
42
  label = parsed_json["label"]
43
+ filepath = parsed_json["filepath"]
37
44
  node_id = parsed_json["node_id"]
38
45
  new(
39
46
  label: label,
47
+ filepath: filepath,
40
48
  node_id: node_id,
41
49
  additional_properties: struct
42
50
  )
@@ -55,6 +63,7 @@ module Vellum
55
63
  # @return [Void]
56
64
  def self.validate_raw(obj:)
57
65
  obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
66
+ obj.filepath&.is_a?(String) != false || raise("Passed value for field obj.filepath is not the expected type, validation failed.")
58
67
  obj.node_id.is_a?(String) != false || raise("Passed value for field obj.node_id is not the expected type, validation failed.")
59
68
  end
60
69
  end
@@ -3,6 +3,10 @@ require "json"
3
3
  require_relative "scenario_input_string_variable_value"
4
4
  require_relative "scenario_input_json_variable_value"
5
5
  require_relative "scenario_input_chat_history_variable_value"
6
+ require_relative "scenario_input_audio_variable_value"
7
+ require_relative "scenario_input_video_variable_value"
8
+ require_relative "scenario_input_image_variable_value"
9
+ require_relative "scenario_input_document_variable_value"
6
10
 
7
11
  module Vellum
8
12
  class ScenarioInput
@@ -40,6 +44,46 @@ end
40
44
  return Vellum::ScenarioInputChatHistoryVariableValue.from_json(json_object: struct)
41
45
  else
42
46
  return nil
47
+ end
48
+ rescue StandardError
49
+ # noop
50
+ end
51
+ begin
52
+ Vellum::ScenarioInputAudioVariableValue.validate_raw(obj: struct)
53
+ unless struct.nil?
54
+ return Vellum::ScenarioInputAudioVariableValue.from_json(json_object: struct)
55
+ else
56
+ return nil
57
+ end
58
+ rescue StandardError
59
+ # noop
60
+ end
61
+ begin
62
+ Vellum::ScenarioInputVideoVariableValue.validate_raw(obj: struct)
63
+ unless struct.nil?
64
+ return Vellum::ScenarioInputVideoVariableValue.from_json(json_object: struct)
65
+ else
66
+ return nil
67
+ end
68
+ rescue StandardError
69
+ # noop
70
+ end
71
+ begin
72
+ Vellum::ScenarioInputImageVariableValue.validate_raw(obj: struct)
73
+ unless struct.nil?
74
+ return Vellum::ScenarioInputImageVariableValue.from_json(json_object: struct)
75
+ else
76
+ return nil
77
+ end
78
+ rescue StandardError
79
+ # noop
80
+ end
81
+ begin
82
+ Vellum::ScenarioInputDocumentVariableValue.validate_raw(obj: struct)
83
+ unless struct.nil?
84
+ return Vellum::ScenarioInputDocumentVariableValue.from_json(json_object: struct)
85
+ else
86
+ return nil
43
87
  end
44
88
  rescue StandardError
45
89
  # noop
@@ -68,6 +112,26 @@ end
68
112
  rescue StandardError
69
113
  # noop
70
114
  end
115
+ begin
116
+ return Vellum::ScenarioInputAudioVariableValue.validate_raw(obj: obj)
117
+ rescue StandardError
118
+ # noop
119
+ end
120
+ begin
121
+ return Vellum::ScenarioInputVideoVariableValue.validate_raw(obj: obj)
122
+ rescue StandardError
123
+ # noop
124
+ end
125
+ begin
126
+ return Vellum::ScenarioInputImageVariableValue.validate_raw(obj: obj)
127
+ rescue StandardError
128
+ # noop
129
+ end
130
+ begin
131
+ return Vellum::ScenarioInputDocumentVariableValue.validate_raw(obj: obj)
132
+ rescue StandardError
133
+ # noop
134
+ end
71
135
  raise("Passed value matched no type within the union, validation failed.")
72
136
  end
73
137
  end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_audio"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ScenarioInputAudioVariableValue
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumAudio]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :input_variable_id
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumAudio]
24
+ # @param input_variable_id [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::ScenarioInputAudioVariableValue]
27
+ def initialize(type:, value:, input_variable_id:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @input_variable_id = input_variable_id
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "input_variable_id": input_variable_id }
33
+ end
34
+ # Deserialize a JSON object to an instance of ScenarioInputAudioVariableValue
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Vellum::ScenarioInputAudioVariableValue]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ type = parsed_json["type"]
42
+ unless parsed_json["value"].nil?
43
+ value = parsed_json["value"].to_json
44
+ value = Vellum::VellumAudio.from_json(json_object: value)
45
+ else
46
+ value = nil
47
+ end
48
+ input_variable_id = parsed_json["input_variable_id"]
49
+ new(
50
+ type: type,
51
+ value: value,
52
+ input_variable_id: input_variable_id,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+ # Serialize an instance of ScenarioInputAudioVariableValue to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json
60
+ @_field_set&.to_json
61
+ end
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
70
+ Vellum::VellumAudio.validate_raw(obj: obj.value)
71
+ obj.input_variable_id.is_a?(String) != false || raise("Passed value for field obj.input_variable_id is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_document"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ScenarioInputDocumentVariableValue
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumDocument]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :input_variable_id
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumDocument]
24
+ # @param input_variable_id [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::ScenarioInputDocumentVariableValue]
27
+ def initialize(type:, value:, input_variable_id:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @input_variable_id = input_variable_id
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "input_variable_id": input_variable_id }
33
+ end
34
+ # Deserialize a JSON object to an instance of ScenarioInputDocumentVariableValue
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Vellum::ScenarioInputDocumentVariableValue]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ type = parsed_json["type"]
42
+ unless parsed_json["value"].nil?
43
+ value = parsed_json["value"].to_json
44
+ value = Vellum::VellumDocument.from_json(json_object: value)
45
+ else
46
+ value = nil
47
+ end
48
+ input_variable_id = parsed_json["input_variable_id"]
49
+ new(
50
+ type: type,
51
+ value: value,
52
+ input_variable_id: input_variable_id,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+ # Serialize an instance of ScenarioInputDocumentVariableValue to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json
60
+ @_field_set&.to_json
61
+ end
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
70
+ Vellum::VellumDocument.validate_raw(obj: obj.value)
71
+ obj.input_variable_id.is_a?(String) != false || raise("Passed value for field obj.input_variable_id is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_image"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ScenarioInputImageVariableValue
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumImage]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :input_variable_id
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumImage]
24
+ # @param input_variable_id [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::ScenarioInputImageVariableValue]
27
+ def initialize(type:, value:, input_variable_id:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @input_variable_id = input_variable_id
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "input_variable_id": input_variable_id }
33
+ end
34
+ # Deserialize a JSON object to an instance of ScenarioInputImageVariableValue
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Vellum::ScenarioInputImageVariableValue]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ type = parsed_json["type"]
42
+ unless parsed_json["value"].nil?
43
+ value = parsed_json["value"].to_json
44
+ value = Vellum::VellumImage.from_json(json_object: value)
45
+ else
46
+ value = nil
47
+ end
48
+ input_variable_id = parsed_json["input_variable_id"]
49
+ new(
50
+ type: type,
51
+ value: value,
52
+ input_variable_id: input_variable_id,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+ # Serialize an instance of ScenarioInputImageVariableValue to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json
60
+ @_field_set&.to_json
61
+ end
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
70
+ Vellum::VellumImage.validate_raw(obj: obj.value)
71
+ obj.input_variable_id.is_a?(String) != false || raise("Passed value for field obj.input_variable_id is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_video"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ScenarioInputVideoVariableValue
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumVideo]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :input_variable_id
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumVideo]
24
+ # @param input_variable_id [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::ScenarioInputVideoVariableValue]
27
+ def initialize(type:, value:, input_variable_id:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @input_variable_id = input_variable_id
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "input_variable_id": input_variable_id }
33
+ end
34
+ # Deserialize a JSON object to an instance of ScenarioInputVideoVariableValue
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Vellum::ScenarioInputVideoVariableValue]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ type = parsed_json["type"]
42
+ unless parsed_json["value"].nil?
43
+ value = parsed_json["value"].to_json
44
+ value = Vellum::VellumVideo.from_json(json_object: value)
45
+ else
46
+ value = nil
47
+ end
48
+ input_variable_id = parsed_json["input_variable_id"]
49
+ new(
50
+ type: type,
51
+ value: value,
52
+ input_variable_id: input_variable_id,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+ # Serialize an instance of ScenarioInputVideoVariableValue to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json
60
+ @_field_set&.to_json
61
+ end
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
70
+ Vellum::VellumVideo.validate_raw(obj: obj.value)
71
+ obj.input_variable_id.is_a?(String) != false || raise("Passed value for field obj.input_variable_id is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
@@ -8,7 +8,7 @@ module Vellum
8
8
  class SpanLink
9
9
  # @return [String]
10
10
  attr_reader :trace_id
11
- # @return [Vellum::SPAN_LINK_TYPE_ENUM]
11
+ # @return [Vellum::SpanLinkTypeEnum]
12
12
  attr_reader :type
13
13
  # @return [Vellum::ParentContext]
14
14
  attr_reader :span_context
@@ -21,7 +21,7 @@ module Vellum
21
21
  OMIT = Object.new
22
22
 
23
23
  # @param trace_id [String]
24
- # @param type [Vellum::SPAN_LINK_TYPE_ENUM]
24
+ # @param type [Vellum::SpanLinkTypeEnum]
25
25
  # @param span_context [Vellum::ParentContext]
26
26
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
27
  # @return [Vellum::SpanLink]
@@ -68,7 +68,7 @@ module Vellum
68
68
  # @return [Void]
69
69
  def self.validate_raw(obj:)
70
70
  obj.trace_id.is_a?(String) != false || raise("Passed value for field obj.trace_id is not the expected type, validation failed.")
71
- obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
71
+ obj.type.is_a?(Vellum::SpanLinkTypeEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
72
72
  Vellum::ParentContext.validate_raw(obj: obj.span_context)
73
73
  end
74
74
  end