vellum_ai 1.2.0 → 1.2.1
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 +3 -0
- data/lib/vellum_ai/events/client.rb +101 -0
- data/lib/vellum_ai/types/error_detail_response.rb +51 -0
- data/lib/vellum_ai/types/event_create_response.rb +54 -0
- data/lib/vellum_ai/types/execution_thinking_vellum_value.rb +6 -4
- data/lib/vellum_ai/types/thinking_vellum_value.rb +6 -4
- data/lib/vellum_ai/types/thinking_vellum_value_request.rb +6 -4
- data/lib/vellum_ai/types/workflow_event.rb +234 -0
- data/lib/vellum_ai.rb +7 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3207156e6a125a3be3b1865611e192432ef980d2cec14a17b1188a08688eab4
|
4
|
+
data.tar.gz: 181f8c5ddb435cc230af2e842f9fe2b01cbcd5a9105b2481e20ea116e4ea4cfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69238e5ab6fb2994454740dd24180151bf06b75b4a91ee7c694a489afd0e38d9c9c33a846e49ff37fb073a30caca200419c63f6d0a26f0aa414049c0e029ee77
|
7
|
+
data.tar.gz: 21175d2006453c495cb65288193abe50cd736d31190b9bc4736d39e8a36a315ed5f4de5c3f0534e6a41ca6a8165b927659c248785d6b2a17c32258927cfc55e4
|
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.2.
|
59
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.2.1' }
|
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.2.
|
110
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.2.1' }
|
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
@@ -127,8 +127,10 @@ require_relative "vellum_ai/types/entity_visibility"
|
|
127
127
|
require_relative "vellum_ai/types/environment_enum"
|
128
128
|
require_relative "vellum_ai/types/ephemeral_prompt_cache_config"
|
129
129
|
require_relative "vellum_ai/types/ephemeral_prompt_cache_config_type_enum"
|
130
|
+
require_relative "vellum_ai/types/error_detail_response"
|
130
131
|
require_relative "vellum_ai/types/error_vellum_value"
|
131
132
|
require_relative "vellum_ai/types/error_vellum_value_request"
|
133
|
+
require_relative "vellum_ai/types/event_create_response"
|
132
134
|
require_relative "vellum_ai/types/execute_api_response_json"
|
133
135
|
require_relative "vellum_ai/types/execute_api_response"
|
134
136
|
require_relative "vellum_ai/types/initiated_execute_prompt_event"
|
@@ -557,6 +559,7 @@ require_relative "vellum_ai/types/workflow_deployment_release_workflow_version"
|
|
557
559
|
require_relative "vellum_ai/types/workflow_event_error"
|
558
560
|
require_relative "vellum_ai/types/workflow_initialization_error"
|
559
561
|
require_relative "vellum_ai/types/workflow_error"
|
562
|
+
require_relative "vellum_ai/types/workflow_event"
|
560
563
|
require_relative "vellum_ai/types/workflow_event_execution_read"
|
561
564
|
require_relative "vellum_ai/types/workflow_execution_actual"
|
562
565
|
require_relative "vellum_ai/types/workflow_execution_detail"
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require_relative "../../requests"
|
3
|
+
require_relative "../types/workflow_event"
|
4
|
+
require_relative "../types/event_create_response"
|
5
|
+
require "async"
|
6
|
+
require_relative "../../requests"
|
7
|
+
|
8
|
+
module Vellum
|
9
|
+
class EventsClient
|
10
|
+
# @return [Vellum::RequestClient]
|
11
|
+
attr_reader :request_client
|
12
|
+
|
13
|
+
|
14
|
+
# @param request_client [Vellum::RequestClient]
|
15
|
+
# @return [Vellum::EventsClient]
|
16
|
+
def initialize(request_client:)
|
17
|
+
@request_client = request_client
|
18
|
+
end
|
19
|
+
# Accept an event and publish it to ClickHouse for analytics processing.
|
20
|
+
#
|
21
|
+
# @param request [Vellum::NodeExecutionInitiatedEvent, Vellum::NodeExecutionStreamingEvent, Vellum::NodeExecutionFulfilledEvent, Vellum::NodeExecutionRejectedEvent, Vellum::NodeExecutionPausedEvent, Vellum::NodeExecutionResumedEvent, Vellum::WorkflowExecutionInitiatedEvent, Vellum::WorkflowExecutionStreamingEvent, Vellum::WorkflowExecutionRejectedEvent, Vellum::WorkflowExecutionFulfilledEvent, Vellum::WorkflowExecutionPausedEvent, Vellum::WorkflowExecutionResumedEvent, Vellum::WorkflowExecutionSnapshottedEvent]
|
22
|
+
# @param request_options [Vellum::RequestOptions]
|
23
|
+
# @return [Vellum::EventCreateResponse]
|
24
|
+
# @example
|
25
|
+
# api = Vellum::Client.new(
|
26
|
+
# base_url: "https://api.example.com",
|
27
|
+
# environment: Vellum::Environment::PRODUCTION,
|
28
|
+
# api_key: "YOUR_API_KEY"
|
29
|
+
# )
|
30
|
+
# api.events.create(request: { name: "node.execution.initiated", body: { node_definition: { name: "name", module_: ["module", "module"], id: "id" }, inputs: { "inputs": {"key":"value"} } }, id: "id", timestamp: DateTime.parse("2024-01-15T09:30:00.000Z"), trace_id: "trace_id", span_id: "span_id" })
|
31
|
+
def create(request:, request_options: nil)
|
32
|
+
response = @request_client.conn.post do | req |
|
33
|
+
unless request_options&.timeout_in_seconds.nil?
|
34
|
+
req.options.timeout = request_options.timeout_in_seconds
|
35
|
+
end
|
36
|
+
unless request_options&.api_key.nil?
|
37
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
38
|
+
end
|
39
|
+
unless request_options&.api_version.nil?
|
40
|
+
req.headers["X-API-Version"] = request_options.api_version
|
41
|
+
else
|
42
|
+
req.headers["X-API-Version"] = "2025-07-30"
|
43
|
+
end
|
44
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
45
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
46
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
47
|
+
end
|
48
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
49
|
+
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/monitoring/v1/events"
|
50
|
+
end
|
51
|
+
Vellum::EventCreateResponse.from_json(json_object: response.body)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
class AsyncEventsClient
|
55
|
+
# @return [Vellum::AsyncRequestClient]
|
56
|
+
attr_reader :request_client
|
57
|
+
|
58
|
+
|
59
|
+
# @param request_client [Vellum::RequestClient]
|
60
|
+
# @return [Vellum::AsyncEventsClient]
|
61
|
+
def initialize(request_client:)
|
62
|
+
@request_client = request_client
|
63
|
+
end
|
64
|
+
# Accept an event and publish it to ClickHouse for analytics processing.
|
65
|
+
#
|
66
|
+
# @param request [Vellum::NodeExecutionInitiatedEvent, Vellum::NodeExecutionStreamingEvent, Vellum::NodeExecutionFulfilledEvent, Vellum::NodeExecutionRejectedEvent, Vellum::NodeExecutionPausedEvent, Vellum::NodeExecutionResumedEvent, Vellum::WorkflowExecutionInitiatedEvent, Vellum::WorkflowExecutionStreamingEvent, Vellum::WorkflowExecutionRejectedEvent, Vellum::WorkflowExecutionFulfilledEvent, Vellum::WorkflowExecutionPausedEvent, Vellum::WorkflowExecutionResumedEvent, Vellum::WorkflowExecutionSnapshottedEvent]
|
67
|
+
# @param request_options [Vellum::RequestOptions]
|
68
|
+
# @return [Vellum::EventCreateResponse]
|
69
|
+
# @example
|
70
|
+
# api = Vellum::Client.new(
|
71
|
+
# base_url: "https://api.example.com",
|
72
|
+
# environment: Vellum::Environment::PRODUCTION,
|
73
|
+
# api_key: "YOUR_API_KEY"
|
74
|
+
# )
|
75
|
+
# api.events.create(request: { name: "node.execution.initiated", body: { node_definition: { name: "name", module_: ["module", "module"], id: "id" }, inputs: { "inputs": {"key":"value"} } }, id: "id", timestamp: DateTime.parse("2024-01-15T09:30:00.000Z"), trace_id: "trace_id", span_id: "span_id" })
|
76
|
+
def create(request:, request_options: nil)
|
77
|
+
Async do
|
78
|
+
response = @request_client.conn.post do | req |
|
79
|
+
unless request_options&.timeout_in_seconds.nil?
|
80
|
+
req.options.timeout = request_options.timeout_in_seconds
|
81
|
+
end
|
82
|
+
unless request_options&.api_key.nil?
|
83
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
84
|
+
end
|
85
|
+
unless request_options&.api_version.nil?
|
86
|
+
req.headers["X-API-Version"] = request_options.api_version
|
87
|
+
else
|
88
|
+
req.headers["X-API-Version"] = "2025-07-30"
|
89
|
+
end
|
90
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
91
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
92
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
93
|
+
end
|
94
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
95
|
+
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/monitoring/v1/events"
|
96
|
+
end
|
97
|
+
Vellum::EventCreateResponse.from_json(json_object: response.body)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "ostruct"
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class ErrorDetailResponse
|
7
|
+
# @return [String] Message informing the user of the error.
|
8
|
+
attr_reader :detail
|
9
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
10
|
+
attr_reader :additional_properties
|
11
|
+
# @return [Object]
|
12
|
+
attr_reader :_field_set
|
13
|
+
protected :_field_set
|
14
|
+
|
15
|
+
OMIT = Object.new
|
16
|
+
|
17
|
+
# @param detail [String] Message informing the user of the error.
|
18
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
# @return [Vellum::ErrorDetailResponse]
|
20
|
+
def initialize(detail:, additional_properties: nil)
|
21
|
+
@detail = detail
|
22
|
+
@additional_properties = additional_properties
|
23
|
+
@_field_set = { "detail": detail }
|
24
|
+
end
|
25
|
+
# Deserialize a JSON object to an instance of ErrorDetailResponse
|
26
|
+
#
|
27
|
+
# @param json_object [String]
|
28
|
+
# @return [Vellum::ErrorDetailResponse]
|
29
|
+
def self.from_json(json_object:)
|
30
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
31
|
+
parsed_json = JSON.parse(json_object)
|
32
|
+
detail = parsed_json["detail"]
|
33
|
+
new(detail: detail, additional_properties: struct)
|
34
|
+
end
|
35
|
+
# Serialize an instance of ErrorDetailResponse to a JSON object
|
36
|
+
#
|
37
|
+
# @return [String]
|
38
|
+
def to_json
|
39
|
+
@_field_set&.to_json
|
40
|
+
end
|
41
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
42
|
+
# hash and check each fields type against the current object's property
|
43
|
+
# definitions.
|
44
|
+
#
|
45
|
+
# @param obj [Object]
|
46
|
+
# @return [Void]
|
47
|
+
def self.validate_raw(obj:)
|
48
|
+
obj.detail.is_a?(String) != false || raise("Passed value for field obj.detail is not the expected type, validation failed.")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "ostruct"
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
# Response serializer for successful event creation.
|
7
|
+
class EventCreateResponse
|
8
|
+
# @return [Boolean] Indicates whether the event was published successfully.
|
9
|
+
attr_reader :success
|
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 success [Boolean] Indicates whether the event was published successfully.
|
19
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
# @return [Vellum::EventCreateResponse]
|
21
|
+
def initialize(success: OMIT, additional_properties: nil)
|
22
|
+
@success = success if success != OMIT
|
23
|
+
@additional_properties = additional_properties
|
24
|
+
@_field_set = { "success": success }.reject do | _k, v |
|
25
|
+
v == OMIT
|
26
|
+
end
|
27
|
+
end
|
28
|
+
# Deserialize a JSON object to an instance of EventCreateResponse
|
29
|
+
#
|
30
|
+
# @param json_object [String]
|
31
|
+
# @return [Vellum::EventCreateResponse]
|
32
|
+
def self.from_json(json_object:)
|
33
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
34
|
+
parsed_json = JSON.parse(json_object)
|
35
|
+
success = parsed_json["success"]
|
36
|
+
new(success: success, additional_properties: struct)
|
37
|
+
end
|
38
|
+
# Serialize an instance of EventCreateResponse to a JSON object
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
def to_json
|
42
|
+
@_field_set&.to_json
|
43
|
+
end
|
44
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
45
|
+
# hash and check each fields type against the current object's property
|
46
|
+
# definitions.
|
47
|
+
#
|
48
|
+
# @param obj [Object]
|
49
|
+
# @return [Void]
|
50
|
+
def self.validate_raw(obj:)
|
51
|
+
obj.success&.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -28,13 +28,15 @@ module Vellum
|
|
28
28
|
# @param value [Vellum::StringVellumValue]
|
29
29
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
# @return [Vellum::ExecutionThinkingVellumValue]
|
31
|
-
def initialize(id:, name:, type:, value
|
31
|
+
def initialize(id:, name:, type:, value: OMIT, additional_properties: nil)
|
32
32
|
@id = id
|
33
33
|
@name = name
|
34
34
|
@type = type
|
35
|
-
@value = value
|
35
|
+
@value = value if value != OMIT
|
36
36
|
@additional_properties = additional_properties
|
37
|
-
@_field_set = { "id": id, "name": name, "type": type, "value": value }
|
37
|
+
@_field_set = { "id": id, "name": name, "type": type, "value": value }.reject do | _k, v |
|
38
|
+
v == OMIT
|
39
|
+
end
|
38
40
|
end
|
39
41
|
# Deserialize a JSON object to an instance of ExecutionThinkingVellumValue
|
40
42
|
#
|
@@ -76,7 +78,7 @@ module Vellum
|
|
76
78
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
77
79
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
78
80
|
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
79
|
-
Vellum::StringVellumValue.validate_raw(obj: obj.value)
|
81
|
+
obj.value.nil? || Vellum::StringVellumValue.validate_raw(obj: obj.value)
|
80
82
|
end
|
81
83
|
end
|
82
84
|
end
|
@@ -22,11 +22,13 @@ module Vellum
|
|
22
22
|
# @param value [Vellum::StringVellumValue]
|
23
23
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
24
|
# @return [Vellum::ThinkingVellumValue]
|
25
|
-
def initialize(type:, value
|
25
|
+
def initialize(type:, value: OMIT, additional_properties: nil)
|
26
26
|
@type = type
|
27
|
-
@value = value
|
27
|
+
@value = value if value != OMIT
|
28
28
|
@additional_properties = additional_properties
|
29
|
-
@_field_set = { "type": type, "value": value }
|
29
|
+
@_field_set = { "type": type, "value": value }.reject do | _k, v |
|
30
|
+
v == OMIT
|
31
|
+
end
|
30
32
|
end
|
31
33
|
# Deserialize a JSON object to an instance of ThinkingVellumValue
|
32
34
|
#
|
@@ -62,7 +64,7 @@ module Vellum
|
|
62
64
|
# @return [Void]
|
63
65
|
def self.validate_raw(obj:)
|
64
66
|
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
65
|
-
Vellum::StringVellumValue.validate_raw(obj: obj.value)
|
67
|
+
obj.value.nil? || Vellum::StringVellumValue.validate_raw(obj: obj.value)
|
66
68
|
end
|
67
69
|
end
|
68
70
|
end
|
@@ -22,11 +22,13 @@ module Vellum
|
|
22
22
|
# @param value [Vellum::StringVellumValueRequest]
|
23
23
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
24
|
# @return [Vellum::ThinkingVellumValueRequest]
|
25
|
-
def initialize(type:, value
|
25
|
+
def initialize(type:, value: OMIT, additional_properties: nil)
|
26
26
|
@type = type
|
27
|
-
@value = value
|
27
|
+
@value = value if value != OMIT
|
28
28
|
@additional_properties = additional_properties
|
29
|
-
@_field_set = { "type": type, "value": value }
|
29
|
+
@_field_set = { "type": type, "value": value }.reject do | _k, v |
|
30
|
+
v == OMIT
|
31
|
+
end
|
30
32
|
end
|
31
33
|
# Deserialize a JSON object to an instance of ThinkingVellumValueRequest
|
32
34
|
#
|
@@ -62,7 +64,7 @@ module Vellum
|
|
62
64
|
# @return [Void]
|
63
65
|
def self.validate_raw(obj:)
|
64
66
|
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
65
|
-
Vellum::StringVellumValueRequest.validate_raw(obj: obj.value)
|
67
|
+
obj.value.nil? || Vellum::StringVellumValueRequest.validate_raw(obj: obj.value)
|
66
68
|
end
|
67
69
|
end
|
68
70
|
end
|
@@ -0,0 +1,234 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "json"
|
3
|
+
require_relative "node_execution_initiated_event"
|
4
|
+
require_relative "node_execution_streaming_event"
|
5
|
+
require_relative "node_execution_fulfilled_event"
|
6
|
+
require_relative "node_execution_rejected_event"
|
7
|
+
require_relative "node_execution_paused_event"
|
8
|
+
require_relative "node_execution_resumed_event"
|
9
|
+
require_relative "workflow_execution_initiated_event"
|
10
|
+
require_relative "workflow_execution_streaming_event"
|
11
|
+
require_relative "workflow_execution_rejected_event"
|
12
|
+
require_relative "workflow_execution_fulfilled_event"
|
13
|
+
require_relative "workflow_execution_paused_event"
|
14
|
+
require_relative "workflow_execution_resumed_event"
|
15
|
+
require_relative "workflow_execution_snapshotted_event"
|
16
|
+
|
17
|
+
module Vellum
|
18
|
+
class WorkflowEvent
|
19
|
+
|
20
|
+
|
21
|
+
# Deserialize a JSON object to an instance of WorkflowEvent
|
22
|
+
#
|
23
|
+
# @param json_object [String]
|
24
|
+
# @return [Vellum::WorkflowEvent]
|
25
|
+
def self.from_json(json_object:)
|
26
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
27
|
+
begin
|
28
|
+
Vellum::NodeExecutionInitiatedEvent.validate_raw(obj: struct)
|
29
|
+
unless struct.nil?
|
30
|
+
return Vellum::NodeExecutionInitiatedEvent.from_json(json_object: struct)
|
31
|
+
else
|
32
|
+
return nil
|
33
|
+
end
|
34
|
+
rescue StandardError
|
35
|
+
# noop
|
36
|
+
end
|
37
|
+
begin
|
38
|
+
Vellum::NodeExecutionStreamingEvent.validate_raw(obj: struct)
|
39
|
+
unless struct.nil?
|
40
|
+
return Vellum::NodeExecutionStreamingEvent.from_json(json_object: struct)
|
41
|
+
else
|
42
|
+
return nil
|
43
|
+
end
|
44
|
+
rescue StandardError
|
45
|
+
# noop
|
46
|
+
end
|
47
|
+
begin
|
48
|
+
Vellum::NodeExecutionFulfilledEvent.validate_raw(obj: struct)
|
49
|
+
unless struct.nil?
|
50
|
+
return Vellum::NodeExecutionFulfilledEvent.from_json(json_object: struct)
|
51
|
+
else
|
52
|
+
return nil
|
53
|
+
end
|
54
|
+
rescue StandardError
|
55
|
+
# noop
|
56
|
+
end
|
57
|
+
begin
|
58
|
+
Vellum::NodeExecutionRejectedEvent.validate_raw(obj: struct)
|
59
|
+
unless struct.nil?
|
60
|
+
return Vellum::NodeExecutionRejectedEvent.from_json(json_object: struct)
|
61
|
+
else
|
62
|
+
return nil
|
63
|
+
end
|
64
|
+
rescue StandardError
|
65
|
+
# noop
|
66
|
+
end
|
67
|
+
begin
|
68
|
+
Vellum::NodeExecutionPausedEvent.validate_raw(obj: struct)
|
69
|
+
unless struct.nil?
|
70
|
+
return Vellum::NodeExecutionPausedEvent.from_json(json_object: struct)
|
71
|
+
else
|
72
|
+
return nil
|
73
|
+
end
|
74
|
+
rescue StandardError
|
75
|
+
# noop
|
76
|
+
end
|
77
|
+
begin
|
78
|
+
Vellum::NodeExecutionResumedEvent.validate_raw(obj: struct)
|
79
|
+
unless struct.nil?
|
80
|
+
return Vellum::NodeExecutionResumedEvent.from_json(json_object: struct)
|
81
|
+
else
|
82
|
+
return nil
|
83
|
+
end
|
84
|
+
rescue StandardError
|
85
|
+
# noop
|
86
|
+
end
|
87
|
+
begin
|
88
|
+
Vellum::WorkflowExecutionInitiatedEvent.validate_raw(obj: struct)
|
89
|
+
unless struct.nil?
|
90
|
+
return Vellum::WorkflowExecutionInitiatedEvent.from_json(json_object: struct)
|
91
|
+
else
|
92
|
+
return nil
|
93
|
+
end
|
94
|
+
rescue StandardError
|
95
|
+
# noop
|
96
|
+
end
|
97
|
+
begin
|
98
|
+
Vellum::WorkflowExecutionStreamingEvent.validate_raw(obj: struct)
|
99
|
+
unless struct.nil?
|
100
|
+
return Vellum::WorkflowExecutionStreamingEvent.from_json(json_object: struct)
|
101
|
+
else
|
102
|
+
return nil
|
103
|
+
end
|
104
|
+
rescue StandardError
|
105
|
+
# noop
|
106
|
+
end
|
107
|
+
begin
|
108
|
+
Vellum::WorkflowExecutionRejectedEvent.validate_raw(obj: struct)
|
109
|
+
unless struct.nil?
|
110
|
+
return Vellum::WorkflowExecutionRejectedEvent.from_json(json_object: struct)
|
111
|
+
else
|
112
|
+
return nil
|
113
|
+
end
|
114
|
+
rescue StandardError
|
115
|
+
# noop
|
116
|
+
end
|
117
|
+
begin
|
118
|
+
Vellum::WorkflowExecutionFulfilledEvent.validate_raw(obj: struct)
|
119
|
+
unless struct.nil?
|
120
|
+
return Vellum::WorkflowExecutionFulfilledEvent.from_json(json_object: struct)
|
121
|
+
else
|
122
|
+
return nil
|
123
|
+
end
|
124
|
+
rescue StandardError
|
125
|
+
# noop
|
126
|
+
end
|
127
|
+
begin
|
128
|
+
Vellum::WorkflowExecutionPausedEvent.validate_raw(obj: struct)
|
129
|
+
unless struct.nil?
|
130
|
+
return Vellum::WorkflowExecutionPausedEvent.from_json(json_object: struct)
|
131
|
+
else
|
132
|
+
return nil
|
133
|
+
end
|
134
|
+
rescue StandardError
|
135
|
+
# noop
|
136
|
+
end
|
137
|
+
begin
|
138
|
+
Vellum::WorkflowExecutionResumedEvent.validate_raw(obj: struct)
|
139
|
+
unless struct.nil?
|
140
|
+
return Vellum::WorkflowExecutionResumedEvent.from_json(json_object: struct)
|
141
|
+
else
|
142
|
+
return nil
|
143
|
+
end
|
144
|
+
rescue StandardError
|
145
|
+
# noop
|
146
|
+
end
|
147
|
+
begin
|
148
|
+
Vellum::WorkflowExecutionSnapshottedEvent.validate_raw(obj: struct)
|
149
|
+
unless struct.nil?
|
150
|
+
return Vellum::WorkflowExecutionSnapshottedEvent.from_json(json_object: struct)
|
151
|
+
else
|
152
|
+
return nil
|
153
|
+
end
|
154
|
+
rescue StandardError
|
155
|
+
# noop
|
156
|
+
end
|
157
|
+
return struct
|
158
|
+
end
|
159
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
160
|
+
# hash and check each fields type against the current object's property
|
161
|
+
# definitions.
|
162
|
+
#
|
163
|
+
# @param obj [Object]
|
164
|
+
# @return [Void]
|
165
|
+
def self.validate_raw(obj:)
|
166
|
+
begin
|
167
|
+
return Vellum::NodeExecutionInitiatedEvent.validate_raw(obj: obj)
|
168
|
+
rescue StandardError
|
169
|
+
# noop
|
170
|
+
end
|
171
|
+
begin
|
172
|
+
return Vellum::NodeExecutionStreamingEvent.validate_raw(obj: obj)
|
173
|
+
rescue StandardError
|
174
|
+
# noop
|
175
|
+
end
|
176
|
+
begin
|
177
|
+
return Vellum::NodeExecutionFulfilledEvent.validate_raw(obj: obj)
|
178
|
+
rescue StandardError
|
179
|
+
# noop
|
180
|
+
end
|
181
|
+
begin
|
182
|
+
return Vellum::NodeExecutionRejectedEvent.validate_raw(obj: obj)
|
183
|
+
rescue StandardError
|
184
|
+
# noop
|
185
|
+
end
|
186
|
+
begin
|
187
|
+
return Vellum::NodeExecutionPausedEvent.validate_raw(obj: obj)
|
188
|
+
rescue StandardError
|
189
|
+
# noop
|
190
|
+
end
|
191
|
+
begin
|
192
|
+
return Vellum::NodeExecutionResumedEvent.validate_raw(obj: obj)
|
193
|
+
rescue StandardError
|
194
|
+
# noop
|
195
|
+
end
|
196
|
+
begin
|
197
|
+
return Vellum::WorkflowExecutionInitiatedEvent.validate_raw(obj: obj)
|
198
|
+
rescue StandardError
|
199
|
+
# noop
|
200
|
+
end
|
201
|
+
begin
|
202
|
+
return Vellum::WorkflowExecutionStreamingEvent.validate_raw(obj: obj)
|
203
|
+
rescue StandardError
|
204
|
+
# noop
|
205
|
+
end
|
206
|
+
begin
|
207
|
+
return Vellum::WorkflowExecutionRejectedEvent.validate_raw(obj: obj)
|
208
|
+
rescue StandardError
|
209
|
+
# noop
|
210
|
+
end
|
211
|
+
begin
|
212
|
+
return Vellum::WorkflowExecutionFulfilledEvent.validate_raw(obj: obj)
|
213
|
+
rescue StandardError
|
214
|
+
# noop
|
215
|
+
end
|
216
|
+
begin
|
217
|
+
return Vellum::WorkflowExecutionPausedEvent.validate_raw(obj: obj)
|
218
|
+
rescue StandardError
|
219
|
+
# noop
|
220
|
+
end
|
221
|
+
begin
|
222
|
+
return Vellum::WorkflowExecutionResumedEvent.validate_raw(obj: obj)
|
223
|
+
rescue StandardError
|
224
|
+
# noop
|
225
|
+
end
|
226
|
+
begin
|
227
|
+
return Vellum::WorkflowExecutionSnapshottedEvent.validate_raw(obj: obj)
|
228
|
+
rescue StandardError
|
229
|
+
# noop
|
230
|
+
end
|
231
|
+
raise("Passed value matched no type within the union, validation failed.")
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
data/lib/vellum_ai.rb
CHANGED
@@ -3,6 +3,7 @@ require_relative "environment"
|
|
3
3
|
require_relative "types_export"
|
4
4
|
require_relative "vellum_ai/types/api_version_enum"
|
5
5
|
require_relative "requests"
|
6
|
+
require_relative "vellum_ai/events/client"
|
6
7
|
require_relative "vellum_ai/ad_hoc/client"
|
7
8
|
require_relative "vellum_ai/container_images/client"
|
8
9
|
require_relative "vellum_ai/deployments/client"
|
@@ -49,6 +50,8 @@ require_relative "requests"
|
|
49
50
|
|
50
51
|
module Vellum
|
51
52
|
class Client
|
53
|
+
# @return [Vellum::EventsClient]
|
54
|
+
attr_reader :events
|
52
55
|
# @return [Vellum::AdHocClient]
|
53
56
|
attr_reader :ad_hoc
|
54
57
|
# @return [Vellum::ContainerImagesClient]
|
@@ -105,6 +108,7 @@ module Vellum
|
|
105
108
|
api_key: api_key,
|
106
109
|
api_version: api_version
|
107
110
|
)
|
111
|
+
@events = Vellum::EventsClient.new(request_client: @request_client)
|
108
112
|
@ad_hoc = Vellum::AdHocClient.new(request_client: @request_client)
|
109
113
|
@container_images = Vellum::ContainerImagesClient.new(request_client: @request_client)
|
110
114
|
@deployments = Vellum::DeploymentsClient.new(request_client: @request_client)
|
@@ -502,6 +506,8 @@ end
|
|
502
506
|
end
|
503
507
|
end
|
504
508
|
class AsyncClient
|
509
|
+
# @return [Vellum::AsyncEventsClient]
|
510
|
+
attr_reader :events
|
505
511
|
# @return [Vellum::AsyncAdHocClient]
|
506
512
|
attr_reader :ad_hoc
|
507
513
|
# @return [Vellum::AsyncContainerImagesClient]
|
@@ -558,6 +564,7 @@ end
|
|
558
564
|
api_key: api_key,
|
559
565
|
api_version: api_version
|
560
566
|
)
|
567
|
+
@events = Vellum::AsyncEventsClient.new(request_client: @async_request_client)
|
561
568
|
@ad_hoc = Vellum::AsyncAdHocClient.new(request_client: @async_request_client)
|
562
569
|
@container_images = Vellum::AsyncContainerImagesClient.new(request_client: @async_request_client)
|
563
570
|
@deployments = Vellum::AsyncDeploymentsClient.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.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vellum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/vellum_ai/document_indexes/client.rb
|
146
146
|
- lib/vellum_ai/document_indexes/types/document_indexes_list_request_status.rb
|
147
147
|
- lib/vellum_ai/documents/client.rb
|
148
|
+
- lib/vellum_ai/events/client.rb
|
148
149
|
- lib/vellum_ai/folder_entities/client.rb
|
149
150
|
- lib/vellum_ai/folder_entities/types/folder_entities_list_request_entity_status.rb
|
150
151
|
- lib/vellum_ai/metric_definitions/client.rb
|
@@ -250,9 +251,11 @@ files:
|
|
250
251
|
- lib/vellum_ai/types/environment_enum.rb
|
251
252
|
- lib/vellum_ai/types/ephemeral_prompt_cache_config.rb
|
252
253
|
- lib/vellum_ai/types/ephemeral_prompt_cache_config_type_enum.rb
|
254
|
+
- lib/vellum_ai/types/error_detail_response.rb
|
253
255
|
- lib/vellum_ai/types/error_input.rb
|
254
256
|
- lib/vellum_ai/types/error_vellum_value.rb
|
255
257
|
- lib/vellum_ai/types/error_vellum_value_request.rb
|
258
|
+
- lib/vellum_ai/types/event_create_response.rb
|
256
259
|
- lib/vellum_ai/types/execute_api_request_bearer_token.rb
|
257
260
|
- lib/vellum_ai/types/execute_api_request_body.rb
|
258
261
|
- lib/vellum_ai/types/execute_api_request_headers_value.rb
|
@@ -690,6 +693,7 @@ files:
|
|
690
693
|
- lib/vellum_ai/types/workflow_deployment_release_workflow_deployment.rb
|
691
694
|
- lib/vellum_ai/types/workflow_deployment_release_workflow_version.rb
|
692
695
|
- lib/vellum_ai/types/workflow_error.rb
|
696
|
+
- lib/vellum_ai/types/workflow_event.rb
|
693
697
|
- lib/vellum_ai/types/workflow_event_error.rb
|
694
698
|
- lib/vellum_ai/types/workflow_event_execution_read.rb
|
695
699
|
- lib/vellum_ai/types/workflow_execution_actual.rb
|