carbon_ruby_sdk 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +8 -3
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +6 -2
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +2 -2
- data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +13 -1
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +1 -1
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/spec/models/get_embedding_documents_body_spec.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 839fe56ac65336fa1bdf96a70f15650082dea496ad4a4c0b51a8b233fad54809
|
4
|
+
data.tar.gz: b5cbd86d98e6f0cf33b2aae90dd92a25cacdc3d669177699afe9529360749cc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0e78234fde535d43ec86edf82d88664c26576fdd58e9eb92c149d5785a2a2502da89ba4063798107b60603f39828294c4e8fd7229de9d4bb8af765e51b69f1c
|
7
|
+
data.tar.gz: 88af831f2ba0f5e216daaa6166889195757df579c401fd76bb28c61219a11c26d6ed05dce7b7d696b6ce9899d6b918d5f5560996d43f5a619d1859fcbd511fb7
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
carbon_ruby_sdk (0.1.
|
4
|
+
carbon_ruby_sdk (0.1.18)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
rainbow (3.1.1)
|
43
43
|
rake (13.0.6)
|
44
44
|
regexp_parser (2.9.0)
|
45
|
-
reline (0.
|
45
|
+
reline (0.4.2)
|
46
46
|
io-console (~> 0.5)
|
47
47
|
rexml (3.2.6)
|
48
48
|
rspec (3.13.0)
|
@@ -67,14 +67,14 @@ GEM
|
|
67
67
|
rubocop-ast (>= 1.2.0, < 2.0)
|
68
68
|
ruby-progressbar (~> 1.7)
|
69
69
|
unicode-display_width (>= 1.4.0, < 3.0)
|
70
|
-
rubocop-ast (1.
|
71
|
-
parser (>= 3.
|
70
|
+
rubocop-ast (1.30.0)
|
71
|
+
parser (>= 3.2.1.0)
|
72
72
|
ruby-progressbar (1.13.0)
|
73
73
|
unicode-display_width (2.5.0)
|
74
74
|
uri (0.13.0)
|
75
75
|
|
76
76
|
PLATFORMS
|
77
|
-
arm64-darwin-
|
77
|
+
arm64-darwin-21
|
78
78
|
|
79
79
|
DEPENDENCIES
|
80
80
|
carbon_ruby_sdk!
|
@@ -86,4 +86,4 @@ DEPENDENCIES
|
|
86
86
|
rubocop (~> 1.12.1)
|
87
87
|
|
88
88
|
BUNDLED WITH
|
89
|
-
2.
|
89
|
+
2.3.7
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect external data to LLMs, no matter the source.
|
8
8
|
|
9
|
-
[![npm](https://img.shields.io/badge/gem-v0.1.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v0.1.18-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.18)
|
10
10
|
|
11
11
|
</div>
|
12
12
|
|
@@ -80,7 +80,7 @@ Connect external data to LLMs, no matter the source.
|
|
80
80
|
Add to Gemfile:
|
81
81
|
|
82
82
|
```ruby
|
83
|
-
gem 'carbon_ruby_sdk', '~> 0.1.
|
83
|
+
gem 'carbon_ruby_sdk', '~> 0.1.18'
|
84
84
|
```
|
85
85
|
|
86
86
|
## Getting Started<a id="getting-started"></a>
|
@@ -356,6 +356,7 @@ result = carbon.embeddings.get_documents(
|
|
356
356
|
parent_file_ids: [
|
357
357
|
1
|
358
358
|
],
|
359
|
+
include_all_children: false,
|
359
360
|
tags_v2: {
|
360
361
|
},
|
361
362
|
include_tags: true,
|
@@ -397,6 +398,10 @@ Optional list of file IDs to limit the search to
|
|
397
398
|
Optional list of parent file IDs to limit the search to. A parent file describes
|
398
399
|
a file to which another file belongs (e.g. a folder)
|
399
400
|
|
401
|
+
##### include_all_children: `Boolean`<a id="include_all_children-boolean"></a>
|
402
|
+
Flag to control whether or not to include all children of filtered files in the
|
403
|
+
embedding search.
|
404
|
+
|
400
405
|
##### tags_v2: `Object`<a id="tags_v2-object"></a>
|
401
406
|
A set of tags to limit the search to. Use this instead of `tags`, which is
|
402
407
|
deprecated.
|
@@ -1434,7 +1439,7 @@ Enable OCR for files that support it. Supported formats: pdf
|
|
1434
1439
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1435
1440
|
##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
|
1436
1441
|
Enable integration's file picker for sources that support it. Supported sources:
|
1437
|
-
|
1442
|
+
GOOGLE_DRIVE, ONEDRIVE, BOX, SHAREPOINT, DROPBOX
|
1438
1443
|
|
1439
1444
|
#### 🔄 Return<a id="🔄-return"></a>
|
1440
1445
|
|
@@ -119,6 +119,7 @@ module Carbon
|
|
119
119
|
# @param query_vector [Array<Float>] Optional query vector for which to get related chunks and embeddings. It must have been generated by the same model used to generate the embeddings across which the search is being conducted. Cannot provide both `query` and `query_vector`.
|
120
120
|
# @param file_ids [Array<Integer>] Optional list of file IDs to limit the search to
|
121
121
|
# @param parent_file_ids [Array<Integer>] Optional list of parent file IDs to limit the search to. A parent file describes a file to which another file belongs (e.g. a folder)
|
122
|
+
# @param include_all_children [Boolean] Flag to control whether or not to include all children of filtered files in the embedding search.
|
122
123
|
# @param tags_v2 [Object] A set of tags to limit the search to. Use this instead of `tags`, which is deprecated.
|
123
124
|
# @param include_tags [Boolean] Flag to control whether or not to include tags for each chunk in the response.
|
124
125
|
# @param include_vectors [Boolean] Flag to control whether or not to include embedding vectors in the response.
|
@@ -129,7 +130,7 @@ module Carbon
|
|
129
130
|
# @param embedding_model [EmbeddingGeneratorsNullable]
|
130
131
|
# @param body [GetEmbeddingDocumentsBody]
|
131
132
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
132
|
-
def get_documents(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
|
133
|
+
def get_documents(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
|
133
134
|
_body = {}
|
134
135
|
_body[:tags] = tags if tags != SENTINEL
|
135
136
|
_body[:query] = query if query != SENTINEL
|
@@ -137,6 +138,7 @@ module Carbon
|
|
137
138
|
_body[:k] = k if k != SENTINEL
|
138
139
|
_body[:file_ids] = file_ids if file_ids != SENTINEL
|
139
140
|
_body[:parent_file_ids] = parent_file_ids if parent_file_ids != SENTINEL
|
141
|
+
_body[:include_all_children] = include_all_children if include_all_children != SENTINEL
|
140
142
|
_body[:tags_v2] = tags_v2 if tags_v2 != SENTINEL
|
141
143
|
_body[:include_tags] = include_tags if include_tags != SENTINEL
|
142
144
|
_body[:include_vectors] = include_vectors if include_vectors != SENTINEL
|
@@ -253,6 +255,7 @@ module Carbon
|
|
253
255
|
# @param query_vector [Array<Float>] Optional query vector for which to get related chunks and embeddings. It must have been generated by the same model used to generate the embeddings across which the search is being conducted. Cannot provide both `query` and `query_vector`.
|
254
256
|
# @param file_ids [Array<Integer>] Optional list of file IDs to limit the search to
|
255
257
|
# @param parent_file_ids [Array<Integer>] Optional list of parent file IDs to limit the search to. A parent file describes a file to which another file belongs (e.g. a folder)
|
258
|
+
# @param include_all_children [Boolean] Flag to control whether or not to include all children of filtered files in the embedding search.
|
256
259
|
# @param tags_v2 [Object] A set of tags to limit the search to. Use this instead of `tags`, which is deprecated.
|
257
260
|
# @param include_tags [Boolean] Flag to control whether or not to include tags for each chunk in the response.
|
258
261
|
# @param include_vectors [Boolean] Flag to control whether or not to include embedding vectors in the response.
|
@@ -263,7 +266,7 @@ module Carbon
|
|
263
266
|
# @param embedding_model [EmbeddingGeneratorsNullable]
|
264
267
|
# @param body [GetEmbeddingDocumentsBody]
|
265
268
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
266
|
-
def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
|
269
|
+
def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
|
267
270
|
_body = {}
|
268
271
|
_body[:tags] = tags if tags != SENTINEL
|
269
272
|
_body[:query] = query if query != SENTINEL
|
@@ -271,6 +274,7 @@ module Carbon
|
|
271
274
|
_body[:k] = k if k != SENTINEL
|
272
275
|
_body[:file_ids] = file_ids if file_ids != SENTINEL
|
273
276
|
_body[:parent_file_ids] = parent_file_ids if parent_file_ids != SENTINEL
|
277
|
+
_body[:include_all_children] = include_all_children if include_all_children != SENTINEL
|
274
278
|
_body[:tags_v2] = tags_v2 if tags_v2 != SENTINEL
|
275
279
|
_body[:include_tags] = include_tags if include_tags != SENTINEL
|
276
280
|
_body[:include_vectors] = include_vectors if include_vectors != SENTINEL
|
@@ -545,7 +545,7 @@ module Carbon
|
|
545
545
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
546
546
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
547
547
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
548
|
-
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources:
|
548
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: GOOGLE_DRIVE, ONEDRIVE, BOX, SHAREPOINT, DROPBOX
|
549
549
|
# @param body [OAuthURLRequest]
|
550
550
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
551
551
|
def get_oauth_url(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, extra: {})
|
@@ -607,7 +607,7 @@ module Carbon
|
|
607
607
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
608
608
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
609
609
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
610
|
-
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources:
|
610
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: GOOGLE_DRIVE, ONEDRIVE, BOX, SHAREPOINT, DROPBOX
|
611
611
|
# @param body [OAuthURLRequest]
|
612
612
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
613
613
|
def get_oauth_url_with_http_info(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, extra: {})
|
@@ -29,6 +29,9 @@ module Carbon
|
|
29
29
|
# Optional list of parent file IDs to limit the search to. A parent file describes a file to which another file belongs (e.g. a folder)
|
30
30
|
attr_accessor :parent_file_ids
|
31
31
|
|
32
|
+
# Flag to control whether or not to include all children of filtered files in the embedding search.
|
33
|
+
attr_accessor :include_all_children
|
34
|
+
|
32
35
|
# A set of tags to limit the search to. Use this instead of `tags`, which is deprecated.
|
33
36
|
attr_accessor :tags_v2
|
34
37
|
|
@@ -60,6 +63,7 @@ module Carbon
|
|
60
63
|
:'k' => :'k',
|
61
64
|
:'file_ids' => :'file_ids',
|
62
65
|
:'parent_file_ids' => :'parent_file_ids',
|
66
|
+
:'include_all_children' => :'include_all_children',
|
63
67
|
:'tags_v2' => :'tags_v2',
|
64
68
|
:'include_tags' => :'include_tags',
|
65
69
|
:'include_vectors' => :'include_vectors',
|
@@ -85,6 +89,7 @@ module Carbon
|
|
85
89
|
:'k' => :'Integer',
|
86
90
|
:'file_ids' => :'Array<Integer>',
|
87
91
|
:'parent_file_ids' => :'Array<Integer>',
|
92
|
+
:'include_all_children' => :'Boolean',
|
88
93
|
:'tags_v2' => :'Object',
|
89
94
|
:'include_tags' => :'Boolean',
|
90
95
|
:'include_vectors' => :'Boolean',
|
@@ -161,6 +166,12 @@ module Carbon
|
|
161
166
|
end
|
162
167
|
end
|
163
168
|
|
169
|
+
if attributes.key?(:'include_all_children')
|
170
|
+
self.include_all_children = attributes[:'include_all_children']
|
171
|
+
else
|
172
|
+
self.include_all_children = false
|
173
|
+
end
|
174
|
+
|
164
175
|
if attributes.key?(:'tags_v2')
|
165
176
|
self.tags_v2 = attributes[:'tags_v2']
|
166
177
|
end
|
@@ -270,6 +281,7 @@ module Carbon
|
|
270
281
|
k == o.k &&
|
271
282
|
file_ids == o.file_ids &&
|
272
283
|
parent_file_ids == o.parent_file_ids &&
|
284
|
+
include_all_children == o.include_all_children &&
|
273
285
|
tags_v2 == o.tags_v2 &&
|
274
286
|
include_tags == o.include_tags &&
|
275
287
|
include_vectors == o.include_vectors &&
|
@@ -289,7 +301,7 @@ module Carbon
|
|
289
301
|
# Calculates hash code according to all attributes.
|
290
302
|
# @return [Integer] Hash code
|
291
303
|
def hash
|
292
|
-
[tags, query, query_vector, k, file_ids, parent_file_ids, tags_v2, include_tags, include_vectors, include_raw_file, hybrid_search, hybrid_search_tuning_parameters, media_type, embedding_model].hash
|
304
|
+
[tags, query, query_vector, k, file_ids, parent_file_ids, include_all_children, tags_v2, include_tags, include_vectors, include_raw_file, hybrid_search, hybrid_search_tuning_parameters, media_type, embedding_model].hash
|
293
305
|
end
|
294
306
|
|
295
307
|
# Builds the object from hash
|
@@ -61,7 +61,7 @@ module Carbon
|
|
61
61
|
|
62
62
|
attr_accessor :parse_pdf_tables_with_ocr
|
63
63
|
|
64
|
-
# Enable integration's file picker for sources that support it. Supported sources:
|
64
|
+
# Enable integration's file picker for sources that support it. Supported sources: GOOGLE_DRIVE, ONEDRIVE, BOX, SHAREPOINT, DROPBOX
|
65
65
|
attr_accessor :enable_file_picker
|
66
66
|
|
67
67
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -55,6 +55,12 @@ describe Carbon::GetEmbeddingDocumentsBody do
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
describe 'test attribute "include_all_children"' do
|
59
|
+
it 'should work' do
|
60
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
58
64
|
describe 'test attribute "tags_v2"' do
|
59
65
|
it 'should work' do
|
60
66
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carbon_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konfig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -372,7 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
372
372
|
- !ruby/object:Gem::Version
|
373
373
|
version: '0'
|
374
374
|
requirements: []
|
375
|
-
rubygems_version: 3.
|
375
|
+
rubygems_version: 3.3.7
|
376
376
|
signing_key:
|
377
377
|
specification_version: 4
|
378
378
|
summary: Carbon Ruby Gem
|