carbon_ruby_sdk 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +22 -7
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +6 -2
- data/lib/carbon_ruby_sdk/api/files_api.rb +6 -2
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +8 -8
- data/lib/carbon_ruby_sdk/models/delete_files_v2_query_input.rb +16 -4
- data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +18 -5
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +2 -2
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +1 -1
- data/lib/carbon_ruby_sdk/models/sync_options.rb +1 -1
- data/lib/carbon_ruby_sdk/models/user_file.rb +17 -1
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/spec/models/delete_files_v2_query_input_spec.rb +6 -0
- data/spec/models/get_embedding_documents_body_spec.rb +6 -0
- data/spec/models/user_file_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e46e23bcb9933bb4467a940645cf27e79739674f7969d70a655f3ab55bef38c7
|
4
|
+
data.tar.gz: 5cae95c5ebd2db0bcef1291135198008b03b32cd80ec21adb70b5615a61fbac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c36c755ccf4bdf990f59bedd164b2d3e9d8af63ff2ce29c2100c2d82c49df696a1d9f66fc855f05576c31326353f30f68bf88edf43d59f3ec3fe5517780f7f11
|
7
|
+
data.tar.gz: f36a6432f38fcd3e376c9fba1f37f3ec7e8a4b33b9f6daccf67ea753e9b2de9d88f8e4f7b8e20b1a6ab40f33101c48a7c2ab981c513a1e4d71c3117601ba0ab8
|
data/Gemfile.lock
CHANGED
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.2.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v0.2.12-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.12)
|
10
10
|
|
11
11
|
</div>
|
12
12
|
|
@@ -91,7 +91,7 @@ Connect external data to LLMs, no matter the source.
|
|
91
91
|
Add to Gemfile:
|
92
92
|
|
93
93
|
```ruby
|
94
|
-
gem 'carbon_ruby_sdk', '~> 0.2.
|
94
|
+
gem 'carbon_ruby_sdk', '~> 0.2.12'
|
95
95
|
```
|
96
96
|
|
97
97
|
## Getting Started<a id="getting-started"></a>
|
@@ -381,6 +381,7 @@ result = carbon.embeddings.get_documents(
|
|
381
381
|
media_type: "TEXT",
|
382
382
|
embedding_model: "OPENAI",
|
383
383
|
include_file_level_metadata: false,
|
384
|
+
high_accuracy: false,
|
384
385
|
)
|
385
386
|
p result
|
386
387
|
```
|
@@ -439,6 +440,11 @@ Flag to control whether or not to include file-level metadata in the response.
|
|
439
440
|
This metadata will be included in the `content_metadata` field of each document
|
440
441
|
along with chunk/embedding level metadata.
|
441
442
|
|
443
|
+
##### high_accuracy: `Boolean`<a id="high_accuracy-boolean"></a>
|
444
|
+
Flag to control whether or not to perform a high accuracy embedding search. By
|
445
|
+
default, this is set to false. If true, the search may return more accurate
|
446
|
+
results, but may take longer to complete.
|
447
|
+
|
442
448
|
#### 🔄 Return<a id="🔄-return"></a>
|
443
449
|
|
444
450
|
[DocumentResponseList](./lib/carbon_ruby_sdk/models/document_response_list.rb)
|
@@ -748,6 +754,7 @@ result = carbon.files.delete_v2(
|
|
748
754
|
"non_synced_only" => false,
|
749
755
|
},
|
750
756
|
send_webhook: false,
|
757
|
+
preserve_file_record: false,
|
751
758
|
)
|
752
759
|
p result
|
753
760
|
```
|
@@ -756,6 +763,14 @@ p result
|
|
756
763
|
|
757
764
|
##### filters: [`OrganizationUserFilesToSyncFilters`](./lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb)<a id="filters-organizationuserfilestosyncfilterslibcarbon_ruby_sdkmodelsorganization_user_files_to_sync_filtersrb"></a>
|
758
765
|
##### send_webhook: `Boolean`<a id="send_webhook-boolean"></a>
|
766
|
+
##### preserve_file_record: `Boolean`<a id="preserve_file_record-boolean"></a>
|
767
|
+
Whether or not to delete all data related to the file from the database, BUT to
|
768
|
+
preserve the file metadata, allowing for resyncs. By default
|
769
|
+
`preserve_file_record` is false, which means that all data related to the file
|
770
|
+
*as well as* its metadata will be deleted. Note that even if
|
771
|
+
`preserve_file_record` is true, raw files uploaded via the `uploadfile` endpoint
|
772
|
+
still cannot be resynced.
|
773
|
+
|
759
774
|
#### 🔄 Return<a id="🔄-return"></a>
|
760
775
|
|
761
776
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1281,7 +1296,7 @@ result = carbon.integrations.connect_data_source(
|
|
1281
1296
|
"prepend_filename_to_chunks" => false,
|
1282
1297
|
"sync_files_on_connection" => true,
|
1283
1298
|
"set_page_as_boundary" => false,
|
1284
|
-
"request_id" => "
|
1299
|
+
"request_id" => "0210abaa-8c19-4ac6-9c4b-fb856acce902",
|
1285
1300
|
"enable_file_picker" => true,
|
1286
1301
|
"sync_source_items" => true,
|
1287
1302
|
"incremental_sync" => false,
|
@@ -1501,7 +1516,7 @@ result = carbon.integrations.get_oauth_url(
|
|
1501
1516
|
set_page_as_boundary: false,
|
1502
1517
|
data_source_id: 1,
|
1503
1518
|
connecting_new_account: false,
|
1504
|
-
request_id: "
|
1519
|
+
request_id: "1c47fc7c-4c6e-466f-9bf9-979ad9dc87a7",
|
1505
1520
|
use_ocr: false,
|
1506
1521
|
parse_pdf_tables_with_ocr: false,
|
1507
1522
|
enable_file_picker: true,
|
@@ -1562,7 +1577,7 @@ Enable OCR for files that support it. Supported formats: pdf
|
|
1562
1577
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1563
1578
|
##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
|
1564
1579
|
Enable integration's file picker for sources that support it. Supported sources:
|
1565
|
-
|
1580
|
+
GOOGLE_DRIVE, DROPBOX, BOX, ONEDRIVE, SHAREPOINT
|
1566
1581
|
|
1567
1582
|
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1568
1583
|
Enabling this flag will fetch all available content from the source to be listed
|
@@ -1862,7 +1877,7 @@ result = carbon.integrations.sync_confluence(
|
|
1862
1877
|
prepend_filename_to_chunks: false,
|
1863
1878
|
max_items_per_chunk: 1,
|
1864
1879
|
set_page_as_boundary: false,
|
1865
|
-
request_id: "
|
1880
|
+
request_id: "791318ee-229d-4c64-bb0a-2563b8014484",
|
1866
1881
|
use_ocr: false,
|
1867
1882
|
parse_pdf_tables_with_ocr: false,
|
1868
1883
|
incremental_sync: false,
|
@@ -1967,7 +1982,7 @@ result = carbon.integrations.sync_files(
|
|
1967
1982
|
prepend_filename_to_chunks: false,
|
1968
1983
|
max_items_per_chunk: 1,
|
1969
1984
|
set_page_as_boundary: false,
|
1970
|
-
request_id: "
|
1985
|
+
request_id: "791318ee-229d-4c64-bb0a-2563b8014484",
|
1971
1986
|
use_ocr: false,
|
1972
1987
|
parse_pdf_tables_with_ocr: false,
|
1973
1988
|
incremental_sync: false,
|
@@ -129,9 +129,10 @@ module Carbon
|
|
129
129
|
# @param media_type [FileContentTypesNullable]
|
130
130
|
# @param embedding_model [EmbeddingGeneratorsNullable]
|
131
131
|
# @param include_file_level_metadata [Boolean] Flag to control whether or not to include file-level metadata in the response. This metadata will be included in the `content_metadata` field of each document along with chunk/embedding level metadata.
|
132
|
+
# @param high_accuracy [Boolean] Flag to control whether or not to perform a high accuracy embedding search. By default, this is set to false. If true, the search may return more accurate results, but may take longer to complete.
|
132
133
|
# @param body [GetEmbeddingDocumentsBody]
|
133
134
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
134
|
-
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: SENTINEL, embedding_model: 'OPENAI', include_file_level_metadata: false, extra: {})
|
135
|
+
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: SENTINEL, embedding_model: 'OPENAI', include_file_level_metadata: false, high_accuracy: false, extra: {})
|
135
136
|
_body = {}
|
136
137
|
_body[:tags] = tags if tags != SENTINEL
|
137
138
|
_body[:query] = query if query != SENTINEL
|
@@ -149,6 +150,7 @@ module Carbon
|
|
149
150
|
_body[:media_type] = media_type if media_type != SENTINEL
|
150
151
|
_body[:embedding_model] = embedding_model if embedding_model != SENTINEL
|
151
152
|
_body[:include_file_level_metadata] = include_file_level_metadata if include_file_level_metadata != SENTINEL
|
153
|
+
_body[:high_accuracy] = high_accuracy if high_accuracy != SENTINEL
|
152
154
|
get_embedding_documents_body = _body
|
153
155
|
api_response = get_documents_with_http_info_impl(get_embedding_documents_body, extra)
|
154
156
|
api_response.data
|
@@ -267,9 +269,10 @@ module Carbon
|
|
267
269
|
# @param media_type [FileContentTypesNullable]
|
268
270
|
# @param embedding_model [EmbeddingGeneratorsNullable]
|
269
271
|
# @param include_file_level_metadata [Boolean] Flag to control whether or not to include file-level metadata in the response. This metadata will be included in the `content_metadata` field of each document along with chunk/embedding level metadata.
|
272
|
+
# @param high_accuracy [Boolean] Flag to control whether or not to perform a high accuracy embedding search. By default, this is set to false. If true, the search may return more accurate results, but may take longer to complete.
|
270
273
|
# @param body [GetEmbeddingDocumentsBody]
|
271
274
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
272
|
-
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: SENTINEL, embedding_model: 'OPENAI', include_file_level_metadata: false, extra: {})
|
275
|
+
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: SENTINEL, embedding_model: 'OPENAI', include_file_level_metadata: false, high_accuracy: false, extra: {})
|
273
276
|
_body = {}
|
274
277
|
_body[:tags] = tags if tags != SENTINEL
|
275
278
|
_body[:query] = query if query != SENTINEL
|
@@ -287,6 +290,7 @@ module Carbon
|
|
287
290
|
_body[:media_type] = media_type if media_type != SENTINEL
|
288
291
|
_body[:embedding_model] = embedding_model if embedding_model != SENTINEL
|
289
292
|
_body[:include_file_level_metadata] = include_file_level_metadata if include_file_level_metadata != SENTINEL
|
293
|
+
_body[:high_accuracy] = high_accuracy if high_accuracy != SENTINEL
|
290
294
|
get_embedding_documents_body = _body
|
291
295
|
get_documents_with_http_info_impl(get_embedding_documents_body, extra)
|
292
296
|
end
|
@@ -425,12 +425,14 @@ module Carbon
|
|
425
425
|
#
|
426
426
|
# @param filters [OrganizationUserFilesToSyncFilters]
|
427
427
|
# @param send_webhook [Boolean]
|
428
|
+
# @param preserve_file_record [Boolean] Whether or not to delete all data related to the file from the database, BUT to preserve the file metadata, allowing for resyncs. By default `preserve_file_record` is false, which means that all data related to the file *as well as* its metadata will be deleted. Note that even if `preserve_file_record` is true, raw files uploaded via the `uploadfile` endpoint still cannot be resynced.
|
428
429
|
# @param body [DeleteFilesV2QueryInput]
|
429
430
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
430
|
-
def delete_v2(filters: SENTINEL, send_webhook: false, extra: {})
|
431
|
+
def delete_v2(filters: SENTINEL, send_webhook: false, preserve_file_record: false, extra: {})
|
431
432
|
_body = {}
|
432
433
|
_body[:filters] = filters if filters != SENTINEL
|
433
434
|
_body[:send_webhook] = send_webhook if send_webhook != SENTINEL
|
435
|
+
_body[:preserve_file_record] = preserve_file_record if preserve_file_record != SENTINEL
|
434
436
|
delete_files_v2_query_input = _body
|
435
437
|
api_response = delete_v2_with_http_info_impl(delete_files_v2_query_input, extra)
|
436
438
|
api_response.data
|
@@ -440,12 +442,14 @@ module Carbon
|
|
440
442
|
#
|
441
443
|
# @param filters [OrganizationUserFilesToSyncFilters]
|
442
444
|
# @param send_webhook [Boolean]
|
445
|
+
# @param preserve_file_record [Boolean] Whether or not to delete all data related to the file from the database, BUT to preserve the file metadata, allowing for resyncs. By default `preserve_file_record` is false, which means that all data related to the file *as well as* its metadata will be deleted. Note that even if `preserve_file_record` is true, raw files uploaded via the `uploadfile` endpoint still cannot be resynced.
|
443
446
|
# @param body [DeleteFilesV2QueryInput]
|
444
447
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
445
|
-
def delete_v2_with_http_info(filters: SENTINEL, send_webhook: false, extra: {})
|
448
|
+
def delete_v2_with_http_info(filters: SENTINEL, send_webhook: false, preserve_file_record: false, extra: {})
|
446
449
|
_body = {}
|
447
450
|
_body[:filters] = filters if filters != SENTINEL
|
448
451
|
_body[:send_webhook] = send_webhook if send_webhook != SENTINEL
|
452
|
+
_body[:preserve_file_record] = preserve_file_record if preserve_file_record != SENTINEL
|
449
453
|
delete_files_v2_query_input = _body
|
450
454
|
delete_v2_with_http_info_impl(delete_files_v2_query_input, extra)
|
451
455
|
end
|
@@ -653,13 +653,13 @@ module Carbon
|
|
653
653
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
654
654
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
655
655
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
656
|
-
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources:
|
656
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: GOOGLE_DRIVE, DROPBOX, BOX, ONEDRIVE, SHAREPOINT
|
657
657
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
658
658
|
# @param incremental_sync [Boolean] Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX, INTERCOM, GMAIL, OUTLOOK. It will be ignored for other data sources.
|
659
659
|
# @param file_sync_config [FileSyncConfigNullable]
|
660
660
|
# @param body [OAuthURLRequest]
|
661
661
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
662
|
-
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: '
|
662
|
+
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: '1c47fc7c-4c6e-466f-9bf9-979ad9dc87a7', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
|
663
663
|
_body = {}
|
664
664
|
_body[:tags] = tags if tags != SENTINEL
|
665
665
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -721,13 +721,13 @@ module Carbon
|
|
721
721
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
722
722
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
723
723
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
724
|
-
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources:
|
724
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: GOOGLE_DRIVE, DROPBOX, BOX, ONEDRIVE, SHAREPOINT
|
725
725
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
726
726
|
# @param incremental_sync [Boolean] Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX, INTERCOM, GMAIL, OUTLOOK. It will be ignored for other data sources.
|
727
727
|
# @param file_sync_config [FileSyncConfigNullable]
|
728
728
|
# @param body [OAuthURLRequest]
|
729
729
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
730
|
-
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: '
|
730
|
+
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: '1c47fc7c-4c6e-466f-9bf9-979ad9dc87a7', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
|
731
731
|
_body = {}
|
732
732
|
_body[:tags] = tags if tags != SENTINEL
|
733
733
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -1640,7 +1640,7 @@ module Carbon
|
|
1640
1640
|
# @param file_sync_config [FileSyncConfigNullable]
|
1641
1641
|
# @param body [SyncFilesRequest]
|
1642
1642
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1643
|
-
def sync_confluence(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '
|
1643
|
+
def sync_confluence(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '791318ee-229d-4c64-bb0a-2563b8014484', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
|
1644
1644
|
_body = {}
|
1645
1645
|
_body[:tags] = tags if tags != SENTINEL
|
1646
1646
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1688,7 +1688,7 @@ module Carbon
|
|
1688
1688
|
# @param file_sync_config [FileSyncConfigNullable]
|
1689
1689
|
# @param body [SyncFilesRequest]
|
1690
1690
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1691
|
-
def sync_confluence_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '
|
1691
|
+
def sync_confluence_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '791318ee-229d-4c64-bb0a-2563b8014484', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
|
1692
1692
|
_body = {}
|
1693
1693
|
_body[:tags] = tags if tags != SENTINEL
|
1694
1694
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1896,7 +1896,7 @@ module Carbon
|
|
1896
1896
|
# @param file_sync_config [FileSyncConfigNullable]
|
1897
1897
|
# @param body [SyncFilesRequest]
|
1898
1898
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1899
|
-
def sync_files(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '
|
1899
|
+
def sync_files(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '791318ee-229d-4c64-bb0a-2563b8014484', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
|
1900
1900
|
_body = {}
|
1901
1901
|
_body[:tags] = tags if tags != SENTINEL
|
1902
1902
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1944,7 +1944,7 @@ module Carbon
|
|
1944
1944
|
# @param file_sync_config [FileSyncConfigNullable]
|
1945
1945
|
# @param body [SyncFilesRequest]
|
1946
1946
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1947
|
-
def sync_files_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '
|
1947
|
+
def sync_files_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '791318ee-229d-4c64-bb0a-2563b8014484', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
|
1948
1948
|
_body = {}
|
1949
1949
|
_body[:tags] = tags if tags != SENTINEL
|
1950
1950
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -15,11 +15,15 @@ module Carbon
|
|
15
15
|
|
16
16
|
attr_accessor :send_webhook
|
17
17
|
|
18
|
+
# Whether or not to delete all data related to the file from the database, BUT to preserve the file metadata, allowing for resyncs. By default `preserve_file_record` is false, which means that all data related to the file *as well as* its metadata will be deleted. Note that even if `preserve_file_record` is true, raw files uploaded via the `uploadfile` endpoint still cannot be resynced.
|
19
|
+
attr_accessor :preserve_file_record
|
20
|
+
|
18
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
22
|
def self.attribute_map
|
20
23
|
{
|
21
24
|
:'filters' => :'filters',
|
22
|
-
:'send_webhook' => :'send_webhook'
|
25
|
+
:'send_webhook' => :'send_webhook',
|
26
|
+
:'preserve_file_record' => :'preserve_file_record'
|
23
27
|
}
|
24
28
|
end
|
25
29
|
|
@@ -32,7 +36,8 @@ module Carbon
|
|
32
36
|
def self.openapi_types
|
33
37
|
{
|
34
38
|
:'filters' => :'OrganizationUserFilesToSyncFilters',
|
35
|
-
:'send_webhook' => :'Boolean'
|
39
|
+
:'send_webhook' => :'Boolean',
|
40
|
+
:'preserve_file_record' => :'Boolean'
|
36
41
|
}
|
37
42
|
end
|
38
43
|
|
@@ -66,6 +71,12 @@ module Carbon
|
|
66
71
|
else
|
67
72
|
self.send_webhook = false
|
68
73
|
end
|
74
|
+
|
75
|
+
if attributes.key?(:'preserve_file_record')
|
76
|
+
self.preserve_file_record = attributes[:'preserve_file_record']
|
77
|
+
else
|
78
|
+
self.preserve_file_record = false
|
79
|
+
end
|
69
80
|
end
|
70
81
|
|
71
82
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -87,7 +98,8 @@ module Carbon
|
|
87
98
|
return true if self.equal?(o)
|
88
99
|
self.class == o.class &&
|
89
100
|
filters == o.filters &&
|
90
|
-
send_webhook == o.send_webhook
|
101
|
+
send_webhook == o.send_webhook &&
|
102
|
+
preserve_file_record == o.preserve_file_record
|
91
103
|
end
|
92
104
|
|
93
105
|
# @see the `==` method
|
@@ -99,7 +111,7 @@ module Carbon
|
|
99
111
|
# Calculates hash code according to all attributes.
|
100
112
|
# @return [Integer] Hash code
|
101
113
|
def hash
|
102
|
-
[filters, send_webhook].hash
|
114
|
+
[filters, send_webhook, preserve_file_record].hash
|
103
115
|
end
|
104
116
|
|
105
117
|
# Builds the object from hash
|
@@ -56,6 +56,9 @@ module Carbon
|
|
56
56
|
# Flag to control whether or not to include file-level metadata in the response. This metadata will be included in the `content_metadata` field of each document along with chunk/embedding level metadata.
|
57
57
|
attr_accessor :include_file_level_metadata
|
58
58
|
|
59
|
+
# Flag to control whether or not to perform a high accuracy embedding search. By default, this is set to false. If true, the search may return more accurate results, but may take longer to complete.
|
60
|
+
attr_accessor :high_accuracy
|
61
|
+
|
59
62
|
# Attribute mapping from ruby-style variable name to JSON key.
|
60
63
|
def self.attribute_map
|
61
64
|
{
|
@@ -74,7 +77,8 @@ module Carbon
|
|
74
77
|
:'hybrid_search_tuning_parameters' => :'hybrid_search_tuning_parameters',
|
75
78
|
:'media_type' => :'media_type',
|
76
79
|
:'embedding_model' => :'embedding_model',
|
77
|
-
:'include_file_level_metadata' => :'include_file_level_metadata'
|
80
|
+
:'include_file_level_metadata' => :'include_file_level_metadata',
|
81
|
+
:'high_accuracy' => :'high_accuracy'
|
78
82
|
}
|
79
83
|
end
|
80
84
|
|
@@ -101,7 +105,8 @@ module Carbon
|
|
101
105
|
:'hybrid_search_tuning_parameters' => :'HybridSearchTuningParamsNullable',
|
102
106
|
:'media_type' => :'FileContentTypesNullable',
|
103
107
|
:'embedding_model' => :'EmbeddingGeneratorsNullable',
|
104
|
-
:'include_file_level_metadata' => :'Boolean'
|
108
|
+
:'include_file_level_metadata' => :'Boolean',
|
109
|
+
:'high_accuracy' => :'Boolean'
|
105
110
|
}
|
106
111
|
end
|
107
112
|
|
@@ -120,7 +125,8 @@ module Carbon
|
|
120
125
|
:'hybrid_search_tuning_parameters',
|
121
126
|
:'media_type',
|
122
127
|
:'embedding_model',
|
123
|
-
:'include_file_level_metadata'
|
128
|
+
:'include_file_level_metadata',
|
129
|
+
:'high_accuracy'
|
124
130
|
])
|
125
131
|
end
|
126
132
|
|
@@ -216,6 +222,12 @@ module Carbon
|
|
216
222
|
else
|
217
223
|
self.include_file_level_metadata = false
|
218
224
|
end
|
225
|
+
|
226
|
+
if attributes.key?(:'high_accuracy')
|
227
|
+
self.high_accuracy = attributes[:'high_accuracy']
|
228
|
+
else
|
229
|
+
self.high_accuracy = false
|
230
|
+
end
|
219
231
|
end
|
220
232
|
|
221
233
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -299,7 +311,8 @@ module Carbon
|
|
299
311
|
hybrid_search_tuning_parameters == o.hybrid_search_tuning_parameters &&
|
300
312
|
media_type == o.media_type &&
|
301
313
|
embedding_model == o.embedding_model &&
|
302
|
-
include_file_level_metadata == o.include_file_level_metadata
|
314
|
+
include_file_level_metadata == o.include_file_level_metadata &&
|
315
|
+
high_accuracy == o.high_accuracy
|
303
316
|
end
|
304
317
|
|
305
318
|
# @see the `==` method
|
@@ -311,7 +324,7 @@ module Carbon
|
|
311
324
|
# Calculates hash code according to all attributes.
|
312
325
|
# @return [Integer] Hash code
|
313
326
|
def hash
|
314
|
-
[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, include_file_level_metadata].hash
|
327
|
+
[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, include_file_level_metadata, high_accuracy].hash
|
315
328
|
end
|
316
329
|
|
317
330
|
# 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, DROPBOX, BOX, ONEDRIVE, SHAREPOINT
|
65
65
|
attr_accessor :enable_file_picker
|
66
66
|
|
67
67
|
# Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
@@ -279,7 +279,7 @@ module Carbon
|
|
279
279
|
if attributes.key?(:'request_id')
|
280
280
|
self.request_id = attributes[:'request_id']
|
281
281
|
else
|
282
|
-
self.request_id = '
|
282
|
+
self.request_id = '1c47fc7c-4c6e-466f-9bf9-979ad9dc87a7'
|
283
283
|
end
|
284
284
|
|
285
285
|
if attributes.key?(:'use_ocr')
|
@@ -187,7 +187,7 @@ module Carbon
|
|
187
187
|
if attributes.key?(:'request_id')
|
188
188
|
self.request_id = attributes[:'request_id']
|
189
189
|
else
|
190
|
-
self.request_id = '
|
190
|
+
self.request_id = '791318ee-229d-4c64-bb0a-2563b8014484'
|
191
191
|
end
|
192
192
|
|
193
193
|
if attributes.key?(:'use_ocr')
|
@@ -182,7 +182,7 @@ module Carbon
|
|
182
182
|
if attributes.key?(:'request_id')
|
183
183
|
self.request_id = attributes[:'request_id']
|
184
184
|
else
|
185
|
-
self.request_id = '
|
185
|
+
self.request_id = '0210abaa-8c19-4ac6-9c4b-fb856acce902'
|
186
186
|
end
|
187
187
|
|
188
188
|
if attributes.key?(:'enable_file_picker')
|
@@ -73,6 +73,8 @@ module Carbon
|
|
73
73
|
|
74
74
|
attr_accessor :messages_metadata
|
75
75
|
|
76
|
+
attr_accessor :file_contents_deleted
|
77
|
+
|
76
78
|
attr_accessor :created_at
|
77
79
|
|
78
80
|
attr_accessor :updated_at
|
@@ -111,6 +113,7 @@ module Carbon
|
|
111
113
|
:'request_id' => :'request_id',
|
112
114
|
:'sync_properties' => :'sync_properties',
|
113
115
|
:'messages_metadata' => :'messages_metadata',
|
116
|
+
:'file_contents_deleted' => :'file_contents_deleted',
|
114
117
|
:'created_at' => :'created_at',
|
115
118
|
:'updated_at' => :'updated_at'
|
116
119
|
}
|
@@ -155,6 +158,7 @@ module Carbon
|
|
155
158
|
:'request_id' => :'String',
|
156
159
|
:'sync_properties' => :'Object',
|
157
160
|
:'messages_metadata' => :'Object',
|
161
|
+
:'file_contents_deleted' => :'Boolean',
|
158
162
|
:'created_at' => :'Time',
|
159
163
|
:'updated_at' => :'Time'
|
160
164
|
}
|
@@ -328,6 +332,12 @@ module Carbon
|
|
328
332
|
self.messages_metadata = attributes[:'messages_metadata']
|
329
333
|
end
|
330
334
|
|
335
|
+
if attributes.key?(:'file_contents_deleted')
|
336
|
+
self.file_contents_deleted = attributes[:'file_contents_deleted']
|
337
|
+
else
|
338
|
+
self.file_contents_deleted = false
|
339
|
+
end
|
340
|
+
|
331
341
|
if attributes.key?(:'created_at')
|
332
342
|
self.created_at = attributes[:'created_at']
|
333
343
|
end
|
@@ -381,6 +391,10 @@ module Carbon
|
|
381
391
|
invalid_properties.push('invalid value for "messages_metadata", messages_metadata cannot be nil.')
|
382
392
|
end
|
383
393
|
|
394
|
+
if @file_contents_deleted.nil?
|
395
|
+
invalid_properties.push('invalid value for "file_contents_deleted", file_contents_deleted cannot be nil.')
|
396
|
+
end
|
397
|
+
|
384
398
|
if @created_at.nil?
|
385
399
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
386
400
|
end
|
@@ -405,6 +419,7 @@ module Carbon
|
|
405
419
|
return false if @skip_embedding_generation.nil?
|
406
420
|
return false if @sync_properties.nil?
|
407
421
|
return false if @messages_metadata.nil?
|
422
|
+
return false if @file_contents_deleted.nil?
|
408
423
|
return false if @created_at.nil?
|
409
424
|
return false if @updated_at.nil?
|
410
425
|
true
|
@@ -446,6 +461,7 @@ module Carbon
|
|
446
461
|
request_id == o.request_id &&
|
447
462
|
sync_properties == o.sync_properties &&
|
448
463
|
messages_metadata == o.messages_metadata &&
|
464
|
+
file_contents_deleted == o.file_contents_deleted &&
|
449
465
|
created_at == o.created_at &&
|
450
466
|
updated_at == o.updated_at
|
451
467
|
end
|
@@ -459,7 +475,7 @@ module Carbon
|
|
459
475
|
# Calculates hash code according to all attributes.
|
460
476
|
# @return [Integer] Hash code
|
461
477
|
def hash
|
462
|
-
[tags, id, source, organization_id, organization_supplied_user_id, organization_user_data_source_id, external_file_id, external_url, sync_status, sync_error_message, last_sync, file_statistics, file_metadata, embedding_properties, chunk_size, chunk_overlap, chunk_properties, ocr_properties, ocr_job_started_at, name, parent_id, enable_auto_sync, presigned_url, parsed_text_url, additional_presigned_urls, skip_embedding_generation, source_created_at, generate_sparse_vectors, request_id, sync_properties, messages_metadata, created_at, updated_at].hash
|
478
|
+
[tags, id, source, organization_id, organization_supplied_user_id, organization_user_data_source_id, external_file_id, external_url, sync_status, sync_error_message, last_sync, file_statistics, file_metadata, embedding_properties, chunk_size, chunk_overlap, chunk_properties, ocr_properties, ocr_job_started_at, name, parent_id, enable_auto_sync, presigned_url, parsed_text_url, additional_presigned_urls, skip_embedding_generation, source_created_at, generate_sparse_vectors, request_id, sync_properties, messages_metadata, file_contents_deleted, created_at, updated_at].hash
|
463
479
|
end
|
464
480
|
|
465
481
|
# Builds the object from hash
|
@@ -31,4 +31,10 @@ describe Carbon::DeleteFilesV2QueryInput do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
describe 'test attribute "preserve_file_record"' do
|
35
|
+
it 'should work' do
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
34
40
|
end
|
@@ -115,4 +115,10 @@ describe Carbon::GetEmbeddingDocumentsBody do
|
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
|
+
describe 'test attribute "high_accuracy"' do
|
119
|
+
it 'should work' do
|
120
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
118
124
|
end
|
@@ -205,6 +205,12 @@ describe Carbon::UserFile do
|
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
208
|
+
describe 'test attribute "file_contents_deleted"' do
|
209
|
+
it 'should work' do
|
210
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
208
214
|
describe 'test attribute "created_at"' do
|
209
215
|
it 'should work' do
|
210
216
|
# 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.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konfig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|