vellum_ai 0.3.5 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/requests.rb +2 -2
- data/lib/vellum_ai/folder_entities/client.rb +66 -0
- data/lib/vellum_ai.rb +7 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ab21719c1b255f61fdfec3f4b59311f8ff6abac1fd53084179ad36741f3d1d
|
4
|
+
data.tar.gz: 56727296184e00efcb37b0277e78b15d2fbb4666c767e6d0519c04f781da4d22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed3a4f2da49c992af2c410a3b170ddc23da6b9e150707d88948739714d244a068aaf202c60f625850d5608251cdae77652733352677ea1c5c6cafadd918d71c5
|
7
|
+
data.tar.gz: '06927b37c0254a198d2928e32de4d2f40620dc4e8c1317ddad49dd676fae8008f8ccb13f4486cac478773f4543a561c977eb1e9639691d8d369d033dfa5b43c9'
|
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.7",
|
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.7",
|
50
50
|
"X_API_KEY": api_key.to_s
|
51
51
|
}
|
52
52
|
@conn = Faraday.new(headers: @headers) do |faraday|
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../requests"
|
4
|
+
require "async"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class FolderEntitiesClient
|
8
|
+
attr_reader :request_client
|
9
|
+
|
10
|
+
# @param request_client [RequestClient]
|
11
|
+
# @return [FolderEntitiesClient]
|
12
|
+
def initialize(request_client:)
|
13
|
+
# @type [RequestClient]
|
14
|
+
@request_client = request_client
|
15
|
+
end
|
16
|
+
|
17
|
+
# Add an entity to a specific folder or root directory.
|
18
|
+
#
|
19
|
+
# Adding an entity to a folder will remove it from any other folders it might have been a member of.
|
20
|
+
#
|
21
|
+
# @param folder_id [String] The ID of the folder to which the entity should be added. This can be a UUID of a folder, or the name of a root directory (e.g. "PROMPT_SANDBOX").
|
22
|
+
# @param entity_id [String] The ID of the entity you would like to move.
|
23
|
+
# @param request_options [RequestOptions]
|
24
|
+
# @return [Void]
|
25
|
+
def add_entity_to_folder(folder_id:, entity_id:, request_options: nil)
|
26
|
+
@request_client.conn.post do |req|
|
27
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
28
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
29
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
30
|
+
req.body = { **(request_options&.additional_body_parameters || {}), entity_id: entity_id }.compact
|
31
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/folders/#{folder_id}/add-entity"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class AsyncFolderEntitiesClient
|
37
|
+
attr_reader :request_client
|
38
|
+
|
39
|
+
# @param request_client [AsyncRequestClient]
|
40
|
+
# @return [AsyncFolderEntitiesClient]
|
41
|
+
def initialize(request_client:)
|
42
|
+
# @type [AsyncRequestClient]
|
43
|
+
@request_client = request_client
|
44
|
+
end
|
45
|
+
|
46
|
+
# Add an entity to a specific folder or root directory.
|
47
|
+
#
|
48
|
+
# Adding an entity to a folder will remove it from any other folders it might have been a member of.
|
49
|
+
#
|
50
|
+
# @param folder_id [String] The ID of the folder to which the entity should be added. This can be a UUID of a folder, or the name of a root directory (e.g. "PROMPT_SANDBOX").
|
51
|
+
# @param entity_id [String] The ID of the entity you would like to move.
|
52
|
+
# @param request_options [RequestOptions]
|
53
|
+
# @return [Void]
|
54
|
+
def add_entity_to_folder(folder_id:, entity_id:, request_options: nil)
|
55
|
+
Async do
|
56
|
+
@request_client.conn.post do |req|
|
57
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
58
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
59
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
60
|
+
req.body = { **(request_options&.additional_body_parameters || {}), entity_id: entity_id }.compact
|
61
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/folders/#{folder_id}/add-entity"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/lib/vellum_ai.rb
CHANGED
@@ -6,6 +6,7 @@ require_relative "requests"
|
|
6
6
|
require_relative "vellum_ai/deployments/client"
|
7
7
|
require_relative "vellum_ai/document_indexes/client"
|
8
8
|
require_relative "vellum_ai/documents/client"
|
9
|
+
require_relative "vellum_ai/folder_entities/client"
|
9
10
|
require_relative "vellum_ai/model_versions/client"
|
10
11
|
require_relative "vellum_ai/registered_prompts/client"
|
11
12
|
require_relative "vellum_ai/sandboxes/client"
|
@@ -27,8 +28,8 @@ require_relative "vellum_ai/types/submit_workflow_execution_actual_request"
|
|
27
28
|
|
28
29
|
module Vellum
|
29
30
|
class Client
|
30
|
-
attr_reader :deployments, :document_indexes, :documents, :
|
31
|
-
:test_suites, :workflow_deployments
|
31
|
+
attr_reader :deployments, :document_indexes, :documents, :folder_entities, :model_versions, :registered_prompts,
|
32
|
+
:sandboxes, :test_suites, :workflow_deployments
|
32
33
|
|
33
34
|
# @param environment [Environment]
|
34
35
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
@@ -41,6 +42,7 @@ module Vellum
|
|
41
42
|
@deployments = DeploymentsClient.new(request_client: @request_client)
|
42
43
|
@document_indexes = DocumentIndexesClient.new(request_client: @request_client)
|
43
44
|
@documents = DocumentsClient.new(request_client: @request_client)
|
45
|
+
@folder_entities = FolderEntitiesClient.new(request_client: @request_client)
|
44
46
|
@model_versions = ModelVersionsClient.new(request_client: @request_client)
|
45
47
|
@registered_prompts = RegisteredPromptsClient.new(request_client: @request_client)
|
46
48
|
@sandboxes = SandboxesClient.new(request_client: @request_client)
|
@@ -248,8 +250,8 @@ module Vellum
|
|
248
250
|
end
|
249
251
|
|
250
252
|
class AsyncClient
|
251
|
-
attr_reader :deployments, :document_indexes, :documents, :
|
252
|
-
:test_suites, :workflow_deployments
|
253
|
+
attr_reader :deployments, :document_indexes, :documents, :folder_entities, :model_versions, :registered_prompts,
|
254
|
+
:sandboxes, :test_suites, :workflow_deployments
|
253
255
|
|
254
256
|
# @param environment [Environment]
|
255
257
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
@@ -262,6 +264,7 @@ module Vellum
|
|
262
264
|
@deployments = AsyncDeploymentsClient.new(request_client: @async_request_client)
|
263
265
|
@document_indexes = AsyncDocumentIndexesClient.new(request_client: @async_request_client)
|
264
266
|
@documents = AsyncDocumentsClient.new(request_client: @async_request_client)
|
267
|
+
@folder_entities = AsyncFolderEntitiesClient.new(request_client: @async_request_client)
|
265
268
|
@model_versions = AsyncModelVersionsClient.new(request_client: @async_request_client)
|
266
269
|
@registered_prompts = AsyncRegisteredPromptsClient.new(request_client: @async_request_client)
|
267
270
|
@sandboxes = AsyncSandboxesClient.new(request_client: @async_request_client)
|
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.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vellum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/vellum_ai/deployments/types/deployments_list_request_status.rb
|
97
97
|
- lib/vellum_ai/document_indexes/client.rb
|
98
98
|
- lib/vellum_ai/documents/client.rb
|
99
|
+
- lib/vellum_ai/folder_entities/client.rb
|
99
100
|
- lib/vellum_ai/model_versions/client.rb
|
100
101
|
- lib/vellum_ai/registered_prompts/client.rb
|
101
102
|
- lib/vellum_ai/sandboxes/client.rb
|