vellum_ai 1.10.9 → 1.11.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 +1 -0
- data/lib/vellum_ai/ad_hoc/client.rb +2 -0
- data/lib/vellum_ai/documents/client.rb +12 -4
- data/lib/vellum_ai/types/execute_workflow_async_response.rb +52 -0
- data/lib/vellum_ai/types/integration_name.rb +18 -0
- data/lib/vellum_ai/types/vellum_code_resource_definition.rb +11 -2
- data/lib/vellum_ai/types/vellum_variable.rb +9 -2
- data/lib/vellum_ai/types/vellum_variable_type.rb +2 -0
- data/lib/vellum_ai/uploaded_files/client.rb +10 -8
- 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: a60ad69d455a95ad07f2fc8f372c4b33f02ff1d029706aa9bda14a4e02ac654e
|
|
4
|
+
data.tar.gz: 942fd246875f6513a390560f37eacaf9e8ca9c121d79f5a64066a0b56a91639f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff5e52bda3751837cede9f49267451deb82d64af6d7002862e21dce749b2da24659c855520075e93ef7fa4182faa759ee00646831ef55521fc282fb400dc9408
|
|
7
|
+
data.tar.gz: c7bdcd32fa746bcc784e4f2979333350f26718c7c1a4501204e136d423c0837a885b6b3b1041077d78a780fb23d464daf6fc362d4f3482c7506f745b372b0235
|
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.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.
|
|
110
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.11.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
|
@@ -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"
|
|
@@ -33,6 +33,7 @@ module Vellum
|
|
|
33
33
|
# * :extensions (Hash)
|
|
34
34
|
# * :color (String)
|
|
35
35
|
# * :description (String)
|
|
36
|
+
# * :schema (Hash{String => Object})
|
|
36
37
|
# @param parameters [Hash] Request of type Vellum::PromptParameters, as a Hash
|
|
37
38
|
# * :stop (Array<String>)
|
|
38
39
|
# * :temperature (Float)
|
|
@@ -121,6 +122,7 @@ end
|
|
|
121
122
|
# * :extensions (Hash)
|
|
122
123
|
# * :color (String)
|
|
123
124
|
# * :description (String)
|
|
125
|
+
# * :schema (Hash{String => Object})
|
|
124
126
|
# @param parameters [Hash] Request of type Vellum::PromptParameters, as a Hash
|
|
125
127
|
# * :stop (Array<String>)
|
|
126
128
|
# * :temperature (Float)
|
|
@@ -189,13 +189,15 @@ end
|
|
|
189
189
|
# to be re-indexed.
|
|
190
190
|
# @param label [String] A human-friendly name for this document. Typically the filename.
|
|
191
191
|
# @param contents [String, IO]
|
|
192
|
+
# @param url [String] A URL from which the document can be downloaded. Either contents or url must be
|
|
193
|
+
# provided.
|
|
192
194
|
# @param keywords [Array<String>] Optionally include a list of keywords that'll be associated with this document.
|
|
193
195
|
# Used when performing keyword searches.
|
|
194
196
|
# @param metadata [String] A stringified JSON object containing any metadata associated with the document
|
|
195
197
|
# that you'd like to filter upon later.
|
|
196
198
|
# @param request_options [Vellum::RequestOptions]
|
|
197
199
|
# @return [Vellum::UploadDocumentResponse]
|
|
198
|
-
def upload(add_to_index_names: nil, external_id: nil, label:, contents
|
|
200
|
+
def upload(add_to_index_names: nil, external_id: nil, label:, contents: nil, url: nil, keywords: nil, metadata: nil, request_options: nil)
|
|
199
201
|
response = @request_client.conn.post do | req |
|
|
200
202
|
unless request_options&.timeout_in_seconds.nil?
|
|
201
203
|
req.options.timeout = request_options.timeout_in_seconds
|
|
@@ -212,7 +214,9 @@ end
|
|
|
212
214
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
|
213
215
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
214
216
|
end
|
|
215
|
-
req.body = { **(request_options&.additional_body_parameters || {}), add_to_index_names: add_to_index_names, external_id: external_id, label: label, contents:
|
|
217
|
+
req.body = { **(request_options&.additional_body_parameters || {}), add_to_index_names: add_to_index_names, external_id: external_id, label: label, contents: unless contents.nil?
|
|
218
|
+
Vellum::FileUtilities.as_faraday_multipart(file_like: contents)
|
|
219
|
+
end, url: url, keywords: keywords, metadata: metadata }.compact
|
|
216
220
|
req.url "#{@request_client.get_url(environment: Documents, request_options: request_options)}/v1/upload-document"
|
|
217
221
|
end
|
|
218
222
|
Vellum::UploadDocumentResponse.from_json(json_object: response.body)
|
|
@@ -402,13 +406,15 @@ end
|
|
|
402
406
|
# to be re-indexed.
|
|
403
407
|
# @param label [String] A human-friendly name for this document. Typically the filename.
|
|
404
408
|
# @param contents [String, IO]
|
|
409
|
+
# @param url [String] A URL from which the document can be downloaded. Either contents or url must be
|
|
410
|
+
# provided.
|
|
405
411
|
# @param keywords [Array<String>] Optionally include a list of keywords that'll be associated with this document.
|
|
406
412
|
# Used when performing keyword searches.
|
|
407
413
|
# @param metadata [String] A stringified JSON object containing any metadata associated with the document
|
|
408
414
|
# that you'd like to filter upon later.
|
|
409
415
|
# @param request_options [Vellum::RequestOptions]
|
|
410
416
|
# @return [Vellum::UploadDocumentResponse]
|
|
411
|
-
def upload(add_to_index_names: nil, external_id: nil, label:, contents
|
|
417
|
+
def upload(add_to_index_names: nil, external_id: nil, label:, contents: nil, url: nil, keywords: nil, metadata: nil, request_options: nil)
|
|
412
418
|
Async do
|
|
413
419
|
response = @request_client.conn.post do | req |
|
|
414
420
|
unless request_options&.timeout_in_seconds.nil?
|
|
@@ -426,7 +432,9 @@ end
|
|
|
426
432
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
|
427
433
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
428
434
|
end
|
|
429
|
-
req.body = { **(request_options&.additional_body_parameters || {}), add_to_index_names: add_to_index_names, external_id: external_id, label: label, contents:
|
|
435
|
+
req.body = { **(request_options&.additional_body_parameters || {}), add_to_index_names: add_to_index_names, external_id: external_id, label: label, contents: unless contents.nil?
|
|
436
|
+
Vellum::FileUtilities.as_faraday_multipart(file_like: contents)
|
|
437
|
+
end, url: url, keywords: keywords, metadata: metadata }.compact
|
|
430
438
|
req.url "#{@request_client.get_url(environment: Documents, request_options: request_options)}/v1/upload-document"
|
|
431
439
|
end
|
|
432
440
|
Vellum::UploadDocumentResponse.from_json(json_object: response.body)
|
|
@@ -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
|
|
@@ -10,6 +10,7 @@ module Vellum
|
|
|
10
10
|
# * `CODA` - Coda
|
|
11
11
|
# * `HUBSPOT` - Hubspot
|
|
12
12
|
# * `INTERCOM` - Intercom
|
|
13
|
+
# * `INSTAGRAM` - Instagram
|
|
13
14
|
# * `LINEAR` - Linear
|
|
14
15
|
# * `LINKUP` - Linkup
|
|
15
16
|
# * `LISTENNOTES` - Listen Notes
|
|
@@ -23,6 +24,13 @@ module Vellum
|
|
|
23
24
|
# * `GOOGLE_CALENDAR` - Google Calendar
|
|
24
25
|
# * `GOOGLE_DRIVE` - Google Drive
|
|
25
26
|
# * `GMAIL` - Gmail
|
|
27
|
+
# * `GOOGLE_ADS` - Google Ads
|
|
28
|
+
# * `GOOGLE_ANALYTICS` - Google Analytics
|
|
29
|
+
# * `GOOGLE_DOCS` - Google Docs
|
|
30
|
+
# * `GOOGLE_PHOTOS` - Google Photos
|
|
31
|
+
# * `GOOGLE_SEARCH_CONSOLE` - Google Search Console
|
|
32
|
+
# * `GOOGLE_SLIDES` - Google Slides
|
|
33
|
+
# * `GOOGLE_TASKS` - Google Tasks
|
|
26
34
|
# * `ACCULYNX` - AccuLynx
|
|
27
35
|
# * `AFFINITY` - Affinity
|
|
28
36
|
# * `AGENCYZOOM` - AgencyZoom
|
|
@@ -72,6 +80,7 @@ module Vellum
|
|
|
72
80
|
# * `ZENROWS` - ZenRows
|
|
73
81
|
# * `DROPBOX` - Dropbox
|
|
74
82
|
# * `EVENTBRITE` - Eventbrite
|
|
83
|
+
# * `FACEBOOK` - Facebook
|
|
75
84
|
# * `CONFLUENCE` - Confluence
|
|
76
85
|
# * `COINBASE` - Coinbase
|
|
77
86
|
# * `DISCORD` - Discord
|
|
@@ -88,6 +97,7 @@ module Vellum
|
|
|
88
97
|
CODA = "CODA"
|
|
89
98
|
HUBSPOT = "HUBSPOT"
|
|
90
99
|
INTERCOM = "INTERCOM"
|
|
100
|
+
INSTAGRAM = "INSTAGRAM"
|
|
91
101
|
LINEAR = "LINEAR"
|
|
92
102
|
LINKUP = "LINKUP"
|
|
93
103
|
LISTENNOTES = "LISTENNOTES"
|
|
@@ -101,6 +111,13 @@ module Vellum
|
|
|
101
111
|
GOOGLE_CALENDAR = "GOOGLE_CALENDAR"
|
|
102
112
|
GOOGLE_DRIVE = "GOOGLE_DRIVE"
|
|
103
113
|
GMAIL = "GMAIL"
|
|
114
|
+
GOOGLE_ADS = "GOOGLE_ADS"
|
|
115
|
+
GOOGLE_ANALYTICS = "GOOGLE_ANALYTICS"
|
|
116
|
+
GOOGLE_DOCS = "GOOGLE_DOCS"
|
|
117
|
+
GOOGLE_PHOTOS = "GOOGLE_PHOTOS"
|
|
118
|
+
GOOGLE_SEARCH_CONSOLE = "GOOGLE_SEARCH_CONSOLE"
|
|
119
|
+
GOOGLE_SLIDES = "GOOGLE_SLIDES"
|
|
120
|
+
GOOGLE_TASKS = "GOOGLE_TASKS"
|
|
104
121
|
ACCULYNX = "ACCULYNX"
|
|
105
122
|
AFFINITY = "AFFINITY"
|
|
106
123
|
AGENCYZOOM = "AGENCYZOOM"
|
|
@@ -150,6 +167,7 @@ module Vellum
|
|
|
150
167
|
ZENROWS = "ZENROWS"
|
|
151
168
|
DROPBOX = "DROPBOX"
|
|
152
169
|
EVENTBRITE = "EVENTBRITE"
|
|
170
|
+
FACEBOOK = "FACEBOOK"
|
|
153
171
|
CONFLUENCE = "CONFLUENCE"
|
|
154
172
|
COINBASE = "COINBASE"
|
|
155
173
|
DISCORD = "DISCORD"
|
|
@@ -8,6 +8,8 @@ module Vellum
|
|
|
8
8
|
attr_reader :name
|
|
9
9
|
# @return [Array<String>] The module that this resource is defined in.
|
|
10
10
|
attr_reader :module_
|
|
11
|
+
# @return [Boolean] Whether this node should be excluded from monitoring views.
|
|
12
|
+
attr_reader :exclude_from_monitoring
|
|
11
13
|
# @return [String]
|
|
12
14
|
attr_reader :id
|
|
13
15
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
@@ -20,15 +22,19 @@ module Vellum
|
|
|
20
22
|
|
|
21
23
|
# @param name [String]
|
|
22
24
|
# @param module_ [Array<String>] The module that this resource is defined in.
|
|
25
|
+
# @param exclude_from_monitoring [Boolean] Whether this node should be excluded from monitoring views.
|
|
23
26
|
# @param id [String]
|
|
24
27
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
25
28
|
# @return [Vellum::VellumCodeResourceDefinition]
|
|
26
|
-
def initialize(name:, module_:, id:, additional_properties: nil)
|
|
29
|
+
def initialize(name:, module_:, exclude_from_monitoring: OMIT, id:, additional_properties: nil)
|
|
27
30
|
@name = name
|
|
28
31
|
@module_ = module_
|
|
32
|
+
@exclude_from_monitoring = exclude_from_monitoring if exclude_from_monitoring != OMIT
|
|
29
33
|
@id = id
|
|
30
34
|
@additional_properties = additional_properties
|
|
31
|
-
@_field_set = { "name": name, "module": module_, "id": id }
|
|
35
|
+
@_field_set = { "name": name, "module": module_, "exclude_from_monitoring": exclude_from_monitoring, "id": id }.reject do | _k, v |
|
|
36
|
+
v == OMIT
|
|
37
|
+
end
|
|
32
38
|
end
|
|
33
39
|
# Deserialize a JSON object to an instance of VellumCodeResourceDefinition
|
|
34
40
|
#
|
|
@@ -39,10 +45,12 @@ module Vellum
|
|
|
39
45
|
parsed_json = JSON.parse(json_object)
|
|
40
46
|
name = parsed_json["name"]
|
|
41
47
|
module_ = parsed_json["module"]
|
|
48
|
+
exclude_from_monitoring = parsed_json["exclude_from_monitoring"]
|
|
42
49
|
id = parsed_json["id"]
|
|
43
50
|
new(
|
|
44
51
|
name: name,
|
|
45
52
|
module_: module_,
|
|
53
|
+
exclude_from_monitoring: exclude_from_monitoring,
|
|
46
54
|
id: id,
|
|
47
55
|
additional_properties: struct
|
|
48
56
|
)
|
|
@@ -62,6 +70,7 @@ module Vellum
|
|
|
62
70
|
def self.validate_raw(obj:)
|
|
63
71
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
64
72
|
obj.module_.is_a?(Array) != false || raise("Passed value for field obj.module_ is not the expected type, validation failed.")
|
|
73
|
+
obj.exclude_from_monitoring&.is_a?(Boolean) != false || raise("Passed value for field obj.exclude_from_monitoring is not the expected type, validation failed.")
|
|
65
74
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
|
66
75
|
end
|
|
67
76
|
end
|
|
@@ -19,6 +19,8 @@ module Vellum
|
|
|
19
19
|
attr_reader :default
|
|
20
20
|
# @return [Vellum::VellumVariableExtensions]
|
|
21
21
|
attr_reader :extensions
|
|
22
|
+
# @return [Hash{String => Object}]
|
|
23
|
+
attr_reader :schema
|
|
22
24
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
23
25
|
attr_reader :additional_properties
|
|
24
26
|
# @return [Object]
|
|
@@ -33,17 +35,19 @@ module Vellum
|
|
|
33
35
|
# @param required [Boolean]
|
|
34
36
|
# @param default [Vellum::VellumValue]
|
|
35
37
|
# @param extensions [Vellum::VellumVariableExtensions]
|
|
38
|
+
# @param schema [Hash{String => Object}]
|
|
36
39
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
37
40
|
# @return [Vellum::VellumVariable]
|
|
38
|
-
def initialize(id:, key:, type:, required: OMIT, default: OMIT, extensions: OMIT, additional_properties: nil)
|
|
41
|
+
def initialize(id:, key:, type:, required: OMIT, default: OMIT, extensions: OMIT, schema: OMIT, additional_properties: nil)
|
|
39
42
|
@id = id
|
|
40
43
|
@key = key
|
|
41
44
|
@type = type
|
|
42
45
|
@required = required if required != OMIT
|
|
43
46
|
@default = default if default != OMIT
|
|
44
47
|
@extensions = extensions if extensions != OMIT
|
|
48
|
+
@schema = schema if schema != OMIT
|
|
45
49
|
@additional_properties = additional_properties
|
|
46
|
-
@_field_set = { "id": id, "key": key, "type": type, "required": required, "default": default, "extensions": extensions }.reject do | _k, v |
|
|
50
|
+
@_field_set = { "id": id, "key": key, "type": type, "required": required, "default": default, "extensions": extensions, "schema": schema }.reject do | _k, v |
|
|
47
51
|
v == OMIT
|
|
48
52
|
end
|
|
49
53
|
end
|
|
@@ -70,6 +74,7 @@ end
|
|
|
70
74
|
else
|
|
71
75
|
extensions = nil
|
|
72
76
|
end
|
|
77
|
+
schema = parsed_json["schema"]
|
|
73
78
|
new(
|
|
74
79
|
id: id,
|
|
75
80
|
key: key,
|
|
@@ -77,6 +82,7 @@ end
|
|
|
77
82
|
required: required,
|
|
78
83
|
default: default,
|
|
79
84
|
extensions: extensions,
|
|
85
|
+
schema: schema,
|
|
80
86
|
additional_properties: struct
|
|
81
87
|
)
|
|
82
88
|
end
|
|
@@ -99,6 +105,7 @@ end
|
|
|
99
105
|
obj.required&.is_a?(Boolean) != false || raise("Passed value for field obj.required is not the expected type, validation failed.")
|
|
100
106
|
obj.default.nil? || Vellum::VellumValue.validate_raw(obj: obj.default)
|
|
101
107
|
obj.extensions.nil? || Vellum::VellumVariableExtensions.validate_raw(obj: obj.extensions)
|
|
108
|
+
obj.schema&.is_a?(Hash) != false || raise("Passed value for field obj.schema is not the expected type, validation failed.")
|
|
102
109
|
end
|
|
103
110
|
end
|
|
104
111
|
end
|
|
@@ -15,6 +15,7 @@ module Vellum
|
|
|
15
15
|
# * `DOCUMENT` - DOCUMENT
|
|
16
16
|
# * `NULL` - NULL
|
|
17
17
|
# * `THINKING` - THINKING
|
|
18
|
+
# * `REFERENCE` - REFERENCE
|
|
18
19
|
class VellumVariableType
|
|
19
20
|
|
|
20
21
|
STRING = "STRING"
|
|
@@ -31,6 +32,7 @@ module Vellum
|
|
|
31
32
|
DOCUMENT = "DOCUMENT"
|
|
32
33
|
NULL = "NULL"
|
|
33
34
|
THINKING = "THINKING"
|
|
35
|
+
REFERENCE = "REFERENCE"
|
|
34
36
|
|
|
35
37
|
end
|
|
36
38
|
end
|
|
@@ -48,6 +48,9 @@ end
|
|
|
48
48
|
# Retrieve a previously uploaded file by its ID
|
|
49
49
|
#
|
|
50
50
|
# @param id [String] A UUID string identifying this uploaded file.
|
|
51
|
+
# @param expiry_seconds [Integer] The number of seconds until the signed URL expires. Must be > 0 and <= 2592000
|
|
52
|
+
# (30 days). Non-numeric or out-of-range values fall back to the default (604800
|
|
53
|
+
# seconds or 7 days).
|
|
51
54
|
# @param request_options [Vellum::RequestOptions]
|
|
52
55
|
# @return [Vellum::UploadedFileRead]
|
|
53
56
|
# @example
|
|
@@ -57,7 +60,7 @@ end
|
|
|
57
60
|
# api_key: "YOUR_API_KEY"
|
|
58
61
|
# )
|
|
59
62
|
# api.uploaded_files.retrieve(id: "id")
|
|
60
|
-
def retrieve(id:, request_options: nil)
|
|
63
|
+
def retrieve(id:, expiry_seconds: nil, request_options: nil)
|
|
61
64
|
response = @request_client.conn.get do | req |
|
|
62
65
|
unless request_options&.timeout_in_seconds.nil?
|
|
63
66
|
req.options.timeout = request_options.timeout_in_seconds
|
|
@@ -71,9 +74,7 @@ end
|
|
|
71
74
|
req.headers["X-API-Version"] = "2025-07-30"
|
|
72
75
|
end
|
|
73
76
|
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
|
74
|
-
|
|
75
|
-
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
76
|
-
end
|
|
77
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "expiry_seconds": expiry_seconds }.compact
|
|
77
78
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
78
79
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
79
80
|
end
|
|
@@ -152,6 +153,9 @@ end
|
|
|
152
153
|
# Retrieve a previously uploaded file by its ID
|
|
153
154
|
#
|
|
154
155
|
# @param id [String] A UUID string identifying this uploaded file.
|
|
156
|
+
# @param expiry_seconds [Integer] The number of seconds until the signed URL expires. Must be > 0 and <= 2592000
|
|
157
|
+
# (30 days). Non-numeric or out-of-range values fall back to the default (604800
|
|
158
|
+
# seconds or 7 days).
|
|
155
159
|
# @param request_options [Vellum::RequestOptions]
|
|
156
160
|
# @return [Vellum::UploadedFileRead]
|
|
157
161
|
# @example
|
|
@@ -161,7 +165,7 @@ end
|
|
|
161
165
|
# api_key: "YOUR_API_KEY"
|
|
162
166
|
# )
|
|
163
167
|
# api.uploaded_files.retrieve(id: "id")
|
|
164
|
-
def retrieve(id:, request_options: nil)
|
|
168
|
+
def retrieve(id:, expiry_seconds: nil, request_options: nil)
|
|
165
169
|
Async do
|
|
166
170
|
response = @request_client.conn.get do | req |
|
|
167
171
|
unless request_options&.timeout_in_seconds.nil?
|
|
@@ -176,9 +180,7 @@ end
|
|
|
176
180
|
req.headers["X-API-Version"] = "2025-07-30"
|
|
177
181
|
end
|
|
178
182
|
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
|
179
|
-
|
|
180
|
-
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
181
|
-
end
|
|
183
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "expiry_seconds": expiry_seconds }.compact
|
|
182
184
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
|
183
185
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
|
184
186
|
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.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-22 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
|