carbon_ruby_sdk 0.1.25 → 0.1.27
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/Gemfile.lock +1 -1
- data/README.md +31 -7
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +1 -1
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +24 -8
- data/lib/carbon_ruby_sdk/models/file_formats.rb +2 -1
- data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/helpdesk_file_sync_config.rb +228 -0
- data/lib/carbon_ruby_sdk/models/helpdesk_file_sync_config_nullable.rb +229 -0
- data/lib/carbon_ruby_sdk/models/helpdesk_file_types.rb +36 -0
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +28 -6
- data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +16 -5
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +18 -6
- data/lib/carbon_ruby_sdk/models/sync_options.rb +27 -5
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +3 -0
- data/spec/models/helpdesk_file_sync_config_nullable_spec.rb +34 -0
- data/spec/models/helpdesk_file_sync_config_spec.rb +34 -0
- data/spec/models/helpdesk_file_types_spec.rb +22 -0
- data/spec/models/o_auth_url_request_spec.rb +12 -0
- data/spec/models/organization_user_files_to_sync_filters_spec.rb +6 -0
- data/spec/models/sync_files_request_spec.rb +6 -0
- data/spec/models/sync_options_spec.rb +12 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ac9daf22135c068fcd84189709ef118201beb9d4eab590bf898a4026056e98c
|
4
|
+
data.tar.gz: 041716ceb046ef931db5d67446d7a44862af32197c41420c8167aec333e5d66c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 555efe547b71f4c34487c10e6d648273f8222fcf4aae49c3c0764734716aef951ec18e87e8dfd7060977668ccc20036c4a13a84b3f5baa7e2bb5a2afebfb3cbb
|
7
|
+
data.tar.gz: 147ab93158e1bd2d89175f692c2512bd55f88cb16e8437675fbf3e26bf4ce1a365fd665715241f0dec61cb0252aefcbb42d69edc13d88cf36c3f8d0b87c0edc4
|
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
|
-
[](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.27)
|
10
10
|
|
11
11
|
</div>
|
12
12
|
|
@@ -84,7 +84,7 @@ Connect external data to LLMs, no matter the source.
|
|
84
84
|
Add to Gemfile:
|
85
85
|
|
86
86
|
```ruby
|
87
|
-
gem 'carbon_ruby_sdk', '~> 0.1.
|
87
|
+
gem 'carbon_ruby_sdk', '~> 0.1.27'
|
88
88
|
```
|
89
89
|
|
90
90
|
## Getting Started<a id="getting-started"></a>
|
@@ -1197,9 +1197,10 @@ result = carbon.integrations.connect_data_source(
|
|
1197
1197
|
"prepend_filename_to_chunks" => false,
|
1198
1198
|
"sync_files_on_connection" => true,
|
1199
1199
|
"set_page_as_boundary" => false,
|
1200
|
-
"request_id" => "
|
1200
|
+
"request_id" => "b9a72b38-115a-4dd6-bad9-00185ae2333b",
|
1201
1201
|
"enable_file_picker" => true,
|
1202
1202
|
"sync_source_items" => true,
|
1203
|
+
"incremental_sync" => false,
|
1203
1204
|
},
|
1204
1205
|
)
|
1205
1206
|
p result
|
@@ -1409,11 +1410,16 @@ result = carbon.integrations.get_oauth_url(
|
|
1409
1410
|
set_page_as_boundary: false,
|
1410
1411
|
data_source_id: 1,
|
1411
1412
|
connecting_new_account: false,
|
1412
|
-
request_id: "
|
1413
|
+
request_id: "444e3f13-e490-4cc0-9cba-48957104083d",
|
1413
1414
|
use_ocr: false,
|
1414
1415
|
parse_pdf_tables_with_ocr: false,
|
1415
1416
|
enable_file_picker: true,
|
1416
1417
|
sync_source_items: true,
|
1418
|
+
incremental_sync: false,
|
1419
|
+
file_sync_config: {
|
1420
|
+
"file_types" => ["ARTICLE"],
|
1421
|
+
"sync_attachments" => false,
|
1422
|
+
},
|
1417
1423
|
)
|
1418
1424
|
p result
|
1419
1425
|
```
|
@@ -1463,12 +1469,18 @@ Enable OCR for files that support it. Supported formats: pdf
|
|
1463
1469
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1464
1470
|
##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
|
1465
1471
|
Enable integration's file picker for sources that support it. Supported sources:
|
1466
|
-
BOX, SHAREPOINT,
|
1472
|
+
BOX, SHAREPOINT, GOOGLE_DRIVE, DROPBOX, ONEDRIVE
|
1467
1473
|
|
1468
1474
|
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1469
1475
|
Enabling this flag will fetch all available content from the source to be listed
|
1470
1476
|
via list items endpoint
|
1471
1477
|
|
1478
|
+
##### incremental_sync: `Boolean`<a id="incremental_sync-boolean"></a>
|
1479
|
+
Only sync files if they have not already been synced or if the embedding
|
1480
|
+
properties have changed. This flag is currently supported by ONEDRIVE,
|
1481
|
+
GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
|
1482
|
+
|
1483
|
+
##### file_sync_config: [`HelpdeskFileSyncConfigNullable`](./lib/carbon_ruby_sdk/models/helpdesk_file_sync_config_nullable.rb)<a id="file_sync_config-helpdeskfilesyncconfignullablelibcarbon_ruby_sdkmodelshelpdesk_file_sync_config_nullablerb"></a>
|
1472
1484
|
#### 🔄 Return<a id="🔄-return"></a>
|
1473
1485
|
|
1474
1486
|
[OuthURLResponse](./lib/carbon_ruby_sdk/models/outh_url_response.rb)
|
@@ -1719,9 +1731,10 @@ result = carbon.integrations.sync_confluence(
|
|
1719
1731
|
prepend_filename_to_chunks: false,
|
1720
1732
|
max_items_per_chunk: 1,
|
1721
1733
|
set_page_as_boundary: false,
|
1722
|
-
request_id: "
|
1734
|
+
request_id: "a5c6b913-12ce-4ae5-af61-694dd5c400fc",
|
1723
1735
|
use_ocr: false,
|
1724
1736
|
parse_pdf_tables_with_ocr: false,
|
1737
|
+
incremental_sync: false,
|
1725
1738
|
)
|
1726
1739
|
p result
|
1727
1740
|
```
|
@@ -1744,6 +1757,11 @@ Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
|
1744
1757
|
##### request_id: `String`<a id="request_id-string"></a>
|
1745
1758
|
##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
|
1746
1759
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1760
|
+
##### incremental_sync: `Boolean`<a id="incremental_sync-boolean"></a>
|
1761
|
+
Only sync files if they have not already been synced or if the embedding
|
1762
|
+
properties have changed. This flag is currently supported by ONEDRIVE,
|
1763
|
+
GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
|
1764
|
+
|
1747
1765
|
#### 🔄 Return<a id="🔄-return"></a>
|
1748
1766
|
|
1749
1767
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1810,9 +1828,10 @@ result = carbon.integrations.sync_files(
|
|
1810
1828
|
prepend_filename_to_chunks: false,
|
1811
1829
|
max_items_per_chunk: 1,
|
1812
1830
|
set_page_as_boundary: false,
|
1813
|
-
request_id: "
|
1831
|
+
request_id: "a5c6b913-12ce-4ae5-af61-694dd5c400fc",
|
1814
1832
|
use_ocr: false,
|
1815
1833
|
parse_pdf_tables_with_ocr: false,
|
1834
|
+
incremental_sync: false,
|
1816
1835
|
)
|
1817
1836
|
p result
|
1818
1837
|
```
|
@@ -1835,6 +1854,11 @@ Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
|
1835
1854
|
##### request_id: `String`<a id="request_id-string"></a>
|
1836
1855
|
##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
|
1837
1856
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1857
|
+
##### incremental_sync: `Boolean`<a id="incremental_sync-boolean"></a>
|
1858
|
+
Only sync files if they have not already been synced or if the embedding
|
1859
|
+
properties have changed. This flag is currently supported by ONEDRIVE,
|
1860
|
+
GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
|
1861
|
+
|
1838
1862
|
#### 🔄 Return<a id="🔄-return"></a>
|
1839
1863
|
|
1840
1864
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -336,7 +336,7 @@ module Carbon
|
|
336
336
|
return_type = opts[:debug_return_type] || 'DocumentResponseList'
|
337
337
|
|
338
338
|
# auth_names
|
339
|
-
auth_names = opts[:debug_auth_names] || [
|
339
|
+
auth_names = opts[:debug_auth_names] || []
|
340
340
|
|
341
341
|
new_options = opts.merge(
|
342
342
|
:operation => :"EmbeddingsApi.get_documents",
|
@@ -557,11 +557,13 @@ module Carbon
|
|
557
557
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
558
558
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
559
559
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
560
|
-
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, SHAREPOINT,
|
560
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, SHAREPOINT, GOOGLE_DRIVE, DROPBOX, ONEDRIVE
|
561
561
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
562
|
+
# @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. It will be ignored for other data sources.
|
563
|
+
# @param file_sync_config [HelpdeskFileSyncConfigNullable]
|
562
564
|
# @param body [OAuthURLRequest]
|
563
565
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
564
|
-
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: '
|
566
|
+
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: '444e3f13-e490-4cc0-9cba-48957104083d', 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: {})
|
565
567
|
_body = {}
|
566
568
|
_body[:tags] = tags if tags != SENTINEL
|
567
569
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -587,6 +589,8 @@ module Carbon
|
|
587
589
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
588
590
|
_body[:enable_file_picker] = enable_file_picker if enable_file_picker != SENTINEL
|
589
591
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
592
|
+
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
593
|
+
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
590
594
|
o_auth_url_request = _body
|
591
595
|
api_response = get_oauth_url_with_http_info_impl(o_auth_url_request, extra)
|
592
596
|
api_response.data
|
@@ -621,11 +625,13 @@ module Carbon
|
|
621
625
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
622
626
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
623
627
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
624
|
-
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, SHAREPOINT,
|
628
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, SHAREPOINT, GOOGLE_DRIVE, DROPBOX, ONEDRIVE
|
625
629
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
630
|
+
# @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. It will be ignored for other data sources.
|
631
|
+
# @param file_sync_config [HelpdeskFileSyncConfigNullable]
|
626
632
|
# @param body [OAuthURLRequest]
|
627
633
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
628
|
-
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: '
|
634
|
+
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: '444e3f13-e490-4cc0-9cba-48957104083d', 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: {})
|
629
635
|
_body = {}
|
630
636
|
_body[:tags] = tags if tags != SENTINEL
|
631
637
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -651,6 +657,8 @@ module Carbon
|
|
651
657
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
652
658
|
_body[:enable_file_picker] = enable_file_picker if enable_file_picker != SENTINEL
|
653
659
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
660
|
+
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
661
|
+
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
654
662
|
o_auth_url_request = _body
|
655
663
|
get_oauth_url_with_http_info_impl(o_auth_url_request, extra)
|
656
664
|
end
|
@@ -1415,9 +1423,10 @@ module Carbon
|
|
1415
1423
|
# @param request_id [String]
|
1416
1424
|
# @param use_ocr [Boolean]
|
1417
1425
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
1426
|
+
# @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. It will be ignored for other data sources.
|
1418
1427
|
# @param body [SyncFilesRequest]
|
1419
1428
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1420
|
-
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: '
|
1429
|
+
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: 'a5c6b913-12ce-4ae5-af61-694dd5c400fc', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, extra: {})
|
1421
1430
|
_body = {}
|
1422
1431
|
_body[:tags] = tags if tags != SENTINEL
|
1423
1432
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1433,6 +1442,7 @@ module Carbon
|
|
1433
1442
|
_body[:request_id] = request_id if request_id != SENTINEL
|
1434
1443
|
_body[:use_ocr] = use_ocr if use_ocr != SENTINEL
|
1435
1444
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1445
|
+
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
1436
1446
|
sync_files_request = _body
|
1437
1447
|
api_response = sync_confluence_with_http_info_impl(sync_files_request, extra)
|
1438
1448
|
api_response.data
|
@@ -1459,9 +1469,10 @@ module Carbon
|
|
1459
1469
|
# @param request_id [String]
|
1460
1470
|
# @param use_ocr [Boolean]
|
1461
1471
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
1472
|
+
# @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. It will be ignored for other data sources.
|
1462
1473
|
# @param body [SyncFilesRequest]
|
1463
1474
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1464
|
-
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: '
|
1475
|
+
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: 'a5c6b913-12ce-4ae5-af61-694dd5c400fc', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, extra: {})
|
1465
1476
|
_body = {}
|
1466
1477
|
_body[:tags] = tags if tags != SENTINEL
|
1467
1478
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1477,6 +1488,7 @@ module Carbon
|
|
1477
1488
|
_body[:request_id] = request_id if request_id != SENTINEL
|
1478
1489
|
_body[:use_ocr] = use_ocr if use_ocr != SENTINEL
|
1479
1490
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1491
|
+
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
1480
1492
|
sync_files_request = _body
|
1481
1493
|
sync_confluence_with_http_info_impl(sync_files_request, extra)
|
1482
1494
|
end
|
@@ -1663,9 +1675,10 @@ module Carbon
|
|
1663
1675
|
# @param request_id [String]
|
1664
1676
|
# @param use_ocr [Boolean]
|
1665
1677
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
1678
|
+
# @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. It will be ignored for other data sources.
|
1666
1679
|
# @param body [SyncFilesRequest]
|
1667
1680
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1668
|
-
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: '
|
1681
|
+
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: 'a5c6b913-12ce-4ae5-af61-694dd5c400fc', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, extra: {})
|
1669
1682
|
_body = {}
|
1670
1683
|
_body[:tags] = tags if tags != SENTINEL
|
1671
1684
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1681,6 +1694,7 @@ module Carbon
|
|
1681
1694
|
_body[:request_id] = request_id if request_id != SENTINEL
|
1682
1695
|
_body[:use_ocr] = use_ocr if use_ocr != SENTINEL
|
1683
1696
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1697
|
+
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
1684
1698
|
sync_files_request = _body
|
1685
1699
|
api_response = sync_files_with_http_info_impl(sync_files_request, extra)
|
1686
1700
|
api_response.data
|
@@ -1707,9 +1721,10 @@ module Carbon
|
|
1707
1721
|
# @param request_id [String]
|
1708
1722
|
# @param use_ocr [Boolean]
|
1709
1723
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
1724
|
+
# @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. It will be ignored for other data sources.
|
1710
1725
|
# @param body [SyncFilesRequest]
|
1711
1726
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1712
|
-
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: '
|
1727
|
+
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: 'a5c6b913-12ce-4ae5-af61-694dd5c400fc', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, extra: {})
|
1713
1728
|
_body = {}
|
1714
1729
|
_body[:tags] = tags if tags != SENTINEL
|
1715
1730
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1725,6 +1740,7 @@ module Carbon
|
|
1725
1740
|
_body[:request_id] = request_id if request_id != SENTINEL
|
1726
1741
|
_body[:use_ocr] = use_ocr if use_ocr != SENTINEL
|
1727
1742
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1743
|
+
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
1728
1744
|
sync_files_request = _body
|
1729
1745
|
sync_files_with_http_info_impl(sync_files_request, extra)
|
1730
1746
|
end
|
@@ -38,6 +38,7 @@ module Carbon
|
|
38
38
|
GITHUB = "GITHUB".freeze
|
39
39
|
JPG = "JPG".freeze
|
40
40
|
PNG = "PNG".freeze
|
41
|
+
MPEG = "MPEG".freeze
|
41
42
|
MP3 = "MP3".freeze
|
42
43
|
MP4 = "MP4".freeze
|
43
44
|
MP2 = "MP2".freeze
|
@@ -51,7 +52,7 @@ module Carbon
|
|
51
52
|
WEBM = "WEBM".freeze
|
52
53
|
|
53
54
|
def self.all_vars
|
54
|
-
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, MP3, MP4, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, WEBM].freeze
|
55
|
+
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, MPEG, MP3, MP4, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, WEBM].freeze
|
55
56
|
end
|
56
57
|
|
57
58
|
# Builds the enum from string
|
@@ -38,6 +38,7 @@ module Carbon
|
|
38
38
|
GITHUB = "GITHUB".freeze
|
39
39
|
JPG = "JPG".freeze
|
40
40
|
PNG = "PNG".freeze
|
41
|
+
MPEG = "MPEG".freeze
|
41
42
|
MP3 = "MP3".freeze
|
42
43
|
MP4 = "MP4".freeze
|
43
44
|
MP2 = "MP2".freeze
|
@@ -51,7 +52,7 @@ module Carbon
|
|
51
52
|
WEBM = "WEBM".freeze
|
52
53
|
|
53
54
|
def self.all_vars
|
54
|
-
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, MP3, MP4, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, WEBM].freeze
|
55
|
+
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, MPEG, MP3, MP4, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, WEBM].freeze
|
55
56
|
end
|
56
57
|
|
57
58
|
# Builds the enum from string
|
@@ -0,0 +1,228 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Carbon
|
13
|
+
class HelpdeskFileSyncConfig
|
14
|
+
attr_accessor :file_types
|
15
|
+
|
16
|
+
attr_accessor :sync_attachments
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'file_types' => :'file_types',
|
22
|
+
:'sync_attachments' => :'sync_attachments'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns all the JSON keys this model knows about
|
27
|
+
def self.acceptable_attributes
|
28
|
+
attribute_map.values
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'file_types' => :'Array<HelpdeskFileTypes>',
|
35
|
+
:'sync_attachments' => :'Boolean'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::HelpdeskFileSyncConfig` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::HelpdeskFileSyncConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'file_types')
|
61
|
+
if (value = attributes[:'file_types']).is_a?(Array)
|
62
|
+
self.file_types = value
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'sync_attachments')
|
67
|
+
self.sync_attachments = attributes[:'sync_attachments']
|
68
|
+
else
|
69
|
+
self.sync_attachments = false
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properties with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
invalid_properties = Array.new
|
77
|
+
invalid_properties
|
78
|
+
end
|
79
|
+
|
80
|
+
# Check to see if the all the properties in the model are valid
|
81
|
+
# @return true if the model is valid
|
82
|
+
def valid?
|
83
|
+
true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Checks equality by comparing each attribute.
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def ==(o)
|
89
|
+
return true if self.equal?(o)
|
90
|
+
self.class == o.class &&
|
91
|
+
file_types == o.file_types &&
|
92
|
+
sync_attachments == o.sync_attachments
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(o)
|
98
|
+
self == o
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[file_types, sync_attachments].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
new.build_from_hash(attributes)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def build_from_hash(attributes)
|
118
|
+
return nil unless attributes.is_a?(Hash)
|
119
|
+
attributes = attributes.transform_keys(&:to_sym)
|
120
|
+
self.class.openapi_types.each_pair do |key, type|
|
121
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
122
|
+
self.send("#{key}=", nil)
|
123
|
+
elsif type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :Time
|
144
|
+
Time.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :Boolean
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
# models (e.g. Pet) or oneOf
|
175
|
+
klass = Carbon.const_get(type)
|
176
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns the string representation of the object
|
181
|
+
# @return [String] String presentation of the object
|
182
|
+
def to_s
|
183
|
+
to_hash.to_s
|
184
|
+
end
|
185
|
+
|
186
|
+
# to_body is an alias to to_hash (backward compatibility)
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_body
|
189
|
+
to_hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the object in the form of hash
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_hash
|
195
|
+
hash = {}
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
197
|
+
value = self.send(attr)
|
198
|
+
if value.nil?
|
199
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
200
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
201
|
+
end
|
202
|
+
|
203
|
+
hash[param] = _to_hash(value)
|
204
|
+
end
|
205
|
+
hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Outputs non-array value in the form of hash
|
209
|
+
# For object, use to_hash. Otherwise, just return the value
|
210
|
+
# @param [Object] value Any valid value
|
211
|
+
# @return [Hash] Returns the value in the form of hash
|
212
|
+
def _to_hash(value)
|
213
|
+
if value.is_a?(Array)
|
214
|
+
value.compact.map { |v| _to_hash(v) }
|
215
|
+
elsif value.is_a?(Hash)
|
216
|
+
{}.tap do |hash|
|
217
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
218
|
+
end
|
219
|
+
elsif value.respond_to? :to_hash
|
220
|
+
value.to_hash
|
221
|
+
else
|
222
|
+
value
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|