vellum_ai 1.3.0 → 1.3.2
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 +25 -22
- data/lib/vellum_ai/ad_hoc/client.rb +5 -5
- data/lib/vellum_ai/events/client.rb +9 -7
- data/lib/vellum_ai/types/create_workflow_event_request.rb +60 -0
- data/lib/vellum_ai/types/deprecated_prompt_request_input.rb +58 -0
- data/lib/vellum_ai/types/event_create_response.rb +13 -3
- data/lib/vellum_ai/types/logical_operator.rb +2 -0
- data/lib/vellum_ai/types/processing_failure_reason_enum.rb +2 -0
- data/lib/vellum_ai/types/slim_document.rb +2 -0
- data/lib/vellum_ai/types/workflow_input.rb +218 -0
- data/lib/vellum_ai.rb +6 -4
- 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: 6beb24bc37fbeda786b42bbb0821921d4f871b4785f37fac39129a3f1ebf77c7
|
4
|
+
data.tar.gz: 6b4ea408fbce5b9ac3fc8ff42571d0f6d1b87d701be796d03af39aa62944b830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa564bb50a2d53277c62c81638ff3de39aa0b42e60238c79a9554d9dcc65ddd853ab4edbbd689912000f7b7c9729b870db4d872a9003c8a1799f2c295f8305ea
|
7
|
+
data.tar.gz: db8c6272692ece8f2227c708a2d0750b63a632a689e820ce7ee93f3a54dd2c48f5bda27a3e938917a6d11cc6e33ab57b603c900bcf6565346db7f3fbb3b1a2be
|
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.3.
|
59
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.3.2' }
|
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.3.
|
110
|
+
headers = { "X-Fern-Language": 'Ruby', "X-Fern-SDK-Name": 'vellum_ai', "X-Fern-SDK-Version": '1.3.2' }
|
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
@@ -101,6 +101,21 @@ require_relative "vellum_ai/types/container_image_build_config"
|
|
101
101
|
require_relative "vellum_ai/types/container_image_container_image_tag"
|
102
102
|
require_relative "vellum_ai/types/container_image_read"
|
103
103
|
require_relative "vellum_ai/types/create_test_suite_test_case_request"
|
104
|
+
require_relative "vellum_ai/types/node_execution_initiated_event"
|
105
|
+
require_relative "vellum_ai/types/node_execution_streaming_event"
|
106
|
+
require_relative "vellum_ai/types/node_execution_fulfilled_event"
|
107
|
+
require_relative "vellum_ai/types/node_execution_rejected_event"
|
108
|
+
require_relative "vellum_ai/types/node_execution_paused_event"
|
109
|
+
require_relative "vellum_ai/types/node_execution_resumed_event"
|
110
|
+
require_relative "vellum_ai/types/workflow_execution_initiated_event"
|
111
|
+
require_relative "vellum_ai/types/workflow_execution_streaming_event"
|
112
|
+
require_relative "vellum_ai/types/workflow_execution_rejected_event"
|
113
|
+
require_relative "vellum_ai/types/workflow_execution_fulfilled_event"
|
114
|
+
require_relative "vellum_ai/types/workflow_execution_paused_event"
|
115
|
+
require_relative "vellum_ai/types/workflow_execution_resumed_event"
|
116
|
+
require_relative "vellum_ai/types/workflow_execution_snapshotted_event"
|
117
|
+
require_relative "vellum_ai/types/workflow_event"
|
118
|
+
require_relative "vellum_ai/types/create_workflow_event_request"
|
104
119
|
require_relative "vellum_ai/types/delimiter_chunker_config"
|
105
120
|
require_relative "vellum_ai/types/delimiter_chunker_config_request"
|
106
121
|
require_relative "vellum_ai/types/delimiter_chunking"
|
@@ -111,6 +126,16 @@ require_relative "vellum_ai/types/deployment_provider_payload_response"
|
|
111
126
|
require_relative "vellum_ai/types/deployment_read"
|
112
127
|
require_relative "vellum_ai/types/deployment_release_tag_deployment_history_item"
|
113
128
|
require_relative "vellum_ai/types/deployment_release_tag_read"
|
129
|
+
require_relative "vellum_ai/types/workflow_input"
|
130
|
+
require_relative "vellum_ai/types/prompt_request_string_input"
|
131
|
+
require_relative "vellum_ai/types/prompt_request_json_input"
|
132
|
+
require_relative "vellum_ai/types/prompt_request_chat_history_input"
|
133
|
+
require_relative "vellum_ai/types/prompt_request_audio_input"
|
134
|
+
require_relative "vellum_ai/types/prompt_request_video_input"
|
135
|
+
require_relative "vellum_ai/types/prompt_request_image_input"
|
136
|
+
require_relative "vellum_ai/types/prompt_request_document_input"
|
137
|
+
require_relative "vellum_ai/types/prompt_request_input"
|
138
|
+
require_relative "vellum_ai/types/deprecated_prompt_request_input"
|
114
139
|
require_relative "vellum_ai/types/docker_service_token"
|
115
140
|
require_relative "vellum_ai/types/document_document_to_document_index"
|
116
141
|
require_relative "vellum_ai/types/reducto_chunking"
|
@@ -298,19 +323,13 @@ require_relative "vellum_ai/types/named_test_case_video_variable_value_request"
|
|
298
323
|
require_relative "vellum_ai/types/named_test_case_variable_value_request"
|
299
324
|
require_relative "vellum_ai/types/new_member_join_behavior_enum"
|
300
325
|
require_relative "vellum_ai/types/node_execution_fulfilled_body"
|
301
|
-
require_relative "vellum_ai/types/node_execution_fulfilled_event"
|
302
326
|
require_relative "vellum_ai/types/node_execution_initiated_body"
|
303
|
-
require_relative "vellum_ai/types/node_execution_initiated_event"
|
304
327
|
require_relative "vellum_ai/types/node_execution_paused_body"
|
305
|
-
require_relative "vellum_ai/types/node_execution_paused_event"
|
306
328
|
require_relative "vellum_ai/types/node_execution_rejected_body"
|
307
|
-
require_relative "vellum_ai/types/node_execution_rejected_event"
|
308
329
|
require_relative "vellum_ai/types/node_execution_resumed_body"
|
309
|
-
require_relative "vellum_ai/types/node_execution_resumed_event"
|
310
330
|
require_relative "vellum_ai/types/node_execution_span"
|
311
331
|
require_relative "vellum_ai/types/node_execution_span_attributes"
|
312
332
|
require_relative "vellum_ai/types/node_execution_streaming_body"
|
313
|
-
require_relative "vellum_ai/types/node_execution_streaming_event"
|
314
333
|
require_relative "vellum_ai/types/node_input_compiled_array_value"
|
315
334
|
require_relative "vellum_ai/types/node_input_compiled_audio_value"
|
316
335
|
require_relative "vellum_ai/types/node_input_compiled_chat_history_value"
|
@@ -386,14 +405,6 @@ require_relative "vellum_ai/types/thinking_vellum_value"
|
|
386
405
|
require_relative "vellum_ai/types/prompt_output"
|
387
406
|
require_relative "vellum_ai/types/prompt_parameters"
|
388
407
|
require_relative "vellum_ai/types/prompt_push_response"
|
389
|
-
require_relative "vellum_ai/types/prompt_request_audio_input"
|
390
|
-
require_relative "vellum_ai/types/prompt_request_chat_history_input"
|
391
|
-
require_relative "vellum_ai/types/prompt_request_document_input"
|
392
|
-
require_relative "vellum_ai/types/prompt_request_image_input"
|
393
|
-
require_relative "vellum_ai/types/prompt_request_string_input"
|
394
|
-
require_relative "vellum_ai/types/prompt_request_json_input"
|
395
|
-
require_relative "vellum_ai/types/prompt_request_video_input"
|
396
|
-
require_relative "vellum_ai/types/prompt_request_input"
|
397
408
|
require_relative "vellum_ai/types/prompt_settings"
|
398
409
|
require_relative "vellum_ai/types/prompt_version_build_config_sandbox"
|
399
410
|
require_relative "vellum_ai/types/components_schemas_prompt_version_build_config_sandbox"
|
@@ -586,13 +597,6 @@ require_relative "vellum_ai/types/vellum_variable_extensions"
|
|
586
597
|
require_relative "vellum_ai/types/vellum_variable_type"
|
587
598
|
require_relative "vellum_ai/types/vellum_video"
|
588
599
|
require_relative "vellum_ai/types/vellum_video_request"
|
589
|
-
require_relative "vellum_ai/types/workflow_execution_initiated_event"
|
590
|
-
require_relative "vellum_ai/types/workflow_execution_streaming_event"
|
591
|
-
require_relative "vellum_ai/types/workflow_execution_fulfilled_event"
|
592
|
-
require_relative "vellum_ai/types/workflow_execution_rejected_event"
|
593
|
-
require_relative "vellum_ai/types/workflow_execution_paused_event"
|
594
|
-
require_relative "vellum_ai/types/workflow_execution_resumed_event"
|
595
|
-
require_relative "vellum_ai/types/workflow_execution_snapshotted_event"
|
596
600
|
require_relative "vellum_ai/types/vellum_workflow_execution_event"
|
597
601
|
require_relative "vellum_ai/types/workflow_deployment_event_executions_response"
|
598
602
|
require_relative "vellum_ai/types/workflow_deployment_history_item"
|
@@ -603,7 +607,6 @@ require_relative "vellum_ai/types/workflow_deployment_release_workflow_version"
|
|
603
607
|
require_relative "vellum_ai/types/workflow_event_error"
|
604
608
|
require_relative "vellum_ai/types/workflow_initialization_error"
|
605
609
|
require_relative "vellum_ai/types/workflow_error"
|
606
|
-
require_relative "vellum_ai/types/workflow_event"
|
607
610
|
require_relative "vellum_ai/types/workflow_event_execution_read"
|
608
611
|
require_relative "vellum_ai/types/workflow_execution_actual"
|
609
612
|
require_relative "vellum_ai/types/workflow_execution_detail"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require_relative "../../requests"
|
3
|
-
require_relative "../types/
|
3
|
+
require_relative "../types/deprecated_prompt_request_input"
|
4
4
|
require_relative "../types/vellum_variable"
|
5
5
|
require_relative "../types/prompt_parameters"
|
6
6
|
require_relative "../types/prompt_settings"
|
@@ -23,7 +23,7 @@ module Vellum
|
|
23
23
|
@request_client = request_client
|
24
24
|
end
|
25
25
|
# @param ml_model [String]
|
26
|
-
# @param input_values [Array<Hash>] Request of type Array<Vellum::
|
26
|
+
# @param input_values [Array<Hash>] Request of type Array<Vellum::DeprecatedPromptRequestInput>, as a Hash
|
27
27
|
# @param input_variables [Array<Hash>] Request of type Array<Vellum::VellumVariable>, as a Hash
|
28
28
|
# * :id (String)
|
29
29
|
# * :key (String)
|
@@ -70,7 +70,7 @@ module Vellum
|
|
70
70
|
# )
|
71
71
|
# api.ad_hoc.adhoc_execute_prompt(
|
72
72
|
# ml_model: "x",
|
73
|
-
# input_values: [{
|
73
|
+
# input_values: [{ name: "x", type: "STRING", value: "value" }, { name: "x", type: "STRING", value: "value" }],
|
74
74
|
# input_variables: [{ id: "x", key: "key", type: STRING }, { id: "x", key: "key", type: STRING }],
|
75
75
|
# parameters: { },
|
76
76
|
# blocks: [{ block_type: "JINJA", template: "template" }, { block_type: "JINJA", template: "template" }]
|
@@ -109,7 +109,7 @@ end
|
|
109
109
|
@request_client = request_client
|
110
110
|
end
|
111
111
|
# @param ml_model [String]
|
112
|
-
# @param input_values [Array<Hash>] Request of type Array<Vellum::
|
112
|
+
# @param input_values [Array<Hash>] Request of type Array<Vellum::DeprecatedPromptRequestInput>, as a Hash
|
113
113
|
# @param input_variables [Array<Hash>] Request of type Array<Vellum::VellumVariable>, as a Hash
|
114
114
|
# * :id (String)
|
115
115
|
# * :key (String)
|
@@ -156,7 +156,7 @@ end
|
|
156
156
|
# )
|
157
157
|
# api.ad_hoc.adhoc_execute_prompt(
|
158
158
|
# ml_model: "x",
|
159
|
-
# input_values: [{
|
159
|
+
# input_values: [{ name: "x", type: "STRING", value: "value" }, { name: "x", type: "STRING", value: "value" }],
|
160
160
|
# input_variables: [{ id: "x", key: "key", type: STRING }, { id: "x", key: "key", type: STRING }],
|
161
161
|
# parameters: { },
|
162
162
|
# blocks: [{ block_type: "JINJA", template: "template" }, { block_type: "JINJA", template: "template" }]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require_relative "../../requests"
|
3
|
-
require_relative "../types/
|
3
|
+
require_relative "../types/create_workflow_event_request"
|
4
4
|
require_relative "../types/event_create_response"
|
5
5
|
require "async"
|
6
6
|
require_relative "../../requests"
|
@@ -16,9 +16,10 @@ module Vellum
|
|
16
16
|
def initialize(request_client:)
|
17
17
|
@request_client = request_client
|
18
18
|
end
|
19
|
-
# Accept an event and publish
|
19
|
+
# Accept an event or list of events and publish them to ClickHouse for analytics
|
20
|
+
# processing.
|
20
21
|
#
|
21
|
-
# @param request [Vellum::
|
22
|
+
# @param request [Array<Vellum::WorkflowEvent>, Vellum::WorkflowEvent]
|
22
23
|
# @param request_options [Vellum::RequestOptions]
|
23
24
|
# @return [Vellum::EventCreateResponse]
|
24
25
|
# @example
|
@@ -27,7 +28,7 @@ module Vellum
|
|
27
28
|
# environment: Vellum::Environment::PRODUCTION,
|
28
29
|
# api_key: "YOUR_API_KEY"
|
29
30
|
# )
|
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
|
+
# 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" }, { 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
32
|
def create(request:, request_options: nil)
|
32
33
|
response = @request_client.conn.post do | req |
|
33
34
|
unless request_options&.timeout_in_seconds.nil?
|
@@ -61,9 +62,10 @@ end
|
|
61
62
|
def initialize(request_client:)
|
62
63
|
@request_client = request_client
|
63
64
|
end
|
64
|
-
# Accept an event and publish
|
65
|
+
# Accept an event or list of events and publish them to ClickHouse for analytics
|
66
|
+
# processing.
|
65
67
|
#
|
66
|
-
# @param request [Vellum::
|
68
|
+
# @param request [Array<Vellum::WorkflowEvent>, Vellum::WorkflowEvent]
|
67
69
|
# @param request_options [Vellum::RequestOptions]
|
68
70
|
# @return [Vellum::EventCreateResponse]
|
69
71
|
# @example
|
@@ -72,7 +74,7 @@ end
|
|
72
74
|
# environment: Vellum::Environment::PRODUCTION,
|
73
75
|
# api_key: "YOUR_API_KEY"
|
74
76
|
# )
|
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" })
|
77
|
+
# 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" }, { 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
78
|
def create(request:, request_options: nil)
|
77
79
|
Async do
|
78
80
|
response = @request_client.conn.post do | req |
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "json"
|
3
|
+
require_relative "workflow_event"
|
4
|
+
|
5
|
+
module Vellum
|
6
|
+
class CreateWorkflowEventRequest
|
7
|
+
|
8
|
+
|
9
|
+
# Deserialize a JSON object to an instance of CreateWorkflowEventRequest
|
10
|
+
#
|
11
|
+
# @param json_object [String]
|
12
|
+
# @return [Vellum::CreateWorkflowEventRequest]
|
13
|
+
def self.from_json(json_object:)
|
14
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
15
|
+
begin
|
16
|
+
struct.is_a?(Array) != false || raise("Passed value for field struct is not the expected type, validation failed.")
|
17
|
+
unless struct.nil?
|
18
|
+
return struct&.map do | item |
|
19
|
+
item = item.to_json
|
20
|
+
Vellum::WorkflowEvent.from_json(json_object: item)
|
21
|
+
end
|
22
|
+
else
|
23
|
+
return nil
|
24
|
+
end
|
25
|
+
rescue StandardError
|
26
|
+
# noop
|
27
|
+
end
|
28
|
+
begin
|
29
|
+
Vellum::WorkflowEvent.validate_raw(obj: struct)
|
30
|
+
unless struct.nil?
|
31
|
+
return Vellum::WorkflowEvent.from_json(json_object: struct)
|
32
|
+
else
|
33
|
+
return nil
|
34
|
+
end
|
35
|
+
rescue StandardError
|
36
|
+
# noop
|
37
|
+
end
|
38
|
+
return struct
|
39
|
+
end
|
40
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
41
|
+
# hash and check each fields type against the current object's property
|
42
|
+
# definitions.
|
43
|
+
#
|
44
|
+
# @param obj [Object]
|
45
|
+
# @return [Void]
|
46
|
+
def self.validate_raw(obj:)
|
47
|
+
begin
|
48
|
+
return obj.is_a?(Array) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
49
|
+
rescue StandardError
|
50
|
+
# noop
|
51
|
+
end
|
52
|
+
begin
|
53
|
+
return Vellum::WorkflowEvent.validate_raw(obj: obj)
|
54
|
+
rescue StandardError
|
55
|
+
# noop
|
56
|
+
end
|
57
|
+
raise("Passed value matched no type within the union, validation failed.")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "json"
|
3
|
+
require_relative "workflow_input"
|
4
|
+
require_relative "prompt_request_input"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class DeprecatedPromptRequestInput
|
8
|
+
|
9
|
+
|
10
|
+
# Deserialize a JSON object to an instance of DeprecatedPromptRequestInput
|
11
|
+
#
|
12
|
+
# @param json_object [String]
|
13
|
+
# @return [Vellum::DeprecatedPromptRequestInput]
|
14
|
+
def self.from_json(json_object:)
|
15
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
16
|
+
begin
|
17
|
+
Vellum::WorkflowInput.validate_raw(obj: struct)
|
18
|
+
unless struct.nil?
|
19
|
+
return Vellum::WorkflowInput.from_json(json_object: struct)
|
20
|
+
else
|
21
|
+
return nil
|
22
|
+
end
|
23
|
+
rescue StandardError
|
24
|
+
# noop
|
25
|
+
end
|
26
|
+
begin
|
27
|
+
Vellum::PromptRequestInput.validate_raw(obj: struct)
|
28
|
+
unless struct.nil?
|
29
|
+
return Vellum::PromptRequestInput.from_json(json_object: struct)
|
30
|
+
else
|
31
|
+
return nil
|
32
|
+
end
|
33
|
+
rescue StandardError
|
34
|
+
# noop
|
35
|
+
end
|
36
|
+
return struct
|
37
|
+
end
|
38
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
39
|
+
# hash and check each fields type against the current object's property
|
40
|
+
# definitions.
|
41
|
+
#
|
42
|
+
# @param obj [Object]
|
43
|
+
# @return [Void]
|
44
|
+
def self.validate_raw(obj:)
|
45
|
+
begin
|
46
|
+
return Vellum::WorkflowInput.validate_raw(obj: obj)
|
47
|
+
rescue StandardError
|
48
|
+
# noop
|
49
|
+
end
|
50
|
+
begin
|
51
|
+
return Vellum::PromptRequestInput.validate_raw(obj: obj)
|
52
|
+
rescue StandardError
|
53
|
+
# noop
|
54
|
+
end
|
55
|
+
raise("Passed value matched no type within the union, validation failed.")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -7,6 +7,8 @@ module Vellum
|
|
7
7
|
class EventCreateResponse
|
8
8
|
# @return [Boolean] Indicates whether the event was published successfully.
|
9
9
|
attr_reader :success
|
10
|
+
# @return [Integer] Number of events processed
|
11
|
+
attr_reader :count
|
10
12
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
11
13
|
attr_reader :additional_properties
|
12
14
|
# @return [Object]
|
@@ -16,12 +18,14 @@ module Vellum
|
|
16
18
|
OMIT = Object.new
|
17
19
|
|
18
20
|
# @param success [Boolean] Indicates whether the event was published successfully.
|
21
|
+
# @param count [Integer] Number of events processed
|
19
22
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
23
|
# @return [Vellum::EventCreateResponse]
|
21
|
-
def initialize(success: OMIT, additional_properties: nil)
|
24
|
+
def initialize(success: OMIT, count:, additional_properties: nil)
|
22
25
|
@success = success if success != OMIT
|
26
|
+
@count = count
|
23
27
|
@additional_properties = additional_properties
|
24
|
-
@_field_set = { "success": success }.reject do | _k, v |
|
28
|
+
@_field_set = { "success": success, "count": count }.reject do | _k, v |
|
25
29
|
v == OMIT
|
26
30
|
end
|
27
31
|
end
|
@@ -33,7 +37,12 @@ end
|
|
33
37
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
34
38
|
parsed_json = JSON.parse(json_object)
|
35
39
|
success = parsed_json["success"]
|
36
|
-
|
40
|
+
count = parsed_json["count"]
|
41
|
+
new(
|
42
|
+
success: success,
|
43
|
+
count: count,
|
44
|
+
additional_properties: struct
|
45
|
+
)
|
37
46
|
end
|
38
47
|
# Serialize an instance of EventCreateResponse to a JSON object
|
39
48
|
#
|
@@ -49,6 +58,7 @@ end
|
|
49
58
|
# @return [Void]
|
50
59
|
def self.validate_raw(obj:)
|
51
60
|
obj.success&.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.")
|
61
|
+
obj.count.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
|
52
62
|
end
|
53
63
|
end
|
54
64
|
end
|
@@ -19,6 +19,7 @@ module Vellum
|
|
19
19
|
# * `notIn` - NOT_IN
|
20
20
|
# * `between` - BETWEEN
|
21
21
|
# * `notBetween` - NOT_BETWEEN
|
22
|
+
# * `concat` - CONCAT
|
22
23
|
# * `blank` - BLANK
|
23
24
|
# * `notBlank` - NOT_BLANK
|
24
25
|
# * `coalesce` - COALESCE
|
@@ -48,6 +49,7 @@ module Vellum
|
|
48
49
|
NOT_IN = "notIn"
|
49
50
|
BETWEEN = "between"
|
50
51
|
NOT_BETWEEN = "notBetween"
|
52
|
+
CONCAT = "concat"
|
51
53
|
BLANK = "blank"
|
52
54
|
NOT_BLANK = "notBlank"
|
53
55
|
COALESCE = "coalesce"
|
@@ -3,10 +3,12 @@
|
|
3
3
|
module Vellum
|
4
4
|
# * `EXCEEDED_CHARACTER_LIMIT` - Exceeded Character Limit
|
5
5
|
# * `INVALID_FILE` - Invalid File
|
6
|
+
# * `INVALID_CREDENTIALS` - Invalid Credentials
|
6
7
|
class ProcessingFailureReasonEnum
|
7
8
|
|
8
9
|
EXCEEDED_CHARACTER_LIMIT = "EXCEEDED_CHARACTER_LIMIT"
|
9
10
|
INVALID_FILE = "INVALID_FILE"
|
11
|
+
INVALID_CREDENTIALS = "INVALID_CREDENTIALS"
|
10
12
|
|
11
13
|
end
|
12
14
|
end
|
@@ -23,6 +23,7 @@ module Vellum
|
|
23
23
|
# unless processing_state is FAILED.
|
24
24
|
# * `EXCEEDED_CHARACTER_LIMIT` - Exceeded Character Limit
|
25
25
|
# * `INVALID_FILE` - Invalid File
|
26
|
+
# * `INVALID_CREDENTIALS` - Invalid Credentials
|
26
27
|
attr_reader :processing_failure_reason
|
27
28
|
# @return [Vellum::DOCUMENT_STATUS] The document's current status.
|
28
29
|
# * `ACTIVE` - Active
|
@@ -52,6 +53,7 @@ module Vellum
|
|
52
53
|
# unless processing_state is FAILED.
|
53
54
|
# * `EXCEEDED_CHARACTER_LIMIT` - Exceeded Character Limit
|
54
55
|
# * `INVALID_FILE` - Invalid File
|
56
|
+
# * `INVALID_CREDENTIALS` - Invalid Credentials
|
55
57
|
# @param status [Vellum::DOCUMENT_STATUS] The document's current status.
|
56
58
|
# * `ACTIVE` - Active
|
57
59
|
# @param keywords [Array<String>] A list of keywords associated with this document. Originally provided when
|
@@ -0,0 +1,218 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "json"
|
3
|
+
require_relative "string_input"
|
4
|
+
require_relative "json_input"
|
5
|
+
require_relative "chat_history_input"
|
6
|
+
require_relative "number_input"
|
7
|
+
require_relative "search_results_input"
|
8
|
+
require_relative "error_input"
|
9
|
+
require_relative "array_input"
|
10
|
+
require_relative "function_call_input"
|
11
|
+
require_relative "audio_input"
|
12
|
+
require_relative "video_input"
|
13
|
+
require_relative "image_input"
|
14
|
+
require_relative "document_input"
|
15
|
+
|
16
|
+
module Vellum
|
17
|
+
class WorkflowInput
|
18
|
+
|
19
|
+
|
20
|
+
# Deserialize a JSON object to an instance of WorkflowInput
|
21
|
+
#
|
22
|
+
# @param json_object [String]
|
23
|
+
# @return [Vellum::WorkflowInput]
|
24
|
+
def self.from_json(json_object:)
|
25
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
26
|
+
begin
|
27
|
+
Vellum::StringInput.validate_raw(obj: struct)
|
28
|
+
unless struct.nil?
|
29
|
+
return Vellum::StringInput.from_json(json_object: struct)
|
30
|
+
else
|
31
|
+
return nil
|
32
|
+
end
|
33
|
+
rescue StandardError
|
34
|
+
# noop
|
35
|
+
end
|
36
|
+
begin
|
37
|
+
Vellum::JsonInput.validate_raw(obj: struct)
|
38
|
+
unless struct.nil?
|
39
|
+
return Vellum::JsonInput.from_json(json_object: struct)
|
40
|
+
else
|
41
|
+
return nil
|
42
|
+
end
|
43
|
+
rescue StandardError
|
44
|
+
# noop
|
45
|
+
end
|
46
|
+
begin
|
47
|
+
Vellum::ChatHistoryInput.validate_raw(obj: struct)
|
48
|
+
unless struct.nil?
|
49
|
+
return Vellum::ChatHistoryInput.from_json(json_object: struct)
|
50
|
+
else
|
51
|
+
return nil
|
52
|
+
end
|
53
|
+
rescue StandardError
|
54
|
+
# noop
|
55
|
+
end
|
56
|
+
begin
|
57
|
+
Vellum::NumberInput.validate_raw(obj: struct)
|
58
|
+
unless struct.nil?
|
59
|
+
return Vellum::NumberInput.from_json(json_object: struct)
|
60
|
+
else
|
61
|
+
return nil
|
62
|
+
end
|
63
|
+
rescue StandardError
|
64
|
+
# noop
|
65
|
+
end
|
66
|
+
begin
|
67
|
+
Vellum::SearchResultsInput.validate_raw(obj: struct)
|
68
|
+
unless struct.nil?
|
69
|
+
return Vellum::SearchResultsInput.from_json(json_object: struct)
|
70
|
+
else
|
71
|
+
return nil
|
72
|
+
end
|
73
|
+
rescue StandardError
|
74
|
+
# noop
|
75
|
+
end
|
76
|
+
begin
|
77
|
+
Vellum::ErrorInput.validate_raw(obj: struct)
|
78
|
+
unless struct.nil?
|
79
|
+
return Vellum::ErrorInput.from_json(json_object: struct)
|
80
|
+
else
|
81
|
+
return nil
|
82
|
+
end
|
83
|
+
rescue StandardError
|
84
|
+
# noop
|
85
|
+
end
|
86
|
+
begin
|
87
|
+
Vellum::ArrayInput.validate_raw(obj: struct)
|
88
|
+
unless struct.nil?
|
89
|
+
return Vellum::ArrayInput.from_json(json_object: struct)
|
90
|
+
else
|
91
|
+
return nil
|
92
|
+
end
|
93
|
+
rescue StandardError
|
94
|
+
# noop
|
95
|
+
end
|
96
|
+
begin
|
97
|
+
Vellum::FunctionCallInput.validate_raw(obj: struct)
|
98
|
+
unless struct.nil?
|
99
|
+
return Vellum::FunctionCallInput.from_json(json_object: struct)
|
100
|
+
else
|
101
|
+
return nil
|
102
|
+
end
|
103
|
+
rescue StandardError
|
104
|
+
# noop
|
105
|
+
end
|
106
|
+
begin
|
107
|
+
Vellum::AudioInput.validate_raw(obj: struct)
|
108
|
+
unless struct.nil?
|
109
|
+
return Vellum::AudioInput.from_json(json_object: struct)
|
110
|
+
else
|
111
|
+
return nil
|
112
|
+
end
|
113
|
+
rescue StandardError
|
114
|
+
# noop
|
115
|
+
end
|
116
|
+
begin
|
117
|
+
Vellum::VideoInput.validate_raw(obj: struct)
|
118
|
+
unless struct.nil?
|
119
|
+
return Vellum::VideoInput.from_json(json_object: struct)
|
120
|
+
else
|
121
|
+
return nil
|
122
|
+
end
|
123
|
+
rescue StandardError
|
124
|
+
# noop
|
125
|
+
end
|
126
|
+
begin
|
127
|
+
Vellum::ImageInput.validate_raw(obj: struct)
|
128
|
+
unless struct.nil?
|
129
|
+
return Vellum::ImageInput.from_json(json_object: struct)
|
130
|
+
else
|
131
|
+
return nil
|
132
|
+
end
|
133
|
+
rescue StandardError
|
134
|
+
# noop
|
135
|
+
end
|
136
|
+
begin
|
137
|
+
Vellum::DocumentInput.validate_raw(obj: struct)
|
138
|
+
unless struct.nil?
|
139
|
+
return Vellum::DocumentInput.from_json(json_object: struct)
|
140
|
+
else
|
141
|
+
return nil
|
142
|
+
end
|
143
|
+
rescue StandardError
|
144
|
+
# noop
|
145
|
+
end
|
146
|
+
return struct
|
147
|
+
end
|
148
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
149
|
+
# hash and check each fields type against the current object's property
|
150
|
+
# definitions.
|
151
|
+
#
|
152
|
+
# @param obj [Object]
|
153
|
+
# @return [Void]
|
154
|
+
def self.validate_raw(obj:)
|
155
|
+
begin
|
156
|
+
return Vellum::StringInput.validate_raw(obj: obj)
|
157
|
+
rescue StandardError
|
158
|
+
# noop
|
159
|
+
end
|
160
|
+
begin
|
161
|
+
return Vellum::JsonInput.validate_raw(obj: obj)
|
162
|
+
rescue StandardError
|
163
|
+
# noop
|
164
|
+
end
|
165
|
+
begin
|
166
|
+
return Vellum::ChatHistoryInput.validate_raw(obj: obj)
|
167
|
+
rescue StandardError
|
168
|
+
# noop
|
169
|
+
end
|
170
|
+
begin
|
171
|
+
return Vellum::NumberInput.validate_raw(obj: obj)
|
172
|
+
rescue StandardError
|
173
|
+
# noop
|
174
|
+
end
|
175
|
+
begin
|
176
|
+
return Vellum::SearchResultsInput.validate_raw(obj: obj)
|
177
|
+
rescue StandardError
|
178
|
+
# noop
|
179
|
+
end
|
180
|
+
begin
|
181
|
+
return Vellum::ErrorInput.validate_raw(obj: obj)
|
182
|
+
rescue StandardError
|
183
|
+
# noop
|
184
|
+
end
|
185
|
+
begin
|
186
|
+
return Vellum::ArrayInput.validate_raw(obj: obj)
|
187
|
+
rescue StandardError
|
188
|
+
# noop
|
189
|
+
end
|
190
|
+
begin
|
191
|
+
return Vellum::FunctionCallInput.validate_raw(obj: obj)
|
192
|
+
rescue StandardError
|
193
|
+
# noop
|
194
|
+
end
|
195
|
+
begin
|
196
|
+
return Vellum::AudioInput.validate_raw(obj: obj)
|
197
|
+
rescue StandardError
|
198
|
+
# noop
|
199
|
+
end
|
200
|
+
begin
|
201
|
+
return Vellum::VideoInput.validate_raw(obj: obj)
|
202
|
+
rescue StandardError
|
203
|
+
# noop
|
204
|
+
end
|
205
|
+
begin
|
206
|
+
return Vellum::ImageInput.validate_raw(obj: obj)
|
207
|
+
rescue StandardError
|
208
|
+
# noop
|
209
|
+
end
|
210
|
+
begin
|
211
|
+
return Vellum::DocumentInput.validate_raw(obj: obj)
|
212
|
+
rescue StandardError
|
213
|
+
# noop
|
214
|
+
end
|
215
|
+
raise("Passed value matched no type within the union, validation failed.")
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
data/lib/vellum_ai.rb
CHANGED
@@ -296,6 +296,7 @@ end
|
|
296
296
|
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
297
297
|
# additional monitoring data such as user id, session id, etc. for future
|
298
298
|
# analysis.
|
299
|
+
# @param previous_execution_id [String] The ID of a previous Workflow Execution to reference for initial State loading.
|
299
300
|
# @param request_options [Vellum::RequestOptions]
|
300
301
|
# @return [Vellum::ExecuteWorkflowResponse]
|
301
302
|
# @example
|
@@ -305,7 +306,7 @@ end
|
|
305
306
|
# api_key: "YOUR_API_KEY"
|
306
307
|
# )
|
307
308
|
# api.execute_workflow(inputs: [{ name: "x", type: "STRING", value: "value" }, { name: "x", type: "STRING", value: "value" }])
|
308
|
-
def execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, request_options: nil)
|
309
|
+
def execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, previous_execution_id: nil, request_options: nil)
|
309
310
|
response = @request_client.conn.post do | req |
|
310
311
|
unless request_options&.timeout_in_seconds.nil?
|
311
312
|
req.options.timeout = request_options.timeout_in_seconds
|
@@ -322,7 +323,7 @@ end
|
|
322
323
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
323
324
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
324
325
|
end
|
325
|
-
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, expand_meta: expand_meta, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, metadata: metadata }.compact
|
326
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, expand_meta: expand_meta, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, metadata: metadata, previous_execution_id: previous_execution_id }.compact
|
326
327
|
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-workflow"
|
327
328
|
end
|
328
329
|
Vellum::ExecuteWorkflowResponse.from_json(json_object: response.body)
|
@@ -752,6 +753,7 @@ end
|
|
752
753
|
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
753
754
|
# additional monitoring data such as user id, session id, etc. for future
|
754
755
|
# analysis.
|
756
|
+
# @param previous_execution_id [String] The ID of a previous Workflow Execution to reference for initial State loading.
|
755
757
|
# @param request_options [Vellum::RequestOptions]
|
756
758
|
# @return [Vellum::ExecuteWorkflowResponse]
|
757
759
|
# @example
|
@@ -761,7 +763,7 @@ end
|
|
761
763
|
# api_key: "YOUR_API_KEY"
|
762
764
|
# )
|
763
765
|
# api.execute_workflow(inputs: [{ name: "x", type: "STRING", value: "value" }, { name: "x", type: "STRING", value: "value" }])
|
764
|
-
def execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, request_options: nil)
|
766
|
+
def execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, previous_execution_id: nil, request_options: nil)
|
765
767
|
response = @async_request_client.conn.post do | req |
|
766
768
|
unless request_options&.timeout_in_seconds.nil?
|
767
769
|
req.options.timeout = request_options.timeout_in_seconds
|
@@ -778,7 +780,7 @@ end
|
|
778
780
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
779
781
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
780
782
|
end
|
781
|
-
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, expand_meta: expand_meta, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, metadata: metadata }.compact
|
783
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, expand_meta: expand_meta, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, metadata: metadata, previous_execution_id: previous_execution_id }.compact
|
782
784
|
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-workflow"
|
783
785
|
end
|
784
786
|
Vellum::ExecuteWorkflowResponse.from_json(json_object: response.body)
|
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.3.
|
4
|
+
version: 1.3.2
|
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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -226,6 +226,7 @@ files:
|
|
226
226
|
- lib/vellum_ai/types/container_image_container_image_tag.rb
|
227
227
|
- lib/vellum_ai/types/container_image_read.rb
|
228
228
|
- lib/vellum_ai/types/create_test_suite_test_case_request.rb
|
229
|
+
- lib/vellum_ai/types/create_workflow_event_request.rb
|
229
230
|
- lib/vellum_ai/types/delimiter_chunker_config.rb
|
230
231
|
- lib/vellum_ai/types/delimiter_chunker_config_request.rb
|
231
232
|
- lib/vellum_ai/types/delimiter_chunking.rb
|
@@ -236,6 +237,7 @@ files:
|
|
236
237
|
- lib/vellum_ai/types/deployment_read.rb
|
237
238
|
- lib/vellum_ai/types/deployment_release_tag_deployment_history_item.rb
|
238
239
|
- lib/vellum_ai/types/deployment_release_tag_read.rb
|
240
|
+
- lib/vellum_ai/types/deprecated_prompt_request_input.rb
|
239
241
|
- lib/vellum_ai/types/docker_service_token.rb
|
240
242
|
- lib/vellum_ai/types/document_chat_message_content.rb
|
241
243
|
- lib/vellum_ai/types/document_chat_message_content_request.rb
|
@@ -772,6 +774,7 @@ files:
|
|
772
774
|
- lib/vellum_ai/types/workflow_execution_workflow_result_event.rb
|
773
775
|
- lib/vellum_ai/types/workflow_expand_meta_request.rb
|
774
776
|
- lib/vellum_ai/types/workflow_initialization_error.rb
|
777
|
+
- lib/vellum_ai/types/workflow_input.rb
|
775
778
|
- lib/vellum_ai/types/workflow_node_result_data.rb
|
776
779
|
- lib/vellum_ai/types/workflow_node_result_event.rb
|
777
780
|
- lib/vellum_ai/types/workflow_node_result_event_state.rb
|