vellum_ai 0.3.11 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +31 -0
  4. data/lib/vellum_ai/document_indexes/client.rb +150 -0
  5. data/lib/vellum_ai/test_suite_runs/client.rb +149 -0
  6. data/lib/vellum_ai/types/array_variable_value_item.rb +13 -0
  7. data/lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb +19 -5
  8. data/lib/vellum_ai/types/generate_request.rb +2 -2
  9. data/lib/vellum_ai/types/image_variable_value.rb +52 -0
  10. data/lib/vellum_ai/types/initiated_workflow_node_result_event.rb +11 -4
  11. data/lib/vellum_ai/types/paginated_test_suite_run_execution_list.rb +64 -0
  12. data/lib/vellum_ai/types/rejected_workflow_node_result_event.rb +11 -4
  13. data/lib/vellum_ai/types/streaming_workflow_node_result_event.rb +12 -5
  14. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config.rb +57 -0
  15. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data.rb +50 -0
  16. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data_request.rb +50 -0
  17. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_request.rb +57 -0
  18. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_type_enum.rb +5 -0
  19. data/lib/vellum_ai/types/test_suite_run_exec_config.rb +90 -0
  20. data/lib/vellum_ai/types/test_suite_run_exec_config_request.rb +90 -0
  21. data/lib/vellum_ai/types/test_suite_run_execution.rb +69 -0
  22. data/lib/vellum_ai/types/test_suite_run_execution_chat_history_output.rb +54 -0
  23. data/lib/vellum_ai/types/test_suite_run_execution_error_output.rb +56 -0
  24. data/lib/vellum_ai/types/test_suite_run_execution_json_output.rb +50 -0
  25. data/lib/vellum_ai/types/test_suite_run_execution_metric_result.rb +54 -0
  26. data/lib/vellum_ai/types/test_suite_run_execution_number_output.rb +50 -0
  27. data/lib/vellum_ai/types/test_suite_run_execution_output.rb +142 -0
  28. data/lib/vellum_ai/types/test_suite_run_execution_search_results_output.rb +54 -0
  29. data/lib/vellum_ai/types/test_suite_run_execution_string_output.rb +50 -0
  30. data/lib/vellum_ai/types/test_suite_run_metric_error_output.rb +57 -0
  31. data/lib/vellum_ai/types/test_suite_run_metric_error_output_type_enum.rb +5 -0
  32. data/lib/vellum_ai/types/test_suite_run_metric_number_output.rb +51 -0
  33. data/lib/vellum_ai/types/test_suite_run_metric_number_output_type_enum.rb +5 -0
  34. data/lib/vellum_ai/types/test_suite_run_metric_output.rb +90 -0
  35. data/lib/vellum_ai/types/test_suite_run_read.rb +96 -0
  36. data/lib/vellum_ai/types/test_suite_run_state.rb +12 -0
  37. data/lib/vellum_ai/types/test_suite_run_test_suite.rb +55 -0
  38. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config.rb +57 -0
  39. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data.rb +50 -0
  40. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data_request.rb +50 -0
  41. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_request.rb +57 -0
  42. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_type_enum.rb +5 -0
  43. data/lib/vellum_ai/types/workflow_execution_event_error_code.rb +1 -0
  44. data/lib/vellum_ai/types/workflow_output_array.rb +2 -2
  45. data/lib/vellum_ai/types/workflow_output_chat_history.rb +2 -2
  46. data/lib/vellum_ai/types/workflow_output_error.rb +2 -2
  47. data/lib/vellum_ai/types/workflow_output_function_call.rb +2 -2
  48. data/lib/vellum_ai/types/workflow_output_image.rb +2 -2
  49. data/lib/vellum_ai/types/workflow_output_json.rb +2 -2
  50. data/lib/vellum_ai/types/workflow_output_number.rb +2 -2
  51. data/lib/vellum_ai/types/workflow_output_search_results.rb +2 -2
  52. data/lib/vellum_ai/types/workflow_output_string.rb +2 -2
  53. data/lib/vellum_ai.rb +5 -2
  54. metadata +34 -2
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "test_suite_run_metric_number_output"
5
+ require_relative "test_suite_run_metric_error_output"
6
+
7
+ module Vellum
8
+ class TestSuiteRunMetricOutput
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 [TestSuiteRunMetricOutput]
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 TestSuiteRunMetricOutput
24
+ #
25
+ # @param json_object [JSON]
26
+ # @return [TestSuiteRunMetricOutput]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ member = case struct.type
30
+ when "NUMBER"
31
+ TestSuiteRunMetricNumberOutput.from_json(json_object: json_object)
32
+ when "ERROR"
33
+ TestSuiteRunMetricErrorOutput.from_json(json_object: json_object)
34
+ else
35
+ TestSuiteRunMetricNumberOutput.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 "NUMBER"
46
+ { **@member.to_json, type: @discriminant }.to_json
47
+ when "ERROR"
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 "NUMBER"
62
+ TestSuiteRunMetricNumberOutput.validate_raw(obj: obj)
63
+ when "ERROR"
64
+ TestSuiteRunMetricErrorOutput.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 [TestSuiteRunMetricNumberOutput]
79
+ # @return [TestSuiteRunMetricOutput]
80
+ def self.number(member:)
81
+ new(member: member, discriminant: "NUMBER")
82
+ end
83
+
84
+ # @param member [TestSuiteRunMetricErrorOutput]
85
+ # @return [TestSuiteRunMetricOutput]
86
+ def self.error(member:)
87
+ new(member: member, discriminant: "ERROR")
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "test_suite_run_test_suite"
5
+ require_relative "test_suite_run_state"
6
+ require_relative "test_suite_run_exec_config"
7
+ require "json"
8
+
9
+ module Vellum
10
+ class TestSuiteRunRead
11
+ attr_reader :id, :created, :test_suite, :state, :exec_config, :additional_properties
12
+
13
+ # @param id [String]
14
+ # @param created [DateTime]
15
+ # @param test_suite [TestSuiteRunTestSuite]
16
+ # @param state [TEST_SUITE_RUN_STATE] The current state of this run
17
+ # - `QUEUED` - Queued
18
+ # - `RUNNING` - Running
19
+ # - `COMPLETE` - Complete
20
+ # - `FAILED` - Failed
21
+ # - `CANCELLED` - Cancelled
22
+ # @param exec_config [TestSuiteRunExecConfig] Configuration that defines how the Test Suite should be run
23
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
24
+ # @return [TestSuiteRunRead]
25
+ def initialize(id:, created:, test_suite:, state: nil, exec_config: nil, additional_properties: nil)
26
+ # @type [String]
27
+ @id = id
28
+ # @type [DateTime]
29
+ @created = created
30
+ # @type [TestSuiteRunTestSuite]
31
+ @test_suite = test_suite
32
+ # @type [TEST_SUITE_RUN_STATE] The current state of this run
33
+ # - `QUEUED` - Queued
34
+ # - `RUNNING` - Running
35
+ # - `COMPLETE` - Complete
36
+ # - `FAILED` - Failed
37
+ # - `CANCELLED` - Cancelled
38
+ @state = state
39
+ # @type [TestSuiteRunExecConfig] Configuration that defines how the Test Suite should be run
40
+ @exec_config = exec_config
41
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
42
+ @additional_properties = additional_properties
43
+ end
44
+
45
+ # Deserialize a JSON object to an instance of TestSuiteRunRead
46
+ #
47
+ # @param json_object [JSON]
48
+ # @return [TestSuiteRunRead]
49
+ def self.from_json(json_object:)
50
+ struct = JSON.parse(json_object, object_class: OpenStruct)
51
+ parsed_json = JSON.parse(json_object)
52
+ id = struct.id
53
+ created = DateTime.parse(parsed_json["created"])
54
+ if parsed_json["test_suite"].nil?
55
+ test_suite = nil
56
+ else
57
+ test_suite = parsed_json["test_suite"].to_json
58
+ test_suite = TestSuiteRunTestSuite.from_json(json_object: test_suite)
59
+ end
60
+ state = TEST_SUITE_RUN_STATE.key(parsed_json["state"]) || parsed_json["state"]
61
+ if parsed_json["exec_config"].nil?
62
+ exec_config = nil
63
+ else
64
+ exec_config = parsed_json["exec_config"].to_json
65
+ exec_config = TestSuiteRunExecConfig.from_json(json_object: exec_config)
66
+ end
67
+ new(id: id, created: created, test_suite: test_suite, state: state, exec_config: exec_config,
68
+ additional_properties: struct)
69
+ end
70
+
71
+ # Serialize an instance of TestSuiteRunRead to a JSON object
72
+ #
73
+ # @return [JSON]
74
+ def to_json(*_args)
75
+ {
76
+ "id": @id,
77
+ "created": @created,
78
+ "test_suite": @test_suite,
79
+ "state": TEST_SUITE_RUN_STATE[@state] || @state,
80
+ "exec_config": @exec_config
81
+ }.to_json
82
+ end
83
+
84
+ # 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.
85
+ #
86
+ # @param obj [Object]
87
+ # @return [Void]
88
+ def self.validate_raw(obj:)
89
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
90
+ obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
91
+ TestSuiteRunTestSuite.validate_raw(obj: obj.test_suite)
92
+ obj.state&.is_a?(TEST_SUITE_RUN_STATE) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
93
+ obj.exec_config.nil? || TestSuiteRunExecConfig.validate_raw(obj: obj.exec_config)
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ # @type [TEST_SUITE_RUN_STATE]
5
+ TEST_SUITE_RUN_STATE = {
6
+ queued: "QUEUED",
7
+ running: "RUNNING",
8
+ complete: "COMPLETE",
9
+ failed: "FAILED",
10
+ cancelled: "CANCELLED"
11
+ }.freeze
12
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ class TestSuiteRunTestSuite
7
+ attr_reader :id, :history_item_id, :label, :additional_properties
8
+
9
+ # @param id [String]
10
+ # @param history_item_id [String]
11
+ # @param label [String]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [TestSuiteRunTestSuite]
14
+ def initialize(id:, history_item_id:, label:, additional_properties: nil)
15
+ # @type [String]
16
+ @id = id
17
+ # @type [String]
18
+ @history_item_id = history_item_id
19
+ # @type [String]
20
+ @label = label
21
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
22
+ @additional_properties = additional_properties
23
+ end
24
+
25
+ # Deserialize a JSON object to an instance of TestSuiteRunTestSuite
26
+ #
27
+ # @param json_object [JSON]
28
+ # @return [TestSuiteRunTestSuite]
29
+ def self.from_json(json_object:)
30
+ struct = JSON.parse(json_object, object_class: OpenStruct)
31
+ JSON.parse(json_object)
32
+ id = struct.id
33
+ history_item_id = struct.history_item_id
34
+ label = struct.label
35
+ new(id: id, history_item_id: history_item_id, label: label, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of TestSuiteRunTestSuite to a JSON object
39
+ #
40
+ # @return [JSON]
41
+ def to_json(*_args)
42
+ { "id": @id, "history_item_id": @history_item_id, "label": @label }.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.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
51
+ obj.history_item_id.is_a?(String) != false || raise("Passed value for field obj.history_item_id is not the expected type, validation failed.")
52
+ obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_run_workflow_release_tag_exec_config_data"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # Execution configuration for running a Test Suite against a Workflow Deployment
8
+ class TestSuiteRunWorkflowReleaseTagExecConfig
9
+ attr_reader :data, :test_case_ids, :additional_properties
10
+
11
+ # @param data [TestSuiteRunWorkflowReleaseTagExecConfigData]
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 [TestSuiteRunWorkflowReleaseTagExecConfig]
15
+ def initialize(data:, test_case_ids: nil, additional_properties: nil)
16
+ # @type [TestSuiteRunWorkflowReleaseTagExecConfigData]
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 TestSuiteRunWorkflowReleaseTagExecConfig
25
+ #
26
+ # @param json_object [JSON]
27
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfig]
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 = TestSuiteRunWorkflowReleaseTagExecConfigData.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 TestSuiteRunWorkflowReleaseTagExecConfig 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
+ TestSuiteRunWorkflowReleaseTagExecConfigData.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 TestSuiteRunWorkflowReleaseTagExecConfigData
7
+ attr_reader :workflow_deployment_id, :tag, :additional_properties
8
+
9
+ # @param workflow_deployment_id [String] The ID of the Workflow Deployment to run the Test Suite against.
10
+ # @param tag [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow Deployment
11
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
12
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigData]
13
+ def initialize(workflow_deployment_id:, tag: nil, additional_properties: nil)
14
+ # @type [String] The ID of the Workflow Deployment to run the Test Suite against.
15
+ @workflow_deployment_id = workflow_deployment_id
16
+ # @type [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow 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 TestSuiteRunWorkflowReleaseTagExecConfigData
23
+ #
24
+ # @param json_object [JSON]
25
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigData]
26
+ def self.from_json(json_object:)
27
+ struct = JSON.parse(json_object, object_class: OpenStruct)
28
+ JSON.parse(json_object)
29
+ workflow_deployment_id = struct.workflow_deployment_id
30
+ tag = struct.tag
31
+ new(workflow_deployment_id: workflow_deployment_id, tag: tag, additional_properties: struct)
32
+ end
33
+
34
+ # Serialize an instance of TestSuiteRunWorkflowReleaseTagExecConfigData to a JSON object
35
+ #
36
+ # @return [JSON]
37
+ def to_json(*_args)
38
+ { "workflow_deployment_id": @workflow_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.workflow_deployment_id.is_a?(String) != false || raise("Passed value for field obj.workflow_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 TestSuiteRunWorkflowReleaseTagExecConfigDataRequest
7
+ attr_reader :workflow_deployment_id, :tag, :additional_properties
8
+
9
+ # @param workflow_deployment_id [String] The ID of the Workflow Deployment to run the Test Suite against.
10
+ # @param tag [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow Deployment
11
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
12
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
13
+ def initialize(workflow_deployment_id:, tag: nil, additional_properties: nil)
14
+ # @type [String] The ID of the Workflow Deployment to run the Test Suite against.
15
+ @workflow_deployment_id = workflow_deployment_id
16
+ # @type [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow 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 TestSuiteRunWorkflowReleaseTagExecConfigDataRequest
23
+ #
24
+ # @param json_object [JSON]
25
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
26
+ def self.from_json(json_object:)
27
+ struct = JSON.parse(json_object, object_class: OpenStruct)
28
+ JSON.parse(json_object)
29
+ workflow_deployment_id = struct.workflow_deployment_id
30
+ tag = struct.tag
31
+ new(workflow_deployment_id: workflow_deployment_id, tag: tag, additional_properties: struct)
32
+ end
33
+
34
+ # Serialize an instance of TestSuiteRunWorkflowReleaseTagExecConfigDataRequest to a JSON object
35
+ #
36
+ # @return [JSON]
37
+ def to_json(*_args)
38
+ { "workflow_deployment_id": @workflow_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.workflow_deployment_id.is_a?(String) != false || raise("Passed value for field obj.workflow_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_workflow_release_tag_exec_config_data_request"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # Execution configuration for running a Test Suite against a Workflow Deployment
8
+ class TestSuiteRunWorkflowReleaseTagExecConfigRequest
9
+ attr_reader :data, :test_case_ids, :additional_properties
10
+
11
+ # @param data [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
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 [TestSuiteRunWorkflowReleaseTagExecConfigRequest]
15
+ def initialize(data:, test_case_ids: nil, additional_properties: nil)
16
+ # @type [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
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 TestSuiteRunWorkflowReleaseTagExecConfigRequest
25
+ #
26
+ # @param json_object [JSON]
27
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigRequest]
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 = TestSuiteRunWorkflowReleaseTagExecConfigDataRequest.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 TestSuiteRunWorkflowReleaseTagExecConfigRequest 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
+ TestSuiteRunWorkflowReleaseTagExecConfigDataRequest.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,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ TEST_SUITE_RUN_WORKFLOW_RELEASE_TAG_EXEC_CONFIG_TYPE_ENUM = String
5
+ end
@@ -4,6 +4,7 @@ module Vellum
4
4
  # @type [WORKFLOW_EXECUTION_EVENT_ERROR_CODE]
5
5
  WORKFLOW_EXECUTION_EVENT_ERROR_CODE = {
6
6
  workflow_initialization: "WORKFLOW_INITIALIZATION",
7
+ workflow_cancelled: "WORKFLOW_CANCELLED",
7
8
  node_execution_count_limit_reached: "NODE_EXECUTION_COUNT_LIMIT_REACHED",
8
9
  internal_server_error: "INTERNAL_SERVER_ERROR",
9
10
  node_execution: "NODE_EXECUTION",
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [Array<ArrayVariableValueItem>]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputArray]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -54,7 +54,7 @@ module Vellum
54
54
  def self.validate_raw(obj:)
55
55
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
56
56
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
57
- obj.value.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
58
58
  end
59
59
  end
60
60
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [Array<ChatMessage>]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputChatHistory]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -54,7 +54,7 @@ module Vellum
54
54
  def self.validate_raw(obj:)
55
55
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
56
56
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
57
- obj.value.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
58
58
  end
59
59
  end
60
60
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [VellumError]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputError]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -56,7 +56,7 @@ module Vellum
56
56
  def self.validate_raw(obj:)
57
57
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
58
58
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
59
- VellumError.validate_raw(obj: obj.value)
59
+ obj.value.nil? || VellumError.validate_raw(obj: obj.value)
60
60
  end
61
61
  end
62
62
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [FunctionCall]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputFunctionCall]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -56,7 +56,7 @@ module Vellum
56
56
  def self.validate_raw(obj:)
57
57
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
58
58
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
59
- FunctionCall.validate_raw(obj: obj.value)
59
+ obj.value.nil? || FunctionCall.validate_raw(obj: obj.value)
60
60
  end
61
61
  end
62
62
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [VellumImage]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputImage]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -56,7 +56,7 @@ module Vellum
56
56
  def self.validate_raw(obj:)
57
57
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
58
58
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
59
- VellumImage.validate_raw(obj: obj.value)
59
+ obj.value.nil? || VellumImage.validate_raw(obj: obj.value)
60
60
  end
61
61
  end
62
62
  end
@@ -12,7 +12,7 @@ module Vellum
12
12
  # @param value [Hash{String => String}]
13
13
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
14
  # @return [WorkflowOutputJson]
15
- def initialize(id:, name:, value:, additional_properties: nil)
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
16
  # @type [String]
17
17
  @id = id
18
18
  # @type [String] The output's name, as defined in the workflow
@@ -50,7 +50,7 @@ module Vellum
50
50
  def self.validate_raw(obj:)
51
51
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
52
52
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
53
- obj.value.is_a?(Hash) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
53
+ obj.value&.is_a?(Hash) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
54
54
  end
55
55
  end
56
56
  end
@@ -12,7 +12,7 @@ module Vellum
12
12
  # @param value [Float]
13
13
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
14
  # @return [WorkflowOutputNumber]
15
- def initialize(id:, name:, value:, additional_properties: nil)
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
16
  # @type [String]
17
17
  @id = id
18
18
  # @type [String] The output's name, as defined in the workflow
@@ -50,7 +50,7 @@ module Vellum
50
50
  def self.validate_raw(obj:)
51
51
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
52
52
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
53
- obj.value.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
53
+ obj.value&.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
54
54
  end
55
55
  end
56
56
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [Array<SearchResult>]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputSearchResults]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -54,7 +54,7 @@ module Vellum
54
54
  def self.validate_raw(obj:)
55
55
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
56
56
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
57
- obj.value.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
58
58
  end
59
59
  end
60
60
  end
@@ -12,7 +12,7 @@ module Vellum
12
12
  # @param value [String]
13
13
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
14
  # @return [WorkflowOutputString]
15
- def initialize(id:, name:, value:, additional_properties: nil)
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
16
  # @type [String]
17
17
  @id = id
18
18
  # @type [String] The output's name, as defined in the workflow
@@ -50,7 +50,7 @@ module Vellum
50
50
  def self.validate_raw(obj:)
51
51
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
52
52
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
53
- obj.value.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
53
+ obj.value&.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
54
54
  end
55
55
  end
56
56
  end