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,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "chat_message"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class TestSuiteRunExecutionChatHistoryOutput
|
8
|
+
attr_reader :output_variable_id, :value, :additional_properties
|
9
|
+
|
10
|
+
# @param output_variable_id [String]
|
11
|
+
# @param value [Array<ChatMessage>]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [TestSuiteRunExecutionChatHistoryOutput]
|
14
|
+
def initialize(output_variable_id:, value: nil, additional_properties: nil)
|
15
|
+
# @type [String]
|
16
|
+
@output_variable_id = output_variable_id
|
17
|
+
# @type [Array<ChatMessage>]
|
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 TestSuiteRunExecutionChatHistoryOutput
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [TestSuiteRunExecutionChatHistoryOutput]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
parsed_json = JSON.parse(json_object)
|
30
|
+
output_variable_id = struct.output_variable_id
|
31
|
+
value = parsed_json["value"].map do |v|
|
32
|
+
v = v.to_json
|
33
|
+
ChatMessage.from_json(json_object: v)
|
34
|
+
end
|
35
|
+
new(output_variable_id: output_variable_id, value: value, additional_properties: struct)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Serialize an instance of TestSuiteRunExecutionChatHistoryOutput to a JSON object
|
39
|
+
#
|
40
|
+
# @return [JSON]
|
41
|
+
def to_json(*_args)
|
42
|
+
{ "output_variable_id": @output_variable_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.output_variable_id.is_a?(String) != false || raise("Passed value for field obj.output_variable_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 "vellum_error"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class TestSuiteRunExecutionErrorOutput
|
8
|
+
attr_reader :output_variable_id, :value, :additional_properties
|
9
|
+
|
10
|
+
# @param output_variable_id [String]
|
11
|
+
# @param value [VellumError]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [TestSuiteRunExecutionErrorOutput]
|
14
|
+
def initialize(output_variable_id:, value: nil, additional_properties: nil)
|
15
|
+
# @type [String]
|
16
|
+
@output_variable_id = output_variable_id
|
17
|
+
# @type [VellumError]
|
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 TestSuiteRunExecutionErrorOutput
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [TestSuiteRunExecutionErrorOutput]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
parsed_json = JSON.parse(json_object)
|
30
|
+
output_variable_id = struct.output_variable_id
|
31
|
+
if parsed_json["value"].nil?
|
32
|
+
value = nil
|
33
|
+
else
|
34
|
+
value = parsed_json["value"].to_json
|
35
|
+
value = VellumError.from_json(json_object: value)
|
36
|
+
end
|
37
|
+
new(output_variable_id: output_variable_id, value: value, additional_properties: struct)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Serialize an instance of TestSuiteRunExecutionErrorOutput to a JSON object
|
41
|
+
#
|
42
|
+
# @return [JSON]
|
43
|
+
def to_json(*_args)
|
44
|
+
{ "output_variable_id": @output_variable_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.output_variable_id.is_a?(String) != false || raise("Passed value for field obj.output_variable_id is not the expected type, validation failed.")
|
53
|
+
obj.value.nil? || VellumError.validate_raw(obj: obj.value)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class TestSuiteRunExecutionJsonOutput
|
7
|
+
attr_reader :output_variable_id, :value, :additional_properties
|
8
|
+
|
9
|
+
# @param output_variable_id [String]
|
10
|
+
# @param value [Hash{String => String}]
|
11
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
# @return [TestSuiteRunExecutionJsonOutput]
|
13
|
+
def initialize(output_variable_id:, value: nil, additional_properties: nil)
|
14
|
+
# @type [String]
|
15
|
+
@output_variable_id = output_variable_id
|
16
|
+
# @type [Hash{String => String}]
|
17
|
+
@value = value
|
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 TestSuiteRunExecutionJsonOutput
|
23
|
+
#
|
24
|
+
# @param json_object [JSON]
|
25
|
+
# @return [TestSuiteRunExecutionJsonOutput]
|
26
|
+
def self.from_json(json_object:)
|
27
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
28
|
+
JSON.parse(json_object)
|
29
|
+
output_variable_id = struct.output_variable_id
|
30
|
+
value = struct.value
|
31
|
+
new(output_variable_id: output_variable_id, value: value, additional_properties: struct)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Serialize an instance of TestSuiteRunExecutionJsonOutput to a JSON object
|
35
|
+
#
|
36
|
+
# @return [JSON]
|
37
|
+
def to_json(*_args)
|
38
|
+
{ "output_variable_id": @output_variable_id, "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.output_variable_id.is_a?(String) != false || raise("Passed value for field obj.output_variable_id is not the expected type, validation failed.")
|
47
|
+
obj.value&.is_a?(Hash) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_run_metric_output"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class TestSuiteRunExecutionMetricResult
|
8
|
+
attr_reader :metric_id, :outputs, :additional_properties
|
9
|
+
|
10
|
+
# @param metric_id [String]
|
11
|
+
# @param outputs [Array<TestSuiteRunMetricOutput>]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [TestSuiteRunExecutionMetricResult]
|
14
|
+
def initialize(metric_id:, outputs:, additional_properties: nil)
|
15
|
+
# @type [String]
|
16
|
+
@metric_id = metric_id
|
17
|
+
# @type [Array<TestSuiteRunMetricOutput>]
|
18
|
+
@outputs = outputs
|
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 TestSuiteRunExecutionMetricResult
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [TestSuiteRunExecutionMetricResult]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
parsed_json = JSON.parse(json_object)
|
30
|
+
metric_id = struct.metric_id
|
31
|
+
outputs = parsed_json["outputs"].map do |v|
|
32
|
+
v = v.to_json
|
33
|
+
TestSuiteRunMetricOutput.from_json(json_object: v)
|
34
|
+
end
|
35
|
+
new(metric_id: metric_id, outputs: outputs, additional_properties: struct)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Serialize an instance of TestSuiteRunExecutionMetricResult to a JSON object
|
39
|
+
#
|
40
|
+
# @return [JSON]
|
41
|
+
def to_json(*_args)
|
42
|
+
{ "metric_id": @metric_id, "outputs": @outputs }.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.metric_id.is_a?(String) != false || raise("Passed value for field obj.metric_id is not the expected type, validation failed.")
|
51
|
+
obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class TestSuiteRunExecutionNumberOutput
|
7
|
+
attr_reader :output_variable_id, :value, :additional_properties
|
8
|
+
|
9
|
+
# @param output_variable_id [String]
|
10
|
+
# @param value [Float]
|
11
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
# @return [TestSuiteRunExecutionNumberOutput]
|
13
|
+
def initialize(output_variable_id:, value: nil, additional_properties: nil)
|
14
|
+
# @type [String]
|
15
|
+
@output_variable_id = output_variable_id
|
16
|
+
# @type [Float]
|
17
|
+
@value = value
|
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 TestSuiteRunExecutionNumberOutput
|
23
|
+
#
|
24
|
+
# @param json_object [JSON]
|
25
|
+
# @return [TestSuiteRunExecutionNumberOutput]
|
26
|
+
def self.from_json(json_object:)
|
27
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
28
|
+
JSON.parse(json_object)
|
29
|
+
output_variable_id = struct.output_variable_id
|
30
|
+
value = struct.value
|
31
|
+
new(output_variable_id: output_variable_id, value: value, additional_properties: struct)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Serialize an instance of TestSuiteRunExecutionNumberOutput to a JSON object
|
35
|
+
#
|
36
|
+
# @return [JSON]
|
37
|
+
def to_json(*_args)
|
38
|
+
{ "output_variable_id": @output_variable_id, "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.output_variable_id.is_a?(String) != false || raise("Passed value for field obj.output_variable_id is not the expected type, validation failed.")
|
47
|
+
obj.value&.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "test_suite_run_execution_string_output"
|
5
|
+
require_relative "test_suite_run_execution_number_output"
|
6
|
+
require_relative "test_suite_run_execution_json_output"
|
7
|
+
require_relative "test_suite_run_execution_chat_history_output"
|
8
|
+
require_relative "test_suite_run_execution_search_results_output"
|
9
|
+
require_relative "test_suite_run_execution_error_output"
|
10
|
+
|
11
|
+
module Vellum
|
12
|
+
class TestSuiteRunExecutionOutput
|
13
|
+
attr_reader :member, :discriminant
|
14
|
+
|
15
|
+
private_class_method :new
|
16
|
+
alias kind_of? is_a?
|
17
|
+
# @param member [Object]
|
18
|
+
# @param discriminant [String]
|
19
|
+
# @return [TestSuiteRunExecutionOutput]
|
20
|
+
def initialize(member:, discriminant:)
|
21
|
+
# @type [Object]
|
22
|
+
@member = member
|
23
|
+
# @type [String]
|
24
|
+
@discriminant = discriminant
|
25
|
+
end
|
26
|
+
|
27
|
+
# Deserialize a JSON object to an instance of TestSuiteRunExecutionOutput
|
28
|
+
#
|
29
|
+
# @param json_object [JSON]
|
30
|
+
# @return [TestSuiteRunExecutionOutput]
|
31
|
+
def self.from_json(json_object:)
|
32
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
33
|
+
member = case struct.type
|
34
|
+
when "STRING"
|
35
|
+
TestSuiteRunExecutionStringOutput.from_json(json_object: json_object)
|
36
|
+
when "NUMBER"
|
37
|
+
TestSuiteRunExecutionNumberOutput.from_json(json_object: json_object)
|
38
|
+
when "JSON"
|
39
|
+
TestSuiteRunExecutionJsonOutput.from_json(json_object: json_object)
|
40
|
+
when "CHAT_HISTORY"
|
41
|
+
TestSuiteRunExecutionChatHistoryOutput.from_json(json_object: json_object)
|
42
|
+
when "SEARCH_RESULTS"
|
43
|
+
TestSuiteRunExecutionSearchResultsOutput.from_json(json_object: json_object)
|
44
|
+
when "ERROR"
|
45
|
+
TestSuiteRunExecutionErrorOutput.from_json(json_object: json_object)
|
46
|
+
else
|
47
|
+
TestSuiteRunExecutionStringOutput.from_json(json_object: json_object)
|
48
|
+
end
|
49
|
+
new(member: member, discriminant: struct.type)
|
50
|
+
end
|
51
|
+
|
52
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
53
|
+
#
|
54
|
+
# @return [JSON]
|
55
|
+
def to_json(*_args)
|
56
|
+
case @discriminant
|
57
|
+
when "STRING"
|
58
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
59
|
+
when "NUMBER"
|
60
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
61
|
+
when "JSON"
|
62
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
63
|
+
when "CHAT_HISTORY"
|
64
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
65
|
+
when "SEARCH_RESULTS"
|
66
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
67
|
+
when "ERROR"
|
68
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
69
|
+
else
|
70
|
+
{ "type": @discriminant, value: @member }.to_json
|
71
|
+
end
|
72
|
+
@member.to_json
|
73
|
+
end
|
74
|
+
|
75
|
+
# 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.
|
76
|
+
#
|
77
|
+
# @param obj [Object]
|
78
|
+
# @return [Void]
|
79
|
+
def self.validate_raw(obj:)
|
80
|
+
case obj.type
|
81
|
+
when "STRING"
|
82
|
+
TestSuiteRunExecutionStringOutput.validate_raw(obj: obj)
|
83
|
+
when "NUMBER"
|
84
|
+
TestSuiteRunExecutionNumberOutput.validate_raw(obj: obj)
|
85
|
+
when "JSON"
|
86
|
+
TestSuiteRunExecutionJsonOutput.validate_raw(obj: obj)
|
87
|
+
when "CHAT_HISTORY"
|
88
|
+
TestSuiteRunExecutionChatHistoryOutput.validate_raw(obj: obj)
|
89
|
+
when "SEARCH_RESULTS"
|
90
|
+
TestSuiteRunExecutionSearchResultsOutput.validate_raw(obj: obj)
|
91
|
+
when "ERROR"
|
92
|
+
TestSuiteRunExecutionErrorOutput.validate_raw(obj: obj)
|
93
|
+
else
|
94
|
+
raise("Passed value matched no type within the union, validation failed.")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
99
|
+
#
|
100
|
+
# @param obj [Object]
|
101
|
+
# @return [Boolean]
|
102
|
+
def is_a?(obj)
|
103
|
+
@member.is_a?(obj)
|
104
|
+
end
|
105
|
+
|
106
|
+
# @param member [TestSuiteRunExecutionStringOutput]
|
107
|
+
# @return [TestSuiteRunExecutionOutput]
|
108
|
+
def self.string(member:)
|
109
|
+
new(member: member, discriminant: "STRING")
|
110
|
+
end
|
111
|
+
|
112
|
+
# @param member [TestSuiteRunExecutionNumberOutput]
|
113
|
+
# @return [TestSuiteRunExecutionOutput]
|
114
|
+
def self.number(member:)
|
115
|
+
new(member: member, discriminant: "NUMBER")
|
116
|
+
end
|
117
|
+
|
118
|
+
# @param member [TestSuiteRunExecutionJsonOutput]
|
119
|
+
# @return [TestSuiteRunExecutionOutput]
|
120
|
+
def self.json(member:)
|
121
|
+
new(member: member, discriminant: "JSON")
|
122
|
+
end
|
123
|
+
|
124
|
+
# @param member [TestSuiteRunExecutionChatHistoryOutput]
|
125
|
+
# @return [TestSuiteRunExecutionOutput]
|
126
|
+
def self.chat_history(member:)
|
127
|
+
new(member: member, discriminant: "CHAT_HISTORY")
|
128
|
+
end
|
129
|
+
|
130
|
+
# @param member [TestSuiteRunExecutionSearchResultsOutput]
|
131
|
+
# @return [TestSuiteRunExecutionOutput]
|
132
|
+
def self.search_results(member:)
|
133
|
+
new(member: member, discriminant: "SEARCH_RESULTS")
|
134
|
+
end
|
135
|
+
|
136
|
+
# @param member [TestSuiteRunExecutionErrorOutput]
|
137
|
+
# @return [TestSuiteRunExecutionOutput]
|
138
|
+
def self.error(member:)
|
139
|
+
new(member: member, discriminant: "ERROR")
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "search_result"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class TestSuiteRunExecutionSearchResultsOutput
|
8
|
+
attr_reader :output_variable_id, :value, :additional_properties
|
9
|
+
|
10
|
+
# @param output_variable_id [String]
|
11
|
+
# @param value [Array<SearchResult>]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [TestSuiteRunExecutionSearchResultsOutput]
|
14
|
+
def initialize(output_variable_id:, value: nil, additional_properties: nil)
|
15
|
+
# @type [String]
|
16
|
+
@output_variable_id = output_variable_id
|
17
|
+
# @type [Array<SearchResult>]
|
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 TestSuiteRunExecutionSearchResultsOutput
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [TestSuiteRunExecutionSearchResultsOutput]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
parsed_json = JSON.parse(json_object)
|
30
|
+
output_variable_id = struct.output_variable_id
|
31
|
+
value = parsed_json["value"].map do |v|
|
32
|
+
v = v.to_json
|
33
|
+
SearchResult.from_json(json_object: v)
|
34
|
+
end
|
35
|
+
new(output_variable_id: output_variable_id, value: value, additional_properties: struct)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Serialize an instance of TestSuiteRunExecutionSearchResultsOutput to a JSON object
|
39
|
+
#
|
40
|
+
# @return [JSON]
|
41
|
+
def to_json(*_args)
|
42
|
+
{ "output_variable_id": @output_variable_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.output_variable_id.is_a?(String) != false || raise("Passed value for field obj.output_variable_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,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class TestSuiteRunExecutionStringOutput
|
7
|
+
attr_reader :output_variable_id, :value, :additional_properties
|
8
|
+
|
9
|
+
# @param output_variable_id [String]
|
10
|
+
# @param value [String]
|
11
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
# @return [TestSuiteRunExecutionStringOutput]
|
13
|
+
def initialize(output_variable_id:, value: nil, additional_properties: nil)
|
14
|
+
# @type [String]
|
15
|
+
@output_variable_id = output_variable_id
|
16
|
+
# @type [String]
|
17
|
+
@value = value
|
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 TestSuiteRunExecutionStringOutput
|
23
|
+
#
|
24
|
+
# @param json_object [JSON]
|
25
|
+
# @return [TestSuiteRunExecutionStringOutput]
|
26
|
+
def self.from_json(json_object:)
|
27
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
28
|
+
JSON.parse(json_object)
|
29
|
+
output_variable_id = struct.output_variable_id
|
30
|
+
value = struct.value
|
31
|
+
new(output_variable_id: output_variable_id, value: value, additional_properties: struct)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Serialize an instance of TestSuiteRunExecutionStringOutput to a JSON object
|
35
|
+
#
|
36
|
+
# @return [JSON]
|
37
|
+
def to_json(*_args)
|
38
|
+
{ "output_variable_id": @output_variable_id, "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.output_variable_id.is_a?(String) != false || raise("Passed value for field obj.output_variable_id is not the expected type, validation failed.")
|
47
|
+
obj.value&.is_a?(String) != false || raise("Passed value for field obj.value 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 "vellum_error"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
# Output for a test suite run metric that is of type ERROR
|
8
|
+
class TestSuiteRunMetricErrorOutput
|
9
|
+
attr_reader :value, :name, :additional_properties
|
10
|
+
|
11
|
+
# @param value [VellumError]
|
12
|
+
# @param name [String]
|
13
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
# @return [TestSuiteRunMetricErrorOutput]
|
15
|
+
def initialize(value:, name:, additional_properties: nil)
|
16
|
+
# @type [VellumError]
|
17
|
+
@value = value
|
18
|
+
# @type [String]
|
19
|
+
@name = name
|
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 TestSuiteRunMetricErrorOutput
|
25
|
+
#
|
26
|
+
# @param json_object [JSON]
|
27
|
+
# @return [TestSuiteRunMetricErrorOutput]
|
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["value"].nil?
|
32
|
+
value = nil
|
33
|
+
else
|
34
|
+
value = parsed_json["value"].to_json
|
35
|
+
value = VellumError.from_json(json_object: value)
|
36
|
+
end
|
37
|
+
name = struct.name
|
38
|
+
new(value: value, name: name, additional_properties: struct)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Serialize an instance of TestSuiteRunMetricErrorOutput to a JSON object
|
42
|
+
#
|
43
|
+
# @return [JSON]
|
44
|
+
def to_json(*_args)
|
45
|
+
{ "value": @value, "name": @name }.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
|
+
VellumError.validate_raw(obj: obj.value)
|
54
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
# Output for a test suite run metric that is of type NUMBER
|
7
|
+
class TestSuiteRunMetricNumberOutput
|
8
|
+
attr_reader :value, :name, :additional_properties
|
9
|
+
|
10
|
+
# @param value [Float]
|
11
|
+
# @param name [String]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [TestSuiteRunMetricNumberOutput]
|
14
|
+
def initialize(value:, name:, additional_properties: nil)
|
15
|
+
# @type [Float]
|
16
|
+
@value = value
|
17
|
+
# @type [String]
|
18
|
+
@name = name
|
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 TestSuiteRunMetricNumberOutput
|
24
|
+
#
|
25
|
+
# @param json_object [JSON]
|
26
|
+
# @return [TestSuiteRunMetricNumberOutput]
|
27
|
+
def self.from_json(json_object:)
|
28
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
29
|
+
JSON.parse(json_object)
|
30
|
+
value = struct.value
|
31
|
+
name = struct.name
|
32
|
+
new(value: value, name: name, additional_properties: struct)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Serialize an instance of TestSuiteRunMetricNumberOutput to a JSON object
|
36
|
+
#
|
37
|
+
# @return [JSON]
|
38
|
+
def to_json(*_args)
|
39
|
+
{ "value": @value, "name": @name }.to_json
|
40
|
+
end
|
41
|
+
|
42
|
+
# 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.
|
43
|
+
#
|
44
|
+
# @param obj [Object]
|
45
|
+
# @return [Void]
|
46
|
+
def self.validate_raw(obj:)
|
47
|
+
obj.value.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
48
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|