vellum_ai 0.3.11 → 0.3.13
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 +31 -0
- data/lib/vellum_ai/document_indexes/client.rb +150 -0
- data/lib/vellum_ai/test_suite_runs/client.rb +149 -0
- data/lib/vellum_ai/types/array_variable_value_item.rb +13 -0
- data/lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb +19 -5
- data/lib/vellum_ai/types/generate_request.rb +2 -2
- data/lib/vellum_ai/types/image_variable_value.rb +52 -0
- data/lib/vellum_ai/types/initiated_workflow_node_result_event.rb +11 -4
- data/lib/vellum_ai/types/paginated_test_suite_run_execution_list.rb +64 -0
- data/lib/vellum_ai/types/rejected_workflow_node_result_event.rb +11 -4
- data/lib/vellum_ai/types/streaming_workflow_node_result_event.rb +12 -5
- 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_execution_event_error_code.rb +1 -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 +34 -2
@@ -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
|
@@ -8,17 +8,19 @@ require "json"
|
|
8
8
|
module Vellum
|
9
9
|
# An event that indicates that the node has rejected its execution.
|
10
10
|
class RejectedWorkflowNodeResultEvent
|
11
|
-
attr_reader :id, :node_id, :node_result_id, :ts, :data, :error, :additional_properties
|
11
|
+
attr_reader :id, :node_id, :node_result_id, :ts, :data, :source_execution_id, :error, :additional_properties
|
12
12
|
|
13
13
|
# @param id [String]
|
14
14
|
# @param node_id [String]
|
15
15
|
# @param node_result_id [String]
|
16
16
|
# @param ts [DateTime]
|
17
17
|
# @param data [WorkflowNodeResultData]
|
18
|
+
# @param source_execution_id [String]
|
18
19
|
# @param error [WorkflowEventError]
|
19
20
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
21
|
# @return [RejectedWorkflowNodeResultEvent]
|
21
|
-
def initialize(id:, node_id:, node_result_id:, error:, ts: nil, data: nil,
|
22
|
+
def initialize(id:, node_id:, node_result_id:, error:, ts: nil, data: nil, source_execution_id: nil,
|
23
|
+
additional_properties: nil)
|
22
24
|
# @type [String]
|
23
25
|
@id = id
|
24
26
|
# @type [String]
|
@@ -29,6 +31,8 @@ module Vellum
|
|
29
31
|
@ts = ts
|
30
32
|
# @type [WorkflowNodeResultData]
|
31
33
|
@data = data
|
34
|
+
# @type [String]
|
35
|
+
@source_execution_id = source_execution_id
|
32
36
|
# @type [WorkflowEventError]
|
33
37
|
@error = error
|
34
38
|
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -52,14 +56,15 @@ module Vellum
|
|
52
56
|
data = parsed_json["data"].to_json
|
53
57
|
data = WorkflowNodeResultData.from_json(json_object: data)
|
54
58
|
end
|
59
|
+
source_execution_id = struct.source_execution_id
|
55
60
|
if parsed_json["error"].nil?
|
56
61
|
error = nil
|
57
62
|
else
|
58
63
|
error = parsed_json["error"].to_json
|
59
64
|
error = WorkflowEventError.from_json(json_object: error)
|
60
65
|
end
|
61
|
-
new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
|
62
|
-
additional_properties: struct)
|
66
|
+
new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
|
67
|
+
source_execution_id: source_execution_id, error: error, additional_properties: struct)
|
63
68
|
end
|
64
69
|
|
65
70
|
# Serialize an instance of RejectedWorkflowNodeResultEvent to a JSON object
|
@@ -72,6 +77,7 @@ module Vellum
|
|
72
77
|
"node_result_id": @node_result_id,
|
73
78
|
"ts": @ts,
|
74
79
|
"data": @data,
|
80
|
+
"source_execution_id": @source_execution_id,
|
75
81
|
"error": @error
|
76
82
|
}.to_json
|
77
83
|
end
|
@@ -86,6 +92,7 @@ module Vellum
|
|
86
92
|
obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.")
|
87
93
|
obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
|
88
94
|
obj.data.nil? || WorkflowNodeResultData.validate_raw(obj: obj.data)
|
95
|
+
obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.")
|
89
96
|
WorkflowEventError.validate_raw(obj: obj.error)
|
90
97
|
end
|
91
98
|
end
|
@@ -8,19 +8,21 @@ require "json"
|
|
8
8
|
module Vellum
|
9
9
|
# An event that indicates that the node has execution is in progress.
|
10
10
|
class StreamingWorkflowNodeResultEvent
|
11
|
-
attr_reader :id, :node_id, :node_result_id, :ts, :data, :output, :output_index,
|
11
|
+
attr_reader :id, :node_id, :node_result_id, :ts, :data, :source_execution_id, :output, :output_index,
|
12
|
+
:additional_properties
|
12
13
|
|
13
14
|
# @param id [String]
|
14
15
|
# @param node_id [String]
|
15
16
|
# @param node_result_id [String]
|
16
17
|
# @param ts [DateTime]
|
17
18
|
# @param data [WorkflowNodeResultData]
|
19
|
+
# @param source_execution_id [String]
|
18
20
|
# @param output [NodeOutputCompiledValue]
|
19
21
|
# @param output_index [Integer]
|
20
22
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
23
|
# @return [StreamingWorkflowNodeResultEvent]
|
22
|
-
def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil,
|
23
|
-
additional_properties: nil)
|
24
|
+
def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, output: nil,
|
25
|
+
output_index: nil, additional_properties: nil)
|
24
26
|
# @type [String]
|
25
27
|
@id = id
|
26
28
|
# @type [String]
|
@@ -31,6 +33,8 @@ module Vellum
|
|
31
33
|
@ts = ts
|
32
34
|
# @type [WorkflowNodeResultData]
|
33
35
|
@data = data
|
36
|
+
# @type [String]
|
37
|
+
@source_execution_id = source_execution_id
|
34
38
|
# @type [NodeOutputCompiledValue]
|
35
39
|
@output = output
|
36
40
|
# @type [Integer]
|
@@ -56,6 +60,7 @@ module Vellum
|
|
56
60
|
data = parsed_json["data"].to_json
|
57
61
|
data = WorkflowNodeResultData.from_json(json_object: data)
|
58
62
|
end
|
63
|
+
source_execution_id = struct.source_execution_id
|
59
64
|
if parsed_json["output"].nil?
|
60
65
|
output = nil
|
61
66
|
else
|
@@ -63,8 +68,8 @@ module Vellum
|
|
63
68
|
output = NodeOutputCompiledValue.from_json(json_object: output)
|
64
69
|
end
|
65
70
|
output_index = struct.output_index
|
66
|
-
new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
|
67
|
-
output_index: output_index, additional_properties: struct)
|
71
|
+
new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
|
72
|
+
source_execution_id: source_execution_id, output: output, output_index: output_index, additional_properties: struct)
|
68
73
|
end
|
69
74
|
|
70
75
|
# Serialize an instance of StreamingWorkflowNodeResultEvent to a JSON object
|
@@ -77,6 +82,7 @@ module Vellum
|
|
77
82
|
"node_result_id": @node_result_id,
|
78
83
|
"ts": @ts,
|
79
84
|
"data": @data,
|
85
|
+
"source_execution_id": @source_execution_id,
|
80
86
|
"output": @output,
|
81
87
|
"output_index": @output_index
|
82
88
|
}.to_json
|
@@ -92,6 +98,7 @@ module Vellum
|
|
92
98
|
obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.")
|
93
99
|
obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
|
94
100
|
obj.data.nil? || WorkflowNodeResultData.validate_raw(obj: obj.data)
|
101
|
+
obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.")
|
95
102
|
obj.output.nil? || NodeOutputCompiledValue.validate_raw(obj: obj.output)
|
96
103
|
obj.output_index&.is_a?(Integer) != false || raise("Passed value for field obj.output_index is not the expected type, validation failed.")
|
97
104
|
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
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "test_suite_run_deployment_release_tag_exec_config_request"
|
5
|
+
require_relative "test_suite_run_workflow_release_tag_exec_config_request"
|
6
|
+
|
7
|
+
module Vellum
|
8
|
+
class TestSuiteRunExecConfigRequest
|
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 [TestSuiteRunExecConfigRequest]
|
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 TestSuiteRunExecConfigRequest
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [TestSuiteRunExecConfigRequest]
|
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
|
+
TestSuiteRunDeploymentReleaseTagExecConfigRequest.from_json(json_object: json_object)
|
32
|
+
when "WORKFLOW_RELEASE_TAG"
|
33
|
+
TestSuiteRunWorkflowReleaseTagExecConfigRequest.from_json(json_object: json_object)
|
34
|
+
else
|
35
|
+
TestSuiteRunDeploymentReleaseTagExecConfigRequest.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
|
+
TestSuiteRunDeploymentReleaseTagExecConfigRequest.validate_raw(obj: obj)
|
63
|
+
when "WORKFLOW_RELEASE_TAG"
|
64
|
+
TestSuiteRunWorkflowReleaseTagExecConfigRequest.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 [TestSuiteRunDeploymentReleaseTagExecConfigRequest]
|
79
|
+
# @return [TestSuiteRunExecConfigRequest]
|
80
|
+
def self.deployment_release_tag(member:)
|
81
|
+
new(member: member, discriminant: "DEPLOYMENT_RELEASE_TAG")
|
82
|
+
end
|
83
|
+
|
84
|
+
# @param member [TestSuiteRunWorkflowReleaseTagExecConfigRequest]
|
85
|
+
# @return [TestSuiteRunExecConfigRequest]
|
86
|
+
def self.workflow_release_tag(member:)
|
87
|
+
new(member: member, discriminant: "WORKFLOW_RELEASE_TAG")
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_run_execution_output"
|
4
|
+
require_relative "test_suite_run_execution_metric_result"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Vellum
|
8
|
+
class TestSuiteRunExecution
|
9
|
+
attr_reader :id, :test_case_id, :outputs, :metric_results, :additional_properties
|
10
|
+
|
11
|
+
# @param id [String]
|
12
|
+
# @param test_case_id [String]
|
13
|
+
# @param outputs [Array<TestSuiteRunExecutionOutput>]
|
14
|
+
# @param metric_results [Array<TestSuiteRunExecutionMetricResult>]
|
15
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
16
|
+
# @return [TestSuiteRunExecution]
|
17
|
+
def initialize(id:, test_case_id:, outputs:, metric_results:, additional_properties: nil)
|
18
|
+
# @type [String]
|
19
|
+
@id = id
|
20
|
+
# @type [String]
|
21
|
+
@test_case_id = test_case_id
|
22
|
+
# @type [Array<TestSuiteRunExecutionOutput>]
|
23
|
+
@outputs = outputs
|
24
|
+
# @type [Array<TestSuiteRunExecutionMetricResult>]
|
25
|
+
@metric_results = metric_results
|
26
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of TestSuiteRunExecution
|
31
|
+
#
|
32
|
+
# @param json_object [JSON]
|
33
|
+
# @return [TestSuiteRunExecution]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
id = struct.id
|
38
|
+
test_case_id = struct.test_case_id
|
39
|
+
outputs = parsed_json["outputs"].map do |v|
|
40
|
+
v = v.to_json
|
41
|
+
TestSuiteRunExecutionOutput.from_json(json_object: v)
|
42
|
+
end
|
43
|
+
metric_results = parsed_json["metric_results"].map do |v|
|
44
|
+
v = v.to_json
|
45
|
+
TestSuiteRunExecutionMetricResult.from_json(json_object: v)
|
46
|
+
end
|
47
|
+
new(id: id, test_case_id: test_case_id, outputs: outputs, metric_results: metric_results,
|
48
|
+
additional_properties: struct)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Serialize an instance of TestSuiteRunExecution to a JSON object
|
52
|
+
#
|
53
|
+
# @return [JSON]
|
54
|
+
def to_json(*_args)
|
55
|
+
{ "id": @id, "test_case_id": @test_case_id, "outputs": @outputs, "metric_results": @metric_results }.to_json
|
56
|
+
end
|
57
|
+
|
58
|
+
# 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.
|
59
|
+
#
|
60
|
+
# @param obj [Object]
|
61
|
+
# @return [Void]
|
62
|
+
def self.validate_raw(obj:)
|
63
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
64
|
+
obj.test_case_id.is_a?(String) != false || raise("Passed value for field obj.test_case_id is not the expected type, validation failed.")
|
65
|
+
obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.")
|
66
|
+
obj.metric_results.is_a?(Array) != false || raise("Passed value for field obj.metric_results is not the expected type, validation failed.")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|