vellum_ai 0.3.7 → 0.3.9
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.
- checksums.yaml +4 -4
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +16 -0
- data/lib/vellum_ai/deployments/client.rb +2 -2
- data/lib/vellum_ai/types/array_enum.rb +5 -0
- data/lib/vellum_ai/types/array_variable_value_item.rb +155 -0
- data/lib/vellum_ai/types/chat_history_variable_value.rb +49 -0
- data/lib/vellum_ai/types/code_execution_node_result_data.rb +9 -4
- data/lib/vellum_ai/types/node_input_compiled_array_value.rb +59 -0
- data/lib/vellum_ai/types/node_input_variable_compiled_value.rb +13 -0
- data/lib/vellum_ai/types/node_output_compiled_array_value.rb +54 -0
- data/lib/vellum_ai/types/node_output_compiled_function_value.rb +56 -0
- data/lib/vellum_ai/types/node_output_compiled_value.rb +26 -0
- data/lib/vellum_ai/types/number_variable_value.rb +45 -0
- data/lib/vellum_ai/types/prompt_node_result_data.rb +10 -4
- data/lib/vellum_ai/types/search_results_variable_value.rb +49 -0
- data/lib/vellum_ai/types/subworkflow_enum.rb +5 -0
- data/lib/vellum_ai/types/subworkflow_node_result.rb +40 -0
- data/lib/vellum_ai/types/terminal_node_array_result.rb +59 -0
- data/lib/vellum_ai/types/terminal_node_function_call_result.rb +61 -0
- data/lib/vellum_ai/types/terminal_node_result_output.rb +26 -0
- data/lib/vellum_ai/types/vellum_error_code_enum.rb +2 -1
- data/lib/vellum_ai/types/workflow_deployment_read.rb +118 -0
- data/lib/vellum_ai/types/workflow_execution_event_error_code.rb +2 -1
- data/lib/vellum_ai/types/workflow_node_result_data.rb +13 -0
- data/lib/vellum_ai/types/workflow_output.rb +13 -0
- data/lib/vellum_ai/types/workflow_output_array.rb +60 -0
- data/lib/vellum_ai/types/workflow_request_chat_history_input_request.rb +1 -0
- data/lib/vellum_ai/types/workflow_request_json_input_request.rb +1 -0
- data/lib/vellum_ai/types/workflow_request_number_input_request.rb +1 -0
- data/lib/vellum_ai/types/workflow_request_string_input_request.rb +1 -0
- data/lib/vellum_ai/types/workflow_result_event_output_data.rb +26 -0
- data/lib/vellum_ai/types/workflow_result_event_output_data_array.rb +83 -0
- data/lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb +85 -0
- data/lib/vellum_ai/workflow_deployments/client.rb +35 -6
- data/lib/vellum_ai.rb +4 -4
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72a042dfa14e5c853594fed021ab79235d7493790da8e34280f66c6f448fb1db
|
4
|
+
data.tar.gz: 25ddfca2df59cc444d7e4c63cf221f8bb3274a660253183a165c5741ed4de8b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0de23219672cbb8def515bc8fa00b31e0209b3914ca4284f103fbb21a9022d51830ff802d1b924599bbd8443ff40b7de721d9e265d1792acb8d736c58c5150e
|
7
|
+
data.tar.gz: a7cd6b831b2937bd112d934bb6d9a1d57a20594cc567296568bd3271632b29ab082c25d2b11e2fe872579f26b26e2a1c0067ae6d6f5a754f089ba0a15b0b5593
|
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.
|
23
|
+
"X-Fern-SDK-Version": "0.3.9",
|
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.
|
49
|
+
"X-Fern-SDK-Version": "0.3.9",
|
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
@@ -8,9 +8,12 @@ require_relative "vellum_ai/types/array_chat_message_content"
|
|
8
8
|
require_relative "vellum_ai/types/array_chat_message_content_item"
|
9
9
|
require_relative "vellum_ai/types/array_chat_message_content_item_request"
|
10
10
|
require_relative "vellum_ai/types/array_chat_message_content_request"
|
11
|
+
require_relative "vellum_ai/types/array_enum"
|
12
|
+
require_relative "vellum_ai/types/array_variable_value_item"
|
11
13
|
require_relative "vellum_ai/types/block_type_enum"
|
12
14
|
require_relative "vellum_ai/types/chat_history_enum"
|
13
15
|
require_relative "vellum_ai/types/chat_history_input_request"
|
16
|
+
require_relative "vellum_ai/types/chat_history_variable_value"
|
14
17
|
require_relative "vellum_ai/types/chat_message"
|
15
18
|
require_relative "vellum_ai/types/chat_message_content"
|
16
19
|
require_relative "vellum_ai/types/chat_message_content_request"
|
@@ -99,6 +102,7 @@ require_relative "vellum_ai/types/named_test_case_number_variable_value_request"
|
|
99
102
|
require_relative "vellum_ai/types/named_test_case_search_results_variable_value_request"
|
100
103
|
require_relative "vellum_ai/types/named_test_case_string_variable_value_request"
|
101
104
|
require_relative "vellum_ai/types/named_test_case_variable_value_request"
|
105
|
+
require_relative "vellum_ai/types/node_input_compiled_array_value"
|
102
106
|
require_relative "vellum_ai/types/node_input_compiled_chat_history_value"
|
103
107
|
require_relative "vellum_ai/types/node_input_compiled_error_value"
|
104
108
|
require_relative "vellum_ai/types/node_input_compiled_json_value"
|
@@ -106,8 +110,10 @@ require_relative "vellum_ai/types/node_input_compiled_number_value"
|
|
106
110
|
require_relative "vellum_ai/types/node_input_compiled_search_results_value"
|
107
111
|
require_relative "vellum_ai/types/node_input_compiled_string_value"
|
108
112
|
require_relative "vellum_ai/types/node_input_variable_compiled_value"
|
113
|
+
require_relative "vellum_ai/types/node_output_compiled_array_value"
|
109
114
|
require_relative "vellum_ai/types/node_output_compiled_chat_history_value"
|
110
115
|
require_relative "vellum_ai/types/node_output_compiled_error_value"
|
116
|
+
require_relative "vellum_ai/types/node_output_compiled_function_value"
|
111
117
|
require_relative "vellum_ai/types/node_output_compiled_json_value"
|
112
118
|
require_relative "vellum_ai/types/node_output_compiled_number_value"
|
113
119
|
require_relative "vellum_ai/types/node_output_compiled_search_results_value"
|
@@ -116,6 +122,7 @@ require_relative "vellum_ai/types/node_output_compiled_value"
|
|
116
122
|
require_relative "vellum_ai/types/normalized_log_probs"
|
117
123
|
require_relative "vellum_ai/types/normalized_token_log_probs"
|
118
124
|
require_relative "vellum_ai/types/number_enum"
|
125
|
+
require_relative "vellum_ai/types/number_variable_value"
|
119
126
|
require_relative "vellum_ai/types/paginated_slim_deployment_read_list"
|
120
127
|
require_relative "vellum_ai/types/paginated_slim_document_list"
|
121
128
|
require_relative "vellum_ai/types/paginated_slim_workflow_deployment_list"
|
@@ -168,6 +175,7 @@ require_relative "vellum_ai/types/search_result_document_request"
|
|
168
175
|
require_relative "vellum_ai/types/search_result_merging_request"
|
169
176
|
require_relative "vellum_ai/types/search_result_request"
|
170
177
|
require_relative "vellum_ai/types/search_results_enum"
|
178
|
+
require_relative "vellum_ai/types/search_results_variable_value"
|
171
179
|
require_relative "vellum_ai/types/search_weights_request"
|
172
180
|
require_relative "vellum_ai/types/slim_deployment_read"
|
173
181
|
require_relative "vellum_ai/types/slim_document"
|
@@ -184,6 +192,8 @@ require_relative "vellum_ai/types/string_variable_value"
|
|
184
192
|
require_relative "vellum_ai/types/submit_completion_actual_request"
|
185
193
|
require_relative "vellum_ai/types/submit_completion_actuals_error_response"
|
186
194
|
require_relative "vellum_ai/types/submit_workflow_execution_actual_request"
|
195
|
+
require_relative "vellum_ai/types/subworkflow_enum"
|
196
|
+
require_relative "vellum_ai/types/subworkflow_node_result"
|
187
197
|
require_relative "vellum_ai/types/templating_node_chat_history_result"
|
188
198
|
require_relative "vellum_ai/types/templating_node_error_result"
|
189
199
|
require_relative "vellum_ai/types/templating_node_json_result"
|
@@ -193,8 +203,10 @@ require_relative "vellum_ai/types/templating_node_result_data"
|
|
193
203
|
require_relative "vellum_ai/types/templating_node_result_output"
|
194
204
|
require_relative "vellum_ai/types/templating_node_search_results_result"
|
195
205
|
require_relative "vellum_ai/types/templating_node_string_result"
|
206
|
+
require_relative "vellum_ai/types/terminal_node_array_result"
|
196
207
|
require_relative "vellum_ai/types/terminal_node_chat_history_result"
|
197
208
|
require_relative "vellum_ai/types/terminal_node_error_result"
|
209
|
+
require_relative "vellum_ai/types/terminal_node_function_call_result"
|
198
210
|
require_relative "vellum_ai/types/terminal_node_json_result"
|
199
211
|
require_relative "vellum_ai/types/terminal_node_number_result"
|
200
212
|
require_relative "vellum_ai/types/terminal_node_result"
|
@@ -219,6 +231,7 @@ require_relative "vellum_ai/types/vellum_image"
|
|
219
231
|
require_relative "vellum_ai/types/vellum_image_request"
|
220
232
|
require_relative "vellum_ai/types/vellum_variable"
|
221
233
|
require_relative "vellum_ai/types/vellum_variable_type"
|
234
|
+
require_relative "vellum_ai/types/workflow_deployment_read"
|
222
235
|
require_relative "vellum_ai/types/workflow_event_error"
|
223
236
|
require_relative "vellum_ai/types/workflow_execution_actual_chat_history_request"
|
224
237
|
require_relative "vellum_ai/types/workflow_execution_actual_json_request"
|
@@ -231,6 +244,7 @@ require_relative "vellum_ai/types/workflow_node_result_data"
|
|
231
244
|
require_relative "vellum_ai/types/workflow_node_result_event"
|
232
245
|
require_relative "vellum_ai/types/workflow_node_result_event_state"
|
233
246
|
require_relative "vellum_ai/types/workflow_output"
|
247
|
+
require_relative "vellum_ai/types/workflow_output_array"
|
234
248
|
require_relative "vellum_ai/types/workflow_output_chat_history"
|
235
249
|
require_relative "vellum_ai/types/workflow_output_error"
|
236
250
|
require_relative "vellum_ai/types/workflow_output_function_call"
|
@@ -246,8 +260,10 @@ require_relative "vellum_ai/types/workflow_request_number_input_request"
|
|
246
260
|
require_relative "vellum_ai/types/workflow_request_string_input_request"
|
247
261
|
require_relative "vellum_ai/types/workflow_result_event"
|
248
262
|
require_relative "vellum_ai/types/workflow_result_event_output_data"
|
263
|
+
require_relative "vellum_ai/types/workflow_result_event_output_data_array"
|
249
264
|
require_relative "vellum_ai/types/workflow_result_event_output_data_chat_history"
|
250
265
|
require_relative "vellum_ai/types/workflow_result_event_output_data_error"
|
266
|
+
require_relative "vellum_ai/types/workflow_result_event_output_data_function_call"
|
251
267
|
require_relative "vellum_ai/types/workflow_result_event_output_data_json"
|
252
268
|
require_relative "vellum_ai/types/workflow_result_event_output_data_number"
|
253
269
|
require_relative "vellum_ai/types/workflow_result_event_output_data_search_results"
|
@@ -22,7 +22,7 @@ module Vellum
|
|
22
22
|
# @param limit [Integer] Number of results to return per page.
|
23
23
|
# @param offset [Integer] The initial index from which to return the results.
|
24
24
|
# @param ordering [String] Which field to use when ordering the results.
|
25
|
-
# @param status [DEPLOYMENTS_LIST_REQUEST_STATUS]
|
25
|
+
# @param status [DEPLOYMENTS_LIST_REQUEST_STATUS] status
|
26
26
|
# @param request_options [RequestOptions]
|
27
27
|
# @return [PaginatedSlimDeploymentReadList]
|
28
28
|
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil)
|
@@ -92,7 +92,7 @@ module Vellum
|
|
92
92
|
# @param limit [Integer] Number of results to return per page.
|
93
93
|
# @param offset [Integer] The initial index from which to return the results.
|
94
94
|
# @param ordering [String] Which field to use when ordering the results.
|
95
|
-
# @param status [DEPLOYMENTS_LIST_REQUEST_STATUS]
|
95
|
+
# @param status [DEPLOYMENTS_LIST_REQUEST_STATUS] status
|
96
96
|
# @param request_options [RequestOptions]
|
97
97
|
# @return [PaginatedSlimDeploymentReadList]
|
98
98
|
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil)
|
@@ -0,0 +1,155 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "string_variable_value"
|
5
|
+
require_relative "number_variable_value"
|
6
|
+
require_relative "json_variable_value"
|
7
|
+
require_relative "chat_history_variable_value"
|
8
|
+
require_relative "search_results_variable_value"
|
9
|
+
require_relative "error_variable_value"
|
10
|
+
require_relative "function_call_variable_value"
|
11
|
+
|
12
|
+
module Vellum
|
13
|
+
class ArrayVariableValueItem
|
14
|
+
attr_reader :member, :discriminant
|
15
|
+
|
16
|
+
private_class_method :new
|
17
|
+
alias kind_of? is_a?
|
18
|
+
# @param member [Object]
|
19
|
+
# @param discriminant [String]
|
20
|
+
# @return [ArrayVariableValueItem]
|
21
|
+
def initialize(member:, discriminant:)
|
22
|
+
# @type [Object]
|
23
|
+
@member = member
|
24
|
+
# @type [String]
|
25
|
+
@discriminant = discriminant
|
26
|
+
end
|
27
|
+
|
28
|
+
# Deserialize a JSON object to an instance of ArrayVariableValueItem
|
29
|
+
#
|
30
|
+
# @param json_object [JSON]
|
31
|
+
# @return [ArrayVariableValueItem]
|
32
|
+
def self.from_json(json_object:)
|
33
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
34
|
+
member = case struct.type
|
35
|
+
when "STRING"
|
36
|
+
StringVariableValue.from_json(json_object: json_object)
|
37
|
+
when "NUMBER"
|
38
|
+
NumberVariableValue.from_json(json_object: json_object)
|
39
|
+
when "JSON"
|
40
|
+
JsonVariableValue.from_json(json_object: json_object)
|
41
|
+
when "CHAT_HISTORY"
|
42
|
+
ChatHistoryVariableValue.from_json(json_object: json_object)
|
43
|
+
when "SEARCH_RESULTS"
|
44
|
+
SearchResultsVariableValue.from_json(json_object: json_object)
|
45
|
+
when "ERROR"
|
46
|
+
ErrorVariableValue.from_json(json_object: json_object)
|
47
|
+
when "FUNCTION_CALL"
|
48
|
+
FunctionCallVariableValue.from_json(json_object: json_object)
|
49
|
+
else
|
50
|
+
StringVariableValue.from_json(json_object: json_object)
|
51
|
+
end
|
52
|
+
new(member: member, discriminant: struct.type)
|
53
|
+
end
|
54
|
+
|
55
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
56
|
+
#
|
57
|
+
# @return [JSON]
|
58
|
+
def to_json(*_args)
|
59
|
+
case @discriminant
|
60
|
+
when "STRING"
|
61
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
62
|
+
when "NUMBER"
|
63
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
64
|
+
when "JSON"
|
65
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
66
|
+
when "CHAT_HISTORY"
|
67
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
68
|
+
when "SEARCH_RESULTS"
|
69
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
70
|
+
when "ERROR"
|
71
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
72
|
+
when "FUNCTION_CALL"
|
73
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
74
|
+
else
|
75
|
+
{ "type": @discriminant, value: @member }.to_json
|
76
|
+
end
|
77
|
+
@member.to_json
|
78
|
+
end
|
79
|
+
|
80
|
+
# 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.
|
81
|
+
#
|
82
|
+
# @param obj [Object]
|
83
|
+
# @return [Void]
|
84
|
+
def self.validate_raw(obj:)
|
85
|
+
case obj.type
|
86
|
+
when "STRING"
|
87
|
+
StringVariableValue.validate_raw(obj: obj)
|
88
|
+
when "NUMBER"
|
89
|
+
NumberVariableValue.validate_raw(obj: obj)
|
90
|
+
when "JSON"
|
91
|
+
JsonVariableValue.validate_raw(obj: obj)
|
92
|
+
when "CHAT_HISTORY"
|
93
|
+
ChatHistoryVariableValue.validate_raw(obj: obj)
|
94
|
+
when "SEARCH_RESULTS"
|
95
|
+
SearchResultsVariableValue.validate_raw(obj: obj)
|
96
|
+
when "ERROR"
|
97
|
+
ErrorVariableValue.validate_raw(obj: obj)
|
98
|
+
when "FUNCTION_CALL"
|
99
|
+
FunctionCallVariableValue.validate_raw(obj: obj)
|
100
|
+
else
|
101
|
+
raise("Passed value matched no type within the union, validation failed.")
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
106
|
+
#
|
107
|
+
# @param obj [Object]
|
108
|
+
# @return [Boolean]
|
109
|
+
def is_a?(obj)
|
110
|
+
@member.is_a?(obj)
|
111
|
+
end
|
112
|
+
|
113
|
+
# @param member [StringVariableValue]
|
114
|
+
# @return [ArrayVariableValueItem]
|
115
|
+
def self.string(member:)
|
116
|
+
new(member: member, discriminant: "STRING")
|
117
|
+
end
|
118
|
+
|
119
|
+
# @param member [NumberVariableValue]
|
120
|
+
# @return [ArrayVariableValueItem]
|
121
|
+
def self.number(member:)
|
122
|
+
new(member: member, discriminant: "NUMBER")
|
123
|
+
end
|
124
|
+
|
125
|
+
# @param member [JsonVariableValue]
|
126
|
+
# @return [ArrayVariableValueItem]
|
127
|
+
def self.json(member:)
|
128
|
+
new(member: member, discriminant: "JSON")
|
129
|
+
end
|
130
|
+
|
131
|
+
# @param member [ChatHistoryVariableValue]
|
132
|
+
# @return [ArrayVariableValueItem]
|
133
|
+
def self.chat_history(member:)
|
134
|
+
new(member: member, discriminant: "CHAT_HISTORY")
|
135
|
+
end
|
136
|
+
|
137
|
+
# @param member [SearchResultsVariableValue]
|
138
|
+
# @return [ArrayVariableValueItem]
|
139
|
+
def self.search_results(member:)
|
140
|
+
new(member: member, discriminant: "SEARCH_RESULTS")
|
141
|
+
end
|
142
|
+
|
143
|
+
# @param member [ErrorVariableValue]
|
144
|
+
# @return [ArrayVariableValueItem]
|
145
|
+
def self.error(member:)
|
146
|
+
new(member: member, discriminant: "ERROR")
|
147
|
+
end
|
148
|
+
|
149
|
+
# @param member [FunctionCallVariableValue]
|
150
|
+
# @return [ArrayVariableValueItem]
|
151
|
+
def self.function_call(member:)
|
152
|
+
new(member: member, discriminant: "FUNCTION_CALL")
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "chat_message"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class ChatHistoryVariableValue
|
8
|
+
attr_reader :value, :additional_properties
|
9
|
+
|
10
|
+
# @param value [Array<ChatMessage>]
|
11
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
# @return [ChatHistoryVariableValue]
|
13
|
+
def initialize(value: nil, additional_properties: nil)
|
14
|
+
# @type [Array<ChatMessage>]
|
15
|
+
@value = value
|
16
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
@additional_properties = additional_properties
|
18
|
+
end
|
19
|
+
|
20
|
+
# Deserialize a JSON object to an instance of ChatHistoryVariableValue
|
21
|
+
#
|
22
|
+
# @param json_object [JSON]
|
23
|
+
# @return [ChatHistoryVariableValue]
|
24
|
+
def self.from_json(json_object:)
|
25
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
26
|
+
parsed_json = JSON.parse(json_object)
|
27
|
+
value = parsed_json["value"].map do |v|
|
28
|
+
v = v.to_json
|
29
|
+
ChatMessage.from_json(json_object: v)
|
30
|
+
end
|
31
|
+
new(value: value, additional_properties: struct)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Serialize an instance of ChatHistoryVariableValue to a JSON object
|
35
|
+
#
|
36
|
+
# @return [JSON]
|
37
|
+
def to_json(*_args)
|
38
|
+
{ "value": @value }.to_json
|
39
|
+
end
|
40
|
+
|
41
|
+
# 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.
|
42
|
+
#
|
43
|
+
# @param obj [Object]
|
44
|
+
# @return [Void]
|
45
|
+
def self.validate_raw(obj:)
|
46
|
+
obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -5,14 +5,17 @@ require "json"
|
|
5
5
|
|
6
6
|
module Vellum
|
7
7
|
class CodeExecutionNodeResultData
|
8
|
-
attr_reader :output, :additional_properties
|
8
|
+
attr_reader :output, :log_output_id, :additional_properties
|
9
9
|
|
10
10
|
# @param output [CodeExecutionNodeResultOutput]
|
11
|
+
# @param log_output_id [String]
|
11
12
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
13
|
# @return [CodeExecutionNodeResultData]
|
13
|
-
def initialize(output:, additional_properties: nil)
|
14
|
+
def initialize(output:, log_output_id: nil, additional_properties: nil)
|
14
15
|
# @type [CodeExecutionNodeResultOutput]
|
15
16
|
@output = output
|
17
|
+
# @type [String]
|
18
|
+
@log_output_id = log_output_id
|
16
19
|
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
17
20
|
@additional_properties = additional_properties
|
18
21
|
end
|
@@ -30,14 +33,15 @@ module Vellum
|
|
30
33
|
output = parsed_json["output"].to_json
|
31
34
|
output = CodeExecutionNodeResultOutput.from_json(json_object: output)
|
32
35
|
end
|
33
|
-
|
36
|
+
log_output_id = struct.log_output_id
|
37
|
+
new(output: output, log_output_id: log_output_id, additional_properties: struct)
|
34
38
|
end
|
35
39
|
|
36
40
|
# Serialize an instance of CodeExecutionNodeResultData to a JSON object
|
37
41
|
#
|
38
42
|
# @return [JSON]
|
39
43
|
def to_json(*_args)
|
40
|
-
{ "output": @output }.to_json
|
44
|
+
{ "output": @output, "log_output_id": @log_output_id }.to_json
|
41
45
|
end
|
42
46
|
|
43
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.
|
@@ -46,6 +50,7 @@ module Vellum
|
|
46
50
|
# @return [Void]
|
47
51
|
def self.validate_raw(obj:)
|
48
52
|
CodeExecutionNodeResultOutput.validate_raw(obj: obj.output)
|
53
|
+
obj.log_output_id&.is_a?(String) != false || raise("Passed value for field obj.log_output_id is not the expected type, validation failed.")
|
49
54
|
end
|
50
55
|
end
|
51
56
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "array_variable_value_item"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class NodeInputCompiledArrayValue
|
8
|
+
attr_reader :node_input_id, :key, :value, :additional_properties
|
9
|
+
|
10
|
+
# @param node_input_id [String]
|
11
|
+
# @param key [String]
|
12
|
+
# @param value [Array<ArrayVariableValueItem>]
|
13
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
# @return [NodeInputCompiledArrayValue]
|
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 [Array<ArrayVariableValueItem>]
|
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 NodeInputCompiledArrayValue
|
27
|
+
#
|
28
|
+
# @param json_object [JSON]
|
29
|
+
# @return [NodeInputCompiledArrayValue]
|
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
|
+
value = parsed_json["value"].map do |v|
|
36
|
+
v = v.to_json
|
37
|
+
ArrayVariableValueItem.from_json(json_object: v)
|
38
|
+
end
|
39
|
+
new(node_input_id: node_input_id, key: key, value: value, additional_properties: struct)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Serialize an instance of NodeInputCompiledArrayValue to a JSON object
|
43
|
+
#
|
44
|
+
# @return [JSON]
|
45
|
+
def to_json(*_args)
|
46
|
+
{ "node_input_id": @node_input_id, "key": @key, "value": @value }.to_json
|
47
|
+
end
|
48
|
+
|
49
|
+
# 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.
|
50
|
+
#
|
51
|
+
# @param obj [Object]
|
52
|
+
# @return [Void]
|
53
|
+
def self.validate_raw(obj:)
|
54
|
+
obj.node_input_id.is_a?(String) != false || raise("Passed value for field obj.node_input_id is not the expected type, validation failed.")
|
55
|
+
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
56
|
+
obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -7,6 +7,7 @@ require_relative "node_input_compiled_json_value"
|
|
7
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
|
+
require_relative "node_input_compiled_array_value"
|
10
11
|
|
11
12
|
module Vellum
|
12
13
|
class NodeInputVariableCompiledValue
|
@@ -43,6 +44,8 @@ module Vellum
|
|
43
44
|
NodeInputCompiledSearchResultsValue.from_json(json_object: json_object)
|
44
45
|
when "ERROR"
|
45
46
|
NodeInputCompiledErrorValue.from_json(json_object: json_object)
|
47
|
+
when "ARRAY"
|
48
|
+
NodeInputCompiledArrayValue.from_json(json_object: json_object)
|
46
49
|
else
|
47
50
|
NodeInputCompiledStringValue.from_json(json_object: json_object)
|
48
51
|
end
|
@@ -66,6 +69,8 @@ module Vellum
|
|
66
69
|
{ **@member.to_json, type: @discriminant }.to_json
|
67
70
|
when "ERROR"
|
68
71
|
{ **@member.to_json, type: @discriminant }.to_json
|
72
|
+
when "ARRAY"
|
73
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
69
74
|
else
|
70
75
|
{ "type": @discriminant, value: @member }.to_json
|
71
76
|
end
|
@@ -90,6 +95,8 @@ module Vellum
|
|
90
95
|
NodeInputCompiledSearchResultsValue.validate_raw(obj: obj)
|
91
96
|
when "ERROR"
|
92
97
|
NodeInputCompiledErrorValue.validate_raw(obj: obj)
|
98
|
+
when "ARRAY"
|
99
|
+
NodeInputCompiledArrayValue.validate_raw(obj: obj)
|
93
100
|
else
|
94
101
|
raise("Passed value matched no type within the union, validation failed.")
|
95
102
|
end
|
@@ -138,5 +145,11 @@ module Vellum
|
|
138
145
|
def self.error(member:)
|
139
146
|
new(member: member, discriminant: "ERROR")
|
140
147
|
end
|
148
|
+
|
149
|
+
# @param member [NodeInputCompiledArrayValue]
|
150
|
+
# @return [NodeInputVariableCompiledValue]
|
151
|
+
def self.array(member:)
|
152
|
+
new(member: member, discriminant: "ARRAY")
|
153
|
+
end
|
141
154
|
end
|
142
155
|
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 NodeOutputCompiledArrayValue
|
8
|
+
attr_reader :node_output_id, :value, :additional_properties
|
9
|
+
|
10
|
+
# @param node_output_id [String]
|
11
|
+
# @param value [Array<ArrayVariableValueItem>]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [NodeOutputCompiledArrayValue]
|
14
|
+
def initialize(node_output_id:, value: nil, additional_properties: nil)
|
15
|
+
# @type [String]
|
16
|
+
@node_output_id = node_output_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 NodeOutputCompiledArrayValue
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [NodeOutputCompiledArrayValue]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
parsed_json = JSON.parse(json_object)
|
30
|
+
node_output_id = struct.node_output_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(node_output_id: node_output_id, value: value, additional_properties: struct)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Serialize an instance of NodeOutputCompiledArrayValue to a JSON object
|
39
|
+
#
|
40
|
+
# @return [JSON]
|
41
|
+
def to_json(*_args)
|
42
|
+
{ "node_output_id": @node_output_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.node_output_id.is_a?(String) != false || raise("Passed value for field obj.node_output_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 NodeOutputCompiledFunctionValue
|
8
|
+
attr_reader :node_output_id, :value, :additional_properties
|
9
|
+
|
10
|
+
# @param node_output_id [String]
|
11
|
+
# @param value [FunctionCall]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [NodeOutputCompiledFunctionValue]
|
14
|
+
def initialize(node_output_id:, value: nil, additional_properties: nil)
|
15
|
+
# @type [String]
|
16
|
+
@node_output_id = node_output_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 NodeOutputCompiledFunctionValue
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [NodeOutputCompiledFunctionValue]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
parsed_json = JSON.parse(json_object)
|
30
|
+
node_output_id = struct.node_output_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(node_output_id: node_output_id, value: value, additional_properties: struct)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Serialize an instance of NodeOutputCompiledFunctionValue to a JSON object
|
41
|
+
#
|
42
|
+
# @return [JSON]
|
43
|
+
def to_json(*_args)
|
44
|
+
{ "node_output_id": @node_output_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.node_output_id.is_a?(String) != false || raise("Passed value for field obj.node_output_id is not the expected type, validation failed.")
|
53
|
+
obj.value.nil? || FunctionCall.validate_raw(obj: obj.value)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|