vellum_ai 0.3.11 → 0.3.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a34112cfe303a361bb71b349a1b752f9af3a0aeab320d337423fff77fb2b2cac
4
- data.tar.gz: 3de6e6dc8f28729679ae89cb99a7bd210520457564910e499c0ebdddd938a219
3
+ metadata.gz: 16e4f69f639b8fdda67360f5283624c0f67a2868d7d71ab0cacbbd8050197ed4
4
+ data.tar.gz: 95e1664aaa790b617c49298cb1c30102f449c0a965a51caea203ce8323daa99f
5
5
  SHA512:
6
- metadata.gz: f728fd9611386219ed4871bd39a5fba81166c72f04e42d4c877f1f5e4539d5178d0f4b1a195b5090cbba8091e49fb4985dab61903ec5bbd6c89f0fc2bdac0bca
7
- data.tar.gz: 6d9034005bbdfa8a321ddd061a6aacbfa64ab2421506069726eb56ca6bf07eef593ef55903aa354fe1b4e9fc1e72578f93700ace1c547374992738115a461fdb
6
+ metadata.gz: 29494e01a5d2cbf75ecf48411dbb0626518933bc071d295c31120f28375f900fe0212bc606c2b3454a56d461b0f68ba6fca19626cc77fc00912f7511095ec1b3
7
+ data.tar.gz: f7a4d4a5295bb48e3438612a5510a3fccf277dc2858ecdc966fb7992510e2ecb66f415e8fc931b10a2688e100aec741a764c4210d7ba3b9ca7adbd6692e954ec
data/lib/requests.rb CHANGED
@@ -20,7 +20,7 @@ module Vellum
20
20
  @headers = {
21
21
  "X-Fern-Language": "Ruby",
22
22
  "X-Fern-SDK-Name": "Vellum",
23
- "X-Fern-SDK-Version": "0.3.11",
23
+ "X-Fern-SDK-Version": "0.3.12",
24
24
  "X_API_KEY": api_key.to_s
25
25
  }
26
26
  @conn = Faraday.new(headers: @headers) do |faraday|
@@ -46,7 +46,7 @@ module Vellum
46
46
  @headers = {
47
47
  "X-Fern-Language": "Ruby",
48
48
  "X-Fern-SDK-Name": "Vellum",
49
- "X-Fern-SDK-Version": "0.3.11",
49
+ "X-Fern-SDK-Version": "0.3.12",
50
50
  "X_API_KEY": api_key.to_s
51
51
  }
52
52
  @conn = Faraday.new(headers: @headers) do |faraday|
data/lib/types_export.rb CHANGED
@@ -86,6 +86,7 @@ require_relative "vellum_ai/types/generate_stream_result_data"
86
86
  require_relative "vellum_ai/types/image_chat_message_content"
87
87
  require_relative "vellum_ai/types/image_chat_message_content_request"
88
88
  require_relative "vellum_ai/types/image_enum"
89
+ require_relative "vellum_ai/types/image_variable_value"
89
90
  require_relative "vellum_ai/types/indexing_state_enum"
90
91
  require_relative "vellum_ai/types/initiated_enum"
91
92
  require_relative "vellum_ai/types/initiated_execute_prompt_event"
@@ -95,6 +95,78 @@ module Vellum
95
95
  end
96
96
  DocumentIndexRead.from_json(json_object: response.body)
97
97
  end
98
+
99
+ # Used to fully update a Document Index given its ID.
100
+ #
101
+ # @param id [String] A UUID string identifying this document index.
102
+ # @param label [String] A human-readable label for the document index
103
+ # @param status [ENTITY_STATUS] The current status of the document index
104
+ # * `ACTIVE` - Active
105
+ # * `ARCHIVED` - Archived
106
+ # @param environment [ENVIRONMENT_ENUM] The environment this document index is used in
107
+ # * `DEVELOPMENT` - Development
108
+ # * `STAGING` - Staging
109
+ # * `PRODUCTION` - Production
110
+ # @param request_options [RequestOptions]
111
+ # @return [DocumentIndexRead]
112
+ def update(id:, label:, status: nil, environment: nil, request_options: nil)
113
+ response = @request_client.conn.put do |req|
114
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
115
+ req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
116
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
117
+ req.body = {
118
+ **(request_options&.additional_body_parameters || {}),
119
+ label: label,
120
+ status: status,
121
+ environment: environment
122
+ }.compact
123
+ req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes/#{id}"
124
+ end
125
+ DocumentIndexRead.from_json(json_object: response.body)
126
+ end
127
+
128
+ # Used to delete a Document Index given its ID.
129
+ #
130
+ # @param id [String] A UUID string identifying this document index.
131
+ # @param request_options [RequestOptions]
132
+ # @return [Void]
133
+ def destroy(id:, request_options: nil)
134
+ @request_client.conn.delete do |req|
135
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
136
+ req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
137
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
138
+ req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes/#{id}"
139
+ end
140
+ end
141
+
142
+ # Used to partial update a Document Index given its ID.
143
+ #
144
+ # @param id [String] A UUID string identifying this document index.
145
+ # @param label [String] A human-readable label for the document index
146
+ # @param status [ENTITY_STATUS] The current status of the document index
147
+ # * `ACTIVE` - Active
148
+ # * `ARCHIVED` - Archived
149
+ # @param environment [ENVIRONMENT_ENUM] The environment this document index is used in
150
+ # * `DEVELOPMENT` - Development
151
+ # * `STAGING` - Staging
152
+ # * `PRODUCTION` - Production
153
+ # @param request_options [RequestOptions]
154
+ # @return [DocumentIndexRead]
155
+ def partial_update(id:, label: nil, status: nil, environment: nil, request_options: nil)
156
+ response = @request_client.conn.patch do |req|
157
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
158
+ req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
159
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
160
+ req.body = {
161
+ **(request_options&.additional_body_parameters || {}),
162
+ label: label,
163
+ status: status,
164
+ environment: environment
165
+ }.compact
166
+ req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes/#{id}"
167
+ end
168
+ DocumentIndexRead.from_json(json_object: response.body)
169
+ end
98
170
  end
99
171
 
100
172
  class AsyncDocumentIndexesClient
@@ -189,5 +261,83 @@ module Vellum
189
261
  DocumentIndexRead.from_json(json_object: response.body)
190
262
  end
191
263
  end
264
+
265
+ # Used to fully update a Document Index given its ID.
266
+ #
267
+ # @param id [String] A UUID string identifying this document index.
268
+ # @param label [String] A human-readable label for the document index
269
+ # @param status [ENTITY_STATUS] The current status of the document index
270
+ # * `ACTIVE` - Active
271
+ # * `ARCHIVED` - Archived
272
+ # @param environment [ENVIRONMENT_ENUM] The environment this document index is used in
273
+ # * `DEVELOPMENT` - Development
274
+ # * `STAGING` - Staging
275
+ # * `PRODUCTION` - Production
276
+ # @param request_options [RequestOptions]
277
+ # @return [DocumentIndexRead]
278
+ def update(id:, label:, status: nil, environment: nil, request_options: nil)
279
+ Async do
280
+ response = @request_client.conn.put do |req|
281
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
282
+ req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
283
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
284
+ req.body = {
285
+ **(request_options&.additional_body_parameters || {}),
286
+ label: label,
287
+ status: status,
288
+ environment: environment
289
+ }.compact
290
+ req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes/#{id}"
291
+ end
292
+ DocumentIndexRead.from_json(json_object: response.body)
293
+ end
294
+ end
295
+
296
+ # Used to delete a Document Index given its ID.
297
+ #
298
+ # @param id [String] A UUID string identifying this document index.
299
+ # @param request_options [RequestOptions]
300
+ # @return [Void]
301
+ def destroy(id:, request_options: nil)
302
+ Async do
303
+ @request_client.conn.delete do |req|
304
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
305
+ req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
306
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
307
+ req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes/#{id}"
308
+ end
309
+ end
310
+ end
311
+
312
+ # Used to partial update a Document Index given its ID.
313
+ #
314
+ # @param id [String] A UUID string identifying this document index.
315
+ # @param label [String] A human-readable label for the document index
316
+ # @param status [ENTITY_STATUS] The current status of the document index
317
+ # * `ACTIVE` - Active
318
+ # * `ARCHIVED` - Archived
319
+ # @param environment [ENVIRONMENT_ENUM] The environment this document index is used in
320
+ # * `DEVELOPMENT` - Development
321
+ # * `STAGING` - Staging
322
+ # * `PRODUCTION` - Production
323
+ # @param request_options [RequestOptions]
324
+ # @return [DocumentIndexRead]
325
+ def partial_update(id:, label: nil, status: nil, environment: nil, request_options: nil)
326
+ Async do
327
+ response = @request_client.conn.patch do |req|
328
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
329
+ req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
330
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
331
+ req.body = {
332
+ **(request_options&.additional_body_parameters || {}),
333
+ label: label,
334
+ status: status,
335
+ environment: environment
336
+ }.compact
337
+ req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes/#{id}"
338
+ end
339
+ DocumentIndexRead.from_json(json_object: response.body)
340
+ end
341
+ end
192
342
  end
193
343
  end
@@ -8,6 +8,7 @@ require_relative "chat_history_variable_value"
8
8
  require_relative "search_results_variable_value"
9
9
  require_relative "error_variable_value"
10
10
  require_relative "function_call_variable_value"
11
+ require_relative "image_variable_value"
11
12
 
12
13
  module Vellum
13
14
  class ArrayVariableValueItem
@@ -46,6 +47,8 @@ module Vellum
46
47
  ErrorVariableValue.from_json(json_object: json_object)
47
48
  when "FUNCTION_CALL"
48
49
  FunctionCallVariableValue.from_json(json_object: json_object)
50
+ when "IMAGE"
51
+ ImageVariableValue.from_json(json_object: json_object)
49
52
  else
50
53
  StringVariableValue.from_json(json_object: json_object)
51
54
  end
@@ -71,6 +74,8 @@ module Vellum
71
74
  { **@member.to_json, type: @discriminant }.to_json
72
75
  when "FUNCTION_CALL"
73
76
  { **@member.to_json, type: @discriminant }.to_json
77
+ when "IMAGE"
78
+ { **@member.to_json, type: @discriminant }.to_json
74
79
  else
75
80
  { "type": @discriminant, value: @member }.to_json
76
81
  end
@@ -97,6 +102,8 @@ module Vellum
97
102
  ErrorVariableValue.validate_raw(obj: obj)
98
103
  when "FUNCTION_CALL"
99
104
  FunctionCallVariableValue.validate_raw(obj: obj)
105
+ when "IMAGE"
106
+ ImageVariableValue.validate_raw(obj: obj)
100
107
  else
101
108
  raise("Passed value matched no type within the union, validation failed.")
102
109
  end
@@ -151,5 +158,11 @@ module Vellum
151
158
  def self.function_call(member:)
152
159
  new(member: member, discriminant: "FUNCTION_CALL")
153
160
  end
161
+
162
+ # @param member [ImageVariableValue]
163
+ # @return [ArrayVariableValueItem]
164
+ def self.image(member:)
165
+ new(member: member, discriminant: "IMAGE")
166
+ end
154
167
  end
155
168
  end
@@ -8,17 +8,21 @@ require "json"
8
8
  module Vellum
9
9
  # An event that indicates that the node has fulfilled its execution.
10
10
  class FulfilledWorkflowNodeResultEvent
11
- attr_reader :id, :node_id, :node_result_id, :ts, :data, :output_values, :additional_properties
11
+ attr_reader :id, :node_id, :node_result_id, :ts, :data, :source_execution_id, :output_values, :mocked,
12
+ :additional_properties
12
13
 
13
14
  # @param id [String]
14
15
  # @param node_id [String]
15
16
  # @param node_result_id [String]
16
17
  # @param ts [DateTime]
17
18
  # @param data [WorkflowNodeResultData]
19
+ # @param source_execution_id [String]
18
20
  # @param output_values [Array<NodeOutputCompiledValue>]
21
+ # @param mocked [Boolean]
19
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
20
23
  # @return [FulfilledWorkflowNodeResultEvent]
21
- def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, output_values: nil, additional_properties: nil)
24
+ def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, output_values: nil,
25
+ mocked: nil, additional_properties: nil)
22
26
  # @type [String]
23
27
  @id = id
24
28
  # @type [String]
@@ -29,8 +33,12 @@ module Vellum
29
33
  @ts = ts
30
34
  # @type [WorkflowNodeResultData]
31
35
  @data = data
36
+ # @type [String]
37
+ @source_execution_id = source_execution_id
32
38
  # @type [Array<NodeOutputCompiledValue>]
33
39
  @output_values = output_values
40
+ # @type [Boolean]
41
+ @mocked = mocked
34
42
  # @type [OpenStruct] Additional properties unmapped to the current class definition
35
43
  @additional_properties = additional_properties
36
44
  end
@@ -52,12 +60,14 @@ module Vellum
52
60
  data = parsed_json["data"].to_json
53
61
  data = WorkflowNodeResultData.from_json(json_object: data)
54
62
  end
63
+ source_execution_id = struct.source_execution_id
55
64
  output_values = parsed_json["output_values"].map do |v|
56
65
  v = v.to_json
57
66
  NodeOutputCompiledValue.from_json(json_object: v)
58
67
  end
59
- new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data, output_values: output_values,
60
- additional_properties: struct)
68
+ mocked = struct.mocked
69
+ new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
70
+ source_execution_id: source_execution_id, output_values: output_values, mocked: mocked, additional_properties: struct)
61
71
  end
62
72
 
63
73
  # Serialize an instance of FulfilledWorkflowNodeResultEvent to a JSON object
@@ -70,7 +80,9 @@ module Vellum
70
80
  "node_result_id": @node_result_id,
71
81
  "ts": @ts,
72
82
  "data": @data,
73
- "output_values": @output_values
83
+ "source_execution_id": @source_execution_id,
84
+ "output_values": @output_values,
85
+ "mocked": @mocked
74
86
  }.to_json
75
87
  end
76
88
 
@@ -84,7 +96,9 @@ module Vellum
84
96
  obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.")
85
97
  obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
86
98
  obj.data.nil? || WorkflowNodeResultData.validate_raw(obj: obj.data)
99
+ obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.")
87
100
  obj.output_values&.is_a?(Array) != false || raise("Passed value for field obj.output_values is not the expected type, validation failed.")
101
+ obj.mocked&.is_a?(Boolean) != false || raise("Passed value for field obj.mocked is not the expected type, validation failed.")
88
102
  end
89
103
  end
90
104
  end
@@ -8,14 +8,14 @@ module Vellum
8
8
  attr_reader :input_values, :chat_history, :external_ids, :additional_properties
9
9
 
10
10
  # @param input_values [Hash{String => String}] Key/value pairs for each template variable defined in the deployment's prompt.
11
- # @param chat_history [Array<ChatMessageRequest>] Optionally provide a list of chat messages that'll be used in place of the special {$chat_history} variable, if included in the prompt.
11
+ # @param chat_history [Array<ChatMessageRequest>] Optionally provide a list of chat messages that'll be used in place of the special chat_history variable, if included in the prompt.
12
12
  # @param external_ids [Array<String>] Optionally include a unique identifier for each generation, as represented outside of Vellum. Note that this should generally be a list of length one.
13
13
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
14
  # @return [GenerateRequest]
15
15
  def initialize(input_values:, chat_history: nil, external_ids: nil, additional_properties: nil)
16
16
  # @type [Hash{String => String}] Key/value pairs for each template variable defined in the deployment's prompt.
17
17
  @input_values = input_values
18
- # @type [Array<ChatMessageRequest>] Optionally provide a list of chat messages that'll be used in place of the special {$chat_history} variable, if included in the prompt.
18
+ # @type [Array<ChatMessageRequest>] Optionally provide a list of chat messages that'll be used in place of the special chat_history variable, if included in the prompt.
19
19
  @chat_history = chat_history
20
20
  # @type [Array<String>] Optionally include a unique identifier for each generation, as represented outside of Vellum. Note that this should generally be a list of length one.
21
21
  @external_ids = external_ids
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "vellum_image"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # A base Vellum primitive value representing an image.
8
+ class ImageVariableValue
9
+ attr_reader :value, :additional_properties
10
+
11
+ # @param value [VellumImage]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [ImageVariableValue]
14
+ def initialize(value: nil, additional_properties: nil)
15
+ # @type [VellumImage]
16
+ @value = value
17
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
18
+ @additional_properties = additional_properties
19
+ end
20
+
21
+ # Deserialize a JSON object to an instance of ImageVariableValue
22
+ #
23
+ # @param json_object [JSON]
24
+ # @return [ImageVariableValue]
25
+ def self.from_json(json_object:)
26
+ struct = JSON.parse(json_object, object_class: OpenStruct)
27
+ parsed_json = JSON.parse(json_object)
28
+ if parsed_json["value"].nil?
29
+ value = nil
30
+ else
31
+ value = parsed_json["value"].to_json
32
+ value = VellumImage.from_json(json_object: value)
33
+ end
34
+ new(value: value, additional_properties: struct)
35
+ end
36
+
37
+ # Serialize an instance of ImageVariableValue to a JSON object
38
+ #
39
+ # @return [JSON]
40
+ def to_json(*_args)
41
+ { "value": @value }.to_json
42
+ end
43
+
44
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
45
+ #
46
+ # @param obj [Object]
47
+ # @return [Void]
48
+ def self.validate_raw(obj:)
49
+ obj.value.nil? || VellumImage.validate_raw(obj: obj.value)
50
+ end
51
+ end
52
+ end
@@ -8,17 +8,19 @@ require "json"
8
8
  module Vellum
9
9
  # An event that indicates that the node has initiated its execution.
10
10
  class InitiatedWorkflowNodeResultEvent
11
- attr_reader :id, :node_id, :node_result_id, :ts, :data, :input_values, :additional_properties
11
+ attr_reader :id, :node_id, :node_result_id, :ts, :data, :source_execution_id, :input_values, :additional_properties
12
12
 
13
13
  # @param id [String]
14
14
  # @param node_id [String]
15
15
  # @param node_result_id [String]
16
16
  # @param ts [DateTime]
17
17
  # @param data [WorkflowNodeResultData]
18
+ # @param source_execution_id [String]
18
19
  # @param input_values [Array<NodeInputVariableCompiledValue>]
19
20
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
20
21
  # @return [InitiatedWorkflowNodeResultEvent]
21
- def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, input_values: nil, additional_properties: nil)
22
+ def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, input_values: nil,
23
+ additional_properties: nil)
22
24
  # @type [String]
23
25
  @id = id
24
26
  # @type [String]
@@ -29,6 +31,8 @@ module Vellum
29
31
  @ts = ts
30
32
  # @type [WorkflowNodeResultData]
31
33
  @data = data
34
+ # @type [String]
35
+ @source_execution_id = source_execution_id
32
36
  # @type [Array<NodeInputVariableCompiledValue>]
33
37
  @input_values = input_values
34
38
  # @type [OpenStruct] Additional properties unmapped to the current class definition
@@ -52,12 +56,13 @@ module Vellum
52
56
  data = parsed_json["data"].to_json
53
57
  data = WorkflowNodeResultData.from_json(json_object: data)
54
58
  end
59
+ source_execution_id = struct.source_execution_id
55
60
  input_values = parsed_json["input_values"].map do |v|
56
61
  v = v.to_json
57
62
  NodeInputVariableCompiledValue.from_json(json_object: v)
58
63
  end
59
- new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data, input_values: input_values,
60
- additional_properties: struct)
64
+ new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
65
+ source_execution_id: source_execution_id, input_values: input_values, additional_properties: struct)
61
66
  end
62
67
 
63
68
  # Serialize an instance of InitiatedWorkflowNodeResultEvent to a JSON object
@@ -70,6 +75,7 @@ module Vellum
70
75
  "node_result_id": @node_result_id,
71
76
  "ts": @ts,
72
77
  "data": @data,
78
+ "source_execution_id": @source_execution_id,
73
79
  "input_values": @input_values
74
80
  }.to_json
75
81
  end
@@ -84,6 +90,7 @@ module Vellum
84
90
  obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.")
85
91
  obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
86
92
  obj.data.nil? || WorkflowNodeResultData.validate_raw(obj: obj.data)
93
+ obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.")
87
94
  obj.input_values&.is_a?(Array) != false || raise("Passed value for field obj.input_values is not the expected type, validation failed.")
88
95
  end
89
96
  end
@@ -8,17 +8,19 @@ require "json"
8
8
  module Vellum
9
9
  # An event that indicates that the node has rejected its execution.
10
10
  class RejectedWorkflowNodeResultEvent
11
- attr_reader :id, :node_id, :node_result_id, :ts, :data, :error, :additional_properties
11
+ attr_reader :id, :node_id, :node_result_id, :ts, :data, :source_execution_id, :error, :additional_properties
12
12
 
13
13
  # @param id [String]
14
14
  # @param node_id [String]
15
15
  # @param node_result_id [String]
16
16
  # @param ts [DateTime]
17
17
  # @param data [WorkflowNodeResultData]
18
+ # @param source_execution_id [String]
18
19
  # @param error [WorkflowEventError]
19
20
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
20
21
  # @return [RejectedWorkflowNodeResultEvent]
21
- def initialize(id:, node_id:, node_result_id:, error:, ts: nil, data: nil, additional_properties: nil)
22
+ def initialize(id:, node_id:, node_result_id:, error:, ts: nil, data: nil, source_execution_id: nil,
23
+ additional_properties: nil)
22
24
  # @type [String]
23
25
  @id = id
24
26
  # @type [String]
@@ -29,6 +31,8 @@ module Vellum
29
31
  @ts = ts
30
32
  # @type [WorkflowNodeResultData]
31
33
  @data = data
34
+ # @type [String]
35
+ @source_execution_id = source_execution_id
32
36
  # @type [WorkflowEventError]
33
37
  @error = error
34
38
  # @type [OpenStruct] Additional properties unmapped to the current class definition
@@ -52,14 +56,15 @@ module Vellum
52
56
  data = parsed_json["data"].to_json
53
57
  data = WorkflowNodeResultData.from_json(json_object: data)
54
58
  end
59
+ source_execution_id = struct.source_execution_id
55
60
  if parsed_json["error"].nil?
56
61
  error = nil
57
62
  else
58
63
  error = parsed_json["error"].to_json
59
64
  error = WorkflowEventError.from_json(json_object: error)
60
65
  end
61
- new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data, error: error,
62
- additional_properties: struct)
66
+ new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
67
+ source_execution_id: source_execution_id, error: error, additional_properties: struct)
63
68
  end
64
69
 
65
70
  # Serialize an instance of RejectedWorkflowNodeResultEvent to a JSON object
@@ -72,6 +77,7 @@ module Vellum
72
77
  "node_result_id": @node_result_id,
73
78
  "ts": @ts,
74
79
  "data": @data,
80
+ "source_execution_id": @source_execution_id,
75
81
  "error": @error
76
82
  }.to_json
77
83
  end
@@ -86,6 +92,7 @@ module Vellum
86
92
  obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.")
87
93
  obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
88
94
  obj.data.nil? || WorkflowNodeResultData.validate_raw(obj: obj.data)
95
+ obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.")
89
96
  WorkflowEventError.validate_raw(obj: obj.error)
90
97
  end
91
98
  end
@@ -8,19 +8,21 @@ require "json"
8
8
  module Vellum
9
9
  # An event that indicates that the node has execution is in progress.
10
10
  class StreamingWorkflowNodeResultEvent
11
- attr_reader :id, :node_id, :node_result_id, :ts, :data, :output, :output_index, :additional_properties
11
+ attr_reader :id, :node_id, :node_result_id, :ts, :data, :source_execution_id, :output, :output_index,
12
+ :additional_properties
12
13
 
13
14
  # @param id [String]
14
15
  # @param node_id [String]
15
16
  # @param node_result_id [String]
16
17
  # @param ts [DateTime]
17
18
  # @param data [WorkflowNodeResultData]
19
+ # @param source_execution_id [String]
18
20
  # @param output [NodeOutputCompiledValue]
19
21
  # @param output_index [Integer]
20
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
23
  # @return [StreamingWorkflowNodeResultEvent]
22
- def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, output: nil, output_index: nil,
23
- additional_properties: nil)
24
+ def initialize(id:, node_id:, node_result_id:, ts: nil, data: nil, source_execution_id: nil, output: nil,
25
+ output_index: nil, additional_properties: nil)
24
26
  # @type [String]
25
27
  @id = id
26
28
  # @type [String]
@@ -31,6 +33,8 @@ module Vellum
31
33
  @ts = ts
32
34
  # @type [WorkflowNodeResultData]
33
35
  @data = data
36
+ # @type [String]
37
+ @source_execution_id = source_execution_id
34
38
  # @type [NodeOutputCompiledValue]
35
39
  @output = output
36
40
  # @type [Integer]
@@ -56,6 +60,7 @@ module Vellum
56
60
  data = parsed_json["data"].to_json
57
61
  data = WorkflowNodeResultData.from_json(json_object: data)
58
62
  end
63
+ source_execution_id = struct.source_execution_id
59
64
  if parsed_json["output"].nil?
60
65
  output = nil
61
66
  else
@@ -63,8 +68,8 @@ module Vellum
63
68
  output = NodeOutputCompiledValue.from_json(json_object: output)
64
69
  end
65
70
  output_index = struct.output_index
66
- new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data, output: output,
67
- output_index: output_index, additional_properties: struct)
71
+ new(id: id, node_id: node_id, node_result_id: node_result_id, ts: ts, data: data,
72
+ source_execution_id: source_execution_id, output: output, output_index: output_index, additional_properties: struct)
68
73
  end
69
74
 
70
75
  # Serialize an instance of StreamingWorkflowNodeResultEvent to a JSON object
@@ -77,6 +82,7 @@ module Vellum
77
82
  "node_result_id": @node_result_id,
78
83
  "ts": @ts,
79
84
  "data": @data,
85
+ "source_execution_id": @source_execution_id,
80
86
  "output": @output,
81
87
  "output_index": @output_index
82
88
  }.to_json
@@ -92,6 +98,7 @@ module Vellum
92
98
  obj.node_result_id.is_a?(String) != false || raise("Passed value for field obj.node_result_id is not the expected type, validation failed.")
93
99
  obj.ts&.is_a?(DateTime) != false || raise("Passed value for field obj.ts is not the expected type, validation failed.")
94
100
  obj.data.nil? || WorkflowNodeResultData.validate_raw(obj: obj.data)
101
+ obj.source_execution_id&.is_a?(String) != false || raise("Passed value for field obj.source_execution_id is not the expected type, validation failed.")
95
102
  obj.output.nil? || NodeOutputCompiledValue.validate_raw(obj: obj.output)
96
103
  obj.output_index&.is_a?(Integer) != false || raise("Passed value for field obj.output_index is not the expected type, validation failed.")
97
104
  end
@@ -4,6 +4,7 @@ module Vellum
4
4
  # @type [WORKFLOW_EXECUTION_EVENT_ERROR_CODE]
5
5
  WORKFLOW_EXECUTION_EVENT_ERROR_CODE = {
6
6
  workflow_initialization: "WORKFLOW_INITIALIZATION",
7
+ workflow_cancelled: "WORKFLOW_CANCELLED",
7
8
  node_execution_count_limit_reached: "NODE_EXECUTION_COUNT_LIMIT_REACHED",
8
9
  internal_server_error: "INTERNAL_SERVER_ERROR",
9
10
  node_execution: "NODE_EXECUTION",
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: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vellum
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-14 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http-faraday
@@ -185,6 +185,7 @@ files:
185
185
  - lib/vellum_ai/types/image_chat_message_content.rb
186
186
  - lib/vellum_ai/types/image_chat_message_content_request.rb
187
187
  - lib/vellum_ai/types/image_enum.rb
188
+ - lib/vellum_ai/types/image_variable_value.rb
188
189
  - lib/vellum_ai/types/indexing_state_enum.rb
189
190
  - lib/vellum_ai/types/initiated_enum.rb
190
191
  - lib/vellum_ai/types/initiated_execute_prompt_event.rb