vellum_ai 1.10.2 → 1.10.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 +4 -4
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +3 -0
- data/lib/vellum_ai/types/base_output.rb +6 -6
- data/lib/vellum_ai/types/integration_name.rb +2 -0
- data/lib/vellum_ai/types/integration_trigger_context.rb +9 -2
- data/lib/vellum_ai/types/scheduled_trigger_context.rb +9 -2
- data/lib/vellum_ai/types/workflow_output.rb +48 -0
- data/lib/vellum_ai/types/workflow_output_audio.rb +84 -0
- data/lib/vellum_ai/types/workflow_output_document.rb +84 -0
- data/lib/vellum_ai/types/workflow_output_video.rb +84 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aa934e09a4ceec9bd41a115a29ed3fed6e313438530d3ab1efe8b1d44f89e850
|
|
4
|
+
data.tar.gz: 5fcdbe5607b0226cecb8747ba0863f0edd84fb31ad888a4cd6bebe62d9dbc490
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0117a13e0be16c17f1c66636b1bd48156b5bb5fa713cd334956e035bf66ea6dcdd7ac39e3aa15f1bdea5735d37a0558c506770770ccccc8b80cc9d487eb9873
|
|
7
|
+
data.tar.gz: 54a639b35408179957256982cd94f4fe9ecb0a7d637e7fd80cfc27db3b51793a7ded9e33d87a8014640790f648354efe55bf26520c55ca56d7cf5413968a5be5
|
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.
|
|
59
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.10.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.10.
|
|
110
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.10.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
|
@@ -675,6 +675,9 @@ require_relative "vellum_ai/types/workflow_output_array"
|
|
|
675
675
|
require_relative "vellum_ai/types/workflow_output_error"
|
|
676
676
|
require_relative "vellum_ai/types/workflow_output_function_call"
|
|
677
677
|
require_relative "vellum_ai/types/workflow_output_image"
|
|
678
|
+
require_relative "vellum_ai/types/workflow_output_audio"
|
|
679
|
+
require_relative "vellum_ai/types/workflow_output_video"
|
|
680
|
+
require_relative "vellum_ai/types/workflow_output_document"
|
|
678
681
|
require_relative "vellum_ai/types/workflow_output"
|
|
679
682
|
require_relative "vellum_ai/types/workflow_push_deployment_config_request"
|
|
680
683
|
require_relative "vellum_ai/types/workflow_push_response"
|
|
@@ -4,9 +4,9 @@ require "json"
|
|
|
4
4
|
|
|
5
5
|
module Vellum
|
|
6
6
|
class BaseOutput
|
|
7
|
-
# @return [
|
|
7
|
+
# @return [Object]
|
|
8
8
|
attr_reader :value
|
|
9
|
-
# @return [
|
|
9
|
+
# @return [Object]
|
|
10
10
|
attr_reader :delta
|
|
11
11
|
# @return [String]
|
|
12
12
|
attr_reader :name
|
|
@@ -18,8 +18,8 @@ module Vellum
|
|
|
18
18
|
|
|
19
19
|
OMIT = Object.new
|
|
20
20
|
|
|
21
|
-
# @param value [
|
|
22
|
-
# @param delta [
|
|
21
|
+
# @param value [Object]
|
|
22
|
+
# @param delta [Object]
|
|
23
23
|
# @param name [String]
|
|
24
24
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
25
25
|
# @return [Vellum::BaseOutput]
|
|
@@ -62,8 +62,8 @@ end
|
|
|
62
62
|
# @param obj [Object]
|
|
63
63
|
# @return [Void]
|
|
64
64
|
def self.validate_raw(obj:)
|
|
65
|
-
obj.value&.is_a?(
|
|
66
|
-
obj.delta&.is_a?(
|
|
65
|
+
obj.value&.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
|
66
|
+
obj.delta&.is_a?(Object) != false || raise("Passed value for field obj.delta is not the expected type, validation failed.")
|
|
67
67
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
68
68
|
end
|
|
69
69
|
end
|
|
@@ -54,6 +54,7 @@ module Vellum
|
|
|
54
54
|
# * `PEOPLEDATALABS` - People Data Labs
|
|
55
55
|
# * `PERPLEXITY` - Perplexity
|
|
56
56
|
# * `POSTHOG` - PostHog
|
|
57
|
+
# * `PRODUCTBOARD` - Productboard
|
|
57
58
|
# * `REDDIT` - Reddit
|
|
58
59
|
# * `SEMRUSH` - Semrush
|
|
59
60
|
# * `SEMANTICSCHOLAR` - Semantic Scholar
|
|
@@ -131,6 +132,7 @@ module Vellum
|
|
|
131
132
|
PEOPLEDATALABS = "PEOPLEDATALABS"
|
|
132
133
|
PERPLEXITY = "PERPLEXITY"
|
|
133
134
|
POSTHOG = "POSTHOG"
|
|
135
|
+
PRODUCTBOARD = "PRODUCTBOARD"
|
|
134
136
|
REDDIT = "REDDIT"
|
|
135
137
|
SEMRUSH = "SEMRUSH"
|
|
136
138
|
SEMANTICSCHOLAR = "SEMANTICSCHOLAR"
|
|
@@ -12,6 +12,8 @@ module Vellum
|
|
|
12
12
|
attr_reader :links
|
|
13
13
|
# @return [String]
|
|
14
14
|
attr_reader :type
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_reader :trigger_id
|
|
15
17
|
# @return [String]
|
|
16
18
|
attr_reader :span_id
|
|
17
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
@@ -25,16 +27,18 @@ module Vellum
|
|
|
25
27
|
# @param parent [Vellum::ParentContext]
|
|
26
28
|
# @param links [Array<Vellum::SpanLink>]
|
|
27
29
|
# @param type [String]
|
|
30
|
+
# @param trigger_id [String]
|
|
28
31
|
# @param span_id [String]
|
|
29
32
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
33
|
# @return [Vellum::IntegrationTriggerContext]
|
|
31
|
-
def initialize(parent: OMIT, links: OMIT, type:, span_id:, additional_properties: nil)
|
|
34
|
+
def initialize(parent: OMIT, links: OMIT, type:, trigger_id: OMIT, span_id:, additional_properties: nil)
|
|
32
35
|
@parent = parent if parent != OMIT
|
|
33
36
|
@links = links if links != OMIT
|
|
34
37
|
@type = type
|
|
38
|
+
@trigger_id = trigger_id if trigger_id != OMIT
|
|
35
39
|
@span_id = span_id
|
|
36
40
|
@additional_properties = additional_properties
|
|
37
|
-
@_field_set = { "parent": parent, "links": links, "type": type, "span_id": span_id }.reject do | _k, v |
|
|
41
|
+
@_field_set = { "parent": parent, "links": links, "type": type, "trigger_id": trigger_id, "span_id": span_id }.reject do | _k, v |
|
|
38
42
|
v == OMIT
|
|
39
43
|
end
|
|
40
44
|
end
|
|
@@ -56,11 +60,13 @@ end
|
|
|
56
60
|
Vellum::SpanLink.from_json(json_object: item)
|
|
57
61
|
end
|
|
58
62
|
type = parsed_json["type"]
|
|
63
|
+
trigger_id = parsed_json["trigger_id"]
|
|
59
64
|
span_id = parsed_json["span_id"]
|
|
60
65
|
new(
|
|
61
66
|
parent: parent,
|
|
62
67
|
links: links,
|
|
63
68
|
type: type,
|
|
69
|
+
trigger_id: trigger_id,
|
|
64
70
|
span_id: span_id,
|
|
65
71
|
additional_properties: struct
|
|
66
72
|
)
|
|
@@ -81,6 +87,7 @@ end
|
|
|
81
87
|
obj.parent.nil? || Vellum::ParentContext.validate_raw(obj: obj.parent)
|
|
82
88
|
obj.links&.is_a?(Array) != false || raise("Passed value for field obj.links is not the expected type, validation failed.")
|
|
83
89
|
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
|
90
|
+
obj.trigger_id&.is_a?(String) != false || raise("Passed value for field obj.trigger_id is not the expected type, validation failed.")
|
|
84
91
|
obj.span_id.is_a?(String) != false || raise("Passed value for field obj.span_id is not the expected type, validation failed.")
|
|
85
92
|
end
|
|
86
93
|
end
|
|
@@ -12,6 +12,8 @@ module Vellum
|
|
|
12
12
|
attr_reader :links
|
|
13
13
|
# @return [String]
|
|
14
14
|
attr_reader :type
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_reader :trigger_id
|
|
15
17
|
# @return [String]
|
|
16
18
|
attr_reader :span_id
|
|
17
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
@@ -25,16 +27,18 @@ module Vellum
|
|
|
25
27
|
# @param parent [Vellum::ParentContext]
|
|
26
28
|
# @param links [Array<Vellum::SpanLink>]
|
|
27
29
|
# @param type [String]
|
|
30
|
+
# @param trigger_id [String]
|
|
28
31
|
# @param span_id [String]
|
|
29
32
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
33
|
# @return [Vellum::ScheduledTriggerContext]
|
|
31
|
-
def initialize(parent: OMIT, links: OMIT, type:, span_id:, additional_properties: nil)
|
|
34
|
+
def initialize(parent: OMIT, links: OMIT, type:, trigger_id: OMIT, span_id:, additional_properties: nil)
|
|
32
35
|
@parent = parent if parent != OMIT
|
|
33
36
|
@links = links if links != OMIT
|
|
34
37
|
@type = type
|
|
38
|
+
@trigger_id = trigger_id if trigger_id != OMIT
|
|
35
39
|
@span_id = span_id
|
|
36
40
|
@additional_properties = additional_properties
|
|
37
|
-
@_field_set = { "parent": parent, "links": links, "type": type, "span_id": span_id }.reject do | _k, v |
|
|
41
|
+
@_field_set = { "parent": parent, "links": links, "type": type, "trigger_id": trigger_id, "span_id": span_id }.reject do | _k, v |
|
|
38
42
|
v == OMIT
|
|
39
43
|
end
|
|
40
44
|
end
|
|
@@ -56,11 +60,13 @@ end
|
|
|
56
60
|
Vellum::SpanLink.from_json(json_object: item)
|
|
57
61
|
end
|
|
58
62
|
type = parsed_json["type"]
|
|
63
|
+
trigger_id = parsed_json["trigger_id"]
|
|
59
64
|
span_id = parsed_json["span_id"]
|
|
60
65
|
new(
|
|
61
66
|
parent: parent,
|
|
62
67
|
links: links,
|
|
63
68
|
type: type,
|
|
69
|
+
trigger_id: trigger_id,
|
|
64
70
|
span_id: span_id,
|
|
65
71
|
additional_properties: struct
|
|
66
72
|
)
|
|
@@ -81,6 +87,7 @@ end
|
|
|
81
87
|
obj.parent.nil? || Vellum::ParentContext.validate_raw(obj: obj.parent)
|
|
82
88
|
obj.links&.is_a?(Array) != false || raise("Passed value for field obj.links is not the expected type, validation failed.")
|
|
83
89
|
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
|
90
|
+
obj.trigger_id&.is_a?(String) != false || raise("Passed value for field obj.trigger_id is not the expected type, validation failed.")
|
|
84
91
|
obj.span_id.is_a?(String) != false || raise("Passed value for field obj.span_id is not the expected type, validation failed.")
|
|
85
92
|
end
|
|
86
93
|
end
|
|
@@ -9,6 +9,9 @@ require_relative "workflow_output_array"
|
|
|
9
9
|
require_relative "workflow_output_error"
|
|
10
10
|
require_relative "workflow_output_function_call"
|
|
11
11
|
require_relative "workflow_output_image"
|
|
12
|
+
require_relative "workflow_output_audio"
|
|
13
|
+
require_relative "workflow_output_video"
|
|
14
|
+
require_relative "workflow_output_document"
|
|
12
15
|
|
|
13
16
|
module Vellum
|
|
14
17
|
class WorkflowOutput
|
|
@@ -106,6 +109,36 @@ end
|
|
|
106
109
|
return Vellum::WorkflowOutputImage.from_json(json_object: struct)
|
|
107
110
|
else
|
|
108
111
|
return nil
|
|
112
|
+
end
|
|
113
|
+
rescue StandardError
|
|
114
|
+
# noop
|
|
115
|
+
end
|
|
116
|
+
begin
|
|
117
|
+
Vellum::WorkflowOutputAudio.validate_raw(obj: struct)
|
|
118
|
+
unless struct.nil?
|
|
119
|
+
return Vellum::WorkflowOutputAudio.from_json(json_object: struct)
|
|
120
|
+
else
|
|
121
|
+
return nil
|
|
122
|
+
end
|
|
123
|
+
rescue StandardError
|
|
124
|
+
# noop
|
|
125
|
+
end
|
|
126
|
+
begin
|
|
127
|
+
Vellum::WorkflowOutputVideo.validate_raw(obj: struct)
|
|
128
|
+
unless struct.nil?
|
|
129
|
+
return Vellum::WorkflowOutputVideo.from_json(json_object: struct)
|
|
130
|
+
else
|
|
131
|
+
return nil
|
|
132
|
+
end
|
|
133
|
+
rescue StandardError
|
|
134
|
+
# noop
|
|
135
|
+
end
|
|
136
|
+
begin
|
|
137
|
+
Vellum::WorkflowOutputDocument.validate_raw(obj: struct)
|
|
138
|
+
unless struct.nil?
|
|
139
|
+
return Vellum::WorkflowOutputDocument.from_json(json_object: struct)
|
|
140
|
+
else
|
|
141
|
+
return nil
|
|
109
142
|
end
|
|
110
143
|
rescue StandardError
|
|
111
144
|
# noop
|
|
@@ -164,6 +197,21 @@ end
|
|
|
164
197
|
rescue StandardError
|
|
165
198
|
# noop
|
|
166
199
|
end
|
|
200
|
+
begin
|
|
201
|
+
return Vellum::WorkflowOutputAudio.validate_raw(obj: obj)
|
|
202
|
+
rescue StandardError
|
|
203
|
+
# noop
|
|
204
|
+
end
|
|
205
|
+
begin
|
|
206
|
+
return Vellum::WorkflowOutputVideo.validate_raw(obj: obj)
|
|
207
|
+
rescue StandardError
|
|
208
|
+
# noop
|
|
209
|
+
end
|
|
210
|
+
begin
|
|
211
|
+
return Vellum::WorkflowOutputDocument.validate_raw(obj: obj)
|
|
212
|
+
rescue StandardError
|
|
213
|
+
# noop
|
|
214
|
+
end
|
|
167
215
|
raise("Passed value matched no type within the union, validation failed.")
|
|
168
216
|
end
|
|
169
217
|
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require_relative "vellum_audio"
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Vellum
|
|
7
|
+
# An audio output from a Workflow execution.
|
|
8
|
+
class WorkflowOutputAudio
|
|
9
|
+
# @return [String]
|
|
10
|
+
attr_reader :id
|
|
11
|
+
# @return [String] The output's name, as defined in the workflow
|
|
12
|
+
attr_reader :name
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :type
|
|
15
|
+
# @return [Vellum::VellumAudio]
|
|
16
|
+
attr_reader :value
|
|
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 id [String]
|
|
26
|
+
# @param name [String] The output's name, as defined in the workflow
|
|
27
|
+
# @param type [String]
|
|
28
|
+
# @param value [Vellum::VellumAudio]
|
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
|
+
# @return [Vellum::WorkflowOutputAudio]
|
|
31
|
+
def initialize(id:, name:, type:, value: OMIT, additional_properties: nil)
|
|
32
|
+
@id = id
|
|
33
|
+
@name = name
|
|
34
|
+
@type = type
|
|
35
|
+
@value = value if value != OMIT
|
|
36
|
+
@additional_properties = additional_properties
|
|
37
|
+
@_field_set = { "id": id, "name": name, "type": type, "value": value }.reject do | _k, v |
|
|
38
|
+
v == OMIT
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
# Deserialize a JSON object to an instance of WorkflowOutputAudio
|
|
42
|
+
#
|
|
43
|
+
# @param json_object [String]
|
|
44
|
+
# @return [Vellum::WorkflowOutputAudio]
|
|
45
|
+
def self.from_json(json_object:)
|
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
47
|
+
parsed_json = JSON.parse(json_object)
|
|
48
|
+
id = parsed_json["id"]
|
|
49
|
+
name = parsed_json["name"]
|
|
50
|
+
type = parsed_json["type"]
|
|
51
|
+
unless parsed_json["value"].nil?
|
|
52
|
+
value = parsed_json["value"].to_json
|
|
53
|
+
value = Vellum::VellumAudio.from_json(json_object: value)
|
|
54
|
+
else
|
|
55
|
+
value = nil
|
|
56
|
+
end
|
|
57
|
+
new(
|
|
58
|
+
id: id,
|
|
59
|
+
name: name,
|
|
60
|
+
type: type,
|
|
61
|
+
value: value,
|
|
62
|
+
additional_properties: struct
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
# Serialize an instance of WorkflowOutputAudio to a JSON object
|
|
66
|
+
#
|
|
67
|
+
# @return [String]
|
|
68
|
+
def to_json
|
|
69
|
+
@_field_set&.to_json
|
|
70
|
+
end
|
|
71
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
72
|
+
# hash and check each fields type against the current object's property
|
|
73
|
+
# definitions.
|
|
74
|
+
#
|
|
75
|
+
# @param obj [Object]
|
|
76
|
+
# @return [Void]
|
|
77
|
+
def self.validate_raw(obj:)
|
|
78
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
79
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
80
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
|
81
|
+
obj.value.nil? || Vellum::VellumAudio.validate_raw(obj: obj.value)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require_relative "vellum_document"
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Vellum
|
|
7
|
+
# A document output from a Workflow execution.
|
|
8
|
+
class WorkflowOutputDocument
|
|
9
|
+
# @return [String]
|
|
10
|
+
attr_reader :id
|
|
11
|
+
# @return [String] The output's name, as defined in the workflow
|
|
12
|
+
attr_reader :name
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :type
|
|
15
|
+
# @return [Vellum::VellumDocument]
|
|
16
|
+
attr_reader :value
|
|
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 id [String]
|
|
26
|
+
# @param name [String] The output's name, as defined in the workflow
|
|
27
|
+
# @param type [String]
|
|
28
|
+
# @param value [Vellum::VellumDocument]
|
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
|
+
# @return [Vellum::WorkflowOutputDocument]
|
|
31
|
+
def initialize(id:, name:, type:, value: OMIT, additional_properties: nil)
|
|
32
|
+
@id = id
|
|
33
|
+
@name = name
|
|
34
|
+
@type = type
|
|
35
|
+
@value = value if value != OMIT
|
|
36
|
+
@additional_properties = additional_properties
|
|
37
|
+
@_field_set = { "id": id, "name": name, "type": type, "value": value }.reject do | _k, v |
|
|
38
|
+
v == OMIT
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
# Deserialize a JSON object to an instance of WorkflowOutputDocument
|
|
42
|
+
#
|
|
43
|
+
# @param json_object [String]
|
|
44
|
+
# @return [Vellum::WorkflowOutputDocument]
|
|
45
|
+
def self.from_json(json_object:)
|
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
47
|
+
parsed_json = JSON.parse(json_object)
|
|
48
|
+
id = parsed_json["id"]
|
|
49
|
+
name = parsed_json["name"]
|
|
50
|
+
type = parsed_json["type"]
|
|
51
|
+
unless parsed_json["value"].nil?
|
|
52
|
+
value = parsed_json["value"].to_json
|
|
53
|
+
value = Vellum::VellumDocument.from_json(json_object: value)
|
|
54
|
+
else
|
|
55
|
+
value = nil
|
|
56
|
+
end
|
|
57
|
+
new(
|
|
58
|
+
id: id,
|
|
59
|
+
name: name,
|
|
60
|
+
type: type,
|
|
61
|
+
value: value,
|
|
62
|
+
additional_properties: struct
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
# Serialize an instance of WorkflowOutputDocument to a JSON object
|
|
66
|
+
#
|
|
67
|
+
# @return [String]
|
|
68
|
+
def to_json
|
|
69
|
+
@_field_set&.to_json
|
|
70
|
+
end
|
|
71
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
72
|
+
# hash and check each fields type against the current object's property
|
|
73
|
+
# definitions.
|
|
74
|
+
#
|
|
75
|
+
# @param obj [Object]
|
|
76
|
+
# @return [Void]
|
|
77
|
+
def self.validate_raw(obj:)
|
|
78
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
79
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
80
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
|
81
|
+
obj.value.nil? || Vellum::VellumDocument.validate_raw(obj: obj.value)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require_relative "vellum_video"
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Vellum
|
|
7
|
+
# A video output from a Workflow execution.
|
|
8
|
+
class WorkflowOutputVideo
|
|
9
|
+
# @return [String]
|
|
10
|
+
attr_reader :id
|
|
11
|
+
# @return [String] The output's name, as defined in the workflow
|
|
12
|
+
attr_reader :name
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :type
|
|
15
|
+
# @return [Vellum::VellumVideo]
|
|
16
|
+
attr_reader :value
|
|
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 id [String]
|
|
26
|
+
# @param name [String] The output's name, as defined in the workflow
|
|
27
|
+
# @param type [String]
|
|
28
|
+
# @param value [Vellum::VellumVideo]
|
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
|
+
# @return [Vellum::WorkflowOutputVideo]
|
|
31
|
+
def initialize(id:, name:, type:, value: OMIT, additional_properties: nil)
|
|
32
|
+
@id = id
|
|
33
|
+
@name = name
|
|
34
|
+
@type = type
|
|
35
|
+
@value = value if value != OMIT
|
|
36
|
+
@additional_properties = additional_properties
|
|
37
|
+
@_field_set = { "id": id, "name": name, "type": type, "value": value }.reject do | _k, v |
|
|
38
|
+
v == OMIT
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
# Deserialize a JSON object to an instance of WorkflowOutputVideo
|
|
42
|
+
#
|
|
43
|
+
# @param json_object [String]
|
|
44
|
+
# @return [Vellum::WorkflowOutputVideo]
|
|
45
|
+
def self.from_json(json_object:)
|
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
47
|
+
parsed_json = JSON.parse(json_object)
|
|
48
|
+
id = parsed_json["id"]
|
|
49
|
+
name = parsed_json["name"]
|
|
50
|
+
type = parsed_json["type"]
|
|
51
|
+
unless parsed_json["value"].nil?
|
|
52
|
+
value = parsed_json["value"].to_json
|
|
53
|
+
value = Vellum::VellumVideo.from_json(json_object: value)
|
|
54
|
+
else
|
|
55
|
+
value = nil
|
|
56
|
+
end
|
|
57
|
+
new(
|
|
58
|
+
id: id,
|
|
59
|
+
name: name,
|
|
60
|
+
type: type,
|
|
61
|
+
value: value,
|
|
62
|
+
additional_properties: struct
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
# Serialize an instance of WorkflowOutputVideo to a JSON object
|
|
66
|
+
#
|
|
67
|
+
# @return [String]
|
|
68
|
+
def to_json
|
|
69
|
+
@_field_set&.to_json
|
|
70
|
+
end
|
|
71
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
72
|
+
# hash and check each fields type against the current object's property
|
|
73
|
+
# definitions.
|
|
74
|
+
#
|
|
75
|
+
# @param obj [Object]
|
|
76
|
+
# @return [Void]
|
|
77
|
+
def self.validate_raw(obj:)
|
|
78
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
79
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
80
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
|
81
|
+
obj.value.nil? || Vellum::VellumVideo.validate_raw(obj: obj.value)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
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.
|
|
4
|
+
version: 1.10.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-11-
|
|
11
|
+
date: 2025-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -819,7 +819,9 @@ files:
|
|
|
819
819
|
- lib/vellum_ai/types/workflow_node_result_event_state.rb
|
|
820
820
|
- lib/vellum_ai/types/workflow_output.rb
|
|
821
821
|
- lib/vellum_ai/types/workflow_output_array.rb
|
|
822
|
+
- lib/vellum_ai/types/workflow_output_audio.rb
|
|
822
823
|
- lib/vellum_ai/types/workflow_output_chat_history.rb
|
|
824
|
+
- lib/vellum_ai/types/workflow_output_document.rb
|
|
823
825
|
- lib/vellum_ai/types/workflow_output_error.rb
|
|
824
826
|
- lib/vellum_ai/types/workflow_output_function_call.rb
|
|
825
827
|
- lib/vellum_ai/types/workflow_output_image.rb
|
|
@@ -827,6 +829,7 @@ files:
|
|
|
827
829
|
- lib/vellum_ai/types/workflow_output_number.rb
|
|
828
830
|
- lib/vellum_ai/types/workflow_output_search_results.rb
|
|
829
831
|
- lib/vellum_ai/types/workflow_output_string.rb
|
|
832
|
+
- lib/vellum_ai/types/workflow_output_video.rb
|
|
830
833
|
- lib/vellum_ai/types/workflow_parent_context.rb
|
|
831
834
|
- lib/vellum_ai/types/workflow_push_deployment_config_request.rb
|
|
832
835
|
- lib/vellum_ai/types/workflow_push_response.rb
|