carbon_ruby_sdk 0.1.26 → 0.1.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4df15c006e45848696f32fa5cff53262a27cd3679d984728e3b03032bb20fb2d
4
- data.tar.gz: 3bb4f46ac23fcb9b560de22c539f6280c7cbc4d717ff7b762ecff53f3a953ca2
3
+ metadata.gz: 2493bff2eeeb2f8316cf36d0c6422d6983947139edb72efb712112e23c7479c8
4
+ data.tar.gz: cc2d601bcace70b963683cc6b1bc85039e30c335caf5d3acdde00e8ea42f75bd
5
5
  SHA512:
6
- metadata.gz: 561bd129472800a3028d531465beb98ba98794a2e813c477d72aa308c58128f9f912a1fc09a967aca5d9de0d16dc435d518ae3715c288707b5ea840f1be6082a
7
- data.tar.gz: 3dfa67d79380d9a687dccb456fbab1ce19422564c498eec958d4df186276d090754814224ad6bd20588e23b28adb3a80c2125d93ef2771d22d41a6e55c55afdb
6
+ metadata.gz: f76f5af420a391748ae19d0f447c40ff8e832ab9dcbb6da8131c15291d49ad99e108d81fdc8063cf511b94b06e12ceefe86e873276c24e1289d09c432c150d03
7
+ data.tar.gz: 839506399bca6e9d927ee31f2ebd88d12c729913a60c5d3d0d7dad25b582f1e6a66e149e243eb9f34f8569bb9cecfeef2aea86451a1eb0f3c50d0156d06f5c2c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carbon_ruby_sdk (0.1.25)
4
+ carbon_ruby_sdk (0.1.26)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
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.26-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.26)
9
+ [![npm](https://img.shields.io/badge/gem-v0.1.28-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.28)
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.26'
87
+ gem 'carbon_ruby_sdk', '~> 0.1.28'
88
88
  ```
89
89
 
90
90
  ## Getting Started<a id="getting-started"></a>
@@ -581,6 +581,7 @@ p result
581
581
 
582
582
 
583
583
  ### `carbon.files.delete`<a id="carbonfilesdelete"></a>
584
+ ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
584
585
 
585
586
  Delete File Endpoint
586
587
 
@@ -643,6 +644,7 @@ p result
643
644
 
644
645
 
645
646
  ### `carbon.files.delete_many`<a id="carbonfilesdelete_many"></a>
647
+ ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
646
648
 
647
649
  Delete Files Endpoint
648
650
 
@@ -718,6 +720,7 @@ p result
718
720
 
719
721
 
720
722
  ### `carbon.files.get_parsed_file`<a id="carbonfilesget_parsed_file"></a>
723
+ ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
721
724
 
722
725
  This route is deprecated. Use `/user_files_v2` instead.
723
726
 
@@ -747,6 +750,7 @@ p result
747
750
 
748
751
 
749
752
  ### `carbon.files.get_raw_file`<a id="carbonfilesget_raw_file"></a>
753
+ ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
750
754
 
751
755
  This route is deprecated. Use `/user_files_v2` instead.
752
756
 
@@ -872,6 +876,7 @@ p result
872
876
 
873
877
 
874
878
  ### `carbon.files.query_user_files_deprecated`<a id="carbonfilesquery_user_files_deprecated"></a>
879
+ ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
875
880
 
876
881
  This route is deprecated. Use `/user_files_v2` instead.
877
882
 
@@ -1197,9 +1202,10 @@ result = carbon.integrations.connect_data_source(
1197
1202
  "prepend_filename_to_chunks" => false,
1198
1203
  "sync_files_on_connection" => true,
1199
1204
  "set_page_as_boundary" => false,
1200
- "request_id" => "875454df-996d-4d26-83e0-756af9628ed0",
1205
+ "request_id" => "b9a72b38-115a-4dd6-bad9-00185ae2333b",
1201
1206
  "enable_file_picker" => true,
1202
1207
  "sync_source_items" => true,
1208
+ "incremental_sync" => false,
1203
1209
  },
1204
1210
  )
1205
1211
  p result
@@ -1409,11 +1415,16 @@ result = carbon.integrations.get_oauth_url(
1409
1415
  set_page_as_boundary: false,
1410
1416
  data_source_id: 1,
1411
1417
  connecting_new_account: false,
1412
- request_id: "fc8dfd30-8e4c-4f40-acc5-f05b3cc961d2",
1418
+ request_id: "444e3f13-e490-4cc0-9cba-48957104083d",
1413
1419
  use_ocr: false,
1414
1420
  parse_pdf_tables_with_ocr: false,
1415
1421
  enable_file_picker: true,
1416
1422
  sync_source_items: true,
1423
+ incremental_sync: false,
1424
+ file_sync_config: {
1425
+ "file_types" => ["ARTICLE"],
1426
+ "sync_attachments" => false,
1427
+ },
1417
1428
  )
1418
1429
  p result
1419
1430
  ```
@@ -1463,12 +1474,18 @@ Enable OCR for files that support it. Supported formats: pdf
1463
1474
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1464
1475
  ##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
1465
1476
  Enable integration's file picker for sources that support it. Supported sources:
1466
- GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT, DROPBOX, BOX
1477
+ BOX, SHAREPOINT, GOOGLE_DRIVE, DROPBOX, ONEDRIVE
1467
1478
 
1468
1479
  ##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
1469
1480
  Enabling this flag will fetch all available content from the source to be listed
1470
1481
  via list items endpoint
1471
1482
 
1483
+ ##### incremental_sync: `Boolean`<a id="incremental_sync-boolean"></a>
1484
+ Only sync files if they have not already been synced or if the embedding
1485
+ properties have changed. This flag is currently supported by ONEDRIVE,
1486
+ GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
1487
+
1488
+ ##### 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
1489
  #### 🔄 Return<a id="🔄-return"></a>
1473
1490
 
1474
1491
  [OuthURLResponse](./lib/carbon_ruby_sdk/models/outh_url_response.rb)
@@ -1719,9 +1736,10 @@ result = carbon.integrations.sync_confluence(
1719
1736
  prepend_filename_to_chunks: false,
1720
1737
  max_items_per_chunk: 1,
1721
1738
  set_page_as_boundary: false,
1722
- request_id: "2446df66-66dd-4ea3-b248-a416d886e087",
1739
+ request_id: "a5c6b913-12ce-4ae5-af61-694dd5c400fc",
1723
1740
  use_ocr: false,
1724
1741
  parse_pdf_tables_with_ocr: false,
1742
+ incremental_sync: false,
1725
1743
  )
1726
1744
  p result
1727
1745
  ```
@@ -1744,6 +1762,11 @@ Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1744
1762
  ##### request_id: `String`<a id="request_id-string"></a>
1745
1763
  ##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
1746
1764
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1765
+ ##### incremental_sync: `Boolean`<a id="incremental_sync-boolean"></a>
1766
+ Only sync files if they have not already been synced or if the embedding
1767
+ properties have changed. This flag is currently supported by ONEDRIVE,
1768
+ GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
1769
+
1747
1770
  #### 🔄 Return<a id="🔄-return"></a>
1748
1771
 
1749
1772
  [GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
@@ -1810,9 +1833,10 @@ result = carbon.integrations.sync_files(
1810
1833
  prepend_filename_to_chunks: false,
1811
1834
  max_items_per_chunk: 1,
1812
1835
  set_page_as_boundary: false,
1813
- request_id: "2446df66-66dd-4ea3-b248-a416d886e087",
1836
+ request_id: "a5c6b913-12ce-4ae5-af61-694dd5c400fc",
1814
1837
  use_ocr: false,
1815
1838
  parse_pdf_tables_with_ocr: false,
1839
+ incremental_sync: false,
1816
1840
  )
1817
1841
  p result
1818
1842
  ```
@@ -1835,6 +1859,11 @@ Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1835
1859
  ##### request_id: `String`<a id="request_id-string"></a>
1836
1860
  ##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
1837
1861
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1862
+ ##### incremental_sync: `Boolean`<a id="incremental_sync-boolean"></a>
1863
+ Only sync files if they have not already been synced or if the embedding
1864
+ properties have changed. This flag is currently supported by ONEDRIVE,
1865
+ GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
1866
+
1838
1867
  #### 🔄 Return<a id="🔄-return"></a>
1839
1868
 
1840
1869
  [GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
@@ -2393,6 +2422,7 @@ p result
2393
2422
 
2394
2423
 
2395
2424
  ### `carbon.users.toggle_user_features`<a id="carbonuserstoggle_user_features"></a>
2425
+ ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
2396
2426
 
2397
2427
  Toggle User Features
2398
2428
 
@@ -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] || ['accessToken', 'apiKey', 'customerId']
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: GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT, DROPBOX, BOX
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: 'fc8dfd30-8e4c-4f40-acc5-f05b3cc961d2', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, extra: {})
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: GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT, DROPBOX, BOX
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: 'fc8dfd30-8e4c-4f40-acc5-f05b3cc961d2', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, extra: {})
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: '2446df66-66dd-4ea3-b248-a416d886e087', use_ocr: false, parse_pdf_tables_with_ocr: false, extra: {})
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: '2446df66-66dd-4ea3-b248-a416d886e087', use_ocr: false, parse_pdf_tables_with_ocr: false, extra: {})
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: '2446df66-66dd-4ea3-b248-a416d886e087', use_ocr: false, parse_pdf_tables_with_ocr: false, extra: {})
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: '2446df66-66dd-4ea3-b248-a416d886e087', use_ocr: false, parse_pdf_tables_with_ocr: false, extra: {})
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