vellum_ai 1.0.0 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67369f048452ad2c87627f30dbbcf0e213f4152da9f1e855aab0706f47441014
4
- data.tar.gz: e1e08646f0cee2a1f29eb5819443403b074ae803003e1c98e919e9b32ffac1cf
3
+ metadata.gz: 15998f3a3ff3c389235c5e0f79916d02f3492eee4902db68b3e2990cf7d59e34
4
+ data.tar.gz: '079305de85aabb9d4402ac53823d77a8dab1968e73015be26a536ff3e0582817'
5
5
  SHA512:
6
- metadata.gz: dd371afcf49c16646ec2735b9adf20501c1c92a0bd84e5b70f574776d3b24579ba9b651478b9b7134ae3c959acb03bc57e8566a0814ccf3e6cc0958e54c4c133
7
- data.tar.gz: bac7cca95c6da9992d5459d2064d81f73c8edf1c846e6b55afb5e5c87e0b6ef34b6d6cca94afccb11084707b9bde7a33fd8739cd0a5e7b610634efa145457d78
6
+ metadata.gz: 492d7bbd620f76adc89c17d19cfc4d7fe201cda59f4d2b22a52beda63eede8955f1b45b110f06ce7fc499c40063ef5673340034e037727e3d5d027ebbf145063
7
+ data.tar.gz: b746e10b09d25ef1a34b37d9f002c2eb925f9df683815c11b40561e1eadfa2335dec59cf213ea8dc6cdffaa4140ac502b0c5b955338bf746f8456ee9797e3ed2
data/lib/requests.rb CHANGED
@@ -56,7 +56,7 @@ end
56
56
  end
57
57
  # @return [Hash{String => String}]
58
58
  def get_headers
59
- headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.0.0' }
59
+ headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.0.3' }
60
60
  headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
61
61
  headers
62
62
  end
@@ -107,7 +107,7 @@ end
107
107
  end
108
108
  # @return [Hash{String => String}]
109
109
  def get_headers
110
- headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.0.0' }
110
+ headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.0.3' }
111
111
  headers["X-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
112
112
  headers
113
113
  end
data/lib/types_export.rb CHANGED
@@ -297,6 +297,7 @@ require_relative "vellum_ai/types/node_output_compiled_json_value"
297
297
  require_relative "vellum_ai/types/node_output_compiled_number_value"
298
298
  require_relative "vellum_ai/types/node_output_compiled_search_results_value"
299
299
  require_relative "vellum_ai/types/node_output_compiled_string_value"
300
+ require_relative "vellum_ai/types/node_output_compiled_thinking_value"
300
301
  require_relative "vellum_ai/types/node_output_compiled_value"
301
302
  require_relative "vellum_ai/types/node_parent_context"
302
303
  require_relative "vellum_ai/types/normalized_log_probs"
@@ -305,6 +306,7 @@ require_relative "vellum_ai/types/number_vellum_value"
305
306
  require_relative "vellum_ai/types/number_vellum_value_request"
306
307
  require_relative "vellum_ai/types/open_ai_vectorizer_config"
307
308
  require_relative "vellum_ai/types/open_ai_vectorizer_config_request"
309
+ require_relative "vellum_ai/types/organization_limit_config"
308
310
  require_relative "vellum_ai/types/organization_read"
309
311
  require_relative "vellum_ai/types/paginated_container_image_read_list"
310
312
  require_relative "vellum_ai/types/paginated_deployment_release_tag_read_list"
@@ -354,6 +356,7 @@ require_relative "vellum_ai/types/prompt_request_input"
354
356
  require_relative "vellum_ai/types/prompt_settings"
355
357
  require_relative "vellum_ai/types/prompt_version_build_config_sandbox"
356
358
  require_relative "vellum_ai/types/components_schemas_prompt_version_build_config_sandbox"
359
+ require_relative "vellum_ai/types/quota"
357
360
  require_relative "vellum_ai/types/raw_prompt_execution_overrides_request"
358
361
  require_relative "vellum_ai/types/reducto_chunker_config"
359
362
  require_relative "vellum_ai/types/reducto_chunker_config_request"
@@ -539,6 +542,7 @@ require_relative "vellum_ai/types/workflow_execution_paused_event"
539
542
  require_relative "vellum_ai/types/workflow_execution_resumed_event"
540
543
  require_relative "vellum_ai/types/workflow_execution_snapshotted_event"
541
544
  require_relative "vellum_ai/types/vellum_workflow_execution_event"
545
+ require_relative "vellum_ai/types/vembda_service_tier_enum"
542
546
  require_relative "vellum_ai/types/workflow_deployment_event_executions_response"
543
547
  require_relative "vellum_ai/types/workflow_deployment_history_item"
544
548
  require_relative "vellum_ai/types/workflow_deployment_read"
@@ -550,6 +554,7 @@ require_relative "vellum_ai/types/workflow_initialization_error"
550
554
  require_relative "vellum_ai/types/workflow_error"
551
555
  require_relative "vellum_ai/types/workflow_event_execution_read"
552
556
  require_relative "vellum_ai/types/workflow_execution_actual"
557
+ require_relative "vellum_ai/types/workflow_execution_detail"
553
558
  require_relative "vellum_ai/types/workflow_execution_event_error_code"
554
559
  require_relative "vellum_ai/types/workflow_execution_event_type"
555
560
  require_relative "vellum_ai/types/workflow_execution_fulfilled_body"
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+ require_relative "string_vellum_value"
3
+ require_relative "workflow_node_result_event_state"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Vellum
8
+ # An output returned by a node that is of type THINKING.
9
+ class NodeOutputCompiledThinkingValue
10
+ # @return [String]
11
+ attr_reader :type
12
+ # @return [Vellum::StringVellumValue]
13
+ attr_reader :value
14
+ # @return [String]
15
+ attr_reader :node_output_id
16
+ # @return [Vellum::WorkflowNodeResultEventState]
17
+ attr_reader :state
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param type [String]
27
+ # @param value [Vellum::StringVellumValue]
28
+ # @param node_output_id [String]
29
+ # @param state [Vellum::WorkflowNodeResultEventState]
30
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
+ # @return [Vellum::NodeOutputCompiledThinkingValue]
32
+ def initialize(type:, value: OMIT, node_output_id:, state: OMIT, additional_properties: nil)
33
+ @type = type
34
+ @value = value if value != OMIT
35
+ @node_output_id = node_output_id
36
+ @state = state if state != OMIT
37
+ @additional_properties = additional_properties
38
+ @_field_set = { "type": type, "value": value, "node_output_id": node_output_id, "state": state }.reject do | _k, v |
39
+ v == OMIT
40
+ end
41
+ end
42
+ # Deserialize a JSON object to an instance of NodeOutputCompiledThinkingValue
43
+ #
44
+ # @param json_object [String]
45
+ # @return [Vellum::NodeOutputCompiledThinkingValue]
46
+ def self.from_json(json_object:)
47
+ struct = JSON.parse(json_object, object_class: OpenStruct)
48
+ parsed_json = JSON.parse(json_object)
49
+ type = parsed_json["type"]
50
+ unless parsed_json["value"].nil?
51
+ value = parsed_json["value"].to_json
52
+ value = Vellum::StringVellumValue.from_json(json_object: value)
53
+ else
54
+ value = nil
55
+ end
56
+ node_output_id = parsed_json["node_output_id"]
57
+ state = parsed_json["state"]
58
+ new(
59
+ type: type,
60
+ value: value,
61
+ node_output_id: node_output_id,
62
+ state: state,
63
+ additional_properties: struct
64
+ )
65
+ end
66
+ # Serialize an instance of NodeOutputCompiledThinkingValue to a JSON object
67
+ #
68
+ # @return [String]
69
+ def to_json
70
+ @_field_set&.to_json
71
+ end
72
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
73
+ # hash and check each fields type against the current object's property
74
+ # definitions.
75
+ #
76
+ # @param obj [Object]
77
+ # @return [Void]
78
+ def self.validate_raw(obj:)
79
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
80
+ obj.value.nil? || Vellum::StringVellumValue.validate_raw(obj: obj.value)
81
+ obj.node_output_id.is_a?(String) != false || raise("Passed value for field obj.node_output_id is not the expected type, validation failed.")
82
+ obj.state&.is_a?(Vellum::WorkflowNodeResultEventState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
83
+ end
84
+ end
85
+ end
@@ -8,6 +8,7 @@ require_relative "node_output_compiled_search_results_value"
8
8
  require_relative "node_output_compiled_error_value"
9
9
  require_relative "node_output_compiled_array_value"
10
10
  require_relative "node_output_compiled_function_call_value"
11
+ require_relative "node_output_compiled_thinking_value"
11
12
 
12
13
  module Vellum
13
14
  class NodeOutputCompiledValue
@@ -95,6 +96,16 @@ end
95
96
  return Vellum::NodeOutputCompiledFunctionCallValue.from_json(json_object: struct)
96
97
  else
97
98
  return nil
99
+ end
100
+ rescue StandardError
101
+ # noop
102
+ end
103
+ begin
104
+ Vellum::NodeOutputCompiledThinkingValue.validate_raw(obj: struct)
105
+ unless struct.nil?
106
+ return Vellum::NodeOutputCompiledThinkingValue.from_json(json_object: struct)
107
+ else
108
+ return nil
98
109
  end
99
110
  rescue StandardError
100
111
  # noop
@@ -148,6 +159,11 @@ end
148
159
  rescue StandardError
149
160
  # noop
150
161
  end
162
+ begin
163
+ return Vellum::NodeOutputCompiledThinkingValue.validate_raw(obj: obj)
164
+ rescue StandardError
165
+ # noop
166
+ end
151
167
  raise("Passed value matched no type within the union, validation failed.")
152
168
  end
153
169
  end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vembda_service_tier_enum"
3
+ require_relative "quota"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Vellum
8
+ class OrganizationLimitConfig
9
+ # @return [Vellum::VembdaServiceTierEnum]
10
+ attr_reader :vembda_service_tier
11
+ # @return [Vellum::Quota]
12
+ attr_reader :prompt_executions_quota
13
+ # @return [Vellum::Quota]
14
+ attr_reader :workflow_executions_quota
15
+ # @return [Vellum::Quota]
16
+ attr_reader :workflow_runtime_seconds_quota
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param vembda_service_tier [Vellum::VembdaServiceTierEnum]
26
+ # @param prompt_executions_quota [Vellum::Quota]
27
+ # @param workflow_executions_quota [Vellum::Quota]
28
+ # @param workflow_runtime_seconds_quota [Vellum::Quota]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [Vellum::OrganizationLimitConfig]
31
+ def initialize(vembda_service_tier: OMIT, prompt_executions_quota: OMIT, workflow_executions_quota: OMIT, workflow_runtime_seconds_quota: OMIT, additional_properties: nil)
32
+ @vembda_service_tier = vembda_service_tier if vembda_service_tier != OMIT
33
+ @prompt_executions_quota = prompt_executions_quota if prompt_executions_quota != OMIT
34
+ @workflow_executions_quota = workflow_executions_quota if workflow_executions_quota != OMIT
35
+ @workflow_runtime_seconds_quota = workflow_runtime_seconds_quota if workflow_runtime_seconds_quota != OMIT
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "vembda_service_tier": vembda_service_tier, "prompt_executions_quota": prompt_executions_quota, "workflow_executions_quota": workflow_executions_quota, "workflow_runtime_seconds_quota": workflow_runtime_seconds_quota }.reject do | _k, v |
38
+ v == OMIT
39
+ end
40
+ end
41
+ # Deserialize a JSON object to an instance of OrganizationLimitConfig
42
+ #
43
+ # @param json_object [String]
44
+ # @return [Vellum::OrganizationLimitConfig]
45
+ def self.from_json(json_object:)
46
+ struct = JSON.parse(json_object, object_class: OpenStruct)
47
+ parsed_json = JSON.parse(json_object)
48
+ vembda_service_tier = parsed_json["vembda_service_tier"]
49
+ unless parsed_json["prompt_executions_quota"].nil?
50
+ prompt_executions_quota = parsed_json["prompt_executions_quota"].to_json
51
+ prompt_executions_quota = Vellum::Quota.from_json(json_object: prompt_executions_quota)
52
+ else
53
+ prompt_executions_quota = nil
54
+ end
55
+ unless parsed_json["workflow_executions_quota"].nil?
56
+ workflow_executions_quota = parsed_json["workflow_executions_quota"].to_json
57
+ workflow_executions_quota = Vellum::Quota.from_json(json_object: workflow_executions_quota)
58
+ else
59
+ workflow_executions_quota = nil
60
+ end
61
+ unless parsed_json["workflow_runtime_seconds_quota"].nil?
62
+ workflow_runtime_seconds_quota = parsed_json["workflow_runtime_seconds_quota"].to_json
63
+ workflow_runtime_seconds_quota = Vellum::Quota.from_json(json_object: workflow_runtime_seconds_quota)
64
+ else
65
+ workflow_runtime_seconds_quota = nil
66
+ end
67
+ new(
68
+ vembda_service_tier: vembda_service_tier,
69
+ prompt_executions_quota: prompt_executions_quota,
70
+ workflow_executions_quota: workflow_executions_quota,
71
+ workflow_runtime_seconds_quota: workflow_runtime_seconds_quota,
72
+ additional_properties: struct
73
+ )
74
+ end
75
+ # Serialize an instance of OrganizationLimitConfig to a JSON object
76
+ #
77
+ # @return [String]
78
+ def to_json
79
+ @_field_set&.to_json
80
+ end
81
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
82
+ # hash and check each fields type against the current object's property
83
+ # definitions.
84
+ #
85
+ # @param obj [Object]
86
+ # @return [Void]
87
+ def self.validate_raw(obj:)
88
+ obj.vembda_service_tier&.is_a?(Vellum::VembdaServiceTierEnum) != false || raise("Passed value for field obj.vembda_service_tier is not the expected type, validation failed.")
89
+ obj.prompt_executions_quota.nil? || Vellum::Quota.validate_raw(obj: obj.prompt_executions_quota)
90
+ obj.workflow_executions_quota.nil? || Vellum::Quota.validate_raw(obj: obj.workflow_executions_quota)
91
+ obj.workflow_runtime_seconds_quota.nil? || Vellum::Quota.validate_raw(obj: obj.workflow_runtime_seconds_quota)
92
+ end
93
+ end
94
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require_relative "new_member_join_behavior_enum"
3
+ require_relative "organization_limit_config"
3
4
  require "ostruct"
4
5
  require "json"
5
6
 
@@ -13,6 +14,8 @@ module Vellum
13
14
  attr_reader :allow_staff_access
14
15
  # @return [Vellum::NewMemberJoinBehaviorEnum]
15
16
  attr_reader :new_member_join_behavior
17
+ # @return [Vellum::OrganizationLimitConfig]
18
+ attr_reader :limit_config
16
19
  # @return [OpenStruct] Additional properties unmapped to the current class definition
17
20
  attr_reader :additional_properties
18
21
  # @return [Object]
@@ -25,15 +28,17 @@ module Vellum
25
28
  # @param name [String]
26
29
  # @param allow_staff_access [Boolean]
27
30
  # @param new_member_join_behavior [Vellum::NewMemberJoinBehaviorEnum]
31
+ # @param limit_config [Vellum::OrganizationLimitConfig]
28
32
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
33
  # @return [Vellum::OrganizationRead]
30
- def initialize(id:, name:, allow_staff_access: OMIT, new_member_join_behavior:, additional_properties: nil)
34
+ def initialize(id:, name:, allow_staff_access: OMIT, new_member_join_behavior:, limit_config:, additional_properties: nil)
31
35
  @id = id
32
36
  @name = name
33
37
  @allow_staff_access = allow_staff_access if allow_staff_access != OMIT
34
38
  @new_member_join_behavior = new_member_join_behavior
39
+ @limit_config = limit_config
35
40
  @additional_properties = additional_properties
36
- @_field_set = { "id": id, "name": name, "allow_staff_access": allow_staff_access, "new_member_join_behavior": new_member_join_behavior }.reject do | _k, v |
41
+ @_field_set = { "id": id, "name": name, "allow_staff_access": allow_staff_access, "new_member_join_behavior": new_member_join_behavior, "limit_config": limit_config }.reject do | _k, v |
37
42
  v == OMIT
38
43
  end
39
44
  end
@@ -48,11 +53,18 @@ end
48
53
  name = parsed_json["name"]
49
54
  allow_staff_access = parsed_json["allow_staff_access"]
50
55
  new_member_join_behavior = parsed_json["new_member_join_behavior"]
56
+ unless parsed_json["limit_config"].nil?
57
+ limit_config = parsed_json["limit_config"].to_json
58
+ limit_config = Vellum::OrganizationLimitConfig.from_json(json_object: limit_config)
59
+ else
60
+ limit_config = nil
61
+ end
51
62
  new(
52
63
  id: id,
53
64
  name: name,
54
65
  allow_staff_access: allow_staff_access,
55
66
  new_member_join_behavior: new_member_join_behavior,
67
+ limit_config: limit_config,
56
68
  additional_properties: struct
57
69
  )
58
70
  end
@@ -73,6 +85,7 @@ end
73
85
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
74
86
  obj.allow_staff_access&.is_a?(Boolean) != false || raise("Passed value for field obj.allow_staff_access is not the expected type, validation failed.")
75
87
  obj.new_member_join_behavior.is_a?(Vellum::NewMemberJoinBehaviorEnum) != false || raise("Passed value for field obj.new_member_join_behavior is not the expected type, validation failed.")
88
+ Vellum::OrganizationLimitConfig.validate_raw(obj: obj.limit_config)
76
89
  end
77
90
  end
78
91
  end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+ require "ostruct"
3
+ require "json"
4
+
5
+ module Vellum
6
+ class Quota
7
+ # @return [String]
8
+ attr_reader :name
9
+ # @return [Integer]
10
+ attr_reader :value
11
+ # @return [Integer]
12
+ attr_reader :period_seconds
13
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
14
+ attr_reader :additional_properties
15
+ # @return [Object]
16
+ attr_reader :_field_set
17
+ protected :_field_set
18
+
19
+ OMIT = Object.new
20
+
21
+ # @param name [String]
22
+ # @param value [Integer]
23
+ # @param period_seconds [Integer]
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Vellum::Quota]
26
+ def initialize(name:, value: OMIT, period_seconds: OMIT, additional_properties: nil)
27
+ @name = name
28
+ @value = value if value != OMIT
29
+ @period_seconds = period_seconds if period_seconds != OMIT
30
+ @additional_properties = additional_properties
31
+ @_field_set = { "name": name, "value": value, "period_seconds": period_seconds }.reject do | _k, v |
32
+ v == OMIT
33
+ end
34
+ end
35
+ # Deserialize a JSON object to an instance of Quota
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vellum::Quota]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ name = parsed_json["name"]
43
+ value = parsed_json["value"]
44
+ period_seconds = parsed_json["period_seconds"]
45
+ new(
46
+ name: name,
47
+ value: value,
48
+ period_seconds: period_seconds,
49
+ additional_properties: struct
50
+ )
51
+ end
52
+ # Serialize an instance of Quota to a JSON object
53
+ #
54
+ # @return [String]
55
+ def to_json
56
+ @_field_set&.to_json
57
+ end
58
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
59
+ # hash and check each fields type against the current object's property
60
+ # definitions.
61
+ #
62
+ # @param obj [Object]
63
+ # @return [Void]
64
+ def self.validate_raw(obj:)
65
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
66
+ obj.value&.is_a?(Integer) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
67
+ obj.period_seconds&.is_a?(Integer) != false || raise("Passed value for field obj.period_seconds is not the expected type, validation failed.")
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ # * `FREE` - FREE
5
+ # * `PAID` - PAID
6
+ class VembdaServiceTierEnum
7
+
8
+ FREE = "FREE"
9
+ PAID = "PAID"
10
+
11
+ end
12
+ end
@@ -28,10 +28,10 @@ module Vellum
28
28
  # @param metadata [Hash{String => Object}]
29
29
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
30
  # @return [Vellum::WorkflowExecutionActual]
31
- def initialize(output:, timestamp:, quality:, metadata: OMIT, additional_properties: nil)
31
+ def initialize(output:, timestamp:, quality: OMIT, metadata: OMIT, additional_properties: nil)
32
32
  @output = output
33
33
  @timestamp = timestamp
34
- @quality = quality
34
+ @quality = quality if quality != OMIT
35
35
  @metadata = metadata if metadata != OMIT
36
36
  @additional_properties = additional_properties
37
37
  @_field_set = { "output": output, "timestamp": timestamp, "quality": quality, "metadata": metadata }.reject do | _k, v |
@@ -81,7 +81,7 @@ end
81
81
  def self.validate_raw(obj:)
82
82
  Vellum::ExecutionVellumValue.validate_raw(obj: obj.output)
83
83
  obj.timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
84
- obj.quality.is_a?(Float) != false || raise("Passed value for field obj.quality is not the expected type, validation failed.")
84
+ obj.quality&.is_a?(Float) != false || raise("Passed value for field obj.quality is not the expected type, validation failed.")
85
85
  obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
86
86
  end
87
87
  end
@@ -0,0 +1,156 @@
1
+ # frozen_string_literal: true
2
+ require_relative "parent_context"
3
+ require "date"
4
+ require "date"
5
+ require_relative "execution_vellum_value"
6
+ require_relative "workflow_error"
7
+ require_relative "workflow_execution_usage_result"
8
+ require_relative "vellum_span"
9
+ require "ostruct"
10
+ require "json"
11
+
12
+ module Vellum
13
+ class WorkflowExecutionDetail
14
+ # @return [String]
15
+ attr_reader :span_id
16
+ # @return [Vellum::ParentContext]
17
+ attr_reader :parent_context
18
+ # @return [DateTime]
19
+ attr_reader :start
20
+ # @return [DateTime]
21
+ attr_reader :end_
22
+ # @return [Array<Vellum::ExecutionVellumValue>]
23
+ attr_reader :inputs
24
+ # @return [Array<Vellum::ExecutionVellumValue>]
25
+ attr_reader :outputs
26
+ # @return [Vellum::WorkflowError]
27
+ attr_reader :error
28
+ # @return [Array<Vellum::WorkflowExecutionUsageResult>]
29
+ attr_reader :usage_results
30
+ # @return [Array<Vellum::VellumSpan>]
31
+ attr_reader :spans
32
+ # @return [Hash{String => Object}]
33
+ attr_reader :state
34
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
35
+ attr_reader :additional_properties
36
+ # @return [Object]
37
+ attr_reader :_field_set
38
+ protected :_field_set
39
+
40
+ OMIT = Object.new
41
+
42
+ # @param span_id [String]
43
+ # @param parent_context [Vellum::ParentContext]
44
+ # @param start [DateTime]
45
+ # @param end_ [DateTime]
46
+ # @param inputs [Array<Vellum::ExecutionVellumValue>]
47
+ # @param outputs [Array<Vellum::ExecutionVellumValue>]
48
+ # @param error [Vellum::WorkflowError]
49
+ # @param usage_results [Array<Vellum::WorkflowExecutionUsageResult>]
50
+ # @param spans [Array<Vellum::VellumSpan>]
51
+ # @param state [Hash{String => Object}]
52
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
53
+ # @return [Vellum::WorkflowExecutionDetail]
54
+ def initialize(span_id:, parent_context: OMIT, start:, end_: OMIT, inputs:, outputs:, error: OMIT, usage_results: OMIT, spans:, state: OMIT, additional_properties: nil)
55
+ @span_id = span_id
56
+ @parent_context = parent_context if parent_context != OMIT
57
+ @start = start
58
+ @end_ = end_ if end_ != OMIT
59
+ @inputs = inputs
60
+ @outputs = outputs
61
+ @error = error if error != OMIT
62
+ @usage_results = usage_results if usage_results != OMIT
63
+ @spans = spans
64
+ @state = state if state != OMIT
65
+ @additional_properties = additional_properties
66
+ @_field_set = { "span_id": span_id, "parent_context": parent_context, "start": start, "end": end_, "inputs": inputs, "outputs": outputs, "error": error, "usage_results": usage_results, "spans": spans, "state": state }.reject do | _k, v |
67
+ v == OMIT
68
+ end
69
+ end
70
+ # Deserialize a JSON object to an instance of WorkflowExecutionDetail
71
+ #
72
+ # @param json_object [String]
73
+ # @return [Vellum::WorkflowExecutionDetail]
74
+ def self.from_json(json_object:)
75
+ struct = JSON.parse(json_object, object_class: OpenStruct)
76
+ parsed_json = JSON.parse(json_object)
77
+ span_id = parsed_json["span_id"]
78
+ unless parsed_json["parent_context"].nil?
79
+ parent_context = parsed_json["parent_context"].to_json
80
+ parent_context = Vellum::ParentContext.from_json(json_object: parent_context)
81
+ else
82
+ parent_context = nil
83
+ end
84
+ start = unless parsed_json["start"].nil?
85
+ DateTime.parse(parsed_json["start"])
86
+ else
87
+ nil
88
+ end
89
+ end_ = unless parsed_json["end"].nil?
90
+ DateTime.parse(parsed_json["end"])
91
+ else
92
+ nil
93
+ end
94
+ inputs = parsed_json["inputs"]&.map do | item |
95
+ item = item.to_json
96
+ Vellum::ExecutionVellumValue.from_json(json_object: item)
97
+ end
98
+ outputs = parsed_json["outputs"]&.map do | item |
99
+ item = item.to_json
100
+ Vellum::ExecutionVellumValue.from_json(json_object: item)
101
+ end
102
+ unless parsed_json["error"].nil?
103
+ error = parsed_json["error"].to_json
104
+ error = Vellum::WorkflowError.from_json(json_object: error)
105
+ else
106
+ error = nil
107
+ end
108
+ usage_results = parsed_json["usage_results"]&.map do | item |
109
+ item = item.to_json
110
+ Vellum::WorkflowExecutionUsageResult.from_json(json_object: item)
111
+ end
112
+ spans = parsed_json["spans"]&.map do | item |
113
+ item = item.to_json
114
+ Vellum::VellumSpan.from_json(json_object: item)
115
+ end
116
+ state = parsed_json["state"]
117
+ new(
118
+ span_id: span_id,
119
+ parent_context: parent_context,
120
+ start: start,
121
+ end_: end_,
122
+ inputs: inputs,
123
+ outputs: outputs,
124
+ error: error,
125
+ usage_results: usage_results,
126
+ spans: spans,
127
+ state: state,
128
+ additional_properties: struct
129
+ )
130
+ end
131
+ # Serialize an instance of WorkflowExecutionDetail to a JSON object
132
+ #
133
+ # @return [String]
134
+ def to_json
135
+ @_field_set&.to_json
136
+ end
137
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
138
+ # hash and check each fields type against the current object's property
139
+ # definitions.
140
+ #
141
+ # @param obj [Object]
142
+ # @return [Void]
143
+ def self.validate_raw(obj:)
144
+ obj.span_id.is_a?(String) != false || raise("Passed value for field obj.span_id is not the expected type, validation failed.")
145
+ obj.parent_context.nil? || Vellum::ParentContext.validate_raw(obj: obj.parent_context)
146
+ obj.start.is_a?(DateTime) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
147
+ obj.end_&.is_a?(DateTime) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
148
+ obj.inputs.is_a?(Array) != false || raise("Passed value for field obj.inputs is not the expected type, validation failed.")
149
+ obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.")
150
+ obj.error.nil? || Vellum::WorkflowError.validate_raw(obj: obj.error)
151
+ obj.usage_results&.is_a?(Array) != false || raise("Passed value for field obj.usage_results is not the expected type, validation failed.")
152
+ obj.spans.is_a?(Array) != false || raise("Passed value for field obj.spans is not the expected type, validation failed.")
153
+ obj.state&.is_a?(Hash) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+ require_relative "../../requests"
3
+ require_relative "../types/workflow_execution_detail"
4
+ require "async"
5
+ require_relative "../../requests"
6
+
7
+ module Vellum
8
+ class WorkflowExecutionsClient
9
+ # @return [Vellum::RequestClient]
10
+ attr_reader :request_client
11
+
12
+
13
+ # @param request_client [Vellum::RequestClient]
14
+ # @return [Vellum::WorkflowExecutionsClient]
15
+ def initialize(request_client:)
16
+ @request_client = request_client
17
+ end
18
+ # @param execution_id [String]
19
+ # @param request_options [Vellum::RequestOptions]
20
+ # @return [Vellum::WorkflowExecutionDetail]
21
+ # @example
22
+ # api = Vellum::Client.new(
23
+ # base_url: "https://api.example.com",
24
+ # environment: Vellum::Environment::PRODUCTION,
25
+ # api_key: "YOUR_API_KEY"
26
+ # )
27
+ # api.workflow_executions.retrieve_workflow_execution_detail(execution_id: "execution_id")
28
+ def retrieve_workflow_execution_detail(execution_id:, request_options: nil)
29
+ response = @request_client.conn.get do | req |
30
+ unless request_options&.timeout_in_seconds.nil?
31
+ req.options.timeout = request_options.timeout_in_seconds
32
+ end
33
+ unless request_options&.api_key.nil?
34
+ req.headers["X-API-KEY"] = request_options.api_key
35
+ end
36
+ unless request_options&.api_version.nil?
37
+ req.headers["X-API-Version"] = request_options.api_version
38
+ else
39
+ req.headers["X-API-Version"] = "2025-07-30"
40
+ end
41
+ req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
42
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
43
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
44
+ end
45
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
46
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
47
+ end
48
+ req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-executions/#{execution_id}/detail"
49
+ end
50
+ Vellum::WorkflowExecutionDetail.from_json(json_object: response.body)
51
+ end
52
+ end
53
+ class AsyncWorkflowExecutionsClient
54
+ # @return [Vellum::AsyncRequestClient]
55
+ attr_reader :request_client
56
+
57
+
58
+ # @param request_client [Vellum::RequestClient]
59
+ # @return [Vellum::AsyncWorkflowExecutionsClient]
60
+ def initialize(request_client:)
61
+ @request_client = request_client
62
+ end
63
+ # @param execution_id [String]
64
+ # @param request_options [Vellum::RequestOptions]
65
+ # @return [Vellum::WorkflowExecutionDetail]
66
+ # @example
67
+ # api = Vellum::Client.new(
68
+ # base_url: "https://api.example.com",
69
+ # environment: Vellum::Environment::PRODUCTION,
70
+ # api_key: "YOUR_API_KEY"
71
+ # )
72
+ # api.workflow_executions.retrieve_workflow_execution_detail(execution_id: "execution_id")
73
+ def retrieve_workflow_execution_detail(execution_id:, request_options: nil)
74
+ Async do
75
+ response = @request_client.conn.get do | req |
76
+ unless request_options&.timeout_in_seconds.nil?
77
+ req.options.timeout = request_options.timeout_in_seconds
78
+ end
79
+ unless request_options&.api_key.nil?
80
+ req.headers["X-API-KEY"] = request_options.api_key
81
+ end
82
+ unless request_options&.api_version.nil?
83
+ req.headers["X-API-Version"] = request_options.api_version
84
+ else
85
+ req.headers["X-API-Version"] = "2025-07-30"
86
+ end
87
+ req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
88
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
89
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
90
+ end
91
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
92
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
93
+ end
94
+ req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflow-executions/#{execution_id}/detail"
95
+ end
96
+ Vellum::WorkflowExecutionDetail.from_json(json_object: response.body)
97
+ end
98
+ end
99
+ end
100
+ end
data/lib/vellum_ai.rb CHANGED
@@ -18,6 +18,7 @@ require_relative "vellum_ai/test_suite_runs/client"
18
18
  require_relative "vellum_ai/test_suites/client"
19
19
  require_relative "vellum_ai/workflow_deployments/client"
20
20
  require_relative "vellum_ai/release_reviews/client"
21
+ require_relative "vellum_ai/workflow_executions/client"
21
22
  require_relative "vellum_ai/workflow_sandboxes/client"
22
23
  require_relative "vellum_ai/workflows/client"
23
24
  require_relative "vellum_ai/workspace_secrets/client"
@@ -79,6 +80,8 @@ module Vellum
79
80
  attr_reader :workflow_deployments
80
81
  # @return [Vellum::ReleaseReviewsClient]
81
82
  attr_reader :release_reviews
83
+ # @return [Vellum::WorkflowExecutionsClient]
84
+ attr_reader :workflow_executions
82
85
  # @return [Vellum::WorkflowSandboxesClient]
83
86
  attr_reader :workflow_sandboxes
84
87
  # @return [Vellum::WorkflowsClient]
@@ -120,6 +123,7 @@ module Vellum
120
123
  @test_suites = Vellum::TestSuitesClient.new(request_client: @request_client)
121
124
  @workflow_deployments = Vellum::WorkflowDeploymentsClient.new(request_client: @request_client)
122
125
  @release_reviews = Vellum::ReleaseReviewsClient.new(request_client: @request_client)
126
+ @workflow_executions = Vellum::WorkflowExecutionsClient.new(request_client: @request_client)
123
127
  @workflow_sandboxes = Vellum::WorkflowSandboxesClient.new(request_client: @request_client)
124
128
  @workflows = Vellum::WorkflowsClient.new(request_client: @request_client)
125
129
  @workspace_secrets = Vellum::WorkspaceSecretsClient.new(request_client: @request_client)
@@ -532,6 +536,8 @@ end
532
536
  attr_reader :workflow_deployments
533
537
  # @return [Vellum::AsyncReleaseReviewsClient]
534
538
  attr_reader :release_reviews
539
+ # @return [Vellum::AsyncWorkflowExecutionsClient]
540
+ attr_reader :workflow_executions
535
541
  # @return [Vellum::AsyncWorkflowSandboxesClient]
536
542
  attr_reader :workflow_sandboxes
537
543
  # @return [Vellum::AsyncWorkflowsClient]
@@ -573,6 +579,7 @@ end
573
579
  @test_suites = Vellum::AsyncTestSuitesClient.new(request_client: @async_request_client)
574
580
  @workflow_deployments = Vellum::AsyncWorkflowDeploymentsClient.new(request_client: @async_request_client)
575
581
  @release_reviews = Vellum::AsyncReleaseReviewsClient.new(request_client: @async_request_client)
582
+ @workflow_executions = Vellum::AsyncWorkflowExecutionsClient.new(request_client: @async_request_client)
576
583
  @workflow_sandboxes = Vellum::AsyncWorkflowSandboxesClient.new(request_client: @async_request_client)
577
584
  @workflows = Vellum::AsyncWorkflowsClient.new(request_client: @async_request_client)
578
585
  @workspace_secrets = Vellum::AsyncWorkspaceSecretsClient.new(request_client: @async_request_client)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vellum_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vellum
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-14 00:00:00.000000000 Z
11
+ date: 2025-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -422,6 +422,7 @@ files:
422
422
  - lib/vellum_ai/types/node_output_compiled_number_value.rb
423
423
  - lib/vellum_ai/types/node_output_compiled_search_results_value.rb
424
424
  - lib/vellum_ai/types/node_output_compiled_string_value.rb
425
+ - lib/vellum_ai/types/node_output_compiled_thinking_value.rb
425
426
  - lib/vellum_ai/types/node_output_compiled_value.rb
426
427
  - lib/vellum_ai/types/node_parent_context.rb
427
428
  - lib/vellum_ai/types/normalized_log_probs.rb
@@ -437,6 +438,7 @@ files:
437
438
  - lib/vellum_ai/types/open_ai_vectorizer_text_embedding_3_small_request.rb
438
439
  - lib/vellum_ai/types/open_ai_vectorizer_text_embedding_ada_002.rb
439
440
  - lib/vellum_ai/types/open_ai_vectorizer_text_embedding_ada_002_request.rb
441
+ - lib/vellum_ai/types/organization_limit_config.rb
440
442
  - lib/vellum_ai/types/organization_read.rb
441
443
  - lib/vellum_ai/types/paginated_container_image_read_list.rb
442
444
  - lib/vellum_ai/types/paginated_deployment_release_tag_read_list.rb
@@ -477,6 +479,7 @@ files:
477
479
  - lib/vellum_ai/types/prompt_request_string_input.rb
478
480
  - lib/vellum_ai/types/prompt_settings.rb
479
481
  - lib/vellum_ai/types/prompt_version_build_config_sandbox.rb
482
+ - lib/vellum_ai/types/quota.rb
480
483
  - lib/vellum_ai/types/raw_prompt_execution_overrides_request.rb
481
484
  - lib/vellum_ai/types/reducto_chunker_config.rb
482
485
  - lib/vellum_ai/types/reducto_chunker_config_request.rb
@@ -674,6 +677,7 @@ files:
674
677
  - lib/vellum_ai/types/vellum_variable_extensions.rb
675
678
  - lib/vellum_ai/types/vellum_variable_type.rb
676
679
  - lib/vellum_ai/types/vellum_workflow_execution_event.rb
680
+ - lib/vellum_ai/types/vembda_service_tier_enum.rb
677
681
  - lib/vellum_ai/types/workflow_deployment_event_executions_response.rb
678
682
  - lib/vellum_ai/types/workflow_deployment_history_item.rb
679
683
  - lib/vellum_ai/types/workflow_deployment_parent_context.rb
@@ -688,6 +692,7 @@ files:
688
692
  - lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb
689
693
  - lib/vellum_ai/types/workflow_execution_actual_json_request.rb
690
694
  - lib/vellum_ai/types/workflow_execution_actual_string_request.rb
695
+ - lib/vellum_ai/types/workflow_execution_detail.rb
691
696
  - lib/vellum_ai/types/workflow_execution_event_error_code.rb
692
697
  - lib/vellum_ai/types/workflow_execution_event_type.rb
693
698
  - lib/vellum_ai/types/workflow_execution_fulfilled_body.rb
@@ -755,6 +760,7 @@ files:
755
760
  - lib/vellum_ai/workflow_deployments/client.rb
756
761
  - lib/vellum_ai/workflow_deployments/types/list_workflow_release_tags_request_source.rb
757
762
  - lib/vellum_ai/workflow_deployments/types/workflow_deployments_list_request_status.rb
763
+ - lib/vellum_ai/workflow_executions/client.rb
758
764
  - lib/vellum_ai/workflow_sandboxes/client.rb
759
765
  - lib/vellum_ai/workflow_sandboxes/types/list_workflow_sandbox_examples_request_tag.rb
760
766
  - lib/vellum_ai/workflows/client.rb