vellum_ai 0.3.14 → 0.3.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d99892d0551b12dcf9e18e9295d823fbdc0d1a6cf84add280b3da3b3f0f2d678
4
- data.tar.gz: af80f8f4a8b4b9f8da111c7f168761fdc0f1511757071ec3af7add486928c558
3
+ metadata.gz: a970fdb10e4f35641ae4aaa7e91c765be7e3523cfe80a8bace81af9c6b84198f
4
+ data.tar.gz: 51b57947c1b7de1f73a2461471a77d4b36591d050c99559d8af47a43adcc754f
5
5
  SHA512:
6
- metadata.gz: 5444655049a055eb486408d515ecb0591fa705e9ba560f44705fe942d7accf4474935be8160410c88e5d6219f2af1983836c28d922f89107460236c1b9ec05b5
7
- data.tar.gz: 455b6e301766db7a53a8c2e1018f446111213d244cc91d325782ec04ef12bcf94a0bf8a93d6c3c571f88385154ebd6e0dfc43735292a7136c2de3a7b5cf7b038
6
+ metadata.gz: d826047198ef37f76d6e3c50d47bb61a5f86432c7b694d61f7996f86c71d534cca4d89fb9c8f3f53ec3b5768ddbaf993a398bee14ddbb3b5faeb2511e06e265e
7
+ data.tar.gz: f2e91c79ae3f97a0f82889882549d0701d03549455a9f3b1d2a49745742067bf756350137f2967a20e692b7bd26c155cc14fa267350757adf532c5210ca54f6d
data/lib/requests.rb CHANGED
@@ -20,7 +20,7 @@ module Vellum
20
20
  @headers = {
21
21
  "X-Fern-Language": "Ruby",
22
22
  "X-Fern-SDK-Name": "Vellum",
23
- "X-Fern-SDK-Version": "0.3.14",
23
+ "X-Fern-SDK-Version": "0.3.15",
24
24
  "X_API_KEY": api_key.to_s
25
25
  }
26
26
  @conn = Faraday.new(headers: @headers) do |faraday|
@@ -46,7 +46,7 @@ module Vellum
46
46
  @headers = {
47
47
  "X-Fern-Language": "Ruby",
48
48
  "X-Fern-SDK-Name": "Vellum",
49
- "X-Fern-SDK-Version": "0.3.14",
49
+ "X-Fern-SDK-Version": "0.3.15",
50
50
  "X_API_KEY": api_key.to_s
51
51
  }
52
52
  @conn = Faraday.new(headers: @headers) do |faraday|
data/lib/types_export.rb CHANGED
@@ -20,8 +20,10 @@ require_relative "vellum_ai/types/chat_message_content"
20
20
  require_relative "vellum_ai/types/chat_message_content_request"
21
21
  require_relative "vellum_ai/types/chat_message_request"
22
22
  require_relative "vellum_ai/types/chat_message_role"
23
+ require_relative "vellum_ai/types/code_execution_node_array_result"
23
24
  require_relative "vellum_ai/types/code_execution_node_chat_history_result"
24
25
  require_relative "vellum_ai/types/code_execution_node_error_result"
26
+ require_relative "vellum_ai/types/code_execution_node_function_call_result"
25
27
  require_relative "vellum_ai/types/code_execution_node_json_result"
26
28
  require_relative "vellum_ai/types/code_execution_node_number_result"
27
29
  require_relative "vellum_ai/types/code_execution_node_result"
@@ -116,6 +118,7 @@ require_relative "vellum_ai/types/named_test_case_variable_value_request"
116
118
  require_relative "vellum_ai/types/node_input_compiled_array_value"
117
119
  require_relative "vellum_ai/types/node_input_compiled_chat_history_value"
118
120
  require_relative "vellum_ai/types/node_input_compiled_error_value"
121
+ require_relative "vellum_ai/types/node_input_compiled_function_call"
119
122
  require_relative "vellum_ai/types/node_input_compiled_json_value"
120
123
  require_relative "vellum_ai/types/node_input_compiled_number_value"
121
124
  require_relative "vellum_ai/types/node_input_compiled_search_results_value"
@@ -207,8 +210,10 @@ require_relative "vellum_ai/types/submit_completion_actuals_error_response"
207
210
  require_relative "vellum_ai/types/submit_workflow_execution_actual_request"
208
211
  require_relative "vellum_ai/types/subworkflow_enum"
209
212
  require_relative "vellum_ai/types/subworkflow_node_result"
213
+ require_relative "vellum_ai/types/templating_node_array_result"
210
214
  require_relative "vellum_ai/types/templating_node_chat_history_result"
211
215
  require_relative "vellum_ai/types/templating_node_error_result"
216
+ require_relative "vellum_ai/types/templating_node_function_call_result"
212
217
  require_relative "vellum_ai/types/templating_node_json_result"
213
218
  require_relative "vellum_ai/types/templating_node_number_result"
214
219
  require_relative "vellum_ai/types/templating_node_result"
@@ -23,7 +23,7 @@ module Vellum
23
23
  # @param exec_config [Hash] Configuration that defines how the Test Suite should be runRequest of type TestSuiteRunExecConfigRequest, as a Hash
24
24
  # @param request_options [RequestOptions]
25
25
  # @return [TestSuiteRunRead]
26
- def create(exec_config:, test_suite_id: nil, request_options: nil)
26
+ def create(test_suite_id:, exec_config:, request_options: nil)
27
27
  response = @request_client.conn.post do |req|
28
28
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
29
29
  req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
@@ -58,7 +58,7 @@ module Vellum
58
58
  # @param offset [Integer] The initial index from which to return the results.
59
59
  # @param request_options [RequestOptions]
60
60
  # @return [PaginatedTestSuiteRunExecutionList]
61
- def list_test_suite_run_executions(id:, limit: nil, offset: nil, request_options: nil)
61
+ def list_executions(id:, limit: nil, offset: nil, request_options: nil)
62
62
  response = @request_client.conn.get do |req|
63
63
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
64
64
  req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
@@ -90,7 +90,7 @@ module Vellum
90
90
  # @param exec_config [Hash] Configuration that defines how the Test Suite should be runRequest of type TestSuiteRunExecConfigRequest, as a Hash
91
91
  # @param request_options [RequestOptions]
92
92
  # @return [TestSuiteRunRead]
93
- def create(exec_config:, test_suite_id: nil, request_options: nil)
93
+ def create(test_suite_id:, exec_config:, request_options: nil)
94
94
  Async do
95
95
  response = @request_client.conn.post do |req|
96
96
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -129,7 +129,7 @@ module Vellum
129
129
  # @param offset [Integer] The initial index from which to return the results.
130
130
  # @param request_options [RequestOptions]
131
131
  # @return [PaginatedTestSuiteRunExecutionList]
132
- def list_test_suite_run_executions(id:, limit: nil, offset: nil, request_options: nil)
132
+ def list_executions(id:, limit: nil, offset: nil, request_options: nil)
133
133
  Async do
134
134
  response = @request_client.conn.get do |req|
135
135
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "array_variable_value_item"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class CodeExecutionNodeArrayResult
8
+ attr_reader :id, :value, :additional_properties
9
+
10
+ # @param id [String]
11
+ # @param value [Array<ArrayVariableValueItem>]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [CodeExecutionNodeArrayResult]
14
+ def initialize(id:, value: nil, additional_properties: nil)
15
+ # @type [String]
16
+ @id = id
17
+ # @type [Array<ArrayVariableValueItem>]
18
+ @value = value
19
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
20
+ @additional_properties = additional_properties
21
+ end
22
+
23
+ # Deserialize a JSON object to an instance of CodeExecutionNodeArrayResult
24
+ #
25
+ # @param json_object [JSON]
26
+ # @return [CodeExecutionNodeArrayResult]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ parsed_json = JSON.parse(json_object)
30
+ id = struct.id
31
+ value = parsed_json["value"].map do |v|
32
+ v = v.to_json
33
+ ArrayVariableValueItem.from_json(json_object: v)
34
+ end
35
+ new(id: id, value: value, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of CodeExecutionNodeArrayResult to a JSON object
39
+ #
40
+ # @return [JSON]
41
+ def to_json(*_args)
42
+ { "id": @id, "value": @value }.to_json
43
+ end
44
+
45
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
46
+ #
47
+ # @param obj [Object]
48
+ # @return [Void]
49
+ def self.validate_raw(obj:)
50
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
51
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "function_call"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class CodeExecutionNodeFunctionCallResult
8
+ attr_reader :id, :value, :additional_properties
9
+
10
+ # @param id [String]
11
+ # @param value [FunctionCall]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [CodeExecutionNodeFunctionCallResult]
14
+ def initialize(id:, value: nil, additional_properties: nil)
15
+ # @type [String]
16
+ @id = id
17
+ # @type [FunctionCall]
18
+ @value = value
19
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
20
+ @additional_properties = additional_properties
21
+ end
22
+
23
+ # Deserialize a JSON object to an instance of CodeExecutionNodeFunctionCallResult
24
+ #
25
+ # @param json_object [JSON]
26
+ # @return [CodeExecutionNodeFunctionCallResult]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ parsed_json = JSON.parse(json_object)
30
+ id = struct.id
31
+ if parsed_json["value"].nil?
32
+ value = nil
33
+ else
34
+ value = parsed_json["value"].to_json
35
+ value = FunctionCall.from_json(json_object: value)
36
+ end
37
+ new(id: id, value: value, additional_properties: struct)
38
+ end
39
+
40
+ # Serialize an instance of CodeExecutionNodeFunctionCallResult to a JSON object
41
+ #
42
+ # @return [JSON]
43
+ def to_json(*_args)
44
+ { "id": @id, "value": @value }.to_json
45
+ end
46
+
47
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
48
+ #
49
+ # @param obj [Object]
50
+ # @return [Void]
51
+ def self.validate_raw(obj:)
52
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
53
+ obj.value.nil? || FunctionCall.validate_raw(obj: obj.value)
54
+ end
55
+ end
56
+ end
@@ -7,6 +7,8 @@ require_relative "code_execution_node_json_result"
7
7
  require_relative "code_execution_node_chat_history_result"
8
8
  require_relative "code_execution_node_search_results_result"
9
9
  require_relative "code_execution_node_error_result"
10
+ require_relative "code_execution_node_array_result"
11
+ require_relative "code_execution_node_function_call_result"
10
12
 
11
13
  module Vellum
12
14
  class CodeExecutionNodeResultOutput
@@ -43,6 +45,10 @@ module Vellum
43
45
  CodeExecutionNodeSearchResultsResult.from_json(json_object: json_object)
44
46
  when "ERROR"
45
47
  CodeExecutionNodeErrorResult.from_json(json_object: json_object)
48
+ when "ARRAY"
49
+ CodeExecutionNodeArrayResult.from_json(json_object: json_object)
50
+ when "FUNCTION_CALL"
51
+ CodeExecutionNodeFunctionCallResult.from_json(json_object: json_object)
46
52
  else
47
53
  CodeExecutionNodeStringResult.from_json(json_object: json_object)
48
54
  end
@@ -66,6 +72,10 @@ module Vellum
66
72
  { **@member.to_json, type: @discriminant }.to_json
67
73
  when "ERROR"
68
74
  { **@member.to_json, type: @discriminant }.to_json
75
+ when "ARRAY"
76
+ { **@member.to_json, type: @discriminant }.to_json
77
+ when "FUNCTION_CALL"
78
+ { **@member.to_json, type: @discriminant }.to_json
69
79
  else
70
80
  { "type": @discriminant, value: @member }.to_json
71
81
  end
@@ -90,6 +100,10 @@ module Vellum
90
100
  CodeExecutionNodeSearchResultsResult.validate_raw(obj: obj)
91
101
  when "ERROR"
92
102
  CodeExecutionNodeErrorResult.validate_raw(obj: obj)
103
+ when "ARRAY"
104
+ CodeExecutionNodeArrayResult.validate_raw(obj: obj)
105
+ when "FUNCTION_CALL"
106
+ CodeExecutionNodeFunctionCallResult.validate_raw(obj: obj)
93
107
  else
94
108
  raise("Passed value matched no type within the union, validation failed.")
95
109
  end
@@ -138,5 +152,17 @@ module Vellum
138
152
  def self.error(member:)
139
153
  new(member: member, discriminant: "ERROR")
140
154
  end
155
+
156
+ # @param member [CodeExecutionNodeArrayResult]
157
+ # @return [CodeExecutionNodeResultOutput]
158
+ def self.array(member:)
159
+ new(member: member, discriminant: "ARRAY")
160
+ end
161
+
162
+ # @param member [CodeExecutionNodeFunctionCallResult]
163
+ # @return [CodeExecutionNodeResultOutput]
164
+ def self.function_call(member:)
165
+ new(member: member, discriminant: "FUNCTION_CALL")
166
+ end
141
167
  end
142
168
  end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "function_call"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NodeInputCompiledFunctionCall
8
+ attr_reader :node_input_id, :key, :value, :additional_properties
9
+
10
+ # @param node_input_id [String]
11
+ # @param key [String]
12
+ # @param value [FunctionCall]
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [NodeInputCompiledFunctionCall]
15
+ def initialize(node_input_id:, key:, value: nil, additional_properties: nil)
16
+ # @type [String]
17
+ @node_input_id = node_input_id
18
+ # @type [String]
19
+ @key = key
20
+ # @type [FunctionCall]
21
+ @value = value
22
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
23
+ @additional_properties = additional_properties
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of NodeInputCompiledFunctionCall
27
+ #
28
+ # @param json_object [JSON]
29
+ # @return [NodeInputCompiledFunctionCall]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ parsed_json = JSON.parse(json_object)
33
+ node_input_id = struct.node_input_id
34
+ key = struct.key
35
+ if parsed_json["value"].nil?
36
+ value = nil
37
+ else
38
+ value = parsed_json["value"].to_json
39
+ value = FunctionCall.from_json(json_object: value)
40
+ end
41
+ new(node_input_id: node_input_id, key: key, value: value, additional_properties: struct)
42
+ end
43
+
44
+ # Serialize an instance of NodeInputCompiledFunctionCall to a JSON object
45
+ #
46
+ # @return [JSON]
47
+ def to_json(*_args)
48
+ { "node_input_id": @node_input_id, "key": @key, "value": @value }.to_json
49
+ end
50
+
51
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
52
+ #
53
+ # @param obj [Object]
54
+ # @return [Void]
55
+ def self.validate_raw(obj:)
56
+ obj.node_input_id.is_a?(String) != false || raise("Passed value for field obj.node_input_id is not the expected type, validation failed.")
57
+ obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
58
+ obj.value.nil? || FunctionCall.validate_raw(obj: obj.value)
59
+ end
60
+ end
61
+ end
@@ -8,6 +8,7 @@ require_relative "node_input_compiled_chat_history_value"
8
8
  require_relative "node_input_compiled_search_results_value"
9
9
  require_relative "node_input_compiled_error_value"
10
10
  require_relative "node_input_compiled_array_value"
11
+ require_relative "node_input_compiled_function_call"
11
12
 
12
13
  module Vellum
13
14
  class NodeInputVariableCompiledValue
@@ -46,6 +47,8 @@ module Vellum
46
47
  NodeInputCompiledErrorValue.from_json(json_object: json_object)
47
48
  when "ARRAY"
48
49
  NodeInputCompiledArrayValue.from_json(json_object: json_object)
50
+ when "FUNCTION_CALL"
51
+ NodeInputCompiledFunctionCall.from_json(json_object: json_object)
49
52
  else
50
53
  NodeInputCompiledStringValue.from_json(json_object: json_object)
51
54
  end
@@ -71,6 +74,8 @@ module Vellum
71
74
  { **@member.to_json, type: @discriminant }.to_json
72
75
  when "ARRAY"
73
76
  { **@member.to_json, type: @discriminant }.to_json
77
+ when "FUNCTION_CALL"
78
+ { **@member.to_json, type: @discriminant }.to_json
74
79
  else
75
80
  { "type": @discriminant, value: @member }.to_json
76
81
  end
@@ -97,6 +102,8 @@ module Vellum
97
102
  NodeInputCompiledErrorValue.validate_raw(obj: obj)
98
103
  when "ARRAY"
99
104
  NodeInputCompiledArrayValue.validate_raw(obj: obj)
105
+ when "FUNCTION_CALL"
106
+ NodeInputCompiledFunctionCall.validate_raw(obj: obj)
100
107
  else
101
108
  raise("Passed value matched no type within the union, validation failed.")
102
109
  end
@@ -151,5 +158,11 @@ module Vellum
151
158
  def self.array(member:)
152
159
  new(member: member, discriminant: "ARRAY")
153
160
  end
161
+
162
+ # @param member [NodeInputCompiledFunctionCall]
163
+ # @return [NodeInputVariableCompiledValue]
164
+ def self.function_call(member:)
165
+ new(member: member, discriminant: "FUNCTION_CALL")
166
+ end
154
167
  end
155
168
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param results [Array<TestSuiteRunExecution>]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [PaginatedTestSuiteRunExecutionList]
16
- def initialize(count: nil, next_: nil, previous: nil, results: nil, additional_properties: nil)
16
+ def initialize(count:, results:, next_: nil, previous: nil, additional_properties: nil)
17
17
  # @type [Integer]
18
18
  @count = count
19
19
  # @type [String]
@@ -55,10 +55,10 @@ module Vellum
55
55
  # @param obj [Object]
56
56
  # @return [Void]
57
57
  def self.validate_raw(obj:)
58
- obj.count&.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
58
+ obj.count.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
59
59
  obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
60
60
  obj.previous&.is_a?(String) != false || raise("Passed value for field obj.previous is not the expected type, validation failed.")
61
- obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
61
+ obj.results.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
62
62
  end
63
63
  end
64
64
  end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "array_variable_value_item"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class TemplatingNodeArrayResult
8
+ attr_reader :id, :value, :additional_properties
9
+
10
+ # @param id [String]
11
+ # @param value [Array<ArrayVariableValueItem>]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [TemplatingNodeArrayResult]
14
+ def initialize(id:, value: nil, additional_properties: nil)
15
+ # @type [String]
16
+ @id = id
17
+ # @type [Array<ArrayVariableValueItem>]
18
+ @value = value
19
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
20
+ @additional_properties = additional_properties
21
+ end
22
+
23
+ # Deserialize a JSON object to an instance of TemplatingNodeArrayResult
24
+ #
25
+ # @param json_object [JSON]
26
+ # @return [TemplatingNodeArrayResult]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ parsed_json = JSON.parse(json_object)
30
+ id = struct.id
31
+ value = parsed_json["value"].map do |v|
32
+ v = v.to_json
33
+ ArrayVariableValueItem.from_json(json_object: v)
34
+ end
35
+ new(id: id, value: value, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of TemplatingNodeArrayResult to a JSON object
39
+ #
40
+ # @return [JSON]
41
+ def to_json(*_args)
42
+ { "id": @id, "value": @value }.to_json
43
+ end
44
+
45
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
46
+ #
47
+ # @param obj [Object]
48
+ # @return [Void]
49
+ def self.validate_raw(obj:)
50
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
51
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "function_call"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class TemplatingNodeFunctionCallResult
8
+ attr_reader :id, :value, :additional_properties
9
+
10
+ # @param id [String]
11
+ # @param value [FunctionCall]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [TemplatingNodeFunctionCallResult]
14
+ def initialize(id:, value: nil, additional_properties: nil)
15
+ # @type [String]
16
+ @id = id
17
+ # @type [FunctionCall]
18
+ @value = value
19
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
20
+ @additional_properties = additional_properties
21
+ end
22
+
23
+ # Deserialize a JSON object to an instance of TemplatingNodeFunctionCallResult
24
+ #
25
+ # @param json_object [JSON]
26
+ # @return [TemplatingNodeFunctionCallResult]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ parsed_json = JSON.parse(json_object)
30
+ id = struct.id
31
+ if parsed_json["value"].nil?
32
+ value = nil
33
+ else
34
+ value = parsed_json["value"].to_json
35
+ value = FunctionCall.from_json(json_object: value)
36
+ end
37
+ new(id: id, value: value, additional_properties: struct)
38
+ end
39
+
40
+ # Serialize an instance of TemplatingNodeFunctionCallResult to a JSON object
41
+ #
42
+ # @return [JSON]
43
+ def to_json(*_args)
44
+ { "id": @id, "value": @value }.to_json
45
+ end
46
+
47
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
48
+ #
49
+ # @param obj [Object]
50
+ # @return [Void]
51
+ def self.validate_raw(obj:)
52
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
53
+ obj.value.nil? || FunctionCall.validate_raw(obj: obj.value)
54
+ end
55
+ end
56
+ end
@@ -7,6 +7,8 @@ require_relative "templating_node_json_result"
7
7
  require_relative "templating_node_chat_history_result"
8
8
  require_relative "templating_node_search_results_result"
9
9
  require_relative "templating_node_error_result"
10
+ require_relative "templating_node_array_result"
11
+ require_relative "templating_node_function_call_result"
10
12
 
11
13
  module Vellum
12
14
  class TemplatingNodeResultOutput
@@ -43,6 +45,10 @@ module Vellum
43
45
  TemplatingNodeSearchResultsResult.from_json(json_object: json_object)
44
46
  when "ERROR"
45
47
  TemplatingNodeErrorResult.from_json(json_object: json_object)
48
+ when "ARRAY"
49
+ TemplatingNodeArrayResult.from_json(json_object: json_object)
50
+ when "FUNCTION_CALL"
51
+ TemplatingNodeFunctionCallResult.from_json(json_object: json_object)
46
52
  else
47
53
  TemplatingNodeStringResult.from_json(json_object: json_object)
48
54
  end
@@ -66,6 +72,10 @@ module Vellum
66
72
  { **@member.to_json, type: @discriminant }.to_json
67
73
  when "ERROR"
68
74
  { **@member.to_json, type: @discriminant }.to_json
75
+ when "ARRAY"
76
+ { **@member.to_json, type: @discriminant }.to_json
77
+ when "FUNCTION_CALL"
78
+ { **@member.to_json, type: @discriminant }.to_json
69
79
  else
70
80
  { "type": @discriminant, value: @member }.to_json
71
81
  end
@@ -90,6 +100,10 @@ module Vellum
90
100
  TemplatingNodeSearchResultsResult.validate_raw(obj: obj)
91
101
  when "ERROR"
92
102
  TemplatingNodeErrorResult.validate_raw(obj: obj)
103
+ when "ARRAY"
104
+ TemplatingNodeArrayResult.validate_raw(obj: obj)
105
+ when "FUNCTION_CALL"
106
+ TemplatingNodeFunctionCallResult.validate_raw(obj: obj)
93
107
  else
94
108
  raise("Passed value matched no type within the union, validation failed.")
95
109
  end
@@ -138,5 +152,17 @@ module Vellum
138
152
  def self.error(member:)
139
153
  new(member: member, discriminant: "ERROR")
140
154
  end
155
+
156
+ # @param member [TemplatingNodeArrayResult]
157
+ # @return [TemplatingNodeResultOutput]
158
+ def self.array(member:)
159
+ new(member: member, discriminant: "ARRAY")
160
+ end
161
+
162
+ # @param member [TemplatingNodeFunctionCallResult]
163
+ # @return [TemplatingNodeResultOutput]
164
+ def self.function_call(member:)
165
+ new(member: member, discriminant: "FUNCTION_CALL")
166
+ end
141
167
  end
142
168
  end
@@ -22,7 +22,7 @@ module Vellum
22
22
  # @param exec_config [TestSuiteRunExecConfig] Configuration that defines how the Test Suite should be run
23
23
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
24
24
  # @return [TestSuiteRunRead]
25
- def initialize(id:, created:, test_suite:, state: nil, exec_config: nil, additional_properties: nil)
25
+ def initialize(id:, created:, test_suite:, state:, exec_config: nil, additional_properties: nil)
26
26
  # @type [String]
27
27
  @id = id
28
28
  # @type [DateTime]
@@ -89,7 +89,7 @@ module Vellum
89
89
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
90
90
  obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
91
91
  TestSuiteRunTestSuite.validate_raw(obj: obj.test_suite)
92
- obj.state&.is_a?(TEST_SUITE_RUN_STATE) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
92
+ obj.state.is_a?(TEST_SUITE_RUN_STATE) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
93
93
  obj.exec_config.nil? || TestSuiteRunExecConfig.validate_raw(obj: obj.exec_config)
94
94
  end
95
95
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vellum_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vellum
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-03 00:00:00.000000000 Z
11
+ date: 2024-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http-faraday
@@ -120,8 +120,10 @@ files:
120
120
  - lib/vellum_ai/types/chat_message_content_request.rb
121
121
  - lib/vellum_ai/types/chat_message_request.rb
122
122
  - lib/vellum_ai/types/chat_message_role.rb
123
+ - lib/vellum_ai/types/code_execution_node_array_result.rb
123
124
  - lib/vellum_ai/types/code_execution_node_chat_history_result.rb
124
125
  - lib/vellum_ai/types/code_execution_node_error_result.rb
126
+ - lib/vellum_ai/types/code_execution_node_function_call_result.rb
125
127
  - lib/vellum_ai/types/code_execution_node_json_result.rb
126
128
  - lib/vellum_ai/types/code_execution_node_number_result.rb
127
129
  - lib/vellum_ai/types/code_execution_node_result.rb
@@ -216,6 +218,7 @@ files:
216
218
  - lib/vellum_ai/types/node_input_compiled_array_value.rb
217
219
  - lib/vellum_ai/types/node_input_compiled_chat_history_value.rb
218
220
  - lib/vellum_ai/types/node_input_compiled_error_value.rb
221
+ - lib/vellum_ai/types/node_input_compiled_function_call.rb
219
222
  - lib/vellum_ai/types/node_input_compiled_json_value.rb
220
223
  - lib/vellum_ai/types/node_input_compiled_number_value.rb
221
224
  - lib/vellum_ai/types/node_input_compiled_search_results_value.rb
@@ -307,8 +310,10 @@ files:
307
310
  - lib/vellum_ai/types/submit_workflow_execution_actual_request.rb
308
311
  - lib/vellum_ai/types/subworkflow_enum.rb
309
312
  - lib/vellum_ai/types/subworkflow_node_result.rb
313
+ - lib/vellum_ai/types/templating_node_array_result.rb
310
314
  - lib/vellum_ai/types/templating_node_chat_history_result.rb
311
315
  - lib/vellum_ai/types/templating_node_error_result.rb
316
+ - lib/vellum_ai/types/templating_node_function_call_result.rb
312
317
  - lib/vellum_ai/types/templating_node_json_result.rb
313
318
  - lib/vellum_ai/types/templating_node_number_result.rb
314
319
  - lib/vellum_ai/types/templating_node_result.rb