vellum_ai 1.10.9 → 1.11.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/types/execute_workflow_async_response.rb +52 -0
- data/lib/vellum_ai.rb +95 -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: ccd1ca7ad21297e3886feaa9a31a00d06ca1a68f4d33454b9496f9fce2283e31
|
|
4
|
+
data.tar.gz: 6cbf944cf1ea593d32bee316e1dc89ba34e73f1847dab9952151cebce3c84b1e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4cd470bfd9abd70f0d114aeed273e423e6f27097ed5158e6e666945e9f29148d3619906e7950ed661ebef862711d6a1c1c2b564760c6f2e172087087048025ed
|
|
7
|
+
data.tar.gz: 4a017b28dd6158ab7b994b545cd96a58823af8835cb00358d4078dc0ed6dd63451613419e7cda59598923824ddb6983f5b7d3bc42a611c3aa284f9b585b277b4
|
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.11.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.11.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
|
@@ -187,6 +187,7 @@ require_relative "vellum_ai/types/rejected_execute_prompt_response"
|
|
|
187
187
|
require_relative "vellum_ai/types/execute_prompt_response"
|
|
188
188
|
require_relative "vellum_ai/types/components_schemas_composio_execute_tool_request"
|
|
189
189
|
require_relative "vellum_ai/types/components_schemas_composio_execute_tool_response"
|
|
190
|
+
require_relative "vellum_ai/types/execute_workflow_async_response"
|
|
190
191
|
require_relative "vellum_ai/types/execute_workflow_response"
|
|
191
192
|
require_relative "vellum_ai/types/fulfilled_execute_workflow_workflow_result_event"
|
|
192
193
|
require_relative "vellum_ai/types/rejected_execute_workflow_workflow_result_event"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "ostruct"
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Vellum
|
|
6
|
+
# The response from an async Workflow Deployment execution.
|
|
7
|
+
class ExecuteWorkflowAsyncResponse
|
|
8
|
+
# @return [String] The ID of the workflow execution.
|
|
9
|
+
attr_reader :execution_id
|
|
10
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
11
|
+
attr_reader :additional_properties
|
|
12
|
+
# @return [Object]
|
|
13
|
+
attr_reader :_field_set
|
|
14
|
+
protected :_field_set
|
|
15
|
+
|
|
16
|
+
OMIT = Object.new
|
|
17
|
+
|
|
18
|
+
# @param execution_id [String] The ID of the workflow execution.
|
|
19
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
20
|
+
# @return [Vellum::ExecuteWorkflowAsyncResponse]
|
|
21
|
+
def initialize(execution_id:, additional_properties: nil)
|
|
22
|
+
@execution_id = execution_id
|
|
23
|
+
@additional_properties = additional_properties
|
|
24
|
+
@_field_set = { "execution_id": execution_id }
|
|
25
|
+
end
|
|
26
|
+
# Deserialize a JSON object to an instance of ExecuteWorkflowAsyncResponse
|
|
27
|
+
#
|
|
28
|
+
# @param json_object [String]
|
|
29
|
+
# @return [Vellum::ExecuteWorkflowAsyncResponse]
|
|
30
|
+
def self.from_json(json_object:)
|
|
31
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
32
|
+
parsed_json = JSON.parse(json_object)
|
|
33
|
+
execution_id = parsed_json["execution_id"]
|
|
34
|
+
new(execution_id: execution_id, additional_properties: struct)
|
|
35
|
+
end
|
|
36
|
+
# Serialize an instance of ExecuteWorkflowAsyncResponse to a JSON object
|
|
37
|
+
#
|
|
38
|
+
# @return [String]
|
|
39
|
+
def to_json
|
|
40
|
+
@_field_set&.to_json
|
|
41
|
+
end
|
|
42
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
43
|
+
# hash and check each fields type against the current object's property
|
|
44
|
+
# definitions.
|
|
45
|
+
#
|
|
46
|
+
# @param obj [Object]
|
|
47
|
+
# @return [Void]
|
|
48
|
+
def self.validate_raw(obj:)
|
|
49
|
+
obj.execution_id.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.")
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
data/lib/vellum_ai.rb
CHANGED
|
@@ -44,6 +44,7 @@ require_relative "vellum_ai/types/execute_prompt_response"
|
|
|
44
44
|
require_relative "vellum_ai/types/workflow_request_input_request"
|
|
45
45
|
require_relative "vellum_ai/types/workflow_expand_meta_request"
|
|
46
46
|
require_relative "vellum_ai/types/execute_workflow_response"
|
|
47
|
+
require_relative "vellum_ai/types/execute_workflow_async_response"
|
|
47
48
|
require_relative "vellum_ai/types/generate_request"
|
|
48
49
|
require_relative "vellum_ai/types/generate_options_request"
|
|
49
50
|
require_relative "vellum_ai/types/generate_response"
|
|
@@ -348,6 +349,53 @@ end
|
|
|
348
349
|
end
|
|
349
350
|
Vellum::ExecuteWorkflowResponse.from_json(json_object: response.body)
|
|
350
351
|
end
|
|
352
|
+
# Executes a deployed Workflow asynchronously and returns the execution ID.
|
|
353
|
+
#
|
|
354
|
+
# @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding
|
|
355
|
+
# values.Request of type Array<Vellum::WorkflowRequestInputRequest>, as a Hash
|
|
356
|
+
# @param workflow_deployment_id [String] The ID of the Workflow Deployment. Must provide either this or
|
|
357
|
+
# workflow_deployment_name.
|
|
358
|
+
# @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or
|
|
359
|
+
# workflow_deployment_id.
|
|
360
|
+
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the
|
|
361
|
+
# Workflow Deployment
|
|
362
|
+
# @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique
|
|
363
|
+
# within a given Workspace.
|
|
364
|
+
# @param previous_execution_id [String] The ID of a previous Workflow Execution to reference for initial State loading.
|
|
365
|
+
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
|
366
|
+
# additional monitoring data such as user id, session id, etc. for future
|
|
367
|
+
# analysis.
|
|
368
|
+
# @param request_options [Vellum::RequestOptions]
|
|
369
|
+
# @return [Vellum::ExecuteWorkflowAsyncResponse]
|
|
370
|
+
# @example
|
|
371
|
+
# api = Vellum::Client.new(
|
|
372
|
+
# base_url: "https://api.example.com",
|
|
373
|
+
# environment: Vellum::Environment::PRODUCTION,
|
|
374
|
+
# api_key: "YOUR_API_KEY"
|
|
375
|
+
# )
|
|
376
|
+
# api.execute_workflow_async(inputs: [{ name: "x", type: "STRING", value: "value" }, { name: "x", type: "STRING", value: "value" }])
|
|
377
|
+
def execute_workflow_async(inputs:, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, previous_execution_id: nil, metadata: nil, request_options: nil)
|
|
378
|
+
response = @request_client.conn.post do | req |
|
|
379
|
+
unless request_options&.timeout_in_seconds.nil?
|
|
380
|
+
req.options.timeout = request_options.timeout_in_seconds
|
|
381
|
+
end
|
|
382
|
+
unless request_options&.api_key.nil?
|
|
383
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
|
384
|
+
end
|
|
385
|
+
unless request_options&.api_version.nil?
|
|
386
|
+
req.headers["X-API-Version"] = request_options.api_version
|
|
387
|
+
else
|
|
388
|
+
req.headers["X-API-Version"] = "2025-07-30"
|
|
389
|
+
end
|
|
390
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
|
391
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
|
392
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
393
|
+
end
|
|
394
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, previous_execution_id: previous_execution_id, metadata: metadata }.compact
|
|
395
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-workflow-async"
|
|
396
|
+
end
|
|
397
|
+
Vellum::ExecuteWorkflowAsyncResponse.from_json(json_object: response.body)
|
|
398
|
+
end
|
|
351
399
|
# Generate a completion using a previously defined deployment.
|
|
352
400
|
# Important: This endpoint is DEPRECATED and has been superseded by
|
|
353
401
|
# [execute-prompt](/api-reference/api-reference/execute-prompt).
|
|
@@ -820,6 +868,53 @@ end
|
|
|
820
868
|
end
|
|
821
869
|
Vellum::ExecuteWorkflowResponse.from_json(json_object: response.body)
|
|
822
870
|
end
|
|
871
|
+
# Executes a deployed Workflow asynchronously and returns the execution ID.
|
|
872
|
+
#
|
|
873
|
+
# @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding
|
|
874
|
+
# values.Request of type Array<Vellum::WorkflowRequestInputRequest>, as a Hash
|
|
875
|
+
# @param workflow_deployment_id [String] The ID of the Workflow Deployment. Must provide either this or
|
|
876
|
+
# workflow_deployment_name.
|
|
877
|
+
# @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or
|
|
878
|
+
# workflow_deployment_id.
|
|
879
|
+
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the
|
|
880
|
+
# Workflow Deployment
|
|
881
|
+
# @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique
|
|
882
|
+
# within a given Workspace.
|
|
883
|
+
# @param previous_execution_id [String] The ID of a previous Workflow Execution to reference for initial State loading.
|
|
884
|
+
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
|
885
|
+
# additional monitoring data such as user id, session id, etc. for future
|
|
886
|
+
# analysis.
|
|
887
|
+
# @param request_options [Vellum::RequestOptions]
|
|
888
|
+
# @return [Vellum::ExecuteWorkflowAsyncResponse]
|
|
889
|
+
# @example
|
|
890
|
+
# api = Vellum::Client.new(
|
|
891
|
+
# base_url: "https://api.example.com",
|
|
892
|
+
# environment: Vellum::Environment::PRODUCTION,
|
|
893
|
+
# api_key: "YOUR_API_KEY"
|
|
894
|
+
# )
|
|
895
|
+
# api.execute_workflow_async(inputs: [{ name: "x", type: "STRING", value: "value" }, { name: "x", type: "STRING", value: "value" }])
|
|
896
|
+
def execute_workflow_async(inputs:, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, previous_execution_id: nil, metadata: nil, request_options: nil)
|
|
897
|
+
response = @async_request_client.conn.post do | req |
|
|
898
|
+
unless request_options&.timeout_in_seconds.nil?
|
|
899
|
+
req.options.timeout = request_options.timeout_in_seconds
|
|
900
|
+
end
|
|
901
|
+
unless request_options&.api_key.nil?
|
|
902
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
|
903
|
+
end
|
|
904
|
+
unless request_options&.api_version.nil?
|
|
905
|
+
req.headers["X-API-Version"] = request_options.api_version
|
|
906
|
+
else
|
|
907
|
+
req.headers["X-API-Version"] = "2025-07-30"
|
|
908
|
+
end
|
|
909
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
|
910
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
|
911
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
912
|
+
end
|
|
913
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, previous_execution_id: previous_execution_id, metadata: metadata }.compact
|
|
914
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-workflow-async"
|
|
915
|
+
end
|
|
916
|
+
Vellum::ExecuteWorkflowAsyncResponse.from_json(json_object: response.body)
|
|
917
|
+
end
|
|
823
918
|
# Generate a completion using a previously defined deployment.
|
|
824
919
|
# Important: This endpoint is DEPRECATED and has been superseded by
|
|
825
920
|
# [execute-prompt](/api-reference/api-reference/execute-prompt).
|
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.11.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-11-
|
|
11
|
+
date: 2025-11-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -291,6 +291,7 @@ files:
|
|
|
291
291
|
- lib/vellum_ai/types/execute_api_response_json.rb
|
|
292
292
|
- lib/vellum_ai/types/execute_prompt_event.rb
|
|
293
293
|
- lib/vellum_ai/types/execute_prompt_response.rb
|
|
294
|
+
- lib/vellum_ai/types/execute_workflow_async_response.rb
|
|
294
295
|
- lib/vellum_ai/types/execute_workflow_response.rb
|
|
295
296
|
- lib/vellum_ai/types/execute_workflow_workflow_result_event.rb
|
|
296
297
|
- lib/vellum_ai/types/execution_array_vellum_value.rb
|