vellum_ai 1.6.4 → 1.7.0
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 +1 -0
- data/lib/vellum_ai/container_images/client.rb +6 -4
- data/lib/vellum_ai/types/workflow_resolved_state.rb +111 -0
- data/lib/vellum_ai/workflows/client.rb +78 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71eebd4545302eb788cc0a346efd39bdda98c6d88dd021c6e84db4ea62fb0d92
|
4
|
+
data.tar.gz: ecdbc69b304159caf540743308869bac22cc0bd6ce3294df9fe16cdd110762be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3142112780004864ba815f1c21d07bab490ff58c2138e1668e9ebb015c756f1d8eae86fb1b36e473a3ae8141f5e1be0c5989fe5b778a39c9e7ae45215fbf91d2
|
7
|
+
data.tar.gz: 844d8072a79987e863f708ef34e07b9477c091f594c7e4ee4837e01181093a81e32f4e20f048ac2438e508edeb2df2451d7e196e24479f61a05c90b380f16512
|
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.
|
59
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.7.0' }
|
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.
|
110
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.7.0' }
|
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
@@ -678,6 +678,7 @@ require_relative "vellum_ai/types/workflow_request_json_input_request"
|
|
678
678
|
require_relative "vellum_ai/types/workflow_request_number_input_request"
|
679
679
|
require_relative "vellum_ai/types/workflow_request_video_input_request"
|
680
680
|
require_relative "vellum_ai/types/workflow_request_input_request"
|
681
|
+
require_relative "vellum_ai/types/workflow_resolved_state"
|
681
682
|
require_relative "vellum_ai/types/workflow_result_event"
|
682
683
|
require_relative "vellum_ai/types/workflow_result_event_output_data_string"
|
683
684
|
require_relative "vellum_ai/types/workflow_result_event_output_data_number"
|
@@ -128,6 +128,7 @@ end
|
|
128
128
|
# @param name [String]
|
129
129
|
# @param sha [String]
|
130
130
|
# @param tags [Array<String>]
|
131
|
+
# @param force [Boolean]
|
131
132
|
# @param request_options [Vellum::RequestOptions]
|
132
133
|
# @return [Vellum::ContainerImageRead]
|
133
134
|
# @example
|
@@ -141,7 +142,7 @@ end
|
|
141
142
|
# sha: "x",
|
142
143
|
# tags: ["tags", "tags"]
|
143
144
|
# )
|
144
|
-
def push_container_image(name:, sha:, tags:, request_options: nil)
|
145
|
+
def push_container_image(name:, sha:, tags:, force: nil, request_options: nil)
|
145
146
|
response = @request_client.conn.post do | req |
|
146
147
|
unless request_options&.timeout_in_seconds.nil?
|
147
148
|
req.options.timeout = request_options.timeout_in_seconds
|
@@ -158,7 +159,7 @@ end
|
|
158
159
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
159
160
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
160
161
|
end
|
161
|
-
req.body = { **(request_options&.additional_body_parameters || {}), name: name, sha: sha, tags: tags }.compact
|
162
|
+
req.body = { **(request_options&.additional_body_parameters || {}), name: name, sha: sha, tags: tags, force: force }.compact
|
162
163
|
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/container-images/push"
|
163
164
|
end
|
164
165
|
Vellum::ContainerImageRead.from_json(json_object: response.body)
|
@@ -288,6 +289,7 @@ end
|
|
288
289
|
# @param name [String]
|
289
290
|
# @param sha [String]
|
290
291
|
# @param tags [Array<String>]
|
292
|
+
# @param force [Boolean]
|
291
293
|
# @param request_options [Vellum::RequestOptions]
|
292
294
|
# @return [Vellum::ContainerImageRead]
|
293
295
|
# @example
|
@@ -301,7 +303,7 @@ end
|
|
301
303
|
# sha: "x",
|
302
304
|
# tags: ["tags", "tags"]
|
303
305
|
# )
|
304
|
-
def push_container_image(name:, sha:, tags:, request_options: nil)
|
306
|
+
def push_container_image(name:, sha:, tags:, force: nil, request_options: nil)
|
305
307
|
Async do
|
306
308
|
response = @request_client.conn.post do | req |
|
307
309
|
unless request_options&.timeout_in_seconds.nil?
|
@@ -319,7 +321,7 @@ end
|
|
319
321
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
320
322
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
321
323
|
end
|
322
|
-
req.body = { **(request_options&.additional_body_parameters || {}), name: name, sha: sha, tags: tags }.compact
|
324
|
+
req.body = { **(request_options&.additional_body_parameters || {}), name: name, sha: sha, tags: tags, force: force }.compact
|
323
325
|
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/container-images/push"
|
324
326
|
end
|
325
327
|
Vellum::ContainerImageRead.from_json(json_object: response.body)
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "date"
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
# The latest execution state of a given Workflow Execution
|
8
|
+
class WorkflowResolvedState
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :trace_id
|
11
|
+
# @return [DateTime]
|
12
|
+
attr_reader :timestamp
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :span_id
|
15
|
+
# @return [Hash{String => Object}]
|
16
|
+
attr_reader :state
|
17
|
+
# @return [String]
|
18
|
+
attr_reader :previous_span_id
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :previous_trace_id
|
21
|
+
# @return [String]
|
22
|
+
attr_reader :root_span_id
|
23
|
+
# @return [String]
|
24
|
+
attr_reader :root_trace_id
|
25
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
attr_reader :additional_properties
|
27
|
+
# @return [Object]
|
28
|
+
attr_reader :_field_set
|
29
|
+
protected :_field_set
|
30
|
+
|
31
|
+
OMIT = Object.new
|
32
|
+
|
33
|
+
# @param trace_id [String]
|
34
|
+
# @param timestamp [DateTime]
|
35
|
+
# @param span_id [String]
|
36
|
+
# @param state [Hash{String => Object}]
|
37
|
+
# @param previous_span_id [String]
|
38
|
+
# @param previous_trace_id [String]
|
39
|
+
# @param root_span_id [String]
|
40
|
+
# @param root_trace_id [String]
|
41
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
42
|
+
# @return [Vellum::WorkflowResolvedState]
|
43
|
+
def initialize(trace_id:, timestamp:, span_id:, state:, previous_span_id: OMIT, previous_trace_id: OMIT, root_span_id: OMIT, root_trace_id: OMIT, additional_properties: nil)
|
44
|
+
@trace_id = trace_id
|
45
|
+
@timestamp = timestamp
|
46
|
+
@span_id = span_id
|
47
|
+
@state = state
|
48
|
+
@previous_span_id = previous_span_id if previous_span_id != OMIT
|
49
|
+
@previous_trace_id = previous_trace_id if previous_trace_id != OMIT
|
50
|
+
@root_span_id = root_span_id if root_span_id != OMIT
|
51
|
+
@root_trace_id = root_trace_id if root_trace_id != OMIT
|
52
|
+
@additional_properties = additional_properties
|
53
|
+
@_field_set = { "trace_id": trace_id, "timestamp": timestamp, "span_id": span_id, "state": state, "previous_span_id": previous_span_id, "previous_trace_id": previous_trace_id, "root_span_id": root_span_id, "root_trace_id": root_trace_id }.reject do | _k, v |
|
54
|
+
v == OMIT
|
55
|
+
end
|
56
|
+
end
|
57
|
+
# Deserialize a JSON object to an instance of WorkflowResolvedState
|
58
|
+
#
|
59
|
+
# @param json_object [String]
|
60
|
+
# @return [Vellum::WorkflowResolvedState]
|
61
|
+
def self.from_json(json_object:)
|
62
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
63
|
+
parsed_json = JSON.parse(json_object)
|
64
|
+
trace_id = parsed_json["trace_id"]
|
65
|
+
timestamp = unless parsed_json["timestamp"].nil?
|
66
|
+
DateTime.parse(parsed_json["timestamp"])
|
67
|
+
else
|
68
|
+
nil
|
69
|
+
end
|
70
|
+
span_id = parsed_json["span_id"]
|
71
|
+
state = parsed_json["state"]
|
72
|
+
previous_span_id = parsed_json["previous_span_id"]
|
73
|
+
previous_trace_id = parsed_json["previous_trace_id"]
|
74
|
+
root_span_id = parsed_json["root_span_id"]
|
75
|
+
root_trace_id = parsed_json["root_trace_id"]
|
76
|
+
new(
|
77
|
+
trace_id: trace_id,
|
78
|
+
timestamp: timestamp,
|
79
|
+
span_id: span_id,
|
80
|
+
state: state,
|
81
|
+
previous_span_id: previous_span_id,
|
82
|
+
previous_trace_id: previous_trace_id,
|
83
|
+
root_span_id: root_span_id,
|
84
|
+
root_trace_id: root_trace_id,
|
85
|
+
additional_properties: struct
|
86
|
+
)
|
87
|
+
end
|
88
|
+
# Serialize an instance of WorkflowResolvedState to a JSON object
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
def to_json
|
92
|
+
@_field_set&.to_json
|
93
|
+
end
|
94
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
95
|
+
# hash and check each fields type against the current object's property
|
96
|
+
# definitions.
|
97
|
+
#
|
98
|
+
# @param obj [Object]
|
99
|
+
# @return [Void]
|
100
|
+
def self.validate_raw(obj:)
|
101
|
+
obj.trace_id.is_a?(String) != false || raise("Passed value for field obj.trace_id is not the expected type, validation failed.")
|
102
|
+
obj.timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
103
|
+
obj.span_id.is_a?(String) != false || raise("Passed value for field obj.span_id is not the expected type, validation failed.")
|
104
|
+
obj.state.is_a?(Hash) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
|
105
|
+
obj.previous_span_id&.is_a?(String) != false || raise("Passed value for field obj.previous_span_id is not the expected type, validation failed.")
|
106
|
+
obj.previous_trace_id&.is_a?(String) != false || raise("Passed value for field obj.previous_trace_id is not the expected type, validation failed.")
|
107
|
+
obj.root_span_id&.is_a?(String) != false || raise("Passed value for field obj.root_span_id is not the expected type, validation failed.")
|
108
|
+
obj.root_trace_id&.is_a?(String) != false || raise("Passed value for field obj.root_trace_id is not the expected type, validation failed.")
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require_relative "../../requests"
|
3
|
+
require_relative "../types/workflow_resolved_state"
|
3
4
|
require_relative "../types/workflow_push_deployment_config_request"
|
4
5
|
require_relative "../types/workflow_push_response"
|
5
6
|
require_relative "../../core/file_utilities"
|
@@ -7,6 +8,7 @@ require "json"
|
|
7
8
|
require "async"
|
8
9
|
require "async"
|
9
10
|
require "async"
|
11
|
+
require "async"
|
10
12
|
require_relative "../../requests"
|
11
13
|
|
12
14
|
module Vellum
|
@@ -57,6 +59,43 @@ module Vellum
|
|
57
59
|
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/workflows/#{id}/pull"
|
58
60
|
end
|
59
61
|
end
|
62
|
+
# Retrieve the current state of a workflow execution.
|
63
|
+
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
64
|
+
#
|
65
|
+
# @param span_id [String] The span ID of the workflow execution to retrieve state for
|
66
|
+
# @param request_options [Vellum::RequestOptions]
|
67
|
+
# @return [Vellum::WorkflowResolvedState]
|
68
|
+
# @example
|
69
|
+
# api = Vellum::Client.new(
|
70
|
+
# base_url: "https://api.example.com",
|
71
|
+
# environment: Vellum::Environment::PRODUCTION,
|
72
|
+
# api_key: "YOUR_API_KEY"
|
73
|
+
# )
|
74
|
+
# api.workflows.retrieve_state(span_id: "span_id")
|
75
|
+
def retrieve_state(span_id:, request_options: nil)
|
76
|
+
response = @request_client.conn.get do | req |
|
77
|
+
unless request_options&.timeout_in_seconds.nil?
|
78
|
+
req.options.timeout = request_options.timeout_in_seconds
|
79
|
+
end
|
80
|
+
unless request_options&.api_key.nil?
|
81
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
82
|
+
end
|
83
|
+
unless request_options&.api_version.nil?
|
84
|
+
req.headers["X-API-Version"] = request_options.api_version
|
85
|
+
else
|
86
|
+
req.headers["X-API-Version"] = "2025-07-30"
|
87
|
+
end
|
88
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
89
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
90
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
91
|
+
end
|
92
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
93
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
94
|
+
end
|
95
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/workflows/#{span_id}/state"
|
96
|
+
end
|
97
|
+
Vellum::WorkflowResolvedState.from_json(json_object: response.body)
|
98
|
+
end
|
60
99
|
# @param exec_config [String] The execution configuration of the workflow.
|
61
100
|
# @param workflow_sandbox_id [String]
|
62
101
|
# @param deployment_config [Hash] Request of type Vellum::WorkflowPushDeploymentConfigRequest, as a Hash
|
@@ -179,6 +218,45 @@ end
|
|
179
218
|
end
|
180
219
|
end
|
181
220
|
end
|
221
|
+
# Retrieve the current state of a workflow execution.
|
222
|
+
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
223
|
+
#
|
224
|
+
# @param span_id [String] The span ID of the workflow execution to retrieve state for
|
225
|
+
# @param request_options [Vellum::RequestOptions]
|
226
|
+
# @return [Vellum::WorkflowResolvedState]
|
227
|
+
# @example
|
228
|
+
# api = Vellum::Client.new(
|
229
|
+
# base_url: "https://api.example.com",
|
230
|
+
# environment: Vellum::Environment::PRODUCTION,
|
231
|
+
# api_key: "YOUR_API_KEY"
|
232
|
+
# )
|
233
|
+
# api.workflows.retrieve_state(span_id: "span_id")
|
234
|
+
def retrieve_state(span_id:, request_options: nil)
|
235
|
+
Async do
|
236
|
+
response = @request_client.conn.get do | req |
|
237
|
+
unless request_options&.timeout_in_seconds.nil?
|
238
|
+
req.options.timeout = request_options.timeout_in_seconds
|
239
|
+
end
|
240
|
+
unless request_options&.api_key.nil?
|
241
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
242
|
+
end
|
243
|
+
unless request_options&.api_version.nil?
|
244
|
+
req.headers["X-API-Version"] = request_options.api_version
|
245
|
+
else
|
246
|
+
req.headers["X-API-Version"] = "2025-07-30"
|
247
|
+
end
|
248
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
249
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
250
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
251
|
+
end
|
252
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
253
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
254
|
+
end
|
255
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/workflows/#{span_id}/state"
|
256
|
+
end
|
257
|
+
Vellum::WorkflowResolvedState.from_json(json_object: response.body)
|
258
|
+
end
|
259
|
+
end
|
182
260
|
# @param exec_config [String] The execution configuration of the workflow.
|
183
261
|
# @param workflow_sandbox_id [String]
|
184
262
|
# @param deployment_config [Hash] Request of type Vellum::WorkflowPushDeploymentConfigRequest, as a Hash
|
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.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vellum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-10-
|
11
|
+
date: 2025-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -829,6 +829,7 @@ files:
|
|
829
829
|
- lib/vellum_ai/types/workflow_request_number_input_request.rb
|
830
830
|
- lib/vellum_ai/types/workflow_request_string_input_request.rb
|
831
831
|
- lib/vellum_ai/types/workflow_request_video_input_request.rb
|
832
|
+
- lib/vellum_ai/types/workflow_resolved_state.rb
|
832
833
|
- lib/vellum_ai/types/workflow_result_event.rb
|
833
834
|
- lib/vellum_ai/types/workflow_result_event_output_data.rb
|
834
835
|
- lib/vellum_ai/types/workflow_result_event_output_data_array.rb
|