vellum_ai 0.3.12 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +30 -0
- data/lib/vellum_ai/test_suite_runs/client.rb +149 -0
- data/lib/vellum_ai/types/paginated_test_suite_run_execution_list.rb +64 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data_request.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_request.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_type_enum.rb +5 -0
- data/lib/vellum_ai/types/test_suite_run_exec_config.rb +90 -0
- data/lib/vellum_ai/types/test_suite_run_exec_config_request.rb +90 -0
- data/lib/vellum_ai/types/test_suite_run_execution.rb +69 -0
- data/lib/vellum_ai/types/test_suite_run_execution_chat_history_output.rb +54 -0
- data/lib/vellum_ai/types/test_suite_run_execution_error_output.rb +56 -0
- data/lib/vellum_ai/types/test_suite_run_execution_json_output.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_execution_metric_result.rb +54 -0
- data/lib/vellum_ai/types/test_suite_run_execution_number_output.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_execution_output.rb +142 -0
- data/lib/vellum_ai/types/test_suite_run_execution_search_results_output.rb +54 -0
- data/lib/vellum_ai/types/test_suite_run_execution_string_output.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_metric_error_output.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_metric_error_output_type_enum.rb +5 -0
- data/lib/vellum_ai/types/test_suite_run_metric_number_output.rb +51 -0
- data/lib/vellum_ai/types/test_suite_run_metric_number_output_type_enum.rb +5 -0
- data/lib/vellum_ai/types/test_suite_run_metric_output.rb +90 -0
- data/lib/vellum_ai/types/test_suite_run_read.rb +96 -0
- data/lib/vellum_ai/types/test_suite_run_state.rb +12 -0
- data/lib/vellum_ai/types/test_suite_run_test_suite.rb +55 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data_request.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_request.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_type_enum.rb +5 -0
- data/lib/vellum_ai/types/workflow_output_array.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_chat_history.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_error.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_function_call.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_image.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_json.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_number.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_search_results.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_string.rb +2 -2
- data/lib/vellum_ai.rb +5 -2
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d99892d0551b12dcf9e18e9295d823fbdc0d1a6cf84add280b3da3b3f0f2d678
|
4
|
+
data.tar.gz: af80f8f4a8b4b9f8da111c7f168761fdc0f1511757071ec3af7add486928c558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5444655049a055eb486408d515ecb0591fa705e9ba560f44705fe942d7accf4474935be8160410c88e5d6219f2af1983836c28d922f89107460236c1b9ec05b5
|
7
|
+
data.tar.gz: 455b6e301766db7a53a8c2e1018f446111213d244cc91d325782ec04ef12bcf94a0bf8a93d6c3c571f88385154ebd6e0dfc43735292a7136c2de3a7b5cf7b038
|
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.14",
|
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.14",
|
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
@@ -138,6 +138,7 @@ require_relative "vellum_ai/types/paginated_document_index_read_list"
|
|
138
138
|
require_relative "vellum_ai/types/paginated_slim_deployment_read_list"
|
139
139
|
require_relative "vellum_ai/types/paginated_slim_document_list"
|
140
140
|
require_relative "vellum_ai/types/paginated_slim_workflow_deployment_list"
|
141
|
+
require_relative "vellum_ai/types/paginated_test_suite_run_execution_list"
|
141
142
|
require_relative "vellum_ai/types/processing_failure_reason_enum"
|
142
143
|
require_relative "vellum_ai/types/processing_state_enum"
|
143
144
|
require_relative "vellum_ai/types/prompt_deployment_expand_meta_request_request"
|
@@ -233,6 +234,35 @@ require_relative "vellum_ai/types/test_case_number_variable_value"
|
|
233
234
|
require_relative "vellum_ai/types/test_case_search_results_variable_value"
|
234
235
|
require_relative "vellum_ai/types/test_case_string_variable_value"
|
235
236
|
require_relative "vellum_ai/types/test_case_variable_value"
|
237
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config"
|
238
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data"
|
239
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data_request"
|
240
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_request"
|
241
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_type_enum"
|
242
|
+
require_relative "vellum_ai/types/test_suite_run_exec_config"
|
243
|
+
require_relative "vellum_ai/types/test_suite_run_exec_config_request"
|
244
|
+
require_relative "vellum_ai/types/test_suite_run_execution"
|
245
|
+
require_relative "vellum_ai/types/test_suite_run_execution_chat_history_output"
|
246
|
+
require_relative "vellum_ai/types/test_suite_run_execution_error_output"
|
247
|
+
require_relative "vellum_ai/types/test_suite_run_execution_json_output"
|
248
|
+
require_relative "vellum_ai/types/test_suite_run_execution_metric_result"
|
249
|
+
require_relative "vellum_ai/types/test_suite_run_execution_number_output"
|
250
|
+
require_relative "vellum_ai/types/test_suite_run_execution_output"
|
251
|
+
require_relative "vellum_ai/types/test_suite_run_execution_search_results_output"
|
252
|
+
require_relative "vellum_ai/types/test_suite_run_execution_string_output"
|
253
|
+
require_relative "vellum_ai/types/test_suite_run_metric_error_output"
|
254
|
+
require_relative "vellum_ai/types/test_suite_run_metric_error_output_type_enum"
|
255
|
+
require_relative "vellum_ai/types/test_suite_run_metric_number_output"
|
256
|
+
require_relative "vellum_ai/types/test_suite_run_metric_number_output_type_enum"
|
257
|
+
require_relative "vellum_ai/types/test_suite_run_metric_output"
|
258
|
+
require_relative "vellum_ai/types/test_suite_run_read"
|
259
|
+
require_relative "vellum_ai/types/test_suite_run_state"
|
260
|
+
require_relative "vellum_ai/types/test_suite_run_test_suite"
|
261
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config"
|
262
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data"
|
263
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data_request"
|
264
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_request"
|
265
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_type_enum"
|
236
266
|
require_relative "vellum_ai/types/test_suite_test_case"
|
237
267
|
require_relative "vellum_ai/types/upload_document_error_response"
|
238
268
|
require_relative "vellum_ai/types/upload_document_response"
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../requests"
|
4
|
+
require_relative "../types/test_suite_run_exec_config_request"
|
5
|
+
require_relative "../types/test_suite_run_read"
|
6
|
+
require_relative "../types/paginated_test_suite_run_execution_list"
|
7
|
+
require "async"
|
8
|
+
|
9
|
+
module Vellum
|
10
|
+
class TestSuiteRunsClient
|
11
|
+
attr_reader :request_client
|
12
|
+
|
13
|
+
# @param request_client [RequestClient]
|
14
|
+
# @return [TestSuiteRunsClient]
|
15
|
+
def initialize(request_client:)
|
16
|
+
# @type [RequestClient]
|
17
|
+
@request_client = request_client
|
18
|
+
end
|
19
|
+
|
20
|
+
# Trigger a Test Suite and create a new Test Suite Run
|
21
|
+
#
|
22
|
+
# @param test_suite_id [String] The ID of the Test Suite to run
|
23
|
+
# @param exec_config [Hash] Configuration that defines how the Test Suite should be runRequest of type TestSuiteRunExecConfigRequest, as a Hash
|
24
|
+
# @param request_options [RequestOptions]
|
25
|
+
# @return [TestSuiteRunRead]
|
26
|
+
def create(exec_config:, test_suite_id: nil, request_options: nil)
|
27
|
+
response = @request_client.conn.post do |req|
|
28
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
29
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
30
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
31
|
+
req.body = {
|
32
|
+
**(request_options&.additional_body_parameters || {}),
|
33
|
+
test_suite_id: test_suite_id,
|
34
|
+
exec_config: exec_config
|
35
|
+
}.compact
|
36
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs"
|
37
|
+
end
|
38
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Retrieve a specific Test Suite Run by ID
|
42
|
+
#
|
43
|
+
# @param id [String] A UUID string identifying this test suite run.
|
44
|
+
# @param request_options [RequestOptions]
|
45
|
+
# @return [TestSuiteRunRead]
|
46
|
+
def retrieve(id:, request_options: nil)
|
47
|
+
response = @request_client.conn.get do |req|
|
48
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
49
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
50
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
51
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}"
|
52
|
+
end
|
53
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
54
|
+
end
|
55
|
+
|
56
|
+
# @param id [String] A UUID string identifying this test suite run.
|
57
|
+
# @param limit [Integer] Number of results to return per page.
|
58
|
+
# @param offset [Integer] The initial index from which to return the results.
|
59
|
+
# @param request_options [RequestOptions]
|
60
|
+
# @return [PaginatedTestSuiteRunExecutionList]
|
61
|
+
def list_test_suite_run_executions(id:, limit: nil, offset: nil, request_options: nil)
|
62
|
+
response = @request_client.conn.get do |req|
|
63
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
64
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
65
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
66
|
+
req.params = {
|
67
|
+
**(request_options&.additional_query_parameters || {}),
|
68
|
+
"limit": limit,
|
69
|
+
"offset": offset
|
70
|
+
}.compact
|
71
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}/executions"
|
72
|
+
end
|
73
|
+
PaginatedTestSuiteRunExecutionList.from_json(json_object: response.body)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
class AsyncTestSuiteRunsClient
|
78
|
+
attr_reader :request_client
|
79
|
+
|
80
|
+
# @param request_client [AsyncRequestClient]
|
81
|
+
# @return [AsyncTestSuiteRunsClient]
|
82
|
+
def initialize(request_client:)
|
83
|
+
# @type [AsyncRequestClient]
|
84
|
+
@request_client = request_client
|
85
|
+
end
|
86
|
+
|
87
|
+
# Trigger a Test Suite and create a new Test Suite Run
|
88
|
+
#
|
89
|
+
# @param test_suite_id [String] The ID of the Test Suite to run
|
90
|
+
# @param exec_config [Hash] Configuration that defines how the Test Suite should be runRequest of type TestSuiteRunExecConfigRequest, as a Hash
|
91
|
+
# @param request_options [RequestOptions]
|
92
|
+
# @return [TestSuiteRunRead]
|
93
|
+
def create(exec_config:, test_suite_id: nil, request_options: nil)
|
94
|
+
Async do
|
95
|
+
response = @request_client.conn.post do |req|
|
96
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
97
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
98
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
99
|
+
req.body = {
|
100
|
+
**(request_options&.additional_body_parameters || {}),
|
101
|
+
test_suite_id: test_suite_id,
|
102
|
+
exec_config: exec_config
|
103
|
+
}.compact
|
104
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs"
|
105
|
+
end
|
106
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# Retrieve a specific Test Suite Run by ID
|
111
|
+
#
|
112
|
+
# @param id [String] A UUID string identifying this test suite run.
|
113
|
+
# @param request_options [RequestOptions]
|
114
|
+
# @return [TestSuiteRunRead]
|
115
|
+
def retrieve(id:, request_options: nil)
|
116
|
+
Async do
|
117
|
+
response = @request_client.conn.get do |req|
|
118
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
119
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
120
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
121
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}"
|
122
|
+
end
|
123
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# @param id [String] A UUID string identifying this test suite run.
|
128
|
+
# @param limit [Integer] Number of results to return per page.
|
129
|
+
# @param offset [Integer] The initial index from which to return the results.
|
130
|
+
# @param request_options [RequestOptions]
|
131
|
+
# @return [PaginatedTestSuiteRunExecutionList]
|
132
|
+
def list_test_suite_run_executions(id:, limit: nil, offset: nil, request_options: nil)
|
133
|
+
Async do
|
134
|
+
response = @request_client.conn.get do |req|
|
135
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
136
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
137
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
138
|
+
req.params = {
|
139
|
+
**(request_options&.additional_query_parameters || {}),
|
140
|
+
"limit": limit,
|
141
|
+
"offset": offset
|
142
|
+
}.compact
|
143
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}/executions"
|
144
|
+
end
|
145
|
+
PaginatedTestSuiteRunExecutionList.from_json(json_object: response.body)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_run_execution"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class PaginatedTestSuiteRunExecutionList
|
8
|
+
attr_reader :count, :next_, :previous, :results, :additional_properties
|
9
|
+
|
10
|
+
# @param count [Integer]
|
11
|
+
# @param next_ [String]
|
12
|
+
# @param previous [String]
|
13
|
+
# @param results [Array<TestSuiteRunExecution>]
|
14
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
# @return [PaginatedTestSuiteRunExecutionList]
|
16
|
+
def initialize(count: nil, next_: nil, previous: nil, results: nil, additional_properties: nil)
|
17
|
+
# @type [Integer]
|
18
|
+
@count = count
|
19
|
+
# @type [String]
|
20
|
+
@next_ = next_
|
21
|
+
# @type [String]
|
22
|
+
@previous = previous
|
23
|
+
# @type [Array<TestSuiteRunExecution>]
|
24
|
+
@results = results
|
25
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
end
|
28
|
+
|
29
|
+
# Deserialize a JSON object to an instance of PaginatedTestSuiteRunExecutionList
|
30
|
+
#
|
31
|
+
# @param json_object [JSON]
|
32
|
+
# @return [PaginatedTestSuiteRunExecutionList]
|
33
|
+
def self.from_json(json_object:)
|
34
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
|
+
parsed_json = JSON.parse(json_object)
|
36
|
+
count = struct.count
|
37
|
+
next_ = struct.next
|
38
|
+
previous = struct.previous
|
39
|
+
results = parsed_json["results"].map do |v|
|
40
|
+
v = v.to_json
|
41
|
+
TestSuiteRunExecution.from_json(json_object: v)
|
42
|
+
end
|
43
|
+
new(count: count, next_: next_, previous: previous, results: results, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of PaginatedTestSuiteRunExecutionList to a JSON object
|
47
|
+
#
|
48
|
+
# @return [JSON]
|
49
|
+
def to_json(*_args)
|
50
|
+
{ "count": @count, "next": @next_, "previous": @previous, "results": @results }.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# 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.
|
54
|
+
#
|
55
|
+
# @param obj [Object]
|
56
|
+
# @return [Void]
|
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.")
|
59
|
+
obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
|
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.")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_run_deployment_release_tag_exec_config_data"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
# Execution configuration for running a Test Suite against a Prompt Deployment
|
8
|
+
class TestSuiteRunDeploymentReleaseTagExecConfig
|
9
|
+
attr_reader :data, :test_case_ids, :additional_properties
|
10
|
+
|
11
|
+
# @param data [TestSuiteRunDeploymentReleaseTagExecConfigData]
|
12
|
+
# @param test_case_ids [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
|
13
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfig]
|
15
|
+
def initialize(data:, test_case_ids: nil, additional_properties: nil)
|
16
|
+
# @type [TestSuiteRunDeploymentReleaseTagExecConfigData]
|
17
|
+
@data = data
|
18
|
+
# @type [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
|
19
|
+
@test_case_ids = test_case_ids
|
20
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
@additional_properties = additional_properties
|
22
|
+
end
|
23
|
+
|
24
|
+
# Deserialize a JSON object to an instance of TestSuiteRunDeploymentReleaseTagExecConfig
|
25
|
+
#
|
26
|
+
# @param json_object [JSON]
|
27
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfig]
|
28
|
+
def self.from_json(json_object:)
|
29
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
30
|
+
parsed_json = JSON.parse(json_object)
|
31
|
+
if parsed_json["data"].nil?
|
32
|
+
data = nil
|
33
|
+
else
|
34
|
+
data = parsed_json["data"].to_json
|
35
|
+
data = TestSuiteRunDeploymentReleaseTagExecConfigData.from_json(json_object: data)
|
36
|
+
end
|
37
|
+
test_case_ids = struct.test_case_ids
|
38
|
+
new(data: data, test_case_ids: test_case_ids, additional_properties: struct)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Serialize an instance of TestSuiteRunDeploymentReleaseTagExecConfig to a JSON object
|
42
|
+
#
|
43
|
+
# @return [JSON]
|
44
|
+
def to_json(*_args)
|
45
|
+
{ "data": @data, "test_case_ids": @test_case_ids }.to_json
|
46
|
+
end
|
47
|
+
|
48
|
+
# 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.
|
49
|
+
#
|
50
|
+
# @param obj [Object]
|
51
|
+
# @return [Void]
|
52
|
+
def self.validate_raw(obj:)
|
53
|
+
TestSuiteRunDeploymentReleaseTagExecConfigData.validate_raw(obj: obj.data)
|
54
|
+
obj.test_case_ids&.is_a?(Array) != false || raise("Passed value for field obj.test_case_ids is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class TestSuiteRunDeploymentReleaseTagExecConfigData
|
7
|
+
attr_reader :deployment_id, :tag, :additional_properties
|
8
|
+
|
9
|
+
# @param deployment_id [String] The ID of the Prompt Deployment to run the Test Suite against.
|
10
|
+
# @param tag [String] A tag identifying which release of the Prompt Deployment to run the Test Suite against. Useful for testing past versions of the Prompt Deployment
|
11
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfigData]
|
13
|
+
def initialize(deployment_id:, tag: nil, additional_properties: nil)
|
14
|
+
# @type [String] The ID of the Prompt Deployment to run the Test Suite against.
|
15
|
+
@deployment_id = deployment_id
|
16
|
+
# @type [String] A tag identifying which release of the Prompt Deployment to run the Test Suite against. Useful for testing past versions of the Prompt Deployment
|
17
|
+
@tag = tag
|
18
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
@additional_properties = additional_properties
|
20
|
+
end
|
21
|
+
|
22
|
+
# Deserialize a JSON object to an instance of TestSuiteRunDeploymentReleaseTagExecConfigData
|
23
|
+
#
|
24
|
+
# @param json_object [JSON]
|
25
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfigData]
|
26
|
+
def self.from_json(json_object:)
|
27
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
28
|
+
JSON.parse(json_object)
|
29
|
+
deployment_id = struct.deployment_id
|
30
|
+
tag = struct.tag
|
31
|
+
new(deployment_id: deployment_id, tag: tag, additional_properties: struct)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Serialize an instance of TestSuiteRunDeploymentReleaseTagExecConfigData to a JSON object
|
35
|
+
#
|
36
|
+
# @return [JSON]
|
37
|
+
def to_json(*_args)
|
38
|
+
{ "deployment_id": @deployment_id, "tag": @tag }.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.deployment_id.is_a?(String) != false || raise("Passed value for field obj.deployment_id is not the expected type, validation failed.")
|
47
|
+
obj.tag&.is_a?(String) != false || raise("Passed value for field obj.tag is not the expected type, validation failed.")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class TestSuiteRunDeploymentReleaseTagExecConfigDataRequest
|
7
|
+
attr_reader :deployment_id, :tag, :additional_properties
|
8
|
+
|
9
|
+
# @param deployment_id [String] The ID of the Prompt Deployment to run the Test Suite against.
|
10
|
+
# @param tag [String] A tag identifying which release of the Prompt Deployment to run the Test Suite against. Useful for testing past versions of the Prompt Deployment
|
11
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfigDataRequest]
|
13
|
+
def initialize(deployment_id:, tag: nil, additional_properties: nil)
|
14
|
+
# @type [String] The ID of the Prompt Deployment to run the Test Suite against.
|
15
|
+
@deployment_id = deployment_id
|
16
|
+
# @type [String] A tag identifying which release of the Prompt Deployment to run the Test Suite against. Useful for testing past versions of the Prompt Deployment
|
17
|
+
@tag = tag
|
18
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
@additional_properties = additional_properties
|
20
|
+
end
|
21
|
+
|
22
|
+
# Deserialize a JSON object to an instance of TestSuiteRunDeploymentReleaseTagExecConfigDataRequest
|
23
|
+
#
|
24
|
+
# @param json_object [JSON]
|
25
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfigDataRequest]
|
26
|
+
def self.from_json(json_object:)
|
27
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
28
|
+
JSON.parse(json_object)
|
29
|
+
deployment_id = struct.deployment_id
|
30
|
+
tag = struct.tag
|
31
|
+
new(deployment_id: deployment_id, tag: tag, additional_properties: struct)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Serialize an instance of TestSuiteRunDeploymentReleaseTagExecConfigDataRequest to a JSON object
|
35
|
+
#
|
36
|
+
# @return [JSON]
|
37
|
+
def to_json(*_args)
|
38
|
+
{ "deployment_id": @deployment_id, "tag": @tag }.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.deployment_id.is_a?(String) != false || raise("Passed value for field obj.deployment_id is not the expected type, validation failed.")
|
47
|
+
obj.tag&.is_a?(String) != false || raise("Passed value for field obj.tag is not the expected type, validation failed.")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_run_deployment_release_tag_exec_config_data_request"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
# Execution configuration for running a Test Suite against a Prompt Deployment
|
8
|
+
class TestSuiteRunDeploymentReleaseTagExecConfigRequest
|
9
|
+
attr_reader :data, :test_case_ids, :additional_properties
|
10
|
+
|
11
|
+
# @param data [TestSuiteRunDeploymentReleaseTagExecConfigDataRequest]
|
12
|
+
# @param test_case_ids [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
|
13
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfigRequest]
|
15
|
+
def initialize(data:, test_case_ids: nil, additional_properties: nil)
|
16
|
+
# @type [TestSuiteRunDeploymentReleaseTagExecConfigDataRequest]
|
17
|
+
@data = data
|
18
|
+
# @type [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
|
19
|
+
@test_case_ids = test_case_ids
|
20
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
@additional_properties = additional_properties
|
22
|
+
end
|
23
|
+
|
24
|
+
# Deserialize a JSON object to an instance of TestSuiteRunDeploymentReleaseTagExecConfigRequest
|
25
|
+
#
|
26
|
+
# @param json_object [JSON]
|
27
|
+
# @return [TestSuiteRunDeploymentReleaseTagExecConfigRequest]
|
28
|
+
def self.from_json(json_object:)
|
29
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
30
|
+
parsed_json = JSON.parse(json_object)
|
31
|
+
if parsed_json["data"].nil?
|
32
|
+
data = nil
|
33
|
+
else
|
34
|
+
data = parsed_json["data"].to_json
|
35
|
+
data = TestSuiteRunDeploymentReleaseTagExecConfigDataRequest.from_json(json_object: data)
|
36
|
+
end
|
37
|
+
test_case_ids = struct.test_case_ids
|
38
|
+
new(data: data, test_case_ids: test_case_ids, additional_properties: struct)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Serialize an instance of TestSuiteRunDeploymentReleaseTagExecConfigRequest to a JSON object
|
42
|
+
#
|
43
|
+
# @return [JSON]
|
44
|
+
def to_json(*_args)
|
45
|
+
{ "data": @data, "test_case_ids": @test_case_ids }.to_json
|
46
|
+
end
|
47
|
+
|
48
|
+
# 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.
|
49
|
+
#
|
50
|
+
# @param obj [Object]
|
51
|
+
# @return [Void]
|
52
|
+
def self.validate_raw(obj:)
|
53
|
+
TestSuiteRunDeploymentReleaseTagExecConfigDataRequest.validate_raw(obj: obj.data)
|
54
|
+
obj.test_case_ids&.is_a?(Array) != false || raise("Passed value for field obj.test_case_ids is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "test_suite_run_deployment_release_tag_exec_config"
|
5
|
+
require_relative "test_suite_run_workflow_release_tag_exec_config"
|
6
|
+
|
7
|
+
module Vellum
|
8
|
+
class TestSuiteRunExecConfig
|
9
|
+
attr_reader :member, :discriminant
|
10
|
+
|
11
|
+
private_class_method :new
|
12
|
+
alias kind_of? is_a?
|
13
|
+
# @param member [Object]
|
14
|
+
# @param discriminant [String]
|
15
|
+
# @return [TestSuiteRunExecConfig]
|
16
|
+
def initialize(member:, discriminant:)
|
17
|
+
# @type [Object]
|
18
|
+
@member = member
|
19
|
+
# @type [String]
|
20
|
+
@discriminant = discriminant
|
21
|
+
end
|
22
|
+
|
23
|
+
# Deserialize a JSON object to an instance of TestSuiteRunExecConfig
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [TestSuiteRunExecConfig]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
member = case struct.type
|
30
|
+
when "DEPLOYMENT_RELEASE_TAG"
|
31
|
+
TestSuiteRunDeploymentReleaseTagExecConfig.from_json(json_object: json_object)
|
32
|
+
when "WORKFLOW_RELEASE_TAG"
|
33
|
+
TestSuiteRunWorkflowReleaseTagExecConfig.from_json(json_object: json_object)
|
34
|
+
else
|
35
|
+
TestSuiteRunDeploymentReleaseTagExecConfig.from_json(json_object: json_object)
|
36
|
+
end
|
37
|
+
new(member: member, discriminant: struct.type)
|
38
|
+
end
|
39
|
+
|
40
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
41
|
+
#
|
42
|
+
# @return [JSON]
|
43
|
+
def to_json(*_args)
|
44
|
+
case @discriminant
|
45
|
+
when "DEPLOYMENT_RELEASE_TAG"
|
46
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
47
|
+
when "WORKFLOW_RELEASE_TAG"
|
48
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
49
|
+
else
|
50
|
+
{ "type": @discriminant, value: @member }.to_json
|
51
|
+
end
|
52
|
+
@member.to_json
|
53
|
+
end
|
54
|
+
|
55
|
+
# 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.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
case obj.type
|
61
|
+
when "DEPLOYMENT_RELEASE_TAG"
|
62
|
+
TestSuiteRunDeploymentReleaseTagExecConfig.validate_raw(obj: obj)
|
63
|
+
when "WORKFLOW_RELEASE_TAG"
|
64
|
+
TestSuiteRunWorkflowReleaseTagExecConfig.validate_raw(obj: obj)
|
65
|
+
else
|
66
|
+
raise("Passed value matched no type within the union, validation failed.")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
71
|
+
#
|
72
|
+
# @param obj [Object]
|
73
|
+
# @return [Boolean]
|
74
|
+
def is_a?(obj)
|
75
|
+
@member.is_a?(obj)
|
76
|
+
end
|
77
|
+
|
78
|
+
# @param member [TestSuiteRunDeploymentReleaseTagExecConfig]
|
79
|
+
# @return [TestSuiteRunExecConfig]
|
80
|
+
def self.deployment_release_tag(member:)
|
81
|
+
new(member: member, discriminant: "DEPLOYMENT_RELEASE_TAG")
|
82
|
+
end
|
83
|
+
|
84
|
+
# @param member [TestSuiteRunWorkflowReleaseTagExecConfig]
|
85
|
+
# @return [TestSuiteRunExecConfig]
|
86
|
+
def self.workflow_release_tag(member:)
|
87
|
+
new(member: member, discriminant: "WORKFLOW_RELEASE_TAG")
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|