vellum_ai 0.3.7 → 0.3.8
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 +9 -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/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/workflow_deployment_read.rb +118 -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/workflow_deployments/client.rb +35 -6
- data/lib/vellum_ai.rb +4 -4
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adb4760882a30ad83ab4941e55cb8a40ae87e258c1bf3e20e3ac448b2813e7f1
|
4
|
+
data.tar.gz: 8c59f859ad9128cb569fa0c4b1139097e46e7d6ad62c060aa87137d85275e001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5174ac6dcb5de429f610cf186a21badc4210d412c3a9286cde43e6c71687a604a3ea907e7a842a8be93e3cef159963c71e150455e7ab74122ced178e9fca03f7
|
7
|
+
data.tar.gz: 2bcf48bbf3e24cc50d1c3f06554cce5fff4381d9005bf4e965bb2df29e25a4ad2483f187f4ace29919c989d17c19923e888338f368812e54479ccd6523f1d68f
|
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.8",
|
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.8",
|
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"
|
@@ -219,6 +227,7 @@ require_relative "vellum_ai/types/vellum_image"
|
|
219
227
|
require_relative "vellum_ai/types/vellum_image_request"
|
220
228
|
require_relative "vellum_ai/types/vellum_variable"
|
221
229
|
require_relative "vellum_ai/types/vellum_variable_type"
|
230
|
+
require_relative "vellum_ai/types/workflow_deployment_read"
|
222
231
|
require_relative "vellum_ai/types/workflow_event_error"
|
223
232
|
require_relative "vellum_ai/types/workflow_execution_actual_chat_history_request"
|
224
233
|
require_relative "vellum_ai/types/workflow_execution_actual_json_request"
|
@@ -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
|
@@ -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:, 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:, 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
|
@@ -7,6 +7,8 @@ require_relative "node_output_compiled_json_value"
|
|
7
7
|
require_relative "node_output_compiled_chat_history_value"
|
8
8
|
require_relative "node_output_compiled_search_results_value"
|
9
9
|
require_relative "node_output_compiled_error_value"
|
10
|
+
require_relative "node_output_compiled_array_value"
|
11
|
+
require_relative "node_output_compiled_function_value"
|
10
12
|
|
11
13
|
module Vellum
|
12
14
|
class NodeOutputCompiledValue
|
@@ -43,6 +45,10 @@ module Vellum
|
|
43
45
|
NodeOutputCompiledSearchResultsValue.from_json(json_object: json_object)
|
44
46
|
when "ERROR"
|
45
47
|
NodeOutputCompiledErrorValue.from_json(json_object: json_object)
|
48
|
+
when "ARRAY"
|
49
|
+
NodeOutputCompiledArrayValue.from_json(json_object: json_object)
|
50
|
+
when "FUNCTION_CALL"
|
51
|
+
NodeOutputCompiledFunctionValue.from_json(json_object: json_object)
|
46
52
|
else
|
47
53
|
NodeOutputCompiledStringValue.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
|
NodeOutputCompiledSearchResultsValue.validate_raw(obj: obj)
|
91
101
|
when "ERROR"
|
92
102
|
NodeOutputCompiledErrorValue.validate_raw(obj: obj)
|
103
|
+
when "ARRAY"
|
104
|
+
NodeOutputCompiledArrayValue.validate_raw(obj: obj)
|
105
|
+
when "FUNCTION_CALL"
|
106
|
+
NodeOutputCompiledFunctionValue.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 [NodeOutputCompiledArrayValue]
|
157
|
+
# @return [NodeOutputCompiledValue]
|
158
|
+
def self.array(member:)
|
159
|
+
new(member: member, discriminant: "ARRAY")
|
160
|
+
end
|
161
|
+
|
162
|
+
# @param member [NodeOutputCompiledFunctionValue]
|
163
|
+
# @return [NodeOutputCompiledValue]
|
164
|
+
def self.function_call(member:)
|
165
|
+
new(member: member, discriminant: "FUNCTION_CALL")
|
166
|
+
end
|
141
167
|
end
|
142
168
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class NumberVariableValue
|
7
|
+
attr_reader :value, :additional_properties
|
8
|
+
|
9
|
+
# @param value [Float]
|
10
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
11
|
+
# @return [NumberVariableValue]
|
12
|
+
def initialize(value: nil, additional_properties: nil)
|
13
|
+
# @type [Float]
|
14
|
+
@value = value
|
15
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
16
|
+
@additional_properties = additional_properties
|
17
|
+
end
|
18
|
+
|
19
|
+
# Deserialize a JSON object to an instance of NumberVariableValue
|
20
|
+
#
|
21
|
+
# @param json_object [JSON]
|
22
|
+
# @return [NumberVariableValue]
|
23
|
+
def self.from_json(json_object:)
|
24
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
25
|
+
JSON.parse(json_object)
|
26
|
+
value = struct.value
|
27
|
+
new(value: value, additional_properties: struct)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Serialize an instance of NumberVariableValue to a JSON object
|
31
|
+
#
|
32
|
+
# @return [JSON]
|
33
|
+
def to_json(*_args)
|
34
|
+
{ "value": @value }.to_json
|
35
|
+
end
|
36
|
+
|
37
|
+
# 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.
|
38
|
+
#
|
39
|
+
# @param obj [Object]
|
40
|
+
# @return [Void]
|
41
|
+
def self.validate_raw(obj:)
|
42
|
+
obj.value&.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -4,17 +4,20 @@ require "json"
|
|
4
4
|
|
5
5
|
module Vellum
|
6
6
|
class PromptNodeResultData
|
7
|
-
attr_reader :output_id, :text, :delta, :additional_properties
|
7
|
+
attr_reader :output_id, :array_output_id, :text, :delta, :additional_properties
|
8
8
|
|
9
9
|
# @param output_id [String]
|
10
|
+
# @param array_output_id [String]
|
10
11
|
# @param text [String]
|
11
12
|
# @param delta [String]
|
12
13
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
14
|
# @return [PromptNodeResultData]
|
14
|
-
def initialize(output_id:, text: nil, delta: nil, additional_properties: nil)
|
15
|
+
def initialize(output_id:, array_output_id: nil, text: nil, delta: nil, additional_properties: nil)
|
15
16
|
# @type [String]
|
16
17
|
@output_id = output_id
|
17
18
|
# @type [String]
|
19
|
+
@array_output_id = array_output_id
|
20
|
+
# @type [String]
|
18
21
|
@text = text
|
19
22
|
# @type [String]
|
20
23
|
@delta = delta
|
@@ -30,16 +33,18 @@ module Vellum
|
|
30
33
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
31
34
|
JSON.parse(json_object)
|
32
35
|
output_id = struct.output_id
|
36
|
+
array_output_id = struct.array_output_id
|
33
37
|
text = struct.text
|
34
38
|
delta = struct.delta
|
35
|
-
new(output_id: output_id, text: text, delta: delta,
|
39
|
+
new(output_id: output_id, array_output_id: array_output_id, text: text, delta: delta,
|
40
|
+
additional_properties: struct)
|
36
41
|
end
|
37
42
|
|
38
43
|
# Serialize an instance of PromptNodeResultData to a JSON object
|
39
44
|
#
|
40
45
|
# @return [JSON]
|
41
46
|
def to_json(*_args)
|
42
|
-
{ "output_id": @output_id, "text": @text, "delta": @delta }.to_json
|
47
|
+
{ "output_id": @output_id, "array_output_id": @array_output_id, "text": @text, "delta": @delta }.to_json
|
43
48
|
end
|
44
49
|
|
45
50
|
# 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,6 +53,7 @@ module Vellum
|
|
48
53
|
# @return [Void]
|
49
54
|
def self.validate_raw(obj:)
|
50
55
|
obj.output_id.is_a?(String) != false || raise("Passed value for field obj.output_id is not the expected type, validation failed.")
|
56
|
+
obj.array_output_id&.is_a?(String) != false || raise("Passed value for field obj.array_output_id is not the expected type, validation failed.")
|
51
57
|
obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
52
58
|
obj.delta&.is_a?(String) != false || raise("Passed value for field obj.delta is not the expected type, validation failed.")
|
53
59
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "search_result"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class SearchResultsVariableValue
|
8
|
+
attr_reader :value, :additional_properties
|
9
|
+
|
10
|
+
# @param value [Array<SearchResult>]
|
11
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
# @return [SearchResultsVariableValue]
|
13
|
+
def initialize(value: nil, additional_properties: nil)
|
14
|
+
# @type [Array<SearchResult>]
|
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 SearchResultsVariableValue
|
21
|
+
#
|
22
|
+
# @param json_object [JSON]
|
23
|
+
# @return [SearchResultsVariableValue]
|
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
|
+
SearchResult.from_json(json_object: v)
|
30
|
+
end
|
31
|
+
new(value: value, additional_properties: struct)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Serialize an instance of SearchResultsVariableValue 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
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "entity_status"
|
4
|
+
require_relative "environment_enum"
|
5
|
+
require "date"
|
6
|
+
require_relative "vellum_variable"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module Vellum
|
10
|
+
class WorkflowDeploymentRead
|
11
|
+
attr_reader :id, :name, :label, :status, :environment, :created, :last_deployed_on, :input_variables,
|
12
|
+
:output_variables, :additional_properties
|
13
|
+
|
14
|
+
# @param id [String]
|
15
|
+
# @param name [String] A name that uniquely identifies this workflow deployment within its workspace
|
16
|
+
# @param label [String] A human-readable label for the workflow deployment
|
17
|
+
# @param status [ENTITY_STATUS] The current status of the workflow deployment
|
18
|
+
# - `ACTIVE` - Active
|
19
|
+
# - `ARCHIVED` - Archived
|
20
|
+
# @param environment [ENVIRONMENT_ENUM] The environment this workflow deployment is used in
|
21
|
+
# - `DEVELOPMENT` - Development
|
22
|
+
# - `STAGING` - Staging
|
23
|
+
# - `PRODUCTION` - Production
|
24
|
+
# @param created [DateTime]
|
25
|
+
# @param last_deployed_on [DateTime]
|
26
|
+
# @param input_variables [Array<VellumVariable>] The input variables this Workflow Deployment expects to receive values for when it is executed.
|
27
|
+
# @param output_variables [Array<VellumVariable>] The output variables this Workflow Deployment produces values for when it's executed.
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [WorkflowDeploymentRead]
|
30
|
+
def initialize(id:, name:, label:, created:, last_deployed_on:, input_variables:, output_variables:, status: nil,
|
31
|
+
environment: nil, additional_properties: nil)
|
32
|
+
# @type [String]
|
33
|
+
@id = id
|
34
|
+
# @type [String] A name that uniquely identifies this workflow deployment within its workspace
|
35
|
+
@name = name
|
36
|
+
# @type [String] A human-readable label for the workflow deployment
|
37
|
+
@label = label
|
38
|
+
# @type [ENTITY_STATUS] The current status of the workflow deployment
|
39
|
+
# - `ACTIVE` - Active
|
40
|
+
# - `ARCHIVED` - Archived
|
41
|
+
@status = status
|
42
|
+
# @type [ENVIRONMENT_ENUM] The environment this workflow deployment is used in
|
43
|
+
# - `DEVELOPMENT` - Development
|
44
|
+
# - `STAGING` - Staging
|
45
|
+
# - `PRODUCTION` - Production
|
46
|
+
@environment = environment
|
47
|
+
# @type [DateTime]
|
48
|
+
@created = created
|
49
|
+
# @type [DateTime]
|
50
|
+
@last_deployed_on = last_deployed_on
|
51
|
+
# @type [Array<VellumVariable>] The input variables this Workflow Deployment expects to receive values for when it is executed.
|
52
|
+
@input_variables = input_variables
|
53
|
+
# @type [Array<VellumVariable>] The output variables this Workflow Deployment produces values for when it's executed.
|
54
|
+
@output_variables = output_variables
|
55
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
56
|
+
@additional_properties = additional_properties
|
57
|
+
end
|
58
|
+
|
59
|
+
# Deserialize a JSON object to an instance of WorkflowDeploymentRead
|
60
|
+
#
|
61
|
+
# @param json_object [JSON]
|
62
|
+
# @return [WorkflowDeploymentRead]
|
63
|
+
def self.from_json(json_object:)
|
64
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
65
|
+
parsed_json = JSON.parse(json_object)
|
66
|
+
id = struct.id
|
67
|
+
name = struct.name
|
68
|
+
label = struct.label
|
69
|
+
status = ENTITY_STATUS.key(parsed_json["status"]) || parsed_json["status"]
|
70
|
+
environment = ENVIRONMENT_ENUM.key(parsed_json["environment"]) || parsed_json["environment"]
|
71
|
+
created = DateTime.parse(parsed_json["created"])
|
72
|
+
last_deployed_on = DateTime.parse(parsed_json["last_deployed_on"])
|
73
|
+
input_variables = parsed_json["input_variables"].map do |v|
|
74
|
+
v = v.to_json
|
75
|
+
VellumVariable.from_json(json_object: v)
|
76
|
+
end
|
77
|
+
output_variables = parsed_json["output_variables"].map do |v|
|
78
|
+
v = v.to_json
|
79
|
+
VellumVariable.from_json(json_object: v)
|
80
|
+
end
|
81
|
+
new(id: id, name: name, label: label, status: status, environment: environment, created: created,
|
82
|
+
last_deployed_on: last_deployed_on, input_variables: input_variables, output_variables: output_variables, additional_properties: struct)
|
83
|
+
end
|
84
|
+
|
85
|
+
# Serialize an instance of WorkflowDeploymentRead to a JSON object
|
86
|
+
#
|
87
|
+
# @return [JSON]
|
88
|
+
def to_json(*_args)
|
89
|
+
{
|
90
|
+
"id": @id,
|
91
|
+
"name": @name,
|
92
|
+
"label": @label,
|
93
|
+
"status": ENTITY_STATUS[@status] || @status,
|
94
|
+
"environment": ENVIRONMENT_ENUM[@environment] || @environment,
|
95
|
+
"created": @created,
|
96
|
+
"last_deployed_on": @last_deployed_on,
|
97
|
+
"input_variables": @input_variables,
|
98
|
+
"output_variables": @output_variables
|
99
|
+
}.to_json
|
100
|
+
end
|
101
|
+
|
102
|
+
# 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.
|
103
|
+
#
|
104
|
+
# @param obj [Object]
|
105
|
+
# @return [Void]
|
106
|
+
def self.validate_raw(obj:)
|
107
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
108
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
109
|
+
obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
|
110
|
+
obj.status&.is_a?(ENTITY_STATUS) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
111
|
+
obj.environment&.is_a?(ENVIRONMENT_ENUM) != false || raise("Passed value for field obj.environment is not the expected type, validation failed.")
|
112
|
+
obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
|
113
|
+
obj.last_deployed_on.is_a?(DateTime) != false || raise("Passed value for field obj.last_deployed_on is not the expected type, validation failed.")
|
114
|
+
obj.input_variables.is_a?(Array) != false || raise("Passed value for field obj.input_variables is not the expected type, validation failed.")
|
115
|
+
obj.output_variables.is_a?(Array) != false || raise("Passed value for field obj.output_variables is not the expected type, validation failed.")
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require_relative "../../requests"
|
4
4
|
require_relative "types/workflow_deployments_list_request_status"
|
5
5
|
require_relative "../types/paginated_slim_workflow_deployment_list"
|
6
|
+
require_relative "../types/workflow_deployment_read"
|
6
7
|
require "async"
|
7
8
|
|
8
9
|
module Vellum
|
@@ -19,9 +20,7 @@ module Vellum
|
|
19
20
|
# @param limit [Integer] Number of results to return per page.
|
20
21
|
# @param offset [Integer] The initial index from which to return the results.
|
21
22
|
# @param ordering [String] Which field to use when ordering the results.
|
22
|
-
# @param status [WORKFLOW_DEPLOYMENTS_LIST_REQUEST_STATUS]
|
23
|
-
# - `ACTIVE` - Active
|
24
|
-
# - `ARCHIVED` - Archived
|
23
|
+
# @param status [WORKFLOW_DEPLOYMENTS_LIST_REQUEST_STATUS] status
|
25
24
|
# @param request_options [RequestOptions]
|
26
25
|
# @return [PaginatedSlimWorkflowDeploymentList]
|
27
26
|
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil)
|
@@ -40,6 +39,21 @@ module Vellum
|
|
40
39
|
end
|
41
40
|
PaginatedSlimWorkflowDeploymentList.from_json(json_object: response.body)
|
42
41
|
end
|
42
|
+
|
43
|
+
# Used to retrieve a workflow deployment given its ID or name.
|
44
|
+
#
|
45
|
+
# @param id [String] Either the Workflow Deployment's ID or its unique name
|
46
|
+
# @param request_options [RequestOptions]
|
47
|
+
# @return [WorkflowDeploymentRead]
|
48
|
+
def retrieve(id:, request_options: nil)
|
49
|
+
response = @request_client.conn.get do |req|
|
50
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
51
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
52
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
53
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/workflow-deployments/#{id}"
|
54
|
+
end
|
55
|
+
WorkflowDeploymentRead.from_json(json_object: response.body)
|
56
|
+
end
|
43
57
|
end
|
44
58
|
|
45
59
|
class AsyncWorkflowDeploymentsClient
|
@@ -55,9 +69,7 @@ module Vellum
|
|
55
69
|
# @param limit [Integer] Number of results to return per page.
|
56
70
|
# @param offset [Integer] The initial index from which to return the results.
|
57
71
|
# @param ordering [String] Which field to use when ordering the results.
|
58
|
-
# @param status [WORKFLOW_DEPLOYMENTS_LIST_REQUEST_STATUS]
|
59
|
-
# - `ACTIVE` - Active
|
60
|
-
# - `ARCHIVED` - Archived
|
72
|
+
# @param status [WORKFLOW_DEPLOYMENTS_LIST_REQUEST_STATUS] status
|
61
73
|
# @param request_options [RequestOptions]
|
62
74
|
# @return [PaginatedSlimWorkflowDeploymentList]
|
63
75
|
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil)
|
@@ -78,5 +90,22 @@ module Vellum
|
|
78
90
|
PaginatedSlimWorkflowDeploymentList.from_json(json_object: response.body)
|
79
91
|
end
|
80
92
|
end
|
93
|
+
|
94
|
+
# Used to retrieve a workflow deployment given its ID or name.
|
95
|
+
#
|
96
|
+
# @param id [String] Either the Workflow Deployment's ID or its unique name
|
97
|
+
# @param request_options [RequestOptions]
|
98
|
+
# @return [WorkflowDeploymentRead]
|
99
|
+
def retrieve(id:, request_options: nil)
|
100
|
+
Async do
|
101
|
+
response = @request_client.conn.get do |req|
|
102
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
103
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
104
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
105
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/workflow-deployments/#{id}"
|
106
|
+
end
|
107
|
+
WorkflowDeploymentRead.from_json(json_object: response.body)
|
108
|
+
end
|
109
|
+
end
|
81
110
|
end
|
82
111
|
end
|
data/lib/vellum_ai.rb
CHANGED
@@ -56,7 +56,7 @@ module Vellum
|
|
56
56
|
# @param prompt_deployment_id [String] The ID of the Prompt Deployment. Must provide either this or prompt_deployment_name.
|
57
57
|
# @param prompt_deployment_name [String] The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
58
58
|
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
59
|
-
# @param external_id [String]
|
59
|
+
# @param external_id [String] "Optionally include a unique identifier for tracking purposes. Must be unique for a given prompt deployment.
|
60
60
|
# @param expand_meta [Hash] The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.Request of type PromptDeploymentExpandMetaRequestRequest, as a Hash
|
61
61
|
# * :model_name (Boolean)
|
62
62
|
# * :latency (Boolean)
|
@@ -100,7 +100,7 @@ module Vellum
|
|
100
100
|
# @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
|
101
101
|
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
|
102
102
|
# @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding values.Request of type Array<WorkflowRequestInputRequest>, as a Hash
|
103
|
-
# @param external_id [String] Optionally include a unique identifier for monitoring purposes.
|
103
|
+
# @param external_id [String] Optionally include a unique identifier for monitoring purposes. Must be unique for a given workflow deployment.
|
104
104
|
# @param request_options [RequestOptions]
|
105
105
|
# @return [ExecuteWorkflowResponse]
|
106
106
|
def execute_workflow(inputs:, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil,
|
@@ -278,7 +278,7 @@ module Vellum
|
|
278
278
|
# @param prompt_deployment_id [String] The ID of the Prompt Deployment. Must provide either this or prompt_deployment_name.
|
279
279
|
# @param prompt_deployment_name [String] The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
280
280
|
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
281
|
-
# @param external_id [String]
|
281
|
+
# @param external_id [String] "Optionally include a unique identifier for tracking purposes. Must be unique for a given prompt deployment.
|
282
282
|
# @param expand_meta [Hash] The name of the Prompt Deployment. Must provide either this or prompt_deployment_id.Request of type PromptDeploymentExpandMetaRequestRequest, as a Hash
|
283
283
|
# * :model_name (Boolean)
|
284
284
|
# * :latency (Boolean)
|
@@ -322,7 +322,7 @@ module Vellum
|
|
322
322
|
# @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
|
323
323
|
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
|
324
324
|
# @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding values.Request of type Array<WorkflowRequestInputRequest>, as a Hash
|
325
|
-
# @param external_id [String] Optionally include a unique identifier for monitoring purposes.
|
325
|
+
# @param external_id [String] Optionally include a unique identifier for monitoring purposes. Must be unique for a given workflow deployment.
|
326
326
|
# @param request_options [RequestOptions]
|
327
327
|
# @return [ExecuteWorkflowResponse]
|
328
328
|
def execute_workflow(inputs:, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil,
|
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.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vellum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -107,9 +107,12 @@ files:
|
|
107
107
|
- lib/vellum_ai/types/array_chat_message_content_item.rb
|
108
108
|
- lib/vellum_ai/types/array_chat_message_content_item_request.rb
|
109
109
|
- lib/vellum_ai/types/array_chat_message_content_request.rb
|
110
|
+
- lib/vellum_ai/types/array_enum.rb
|
111
|
+
- lib/vellum_ai/types/array_variable_value_item.rb
|
110
112
|
- lib/vellum_ai/types/block_type_enum.rb
|
111
113
|
- lib/vellum_ai/types/chat_history_enum.rb
|
112
114
|
- lib/vellum_ai/types/chat_history_input_request.rb
|
115
|
+
- lib/vellum_ai/types/chat_history_variable_value.rb
|
113
116
|
- lib/vellum_ai/types/chat_message.rb
|
114
117
|
- lib/vellum_ai/types/chat_message_content.rb
|
115
118
|
- lib/vellum_ai/types/chat_message_content_request.rb
|
@@ -198,6 +201,7 @@ files:
|
|
198
201
|
- lib/vellum_ai/types/named_test_case_search_results_variable_value_request.rb
|
199
202
|
- lib/vellum_ai/types/named_test_case_string_variable_value_request.rb
|
200
203
|
- lib/vellum_ai/types/named_test_case_variable_value_request.rb
|
204
|
+
- lib/vellum_ai/types/node_input_compiled_array_value.rb
|
201
205
|
- lib/vellum_ai/types/node_input_compiled_chat_history_value.rb
|
202
206
|
- lib/vellum_ai/types/node_input_compiled_error_value.rb
|
203
207
|
- lib/vellum_ai/types/node_input_compiled_json_value.rb
|
@@ -205,8 +209,10 @@ files:
|
|
205
209
|
- lib/vellum_ai/types/node_input_compiled_search_results_value.rb
|
206
210
|
- lib/vellum_ai/types/node_input_compiled_string_value.rb
|
207
211
|
- lib/vellum_ai/types/node_input_variable_compiled_value.rb
|
212
|
+
- lib/vellum_ai/types/node_output_compiled_array_value.rb
|
208
213
|
- lib/vellum_ai/types/node_output_compiled_chat_history_value.rb
|
209
214
|
- lib/vellum_ai/types/node_output_compiled_error_value.rb
|
215
|
+
- lib/vellum_ai/types/node_output_compiled_function_value.rb
|
210
216
|
- lib/vellum_ai/types/node_output_compiled_json_value.rb
|
211
217
|
- lib/vellum_ai/types/node_output_compiled_number_value.rb
|
212
218
|
- lib/vellum_ai/types/node_output_compiled_search_results_value.rb
|
@@ -215,6 +221,7 @@ files:
|
|
215
221
|
- lib/vellum_ai/types/normalized_log_probs.rb
|
216
222
|
- lib/vellum_ai/types/normalized_token_log_probs.rb
|
217
223
|
- lib/vellum_ai/types/number_enum.rb
|
224
|
+
- lib/vellum_ai/types/number_variable_value.rb
|
218
225
|
- lib/vellum_ai/types/paginated_slim_deployment_read_list.rb
|
219
226
|
- lib/vellum_ai/types/paginated_slim_document_list.rb
|
220
227
|
- lib/vellum_ai/types/paginated_slim_workflow_deployment_list.rb
|
@@ -267,6 +274,7 @@ files:
|
|
267
274
|
- lib/vellum_ai/types/search_result_merging_request.rb
|
268
275
|
- lib/vellum_ai/types/search_result_request.rb
|
269
276
|
- lib/vellum_ai/types/search_results_enum.rb
|
277
|
+
- lib/vellum_ai/types/search_results_variable_value.rb
|
270
278
|
- lib/vellum_ai/types/search_weights_request.rb
|
271
279
|
- lib/vellum_ai/types/slim_deployment_read.rb
|
272
280
|
- lib/vellum_ai/types/slim_document.rb
|
@@ -318,6 +326,7 @@ files:
|
|
318
326
|
- lib/vellum_ai/types/vellum_image_request.rb
|
319
327
|
- lib/vellum_ai/types/vellum_variable.rb
|
320
328
|
- lib/vellum_ai/types/vellum_variable_type.rb
|
329
|
+
- lib/vellum_ai/types/workflow_deployment_read.rb
|
321
330
|
- lib/vellum_ai/types/workflow_event_error.rb
|
322
331
|
- lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb
|
323
332
|
- lib/vellum_ai/types/workflow_execution_actual_json_request.rb
|