vellum_ai 0.3.9 → 0.3.10
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/types_export.rb +2 -0
- data/lib/vellum_ai/document_indexes/client.rb +58 -0
- data/lib/vellum_ai/document_indexes/types/document_indexes_list_request_status.rb +8 -0
- data/lib/vellum_ai/types/paginated_document_index_read_list.rb +64 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ee15857c4f6d078afa21d87b58baf72fa919289417db31edd4d749d76616dac
|
4
|
+
data.tar.gz: 2b3ef152052326857531cfcea45ee4baa5ec17285aeceab9f1e1fb42719e08f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46b1deb69aee31554a0fef8440a43de43027687f2be4d39c39491a3b0221852961a00759ad42837ce6d2ad16a0aea89ecd2a7671e387e70fa3ac91c1093c7879
|
7
|
+
data.tar.gz: d9325756359ce00b83ba6fa59f6ae988e801c04e420645ae653e43f592a5ae702caac0ccc00c58e026c2ce4f92bd0490c99a6cf25c1865e689e3295d47a5440e
|
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.10",
|
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.10",
|
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
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "vellum_ai/deployments/types/deployments_list_request_status"
|
4
|
+
require_relative "vellum_ai/document_indexes/types/document_indexes_list_request_status"
|
4
5
|
require_relative "vellum_ai/workflow_deployments/types/workflow_deployments_list_request_status"
|
5
6
|
require_relative "vellum_ai/types/api_node_result"
|
6
7
|
require_relative "vellum_ai/types/api_node_result_data"
|
@@ -123,6 +124,7 @@ require_relative "vellum_ai/types/normalized_log_probs"
|
|
123
124
|
require_relative "vellum_ai/types/normalized_token_log_probs"
|
124
125
|
require_relative "vellum_ai/types/number_enum"
|
125
126
|
require_relative "vellum_ai/types/number_variable_value"
|
127
|
+
require_relative "vellum_ai/types/paginated_document_index_read_list"
|
126
128
|
require_relative "vellum_ai/types/paginated_slim_deployment_read_list"
|
127
129
|
require_relative "vellum_ai/types/paginated_slim_document_list"
|
128
130
|
require_relative "vellum_ai/types/paginated_slim_workflow_deployment_list"
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../../requests"
|
4
|
+
require_relative "types/document_indexes_list_request_status"
|
5
|
+
require_relative "../types/paginated_document_index_read_list"
|
4
6
|
require_relative "../types/entity_status"
|
5
7
|
require_relative "../types/environment_enum"
|
6
8
|
require_relative "../types/document_index_read"
|
@@ -17,6 +19,33 @@ module Vellum
|
|
17
19
|
@request_client = request_client
|
18
20
|
end
|
19
21
|
|
22
|
+
# Used to retrieve a list of Document Indexes.
|
23
|
+
#
|
24
|
+
# @param limit [Integer] Number of results to return per page.
|
25
|
+
# @param offset [Integer] The initial index from which to return the results.
|
26
|
+
# @param ordering [String] Which field to use when ordering the results.
|
27
|
+
# @param status [DOCUMENT_INDEXES_LIST_REQUEST_STATUS] The current status of the document index
|
28
|
+
# - `ACTIVE` - Active
|
29
|
+
# - `ARCHIVED` - Archived
|
30
|
+
# @param request_options [RequestOptions]
|
31
|
+
# @return [PaginatedDocumentIndexReadList]
|
32
|
+
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil)
|
33
|
+
response = @request_client.conn.get do |req|
|
34
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
35
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
36
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
37
|
+
req.params = {
|
38
|
+
**(request_options&.additional_query_parameters || {}),
|
39
|
+
"limit": limit,
|
40
|
+
"offset": offset,
|
41
|
+
"ordering": ordering,
|
42
|
+
"status": status
|
43
|
+
}.compact
|
44
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes"
|
45
|
+
end
|
46
|
+
PaginatedDocumentIndexReadList.from_json(json_object: response.body)
|
47
|
+
end
|
48
|
+
|
20
49
|
# Creates a new document index.
|
21
50
|
#
|
22
51
|
# @param label [String] A human-readable label for the document index
|
@@ -78,6 +107,35 @@ module Vellum
|
|
78
107
|
@request_client = request_client
|
79
108
|
end
|
80
109
|
|
110
|
+
# Used to retrieve a list of Document Indexes.
|
111
|
+
#
|
112
|
+
# @param limit [Integer] Number of results to return per page.
|
113
|
+
# @param offset [Integer] The initial index from which to return the results.
|
114
|
+
# @param ordering [String] Which field to use when ordering the results.
|
115
|
+
# @param status [DOCUMENT_INDEXES_LIST_REQUEST_STATUS] The current status of the document index
|
116
|
+
# - `ACTIVE` - Active
|
117
|
+
# - `ARCHIVED` - Archived
|
118
|
+
# @param request_options [RequestOptions]
|
119
|
+
# @return [PaginatedDocumentIndexReadList]
|
120
|
+
def list(limit: nil, offset: nil, ordering: nil, status: nil, request_options: nil)
|
121
|
+
Async do
|
122
|
+
response = @request_client.conn.get do |req|
|
123
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
124
|
+
req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
125
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
126
|
+
req.params = {
|
127
|
+
**(request_options&.additional_query_parameters || {}),
|
128
|
+
"limit": limit,
|
129
|
+
"offset": offset,
|
130
|
+
"ordering": ordering,
|
131
|
+
"status": status
|
132
|
+
}.compact
|
133
|
+
req.url "#{@request_client.default_environment[:Default]}/v1/document-indexes"
|
134
|
+
end
|
135
|
+
PaginatedDocumentIndexReadList.from_json(json_object: response.body)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
81
139
|
# Creates a new document index.
|
82
140
|
#
|
83
141
|
# @param label [String] A human-readable label for the document index
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "document_index_read"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vellum
|
7
|
+
class PaginatedDocumentIndexReadList
|
8
|
+
attr_reader :count, :next_, :previous, :results, :additional_properties
|
9
|
+
|
10
|
+
# @param count [Integer]
|
11
|
+
# @param next_ [String]
|
12
|
+
# @param previous [String]
|
13
|
+
# @param results [Array<DocumentIndexRead>]
|
14
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
# @return [PaginatedDocumentIndexReadList]
|
16
|
+
def initialize(count: nil, next_: nil, previous: nil, results: nil, additional_properties: nil)
|
17
|
+
# @type [Integer]
|
18
|
+
@count = count
|
19
|
+
# @type [String]
|
20
|
+
@next_ = next_
|
21
|
+
# @type [String]
|
22
|
+
@previous = previous
|
23
|
+
# @type [Array<DocumentIndexRead>]
|
24
|
+
@results = results
|
25
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
end
|
28
|
+
|
29
|
+
# Deserialize a JSON object to an instance of PaginatedDocumentIndexReadList
|
30
|
+
#
|
31
|
+
# @param json_object [JSON]
|
32
|
+
# @return [PaginatedDocumentIndexReadList]
|
33
|
+
def self.from_json(json_object:)
|
34
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
|
+
parsed_json = JSON.parse(json_object)
|
36
|
+
count = struct.count
|
37
|
+
next_ = struct.next
|
38
|
+
previous = struct.previous
|
39
|
+
results = parsed_json["results"].map do |v|
|
40
|
+
v = v.to_json
|
41
|
+
DocumentIndexRead.from_json(json_object: v)
|
42
|
+
end
|
43
|
+
new(count: count, next_: next_, previous: previous, results: results, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of PaginatedDocumentIndexReadList to a JSON object
|
47
|
+
#
|
48
|
+
# @return [JSON]
|
49
|
+
def to_json(*_args)
|
50
|
+
{ "count": @count, "next": @next_, "previous": @previous, "results": @results }.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# 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.
|
54
|
+
#
|
55
|
+
# @param obj [Object]
|
56
|
+
# @return [Void]
|
57
|
+
def self.validate_raw(obj:)
|
58
|
+
obj.count&.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
|
59
|
+
obj.next_&.is_a?(String) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.")
|
60
|
+
obj.previous&.is_a?(String) != false || raise("Passed value for field obj.previous is not the expected type, validation failed.")
|
61
|
+
obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
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.10
|
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-
|
11
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- lib/vellum_ai/deployments/client.rb
|
96
96
|
- lib/vellum_ai/deployments/types/deployments_list_request_status.rb
|
97
97
|
- lib/vellum_ai/document_indexes/client.rb
|
98
|
+
- lib/vellum_ai/document_indexes/types/document_indexes_list_request_status.rb
|
98
99
|
- lib/vellum_ai/documents/client.rb
|
99
100
|
- lib/vellum_ai/folder_entities/client.rb
|
100
101
|
- lib/vellum_ai/model_versions/client.rb
|
@@ -222,6 +223,7 @@ files:
|
|
222
223
|
- lib/vellum_ai/types/normalized_token_log_probs.rb
|
223
224
|
- lib/vellum_ai/types/number_enum.rb
|
224
225
|
- lib/vellum_ai/types/number_variable_value.rb
|
226
|
+
- lib/vellum_ai/types/paginated_document_index_read_list.rb
|
225
227
|
- lib/vellum_ai/types/paginated_slim_deployment_read_list.rb
|
226
228
|
- lib/vellum_ai/types/paginated_slim_document_list.rb
|
227
229
|
- lib/vellum_ai/types/paginated_slim_workflow_deployment_list.rb
|