carbon_ruby_sdk 0.2.1 → 0.2.3

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: 2ba0bb9e85c323c3cdaaba5026f74ee0e128f476efacc76ea319f744f9d04dd7
4
- data.tar.gz: 171a3185783d7efa732ce6b4edb3af8bf1558659804df6f4cc91acec4df9b9b9
3
+ metadata.gz: af28a3b256d49d38a6aca558d12a49a6e3f2888587dedeef54311ad7d0bd0ac9
4
+ data.tar.gz: a685b15e3ad3ab32463c4bd03c92432c21bc3c7cf3b8f29bcf340cde6e468377
5
5
  SHA512:
6
- metadata.gz: 373c0a7f539b131c2fc2249d87c78d112dc85da61c89b632febec99663c4a87df4c31bd69886567252d662364dceb06e43d435c709e7bfabfbb6cac5ddbfeaa9
7
- data.tar.gz: 4b6d6fd5fc75e0b5a3e89e3a7b48bb6c7ff34e8a22fdcb2e17569d4d5216d7e042b98d5fcfc2fbd0ef88ee1f336443da4a5439d50376d962037dd1698a560559
6
+ metadata.gz: 023c5d51386e0e76ecd6954f25c69a8562302f89de2a1a15cd72fbfc0e3491c6129ad496da1ad9dbfd80a0030c30ba501cb2e8552cbdd92c07513a20f0257211
7
+ data.tar.gz: 465fbc642ce7bf817b5c5d647d34c1c963e254a21facef003efc0a60a5074dad6c1b642a1093e3f0e9228505bde79b9f5c55e263827987395734718b019c7a06
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carbon_ruby_sdk (0.2.0)
4
+ carbon_ruby_sdk (0.2.2)
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.2.1-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.1)
9
+ [![npm](https://img.shields.io/badge/gem-v0.2.3-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.3)
10
10
 
11
11
  </div>
12
12
 
@@ -39,6 +39,7 @@ Connect external data to LLMs, no matter the source.
39
39
  * [`carbon.files.upload_from_url`](#carbonfilesupload_from_url)
40
40
  * [`carbon.files.upload_text`](#carbonfilesupload_text)
41
41
  * [`carbon.health.check`](#carbonhealthcheck)
42
+ * [`carbon.integrations.cancel`](#carbonintegrationscancel)
42
43
  * [`carbon.integrations.connect_data_source`](#carbonintegrationsconnect_data_source)
43
44
  * [`carbon.integrations.connect_freshdesk`](#carbonintegrationsconnect_freshdesk)
44
45
  * [`carbon.integrations.connect_gitbook`](#carbonintegrationsconnect_gitbook)
@@ -85,7 +86,7 @@ Connect external data to LLMs, no matter the source.
85
86
  Add to Gemfile:
86
87
 
87
88
  ```ruby
88
- gem 'carbon_ruby_sdk', '~> 0.2.1'
89
+ gem 'carbon_ruby_sdk', '~> 0.2.3'
89
90
  ```
90
91
 
91
92
  ## Getting Started<a id="getting-started"></a>
@@ -426,12 +427,6 @@ Flag to control whether or not to perform hybrid search.
426
427
 
427
428
  ##### hybrid_search_tuning_parameters: [`HybridSearchTuningParamsNullable`](./lib/carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable.rb)<a id="hybrid_search_tuning_parameters-hybridsearchtuningparamsnullablelibcarbon_ruby_sdkmodelshybrid_search_tuning_params_nullablerb"></a>
428
429
  ##### media_type: [`FileContentTypesNullable`](./lib/carbon_ruby_sdk/models/file_content_types_nullable.rb)<a id="media_type-filecontenttypesnullablelibcarbon_ruby_sdkmodelsfile_content_types_nullablerb"></a>
429
- Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform
430
- the search. Also plays a role in determining what embedding model is used to
431
- embed the query. If `IMAGE` is chosen as the media type, then the embedding
432
- model used will be an embedding model that is not text-only, *regardless* of
433
- what value is passed for `embedding_model`.
434
-
435
430
  ##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
436
431
  #### 🔄 Return<a id="🔄-return"></a>
437
432
 
@@ -1087,6 +1082,7 @@ result = carbon.files.upload_from_url(
1087
1082
  max_items_per_chunk: 1,
1088
1083
  parse_pdf_tables_with_ocr: false,
1089
1084
  detect_audio_language: false,
1085
+ media_type: "TEXT",
1090
1086
  )
1091
1087
  p result
1092
1088
  ```
@@ -1108,6 +1104,7 @@ Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1108
1104
 
1109
1105
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1110
1106
  ##### detect_audio_language: `Boolean`<a id="detect_audio_language-boolean"></a>
1107
+ ##### media_type: [`FileContentTypesNullable`](./lib/carbon_ruby_sdk/models/file_content_types_nullable.rb)<a id="media_type-filecontenttypesnullablelibcarbon_ruby_sdkmodelsfile_content_types_nullablerb"></a>
1111
1108
  #### 🔄 Return<a id="🔄-return"></a>
1112
1109
 
1113
1110
  [UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
@@ -1193,6 +1190,35 @@ p result
1193
1190
  ---
1194
1191
 
1195
1192
 
1193
+ ### `carbon.integrations.cancel`<a id="carbonintegrationscancel"></a>
1194
+
1195
+ Cancel Data Source Items Sync
1196
+
1197
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1198
+
1199
+ ```ruby
1200
+ result = carbon.integrations.cancel(
1201
+ data_source_id: 1,
1202
+ )
1203
+ p result
1204
+ ```
1205
+
1206
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1207
+
1208
+ ##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
1209
+ #### 🔄 Return<a id="🔄-return"></a>
1210
+
1211
+ [OrganizationUserDataSourceAPI](./lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb)
1212
+
1213
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1214
+
1215
+ `/integrations/items/sync/cancel` `POST`
1216
+
1217
+ [🔙 **Back to Table of Contents**](#table-of-contents)
1218
+
1219
+ ---
1220
+
1221
+
1196
1222
  ### `carbon.integrations.connect_data_source`<a id="carbonintegrationsconnect_data_source"></a>
1197
1223
 
1198
1224
  Connect Data Source
@@ -1214,7 +1240,7 @@ result = carbon.integrations.connect_data_source(
1214
1240
  "prepend_filename_to_chunks" => false,
1215
1241
  "sync_files_on_connection" => true,
1216
1242
  "set_page_as_boundary" => false,
1217
- "request_id" => "fceb0182-329c-4e45-953b-885c747cf4a3",
1243
+ "request_id" => "652297b9-0f55-46d8-869d-13a36e89e5da",
1218
1244
  "enable_file_picker" => true,
1219
1245
  "sync_source_items" => true,
1220
1246
  "incremental_sync" => false,
@@ -1433,7 +1459,7 @@ result = carbon.integrations.get_oauth_url(
1433
1459
  set_page_as_boundary: false,
1434
1460
  data_source_id: 1,
1435
1461
  connecting_new_account: false,
1436
- request_id: "ce1b1ec8-be64-491c-9159-c40f85fa0073",
1462
+ request_id: "71f214fa-2155-41cb-9336-9b3070e86897",
1437
1463
  use_ocr: false,
1438
1464
  parse_pdf_tables_with_ocr: false,
1439
1465
  enable_file_picker: true,
@@ -1493,7 +1519,7 @@ Enable OCR for files that support it. Supported formats: pdf
1493
1519
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1494
1520
  ##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
1495
1521
  Enable integration's file picker for sources that support it. Supported sources:
1496
- DROPBOX, SHAREPOINT, ONEDRIVE, BOX, GOOGLE_DRIVE
1522
+ DROPBOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE, BOX
1497
1523
 
1498
1524
  ##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
1499
1525
  Enabling this flag will fetch all available content from the source to be listed
@@ -1755,7 +1781,7 @@ result = carbon.integrations.sync_confluence(
1755
1781
  prepend_filename_to_chunks: false,
1756
1782
  max_items_per_chunk: 1,
1757
1783
  set_page_as_boundary: false,
1758
- request_id: "9fe9190e-384f-4baa-a416-d51ed93d1be7",
1784
+ request_id: "6136b467-242e-49df-9478-d3e0cfdde299",
1759
1785
  use_ocr: false,
1760
1786
  parse_pdf_tables_with_ocr: false,
1761
1787
  incremental_sync: false,
@@ -1858,7 +1884,7 @@ result = carbon.integrations.sync_files(
1858
1884
  prepend_filename_to_chunks: false,
1859
1885
  max_items_per_chunk: 1,
1860
1886
  set_page_as_boundary: false,
1861
- request_id: "9fe9190e-384f-4baa-a416-d51ed93d1be7",
1887
+ request_id: "6136b467-242e-49df-9478-d3e0cfdde299",
1862
1888
  use_ocr: false,
1863
1889
  parse_pdf_tables_with_ocr: false,
1864
1890
  incremental_sync: false,
@@ -2715,6 +2741,8 @@ result = carbon.utilities.scrape_sitemap(
2715
2741
  css_classes_to_skip: [],
2716
2742
  css_selectors_to_skip: [],
2717
2743
  embedding_model: "OPENAI",
2744
+ url_paths_to_include: [],
2745
+ url_paths_to_exclude: [],
2718
2746
  )
2719
2747
  p result
2720
2748
  ```
@@ -2734,6 +2762,16 @@ p result
2734
2762
  ##### css_classes_to_skip: Array<`String`><a id="css_classes_to_skip-array"></a>
2735
2763
  ##### css_selectors_to_skip: Array<`String`><a id="css_selectors_to_skip-array"></a>
2736
2764
  ##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
2765
+ ##### url_paths_to_include: Array<`String`><a id="url_paths_to_include-array"></a>
2766
+ URL subpaths or directories that you want to include. For example if you want to
2767
+ only include URLs that start with /questions in stackoverflow.com, you will add
2768
+ /questions/ in this input
2769
+
2770
+ ##### url_paths_to_exclude: Array<`String`><a id="url_paths_to_exclude-array"></a>
2771
+ URL subpaths or directories that you want to exclude. For example if you want to
2772
+ exclude URLs that start with /questions in stackoverflow.com, you will add
2773
+ /questions/ in this input
2774
+
2737
2775
  #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2738
2776
 
2739
2777
  `/scrape_sitemap` `POST`
@@ -2773,6 +2811,7 @@ result = carbon.utilities.scrape_web(
2773
2811
  "css_classes_to_skip" => [],
2774
2812
  "css_selectors_to_skip" => [],
2775
2813
  "embedding_model" => "OPENAI",
2814
+ "url_paths_to_include" => [],
2776
2815
  }
2777
2816
  ],
2778
2817
  )
@@ -126,11 +126,11 @@ module Carbon
126
126
  # @param include_raw_file [Boolean] Flag to control whether or not to include a signed URL to the raw file containing each chunk in the response.
127
127
  # @param hybrid_search [Boolean] Flag to control whether or not to perform hybrid search.
128
128
  # @param hybrid_search_tuning_parameters [HybridSearchTuningParamsNullable]
129
- # @param media_type [FileContentTypesNullable] Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform the search. Also plays a role in determining what embedding model is used to embed the query. If `IMAGE` is chosen as the media type, then the embedding model used will be an embedding model that is not text-only, *regardless* of what value is passed for `embedding_model`.
129
+ # @param media_type [FileContentTypesNullable]
130
130
  # @param embedding_model [EmbeddingGeneratorsNullable]
131
131
  # @param body [GetEmbeddingDocumentsBody]
132
132
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
133
- def get_documents(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
133
+ 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', extra: {})
134
134
  _body = {}
135
135
  _body[:tags] = tags if tags != SENTINEL
136
136
  _body[:query] = query if query != SENTINEL
@@ -262,11 +262,11 @@ module Carbon
262
262
  # @param include_raw_file [Boolean] Flag to control whether or not to include a signed URL to the raw file containing each chunk in the response.
263
263
  # @param hybrid_search [Boolean] Flag to control whether or not to perform hybrid search.
264
264
  # @param hybrid_search_tuning_parameters [HybridSearchTuningParamsNullable]
265
- # @param media_type [FileContentTypesNullable] Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform the search. Also plays a role in determining what embedding model is used to embed the query. If `IMAGE` is chosen as the media type, then the embedding model used will be an embedding model that is not text-only, *regardless* of what value is passed for `embedding_model`.
265
+ # @param media_type [FileContentTypesNullable]
266
266
  # @param embedding_model [EmbeddingGeneratorsNullable]
267
267
  # @param body [GetEmbeddingDocumentsBody]
268
268
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
269
- def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
269
+ def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: SENTINEL, embedding_model: 'OPENAI', extra: {})
270
270
  _body = {}
271
271
  _body[:tags] = tags if tags != SENTINEL
272
272
  _body[:query] = query if query != SENTINEL
@@ -1176,7 +1176,7 @@ module Carbon
1176
1176
  # @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
1177
1177
  # @param body [BodyCreateUploadFileUploadfilePost]
1178
1178
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1179
- def upload(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: 'TEXT', extra: {})
1179
+ def upload(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1180
1180
  _body = {}
1181
1181
  _body[:file] = file if file != SENTINEL
1182
1182
  body_create_upload_file_uploadfile_post = _body
@@ -1239,7 +1239,7 @@ module Carbon
1239
1239
  # @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
1240
1240
  # @param body [BodyCreateUploadFileUploadfilePost]
1241
1241
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1242
- def upload_with_http_info(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: 'TEXT', extra: {})
1242
+ def upload_with_http_info(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1243
1243
  _body = {}
1244
1244
  _body[:file] = file if file != SENTINEL
1245
1245
  body_create_upload_file_uploadfile_post = _body
@@ -1274,7 +1274,7 @@ module Carbon
1274
1274
  # @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1275
1275
  # @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
1276
1276
  # @option opts [Boolean] :detect_audio_language Whether to automatically detect the language of the uploaded audio file. (default to false)
1277
- # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension. (default to 'TEXT')
1277
+ # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
1278
1278
  # @return [UserFile]
1279
1279
  private def upload_impl(file, body_create_upload_file_uploadfile_post, opts = {})
1280
1280
  data, _status_code, _headers = upload_with_http_info(file, body_create_upload_file_uploadfile_post, opts)
@@ -1297,7 +1297,7 @@ module Carbon
1297
1297
  # @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1298
1298
  # @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
1299
1299
  # @option opts [Boolean] :detect_audio_language Whether to automatically detect the language of the uploaded audio file. (default to false)
1300
- # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension. (default to 'TEXT')
1300
+ # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
1301
1301
  # @return [APIResponse] data is UserFile, status code, headers and response
1302
1302
  private def upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, opts = {})
1303
1303
  if @api_client.config.debugging
@@ -1385,9 +1385,10 @@ module Carbon
1385
1385
  # @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1386
1386
  # @param parse_pdf_tables_with_ocr [Boolean]
1387
1387
  # @param detect_audio_language [Boolean]
1388
+ # @param media_type [FileContentTypesNullable]
1388
1389
  # @param body [UploadFileFromUrlInput]
1389
1390
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1390
- def upload_from_url(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, extra: {})
1391
+ def upload_from_url(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1391
1392
  _body = {}
1392
1393
  _body[:url] = url if url != SENTINEL
1393
1394
  _body[:file_name] = file_name if file_name != SENTINEL
@@ -1402,6 +1403,7 @@ module Carbon
1402
1403
  _body[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
1403
1404
  _body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
1404
1405
  _body[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
1406
+ _body[:media_type] = media_type if media_type != SENTINEL
1405
1407
  upload_file_from_url_input = _body
1406
1408
  api_response = upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
1407
1409
  api_response.data
@@ -1422,9 +1424,10 @@ module Carbon
1422
1424
  # @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1423
1425
  # @param parse_pdf_tables_with_ocr [Boolean]
1424
1426
  # @param detect_audio_language [Boolean]
1427
+ # @param media_type [FileContentTypesNullable]
1425
1428
  # @param body [UploadFileFromUrlInput]
1426
1429
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1427
- def upload_from_url_with_http_info(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, extra: {})
1430
+ def upload_from_url_with_http_info(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1428
1431
  _body = {}
1429
1432
  _body[:url] = url if url != SENTINEL
1430
1433
  _body[:file_name] = file_name if file_name != SENTINEL
@@ -1439,6 +1442,7 @@ module Carbon
1439
1442
  _body[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
1440
1443
  _body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
1441
1444
  _body[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
1445
+ _body[:media_type] = media_type if media_type != SENTINEL
1442
1446
  upload_file_from_url_input = _body
1443
1447
  upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
1444
1448
  end
@@ -16,6 +16,98 @@ module Carbon
16
16
  @api_client = api_client
17
17
  end
18
18
 
19
+ # Cancel Data Source Items Sync
20
+ #
21
+ # @param data_source_id [Integer]
22
+ # @param body [SyncDirectoryRequest]
23
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
24
+ def cancel(data_source_id:, extra: {})
25
+ _body = {}
26
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
27
+ sync_directory_request = _body
28
+ api_response = cancel_with_http_info_impl(sync_directory_request, extra)
29
+ api_response.data
30
+ end
31
+
32
+ # Cancel Data Source Items Sync
33
+ #
34
+ # @param data_source_id [Integer]
35
+ # @param body [SyncDirectoryRequest]
36
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
37
+ def cancel_with_http_info(data_source_id:, extra: {})
38
+ _body = {}
39
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
40
+ sync_directory_request = _body
41
+ cancel_with_http_info_impl(sync_directory_request, extra)
42
+ end
43
+
44
+ # Cancel Data Source Items Sync
45
+ # @param sync_directory_request [SyncDirectoryRequest]
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [OrganizationUserDataSourceAPI]
48
+ private def cancel_impl(sync_directory_request, opts = {})
49
+ data, _status_code, _headers = cancel_with_http_info(sync_directory_request, opts)
50
+ data
51
+ end
52
+
53
+ # Cancel Data Source Items Sync
54
+ # @param sync_directory_request [SyncDirectoryRequest]
55
+ # @param [Hash] opts the optional parameters
56
+ # @return [APIResponse] data is OrganizationUserDataSourceAPI, status code, headers and response
57
+ private def cancel_with_http_info_impl(sync_directory_request, opts = {})
58
+ if @api_client.config.debugging
59
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.cancel ...'
60
+ end
61
+ # verify the required parameter 'sync_directory_request' is set
62
+ if @api_client.config.client_side_validation && sync_directory_request.nil?
63
+ fail ArgumentError, "Missing the required parameter 'sync_directory_request' when calling IntegrationsApi.cancel"
64
+ end
65
+ # resource path
66
+ local_var_path = '/integrations/items/sync/cancel'
67
+
68
+ # query parameters
69
+ query_params = opts[:query_params] || {}
70
+
71
+ # header parameters
72
+ header_params = opts[:header_params] || {}
73
+ # HTTP header 'Accept' (if needed)
74
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
75
+ # HTTP header 'Content-Type'
76
+ content_type = @api_client.select_header_content_type(['application/json'])
77
+ if !content_type.nil?
78
+ header_params['Content-Type'] = content_type
79
+ end
80
+
81
+ # form parameters
82
+ form_params = opts[:form_params] || {}
83
+
84
+ # http body (model)
85
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sync_directory_request)
86
+
87
+ # return_type
88
+ return_type = opts[:debug_return_type] || 'OrganizationUserDataSourceAPI'
89
+
90
+ # auth_names
91
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
92
+
93
+ new_options = opts.merge(
94
+ :operation => :"IntegrationsApi.cancel",
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :form_params => form_params,
98
+ :body => post_body,
99
+ :auth_names => auth_names,
100
+ :return_type => return_type
101
+ )
102
+
103
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug "API called: IntegrationsApi#cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
106
+ end
107
+ APIResponse::new(data, status_code, headers, response)
108
+ end
109
+
110
+
19
111
  # Connect Data Source
20
112
  #
21
113
  # @param authentication [AuthenticationProperty]
@@ -561,13 +653,13 @@ module Carbon
561
653
  # @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
562
654
  # @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
563
655
  # @param parse_pdf_tables_with_ocr [Boolean]
564
- # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, SHAREPOINT, ONEDRIVE, BOX, GOOGLE_DRIVE
656
+ # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE, BOX
565
657
  # @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
566
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. It will be ignored for other data sources.
567
659
  # @param file_sync_config [FileSyncConfigNullable]
568
660
  # @param body [OAuthURLRequest]
569
661
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
570
- 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: 'ce1b1ec8-be64-491c-9159-c40f85fa0073', 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: {})
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: '71f214fa-2155-41cb-9336-9b3070e86897', 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: {})
571
663
  _body = {}
572
664
  _body[:tags] = tags if tags != SENTINEL
573
665
  _body[:scope] = scope if scope != SENTINEL
@@ -629,13 +721,13 @@ module Carbon
629
721
  # @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
630
722
  # @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
631
723
  # @param parse_pdf_tables_with_ocr [Boolean]
632
- # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, SHAREPOINT, ONEDRIVE, BOX, GOOGLE_DRIVE
724
+ # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE, BOX
633
725
  # @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
634
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. It will be ignored for other data sources.
635
727
  # @param file_sync_config [FileSyncConfigNullable]
636
728
  # @param body [OAuthURLRequest]
637
729
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
638
- 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: 'ce1b1ec8-be64-491c-9159-c40f85fa0073', 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: {})
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: '71f214fa-2155-41cb-9336-9b3070e86897', 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: {})
639
731
  _body = {}
640
732
  _body[:tags] = tags if tags != SENTINEL
641
733
  _body[:scope] = scope if scope != SENTINEL
@@ -1431,7 +1523,7 @@ module Carbon
1431
1523
  # @param file_sync_config [FileSyncConfigNullable]
1432
1524
  # @param body [SyncFilesRequest]
1433
1525
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1434
- 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: '9fe9190e-384f-4baa-a416-d51ed93d1be7', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1526
+ 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: '6136b467-242e-49df-9478-d3e0cfdde299', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1435
1527
  _body = {}
1436
1528
  _body[:tags] = tags if tags != SENTINEL
1437
1529
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -1479,7 +1571,7 @@ module Carbon
1479
1571
  # @param file_sync_config [FileSyncConfigNullable]
1480
1572
  # @param body [SyncFilesRequest]
1481
1573
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1482
- 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: '9fe9190e-384f-4baa-a416-d51ed93d1be7', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1574
+ 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: '6136b467-242e-49df-9478-d3e0cfdde299', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1483
1575
  _body = {}
1484
1576
  _body[:tags] = tags if tags != SENTINEL
1485
1577
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -1687,7 +1779,7 @@ module Carbon
1687
1779
  # @param file_sync_config [FileSyncConfigNullable]
1688
1780
  # @param body [SyncFilesRequest]
1689
1781
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1690
- 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: '9fe9190e-384f-4baa-a416-d51ed93d1be7', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1782
+ 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: '6136b467-242e-49df-9478-d3e0cfdde299', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1691
1783
  _body = {}
1692
1784
  _body[:tags] = tags if tags != SENTINEL
1693
1785
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -1735,7 +1827,7 @@ module Carbon
1735
1827
  # @param file_sync_config [FileSyncConfigNullable]
1736
1828
  # @param body [SyncFilesRequest]
1737
1829
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1738
- 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: '9fe9190e-384f-4baa-a416-d51ed93d1be7', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1830
+ 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: '6136b467-242e-49df-9478-d3e0cfdde299', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1739
1831
  _body = {}
1740
1832
  _body[:tags] = tags if tags != SENTINEL
1741
1833
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -342,9 +342,11 @@ module Carbon
342
342
  # @param css_classes_to_skip [Array<String>]
343
343
  # @param css_selectors_to_skip [Array<String>]
344
344
  # @param embedding_model [EmbeddingGenerators]
345
+ # @param url_paths_to_include [Array<String>] URL subpaths or directories that you want to include. For example if you want to only include URLs that start with /questions in stackoverflow.com, you will add /questions/ in this input
346
+ # @param url_paths_to_exclude [Array<String>] URL subpaths or directories that you want to exclude. For example if you want to exclude URLs that start with /questions in stackoverflow.com, you will add /questions/ in this input
345
347
  # @param body [SitemapScrapeRequest]
346
348
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
347
- def scrape_sitemap(url:, tags: SENTINEL, max_pages_to_scrape: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, enable_auto_sync: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, html_tags_to_skip: SENTINEL, css_classes_to_skip: SENTINEL, css_selectors_to_skip: SENTINEL, embedding_model: 'OPENAI', extra: {})
349
+ def scrape_sitemap(url:, tags: SENTINEL, max_pages_to_scrape: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, enable_auto_sync: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, html_tags_to_skip: SENTINEL, css_classes_to_skip: SENTINEL, css_selectors_to_skip: SENTINEL, embedding_model: 'OPENAI', url_paths_to_include: SENTINEL, url_paths_to_exclude: SENTINEL, extra: {})
348
350
  _body = {}
349
351
  _body[:tags] = tags if tags != SENTINEL
350
352
  _body[:url] = url if url != SENTINEL
@@ -359,6 +361,8 @@ module Carbon
359
361
  _body[:css_classes_to_skip] = css_classes_to_skip if css_classes_to_skip != SENTINEL
360
362
  _body[:css_selectors_to_skip] = css_selectors_to_skip if css_selectors_to_skip != SENTINEL
361
363
  _body[:embedding_model] = embedding_model if embedding_model != SENTINEL
364
+ _body[:url_paths_to_include] = url_paths_to_include if url_paths_to_include != SENTINEL
365
+ _body[:url_paths_to_exclude] = url_paths_to_exclude if url_paths_to_exclude != SENTINEL
362
366
  sitemap_scrape_request = _body
363
367
  api_response = scrape_sitemap_with_http_info_impl(sitemap_scrape_request, extra)
364
368
  api_response.data
@@ -387,9 +391,11 @@ module Carbon
387
391
  # @param css_classes_to_skip [Array<String>]
388
392
  # @param css_selectors_to_skip [Array<String>]
389
393
  # @param embedding_model [EmbeddingGenerators]
394
+ # @param url_paths_to_include [Array<String>] URL subpaths or directories that you want to include. For example if you want to only include URLs that start with /questions in stackoverflow.com, you will add /questions/ in this input
395
+ # @param url_paths_to_exclude [Array<String>] URL subpaths or directories that you want to exclude. For example if you want to exclude URLs that start with /questions in stackoverflow.com, you will add /questions/ in this input
390
396
  # @param body [SitemapScrapeRequest]
391
397
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
392
- def scrape_sitemap_with_http_info(url:, tags: SENTINEL, max_pages_to_scrape: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, enable_auto_sync: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, html_tags_to_skip: SENTINEL, css_classes_to_skip: SENTINEL, css_selectors_to_skip: SENTINEL, embedding_model: 'OPENAI', extra: {})
398
+ def scrape_sitemap_with_http_info(url:, tags: SENTINEL, max_pages_to_scrape: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, enable_auto_sync: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, html_tags_to_skip: SENTINEL, css_classes_to_skip: SENTINEL, css_selectors_to_skip: SENTINEL, embedding_model: 'OPENAI', url_paths_to_include: SENTINEL, url_paths_to_exclude: SENTINEL, extra: {})
393
399
  _body = {}
394
400
  _body[:tags] = tags if tags != SENTINEL
395
401
  _body[:url] = url if url != SENTINEL
@@ -404,6 +410,8 @@ module Carbon
404
410
  _body[:css_classes_to_skip] = css_classes_to_skip if css_classes_to_skip != SENTINEL
405
411
  _body[:css_selectors_to_skip] = css_selectors_to_skip if css_selectors_to_skip != SENTINEL
406
412
  _body[:embedding_model] = embedding_model if embedding_model != SENTINEL
413
+ _body[:url_paths_to_include] = url_paths_to_include if url_paths_to_include != SENTINEL
414
+ _body[:url_paths_to_exclude] = url_paths_to_exclude if url_paths_to_exclude != SENTINEL
407
415
  sitemap_scrape_request = _body
408
416
  scrape_sitemap_with_http_info_impl(sitemap_scrape_request, extra)
409
417
  end
@@ -49,7 +49,6 @@ module Carbon
49
49
 
50
50
  attr_accessor :hybrid_search_tuning_parameters
51
51
 
52
- # Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform the search. Also plays a role in determining what embedding model is used to embed the query. If `IMAGE` is chosen as the media type, then the embedding model used will be an embedding model that is not text-only, *regardless* of what value is passed for `embedding_model`.
53
52
  attr_accessor :media_type
54
53
 
55
54
  attr_accessor :embedding_model
@@ -198,8 +197,6 @@ module Carbon
198
197
 
199
198
  if attributes.key?(:'media_type')
200
199
  self.media_type = attributes[:'media_type']
201
- else
202
- self.media_type = 'TEXT'
203
200
  end
204
201
 
205
202
  if attributes.key?(:'embedding_model')
@@ -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: DROPBOX, SHAREPOINT, ONEDRIVE, BOX, GOOGLE_DRIVE
64
+ # Enable integration's file picker for sources that support it. Supported sources: DROPBOX, GOOGLE_DRIVE, SHAREPOINT, ONEDRIVE, BOX
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 = 'ce1b1ec8-be64-491c-9159-c40f85fa0073'
282
+ self.request_id = '71f214fa-2155-41cb-9336-9b3070e86897'
283
283
  end
284
284
 
285
285
  if attributes.key?(:'use_ocr')
@@ -37,6 +37,12 @@ module Carbon
37
37
 
38
38
  attr_accessor :embedding_model
39
39
 
40
+ # URL subpaths or directories that you want to include. For example if you want to only include URLs that start with /questions in stackoverflow.com, you will add /questions/ in this input
41
+ attr_accessor :url_paths_to_include
42
+
43
+ # URL subpaths or directories that you want to exclude. For example if you want to exclude URLs that start with /questions in stackoverflow.com, you will add /questions/ in this input
44
+ attr_accessor :url_paths_to_exclude
45
+
40
46
  # Attribute mapping from ruby-style variable name to JSON key.
41
47
  def self.attribute_map
42
48
  {
@@ -52,7 +58,9 @@ module Carbon
52
58
  :'html_tags_to_skip' => :'html_tags_to_skip',
53
59
  :'css_classes_to_skip' => :'css_classes_to_skip',
54
60
  :'css_selectors_to_skip' => :'css_selectors_to_skip',
55
- :'embedding_model' => :'embedding_model'
61
+ :'embedding_model' => :'embedding_model',
62
+ :'url_paths_to_include' => :'url_paths_to_include',
63
+ :'url_paths_to_exclude' => :'url_paths_to_exclude'
56
64
  }
57
65
  end
58
66
 
@@ -76,7 +84,9 @@ module Carbon
76
84
  :'html_tags_to_skip' => :'Array<String>',
77
85
  :'css_classes_to_skip' => :'Array<String>',
78
86
  :'css_selectors_to_skip' => :'Array<String>',
79
- :'embedding_model' => :'EmbeddingGenerators'
87
+ :'embedding_model' => :'EmbeddingGenerators',
88
+ :'url_paths_to_include' => :'Array<String>',
89
+ :'url_paths_to_exclude' => :'Array<String>'
80
90
  }
81
91
  end
82
92
 
@@ -94,6 +104,8 @@ module Carbon
94
104
  :'html_tags_to_skip',
95
105
  :'css_classes_to_skip',
96
106
  :'css_selectors_to_skip',
107
+ :'url_paths_to_include',
108
+ :'url_paths_to_exclude'
97
109
  ])
98
110
  end
99
111
 
@@ -185,6 +197,18 @@ module Carbon
185
197
  else
186
198
  self.embedding_model = 'OPENAI'
187
199
  end
200
+
201
+ if attributes.key?(:'url_paths_to_include')
202
+ if (value = attributes[:'url_paths_to_include']).is_a?(Array)
203
+ self.url_paths_to_include = value
204
+ end
205
+ end
206
+
207
+ if attributes.key?(:'url_paths_to_exclude')
208
+ if (value = attributes[:'url_paths_to_exclude']).is_a?(Array)
209
+ self.url_paths_to_exclude = value
210
+ end
211
+ end
188
212
  end
189
213
 
190
214
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -199,6 +223,14 @@ module Carbon
199
223
  invalid_properties.push('invalid value for "max_pages_to_scrape", must be greater than or equal to 1.')
200
224
  end
201
225
 
226
+ if !@url_paths_to_include.nil? && @url_paths_to_include.length > 10
227
+ invalid_properties.push('invalid value for "url_paths_to_include", number of items must be less than or equal to 10.')
228
+ end
229
+
230
+ if !@url_paths_to_exclude.nil? && @url_paths_to_exclude.length > 10
231
+ invalid_properties.push('invalid value for "url_paths_to_exclude", number of items must be less than or equal to 10.')
232
+ end
233
+
202
234
  invalid_properties
203
235
  end
204
236
 
@@ -207,6 +239,8 @@ module Carbon
207
239
  def valid?
208
240
  return false if @url.nil?
209
241
  return false if !@max_pages_to_scrape.nil? && @max_pages_to_scrape < 1
242
+ return false if !@url_paths_to_include.nil? && @url_paths_to_include.length > 10
243
+ return false if !@url_paths_to_exclude.nil? && @url_paths_to_exclude.length > 10
210
244
  true
211
245
  end
212
246
 
@@ -220,6 +254,26 @@ module Carbon
220
254
  @max_pages_to_scrape = max_pages_to_scrape
221
255
  end
222
256
 
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] url_paths_to_include Value to be assigned
259
+ def url_paths_to_include=(url_paths_to_include)
260
+ if !url_paths_to_include.nil? && url_paths_to_include.length > 10
261
+ fail ArgumentError, 'invalid value for "url_paths_to_include", number of items must be less than or equal to 10.'
262
+ end
263
+
264
+ @url_paths_to_include = url_paths_to_include
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] url_paths_to_exclude Value to be assigned
269
+ def url_paths_to_exclude=(url_paths_to_exclude)
270
+ if !url_paths_to_exclude.nil? && url_paths_to_exclude.length > 10
271
+ fail ArgumentError, 'invalid value for "url_paths_to_exclude", number of items must be less than or equal to 10.'
272
+ end
273
+
274
+ @url_paths_to_exclude = url_paths_to_exclude
275
+ end
276
+
223
277
  # Checks equality by comparing each attribute.
224
278
  # @param [Object] Object to be compared
225
279
  def ==(o)
@@ -237,7 +291,9 @@ module Carbon
237
291
  html_tags_to_skip == o.html_tags_to_skip &&
238
292
  css_classes_to_skip == o.css_classes_to_skip &&
239
293
  css_selectors_to_skip == o.css_selectors_to_skip &&
240
- embedding_model == o.embedding_model
294
+ embedding_model == o.embedding_model &&
295
+ url_paths_to_include == o.url_paths_to_include &&
296
+ url_paths_to_exclude == o.url_paths_to_exclude
241
297
  end
242
298
 
243
299
  # @see the `==` method
@@ -249,7 +305,7 @@ module Carbon
249
305
  # Calculates hash code according to all attributes.
250
306
  # @return [Integer] Hash code
251
307
  def hash
252
- [tags, url, max_pages_to_scrape, chunk_size, chunk_overlap, skip_embedding_generation, enable_auto_sync, generate_sparse_vectors, prepend_filename_to_chunks, html_tags_to_skip, css_classes_to_skip, css_selectors_to_skip, embedding_model].hash
308
+ [tags, url, max_pages_to_scrape, chunk_size, chunk_overlap, skip_embedding_generation, enable_auto_sync, generate_sparse_vectors, prepend_filename_to_chunks, html_tags_to_skip, css_classes_to_skip, css_selectors_to_skip, embedding_model, url_paths_to_include, url_paths_to_exclude].hash
253
309
  end
254
310
 
255
311
  # Builds the object from hash
@@ -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 = '9fe9190e-384f-4baa-a416-d51ed93d1be7'
190
+ self.request_id = '6136b467-242e-49df-9478-d3e0cfdde299'
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 = 'fceb0182-329c-4e45-953b-885c747cf4a3'
185
+ self.request_id = '652297b9-0f55-46d8-869d-13a36e89e5da'
186
186
  end
187
187
 
188
188
  if attributes.key?(:'enable_file_picker')
@@ -38,6 +38,8 @@ module Carbon
38
38
 
39
39
  attr_accessor :detect_audio_language
40
40
 
41
+ attr_accessor :media_type
42
+
41
43
  # Attribute mapping from ruby-style variable name to JSON key.
42
44
  def self.attribute_map
43
45
  {
@@ -53,7 +55,8 @@ module Carbon
53
55
  :'prepend_filename_to_chunks' => :'prepend_filename_to_chunks',
54
56
  :'max_items_per_chunk' => :'max_items_per_chunk',
55
57
  :'parse_pdf_tables_with_ocr' => :'parse_pdf_tables_with_ocr',
56
- :'detect_audio_language' => :'detect_audio_language'
58
+ :'detect_audio_language' => :'detect_audio_language',
59
+ :'media_type' => :'media_type'
57
60
  }
58
61
  end
59
62
 
@@ -77,7 +80,8 @@ module Carbon
77
80
  :'prepend_filename_to_chunks' => :'Boolean',
78
81
  :'max_items_per_chunk' => :'Integer',
79
82
  :'parse_pdf_tables_with_ocr' => :'Boolean',
80
- :'detect_audio_language' => :'Boolean'
83
+ :'detect_audio_language' => :'Boolean',
84
+ :'media_type' => :'FileContentTypesNullable'
81
85
  }
82
86
  end
83
87
 
@@ -88,6 +92,7 @@ module Carbon
88
92
  :'chunk_size',
89
93
  :'chunk_overlap',
90
94
  :'max_items_per_chunk',
95
+ :'media_type'
91
96
  ])
92
97
  end
93
98
 
@@ -173,6 +178,10 @@ module Carbon
173
178
  else
174
179
  self.detect_audio_language = false
175
180
  end
181
+
182
+ if attributes.key?(:'media_type')
183
+ self.media_type = attributes[:'media_type']
184
+ end
176
185
  end
177
186
 
178
187
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -210,7 +219,8 @@ module Carbon
210
219
  prepend_filename_to_chunks == o.prepend_filename_to_chunks &&
211
220
  max_items_per_chunk == o.max_items_per_chunk &&
212
221
  parse_pdf_tables_with_ocr == o.parse_pdf_tables_with_ocr &&
213
- detect_audio_language == o.detect_audio_language
222
+ detect_audio_language == o.detect_audio_language &&
223
+ media_type == o.media_type
214
224
  end
215
225
 
216
226
  # @see the `==` method
@@ -222,7 +232,7 @@ module Carbon
222
232
  # Calculates hash code according to all attributes.
223
233
  # @return [Integer] Hash code
224
234
  def hash
225
- [url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk, parse_pdf_tables_with_ocr, detect_audio_language].hash
235
+ [url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk, parse_pdf_tables_with_ocr, detect_audio_language, media_type].hash
226
236
  end
227
237
 
228
238
  # Builds the object from hash
@@ -39,6 +39,9 @@ module Carbon
39
39
 
40
40
  attr_accessor :embedding_model
41
41
 
42
+ # URL subpaths or directories that you want to include. For example if you want to only include URLs that start with /questions in stackoverflow.com, you will add /questions/ in this input
43
+ attr_accessor :url_paths_to_include
44
+
42
45
  # Attribute mapping from ruby-style variable name to JSON key.
43
46
  def self.attribute_map
44
47
  {
@@ -55,7 +58,8 @@ module Carbon
55
58
  :'html_tags_to_skip' => :'html_tags_to_skip',
56
59
  :'css_classes_to_skip' => :'css_classes_to_skip',
57
60
  :'css_selectors_to_skip' => :'css_selectors_to_skip',
58
- :'embedding_model' => :'embedding_model'
61
+ :'embedding_model' => :'embedding_model',
62
+ :'url_paths_to_include' => :'url_paths_to_include'
59
63
  }
60
64
  end
61
65
 
@@ -80,7 +84,8 @@ module Carbon
80
84
  :'html_tags_to_skip' => :'Array<String>',
81
85
  :'css_classes_to_skip' => :'Array<String>',
82
86
  :'css_selectors_to_skip' => :'Array<String>',
83
- :'embedding_model' => :'EmbeddingGenerators'
87
+ :'embedding_model' => :'EmbeddingGenerators',
88
+ :'url_paths_to_include' => :'Array<String>'
84
89
  }
85
90
  end
86
91
 
@@ -99,6 +104,7 @@ module Carbon
99
104
  :'html_tags_to_skip',
100
105
  :'css_classes_to_skip',
101
106
  :'css_selectors_to_skip',
107
+ :'url_paths_to_include'
102
108
  ])
103
109
  end
104
110
 
@@ -198,6 +204,12 @@ module Carbon
198
204
  else
199
205
  self.embedding_model = 'OPENAI'
200
206
  end
207
+
208
+ if attributes.key?(:'url_paths_to_include')
209
+ if (value = attributes[:'url_paths_to_include']).is_a?(Array)
210
+ self.url_paths_to_include = value
211
+ end
212
+ end
201
213
  end
202
214
 
203
215
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -216,6 +228,10 @@ module Carbon
216
228
  invalid_properties.push('invalid value for "max_pages_to_scrape", must be greater than or equal to 1.')
217
229
  end
218
230
 
231
+ if !@url_paths_to_include.nil? && @url_paths_to_include.length > 10
232
+ invalid_properties.push('invalid value for "url_paths_to_include", number of items must be less than or equal to 10.')
233
+ end
234
+
219
235
  invalid_properties
220
236
  end
221
237
 
@@ -225,6 +241,7 @@ module Carbon
225
241
  return false if @url.nil?
226
242
  return false if !@recursion_depth.nil? && @recursion_depth < 0
227
243
  return false if !@max_pages_to_scrape.nil? && @max_pages_to_scrape < 1
244
+ return false if !@url_paths_to_include.nil? && @url_paths_to_include.length > 10
228
245
  true
229
246
  end
230
247
 
@@ -248,6 +265,16 @@ module Carbon
248
265
  @max_pages_to_scrape = max_pages_to_scrape
249
266
  end
250
267
 
268
+ # Custom attribute writer method with validation
269
+ # @param [Object] url_paths_to_include Value to be assigned
270
+ def url_paths_to_include=(url_paths_to_include)
271
+ if !url_paths_to_include.nil? && url_paths_to_include.length > 10
272
+ fail ArgumentError, 'invalid value for "url_paths_to_include", number of items must be less than or equal to 10.'
273
+ end
274
+
275
+ @url_paths_to_include = url_paths_to_include
276
+ end
277
+
251
278
  # Checks equality by comparing each attribute.
252
279
  # @param [Object] Object to be compared
253
280
  def ==(o)
@@ -266,7 +293,8 @@ module Carbon
266
293
  html_tags_to_skip == o.html_tags_to_skip &&
267
294
  css_classes_to_skip == o.css_classes_to_skip &&
268
295
  css_selectors_to_skip == o.css_selectors_to_skip &&
269
- embedding_model == o.embedding_model
296
+ embedding_model == o.embedding_model &&
297
+ url_paths_to_include == o.url_paths_to_include
270
298
  end
271
299
 
272
300
  # @see the `==` method
@@ -278,7 +306,7 @@ module Carbon
278
306
  # Calculates hash code according to all attributes.
279
307
  # @return [Integer] Hash code
280
308
  def hash
281
- [tags, url, recursion_depth, max_pages_to_scrape, chunk_size, chunk_overlap, skip_embedding_generation, enable_auto_sync, generate_sparse_vectors, prepend_filename_to_chunks, html_tags_to_skip, css_classes_to_skip, css_selectors_to_skip, embedding_model].hash
309
+ [tags, url, recursion_depth, max_pages_to_scrape, chunk_size, chunk_overlap, skip_embedding_generation, enable_auto_sync, generate_sparse_vectors, prepend_filename_to_chunks, html_tags_to_skip, css_classes_to_skip, css_selectors_to_skip, embedding_model, url_paths_to_include].hash
282
310
  end
283
311
 
284
312
  # Builds the object from hash
@@ -7,5 +7,5 @@ The version of the OpenAPI document: 1.0.0
7
7
  =end
8
8
 
9
9
  module Carbon
10
- VERSION = '0.2.1'
10
+ VERSION = '0.2.3'
11
11
  end
@@ -26,6 +26,17 @@ describe 'IntegrationsApi' do
26
26
  end
27
27
  end
28
28
 
29
+ # unit tests for cancel
30
+ # Cancel Data Source Items Sync
31
+ # @param sync_directory_request
32
+ # @param [Hash] opts the optional parameters
33
+ # @return [OrganizationUserDataSourceAPI]
34
+ describe 'cancel test' 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
+
29
40
  # unit tests for connect_data_source
30
41
  # Connect Data Source
31
42
  # @param connect_data_source_input
@@ -97,4 +97,16 @@ describe Carbon::SitemapScrapeRequest do
97
97
  end
98
98
  end
99
99
 
100
+ describe 'test attribute "url_paths_to_include"' do
101
+ it 'should work' do
102
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
103
+ end
104
+ end
105
+
106
+ describe 'test attribute "url_paths_to_exclude"' do
107
+ it 'should work' do
108
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
109
+ end
110
+ end
111
+
100
112
  end
@@ -97,4 +97,10 @@ describe Carbon::UploadFileFromUrlInput do
97
97
  end
98
98
  end
99
99
 
100
+ describe 'test attribute "media_type"' do
101
+ it 'should work' do
102
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
103
+ end
104
+ end
105
+
100
106
  end
@@ -103,4 +103,10 @@ describe Carbon::WebscrapeRequest do
103
103
  end
104
104
  end
105
105
 
106
+ describe 'test attribute "url_paths_to_include"' do
107
+ it 'should work' do
108
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
109
+ end
110
+ end
111
+
106
112
  end
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.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konfig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-30 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday