vellum_ai 0.3.11 → 0.3.13
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 +31 -0
- data/lib/vellum_ai/document_indexes/client.rb +150 -0
- data/lib/vellum_ai/test_suite_runs/client.rb +149 -0
- data/lib/vellum_ai/types/array_variable_value_item.rb +13 -0
- data/lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb +19 -5
- data/lib/vellum_ai/types/generate_request.rb +2 -2
- data/lib/vellum_ai/types/image_variable_value.rb +52 -0
- data/lib/vellum_ai/types/initiated_workflow_node_result_event.rb +11 -4
- data/lib/vellum_ai/types/paginated_test_suite_run_execution_list.rb +64 -0
- data/lib/vellum_ai/types/rejected_workflow_node_result_event.rb +11 -4
- data/lib/vellum_ai/types/streaming_workflow_node_result_event.rb +12 -5
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data_request.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_request.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_type_enum.rb +5 -0
- data/lib/vellum_ai/types/test_suite_run_exec_config.rb +90 -0
- data/lib/vellum_ai/types/test_suite_run_exec_config_request.rb +90 -0
- data/lib/vellum_ai/types/test_suite_run_execution.rb +69 -0
- data/lib/vellum_ai/types/test_suite_run_execution_chat_history_output.rb +54 -0
- data/lib/vellum_ai/types/test_suite_run_execution_error_output.rb +56 -0
- data/lib/vellum_ai/types/test_suite_run_execution_json_output.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_execution_metric_result.rb +54 -0
- data/lib/vellum_ai/types/test_suite_run_execution_number_output.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_execution_output.rb +142 -0
- data/lib/vellum_ai/types/test_suite_run_execution_search_results_output.rb +54 -0
- data/lib/vellum_ai/types/test_suite_run_execution_string_output.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_metric_error_output.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_metric_error_output_type_enum.rb +5 -0
- data/lib/vellum_ai/types/test_suite_run_metric_number_output.rb +51 -0
- data/lib/vellum_ai/types/test_suite_run_metric_number_output_type_enum.rb +5 -0
- data/lib/vellum_ai/types/test_suite_run_metric_output.rb +90 -0
- data/lib/vellum_ai/types/test_suite_run_read.rb +96 -0
- data/lib/vellum_ai/types/test_suite_run_state.rb +12 -0
- data/lib/vellum_ai/types/test_suite_run_test_suite.rb +55 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data_request.rb +50 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_request.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_type_enum.rb +5 -0
- data/lib/vellum_ai/types/workflow_execution_event_error_code.rb +1 -0
- data/lib/vellum_ai/types/workflow_output_array.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_chat_history.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_error.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_function_call.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_image.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_json.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_number.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_search_results.rb +2 -2
- data/lib/vellum_ai/types/workflow_output_string.rb +2 -2
- data/lib/vellum_ai.rb +5 -2
- metadata +34 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea4b18359c0ea4e08dbd7be1adb49eba513b4160627f89378704480d9d7dae3e
|
4
|
+
data.tar.gz: 7d1d699a392e57dee0a9dbcf84396c55def4b2e03e6fc53ed9076d2057733670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8046d5a9c7f8073f96c6dc3d6c95da1d841617972dd0e7c52f2f3ccd8d4d66ec90ae5e0b5bea781434cba60b2745945fc9fc1911ed49d43f957f1ade65829a31
|
7
|
+
data.tar.gz: 830eb6ddb227723925dd888a40cc2a1e274df0fb63359b53c4d6634589f9f37b08b2bf9c2a9277fc13d2a58155b07ab81507ac7f0bb7b7e6f23fa6b4a57223cc
|
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.
|
23
|
+
"X-Fern-SDK-Version": "0.3.13",
|
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.
|
49
|
+
"X-Fern-SDK-Version": "0.3.13",
|
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"
|
@@ -137,6 +138,7 @@ require_relative "vellum_ai/types/paginated_document_index_read_list"
|
|
137
138
|
require_relative "vellum_ai/types/paginated_slim_deployment_read_list"
|
138
139
|
require_relative "vellum_ai/types/paginated_slim_document_list"
|
139
140
|
require_relative "vellum_ai/types/paginated_slim_workflow_deployment_list"
|
141
|
+
require_relative "vellum_ai/types/paginated_test_suite_run_execution_list"
|
140
142
|
require_relative "vellum_ai/types/processing_failure_reason_enum"
|
141
143
|
require_relative "vellum_ai/types/processing_state_enum"
|
142
144
|
require_relative "vellum_ai/types/prompt_deployment_expand_meta_request_request"
|
@@ -232,6 +234,35 @@ require_relative "vellum_ai/types/test_case_number_variable_value"
|
|
232
234
|
require_relative "vellum_ai/types/test_case_search_results_variable_value"
|
233
235
|
require_relative "vellum_ai/types/test_case_string_variable_value"
|
234
236
|
require_relative "vellum_ai/types/test_case_variable_value"
|
237
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config"
|
238
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data"
|
239
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data_request"
|
240
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_request"
|
241
|
+
require_relative "vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_type_enum"
|
242
|
+
require_relative "vellum_ai/types/test_suite_run_exec_config"
|
243
|
+
require_relative "vellum_ai/types/test_suite_run_exec_config_request"
|
244
|
+
require_relative "vellum_ai/types/test_suite_run_execution"
|
245
|
+
require_relative "vellum_ai/types/test_suite_run_execution_chat_history_output"
|
246
|
+
require_relative "vellum_ai/types/test_suite_run_execution_error_output"
|
247
|
+
require_relative "vellum_ai/types/test_suite_run_execution_json_output"
|
248
|
+
require_relative "vellum_ai/types/test_suite_run_execution_metric_result"
|
249
|
+
require_relative "vellum_ai/types/test_suite_run_execution_number_output"
|
250
|
+
require_relative "vellum_ai/types/test_suite_run_execution_output"
|
251
|
+
require_relative "vellum_ai/types/test_suite_run_execution_search_results_output"
|
252
|
+
require_relative "vellum_ai/types/test_suite_run_execution_string_output"
|
253
|
+
require_relative "vellum_ai/types/test_suite_run_metric_error_output"
|
254
|
+
require_relative "vellum_ai/types/test_suite_run_metric_error_output_type_enum"
|
255
|
+
require_relative "vellum_ai/types/test_suite_run_metric_number_output"
|
256
|
+
require_relative "vellum_ai/types/test_suite_run_metric_number_output_type_enum"
|
257
|
+
require_relative "vellum_ai/types/test_suite_run_metric_output"
|
258
|
+
require_relative "vellum_ai/types/test_suite_run_read"
|
259
|
+
require_relative "vellum_ai/types/test_suite_run_state"
|
260
|
+
require_relative "vellum_ai/types/test_suite_run_test_suite"
|
261
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config"
|
262
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data"
|
263
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data_request"
|
264
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_request"
|
265
|
+
require_relative "vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_type_enum"
|
235
266
|
require_relative "vellum_ai/types/test_suite_test_case"
|
236
267
|
require_relative "vellum_ai/types/upload_document_error_response"
|
237
268
|
require_relative "vellum_ai/types/upload_document_response"
|
@@ -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
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../requests"
|
4
|
+
require_relative "../types/test_suite_run_exec_config_request"
|
5
|
+
require_relative "../types/test_suite_run_read"
|
6
|
+
require_relative "../types/paginated_test_suite_run_execution_list"
|
7
|
+
require "async"
|
8
|
+
|
9
|
+
module Vellum
|
10
|
+
class TestSuiteRunsClient
|
11
|
+
attr_reader :request_client
|
12
|
+
|
13
|
+
# @param request_client [RequestClient]
|
14
|
+
# @return [TestSuiteRunsClient]
|
15
|
+
def initialize(request_client:)
|
16
|
+
# @type [RequestClient]
|
17
|
+
@request_client = request_client
|
18
|
+
end
|
19
|
+
|
20
|
+
# Trigger a Test Suite and create a new Test Suite Run
|
21
|
+
#
|
22
|
+
# @param test_suite_id [String] The ID of the Test Suite to run
|
23
|
+
# @param exec_config [Hash] Configuration that defines how the Test Suite should be runRequest of type TestSuiteRunExecConfigRequest, as a Hash
|
24
|
+
# @param request_options [RequestOptions]
|
25
|
+
# @return [TestSuiteRunRead]
|
26
|
+
def create(exec_config:, test_suite_id: nil, request_options: nil)
|
27
|
+
response = @request_client.conn.post do |req|
|
28
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
29
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
30
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
31
|
+
req.body = {
|
32
|
+
**(request_options&.additional_body_parameters || {}),
|
33
|
+
test_suite_id: test_suite_id,
|
34
|
+
exec_config: exec_config
|
35
|
+
}.compact
|
36
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs"
|
37
|
+
end
|
38
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Retrieve a specific Test Suite Run by ID
|
42
|
+
#
|
43
|
+
# @param id [String] A UUID string identifying this test suite run.
|
44
|
+
# @param request_options [RequestOptions]
|
45
|
+
# @return [TestSuiteRunRead]
|
46
|
+
def retrieve(id:, request_options: nil)
|
47
|
+
response = @request_client.conn.get do |req|
|
48
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
49
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
50
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
51
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}"
|
52
|
+
end
|
53
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
54
|
+
end
|
55
|
+
|
56
|
+
# @param id [String] A UUID string identifying this test suite run.
|
57
|
+
# @param limit [Integer] Number of results to return per page.
|
58
|
+
# @param offset [Integer] The initial index from which to return the results.
|
59
|
+
# @param request_options [RequestOptions]
|
60
|
+
# @return [PaginatedTestSuiteRunExecutionList]
|
61
|
+
def list_test_suite_run_executions(id:, limit: nil, offset: nil, request_options: nil)
|
62
|
+
response = @request_client.conn.get do |req|
|
63
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
64
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
65
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
66
|
+
req.params = {
|
67
|
+
**(request_options&.additional_query_parameters || {}),
|
68
|
+
"limit": limit,
|
69
|
+
"offset": offset
|
70
|
+
}.compact
|
71
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}/executions"
|
72
|
+
end
|
73
|
+
PaginatedTestSuiteRunExecutionList.from_json(json_object: response.body)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
class AsyncTestSuiteRunsClient
|
78
|
+
attr_reader :request_client
|
79
|
+
|
80
|
+
# @param request_client [AsyncRequestClient]
|
81
|
+
# @return [AsyncTestSuiteRunsClient]
|
82
|
+
def initialize(request_client:)
|
83
|
+
# @type [AsyncRequestClient]
|
84
|
+
@request_client = request_client
|
85
|
+
end
|
86
|
+
|
87
|
+
# Trigger a Test Suite and create a new Test Suite Run
|
88
|
+
#
|
89
|
+
# @param test_suite_id [String] The ID of the Test Suite to run
|
90
|
+
# @param exec_config [Hash] Configuration that defines how the Test Suite should be runRequest of type TestSuiteRunExecConfigRequest, as a Hash
|
91
|
+
# @param request_options [RequestOptions]
|
92
|
+
# @return [TestSuiteRunRead]
|
93
|
+
def create(exec_config:, test_suite_id: nil, request_options: nil)
|
94
|
+
Async do
|
95
|
+
response = @request_client.conn.post do |req|
|
96
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
97
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
98
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
99
|
+
req.body = {
|
100
|
+
**(request_options&.additional_body_parameters || {}),
|
101
|
+
test_suite_id: test_suite_id,
|
102
|
+
exec_config: exec_config
|
103
|
+
}.compact
|
104
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs"
|
105
|
+
end
|
106
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# Retrieve a specific Test Suite Run by ID
|
111
|
+
#
|
112
|
+
# @param id [String] A UUID string identifying this test suite run.
|
113
|
+
# @param request_options [RequestOptions]
|
114
|
+
# @return [TestSuiteRunRead]
|
115
|
+
def retrieve(id:, request_options: nil)
|
116
|
+
Async do
|
117
|
+
response = @request_client.conn.get do |req|
|
118
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
119
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
120
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
121
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}"
|
122
|
+
end
|
123
|
+
TestSuiteRunRead.from_json(json_object: response.body)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# @param id [String] A UUID string identifying this test suite run.
|
128
|
+
# @param limit [Integer] Number of results to return per page.
|
129
|
+
# @param offset [Integer] The initial index from which to return the results.
|
130
|
+
# @param request_options [RequestOptions]
|
131
|
+
# @return [PaginatedTestSuiteRunExecutionList]
|
132
|
+
def list_test_suite_run_executions(id:, limit: nil, offset: nil, request_options: nil)
|
133
|
+
Async do
|
134
|
+
response = @request_client.conn.get 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.params = {
|
139
|
+
**(request_options&.additional_query_parameters || {}),
|
140
|
+
"limit": limit,
|
141
|
+
"offset": offset
|
142
|
+
}.compact
|
143
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/test-suite-runs/#{id}/executions"
|
144
|
+
end
|
145
|
+
PaginatedTestSuiteRunExecutionList.from_json(json_object: response.body)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
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, :
|
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,
|
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
|
-
|
60
|
-
|
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
|
-
"
|
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
|
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
|
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,
|
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,
|
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
|