vellum_ai 1.10.8 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce3b072bd934564cef4ce8389a1fd4efc9be44dc698613bbc448fb1191f18a78
4
- data.tar.gz: 123d7c862c7ba0a013d559d36fcf75731b0748008a1eb99a5788c0a2eeb665a6
3
+ metadata.gz: ccd1ca7ad21297e3886feaa9a31a00d06ca1a68f4d33454b9496f9fce2283e31
4
+ data.tar.gz: 6cbf944cf1ea593d32bee316e1dc89ba34e73f1847dab9952151cebce3c84b1e
5
5
  SHA512:
6
- metadata.gz: b20c1d84e654ea8033b78327101ddf352e42b636816655f02c2ac4634f6b8302a59726a2ba03a85ec0adc7004c9b95750ea13c72a729c9aca53e132e42dd3eb1
7
- data.tar.gz: 6e6414f64d011a5bc20b71f40786432523f7aaf5fa9f0022675b9310d6697f94df122a0464c1a33e9dfa4506645778ad09c17f7032b40c8e6ebd43e977d260ef
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.10.8' }
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.10.8' }
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"
@@ -704,6 +705,7 @@ require_relative "vellum_ai/types/workflow_result_event_output_data_array"
704
705
  require_relative "vellum_ai/types/workflow_result_event_output_data_function_call"
705
706
  require_relative "vellum_ai/types/workflow_result_event_output_data_error"
706
707
  require_relative "vellum_ai/types/workflow_result_event_output_data"
708
+ require_relative "vellum_ai/types/workflow_result_event_state"
707
709
  require_relative "vellum_ai/types/workflow_sandbox_display_data"
708
710
  require_relative "vellum_ai/types/workflow_sandbox_example"
709
711
  require_relative "vellum_ai/types/workflow_stream_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
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vellum
4
- # * `INITIATED` - Initiated
5
- # * `STREAMING` - Streaming
6
- # * `FULFILLED` - Fulfilled
7
- # * `REJECTED` - Rejected
4
+ # * `INITIATED` - INITIATED
5
+ # * `STREAMING` - STREAMING
6
+ # * `FULFILLED` - FULFILLED
7
+ # * `REJECTED` - REJECTED
8
8
  class WorkflowNodeResultEventState
9
9
 
10
10
  INITIATED = "INITIATED"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require_relative "workflow_node_result_event_state"
2
+ require_relative "workflow_result_event_state"
3
3
  require "date"
4
4
  require_relative "workflow_result_event_output_data"
5
5
  require_relative "workflow_event_error"
@@ -12,7 +12,7 @@ module Vellum
12
12
  class WorkflowResultEvent
13
13
  # @return [String]
14
14
  attr_reader :id
15
- # @return [Vellum::WorkflowNodeResultEventState]
15
+ # @return [Vellum::WorkflowResultEventState]
16
16
  attr_reader :state
17
17
  # @return [DateTime]
18
18
  attr_reader :ts
@@ -33,7 +33,7 @@ module Vellum
33
33
  OMIT = Object.new
34
34
 
35
35
  # @param id [String]
36
- # @param state [Vellum::WorkflowNodeResultEventState]
36
+ # @param state [Vellum::WorkflowResultEventState]
37
37
  # @param ts [DateTime]
38
38
  # @param output [Vellum::WorkflowResultEventOutputData]
39
39
  # @param error [Vellum::WorkflowEventError]
@@ -113,7 +113,7 @@ end
113
113
  # @return [Void]
114
114
  def self.validate_raw(obj:)
115
115
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
116
- obj.state.is_a?(Vellum::WorkflowNodeResultEventState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
116
+ obj.state.is_a?(Vellum::WorkflowResultEventState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
117
117
  obj.ts.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
118
118
  obj.output.nil? || Vellum::WorkflowResultEventOutputData.validate_raw(obj: obj.output)
119
119
  obj.error.nil? || Vellum::WorkflowEventError.validate_raw(obj: obj.error)
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ # * `INITIATED` - Initiated
5
+ # * `STREAMING` - Streaming
6
+ # * `FULFILLED` - Fulfilled
7
+ # * `REJECTED` - Rejected
8
+ # * `PENDING` - Pending
9
+ class WorkflowResultEventState
10
+
11
+ INITIATED = "INITIATED"
12
+ STREAMING = "STREAMING"
13
+ FULFILLED = "FULFILLED"
14
+ REJECTED = "REJECTED"
15
+ PENDING = "PENDING"
16
+
17
+ end
18
+ 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.10.8
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-19 00:00:00.000000000 Z
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
@@ -856,6 +857,7 @@ files:
856
857
  - lib/vellum_ai/types/workflow_result_event_output_data_number.rb
857
858
  - lib/vellum_ai/types/workflow_result_event_output_data_search_results.rb
858
859
  - lib/vellum_ai/types/workflow_result_event_output_data_string.rb
860
+ - lib/vellum_ai/types/workflow_result_event_state.rb
859
861
  - lib/vellum_ai/types/workflow_sandbox_display_data.rb
860
862
  - lib/vellum_ai/types/workflow_sandbox_example.rb
861
863
  - lib/vellum_ai/types/workflow_sandbox_parent_context.rb