carbon_ruby_sdk 0.1.34 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +42 -9
- data/lib/carbon_ruby_sdk/api/files_api.rb +13 -6
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +8 -8
- data/lib/carbon_ruby_sdk/api/organizations_api.rb +83 -0
- data/lib/carbon_ruby_sdk/models/data_source_type.rb +9 -3
- data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +9 -3
- data/lib/carbon_ruby_sdk/models/embedding_model.rb +227 -0
- data/lib/carbon_ruby_sdk/models/file_content_types.rb +3 -1
- data/lib/carbon_ruby_sdk/models/file_content_types_nullable.rb +3 -1
- data/lib/carbon_ruby_sdk/models/file_formats.rb +9 -3
- data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +9 -3
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +2 -2
- data/lib/carbon_ruby_sdk/models/organization_response.rb +39 -1
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +1 -1
- data/lib/carbon_ruby_sdk/models/sync_options.rb +1 -1
- data/lib/carbon_ruby_sdk/models/user_response.rb +85 -1
- data/lib/carbon_ruby_sdk/models/webhook.rb +25 -1
- data/lib/carbon_ruby_sdk/models/webhook_no_key.rb +25 -1
- data/lib/carbon_ruby_sdk/models/webhook_status.rb +36 -0
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +2 -0
- data/spec/api/files_api_spec.rb +2 -1
- data/spec/api/organizations_api_spec.rb +11 -0
- data/spec/models/embedding_model_spec.rb +22 -0
- data/spec/models/organization_response_spec.rb +18 -0
- data/spec/models/user_response_spec.rb +36 -0
- data/spec/models/webhook_no_key_spec.rb +12 -0
- data/spec/models/webhook_spec.rb +12 -0
- data/spec/models/webhook_status_spec.rb +22 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ba0bb9e85c323c3cdaaba5026f74ee0e128f476efacc76ea319f744f9d04dd7
|
4
|
+
data.tar.gz: 171a3185783d7efa732ce6b4edb3af8bf1558659804df6f4cc91acec4df9b9b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 373c0a7f539b131c2fc2249d87c78d112dc85da61c89b632febec99663c4a87df4c31bd69886567252d662364dceb06e43d435c709e7bfabfbb6cac5ddbfeaa9
|
7
|
+
data.tar.gz: 4b6d6fd5fc75e0b5a3e89e3a7b48bb6c7ff34e8a22fdcb2e17569d4d5216d7e042b98d5fcfc2fbd0ef88ee1f336443da4a5439d50376d962037dd1698a560559
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect external data to LLMs, no matter the source.
|
8
8
|
|
9
|
-
[![npm](https://img.shields.io/badge/gem-v0.1
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v0.2.1-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.1)
|
10
10
|
|
11
11
|
</div>
|
12
12
|
|
@@ -63,6 +63,7 @@ Connect external data to LLMs, no matter the source.
|
|
63
63
|
* [`carbon.integrations.sync_s3_files`](#carbonintegrationssync_s3_files)
|
64
64
|
* [`carbon.organizations.get`](#carbonorganizationsget)
|
65
65
|
* [`carbon.organizations.update`](#carbonorganizationsupdate)
|
66
|
+
* [`carbon.organizations.update_stats`](#carbonorganizationsupdate_stats)
|
66
67
|
* [`carbon.users.delete`](#carbonusersdelete)
|
67
68
|
* [`carbon.users.get`](#carbonusersget)
|
68
69
|
* [`carbon.users.toggle_user_features`](#carbonuserstoggle_user_features)
|
@@ -84,7 +85,7 @@ Connect external data to LLMs, no matter the source.
|
|
84
85
|
Add to Gemfile:
|
85
86
|
|
86
87
|
```ruby
|
87
|
-
gem 'carbon_ruby_sdk', '~> 0.1
|
88
|
+
gem 'carbon_ruby_sdk', '~> 0.2.1'
|
88
89
|
```
|
89
90
|
|
90
91
|
## Getting Started<a id="getting-started"></a>
|
@@ -995,13 +996,14 @@ result = carbon.files.upload(
|
|
995
996
|
chunk_overlap: 1,
|
996
997
|
skip_embedding_generation: false,
|
997
998
|
set_page_as_boundary: false,
|
998
|
-
embedding_model: "
|
999
|
+
embedding_model: "string_example",
|
999
1000
|
use_ocr: false,
|
1000
1001
|
generate_sparse_vectors: false,
|
1001
1002
|
prepend_filename_to_chunks: false,
|
1002
1003
|
max_items_per_chunk: 1,
|
1003
1004
|
parse_pdf_tables_with_ocr: false,
|
1004
1005
|
detect_audio_language: false,
|
1006
|
+
media_type: "TEXT",
|
1005
1007
|
)
|
1006
1008
|
p result
|
1007
1009
|
```
|
@@ -1024,7 +1026,7 @@ Flag to control whether or not to set the a page's worth of content as the
|
|
1024
1026
|
maximum amount of content that can appear in a chunk. Only valid for PDFs. See
|
1025
1027
|
description route description for more information.
|
1026
1028
|
|
1027
|
-
##### embedding_model: [`
|
1029
|
+
##### embedding_model: [`EmbeddingModel`](./lib/carbon_ruby_sdk/models/embedding_model.rb)<a id="embedding_model-embeddingmodellibcarbon_ruby_sdkmodelsembedding_modelrb"></a>
|
1028
1030
|
Embedding model that will be used to embed file chunks.
|
1029
1031
|
|
1030
1032
|
##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
|
@@ -1047,6 +1049,10 @@ Whether to use rich table parsing when `use_ocr` is enabled.
|
|
1047
1049
|
##### detect_audio_language: `Boolean`<a id="detect_audio_language-boolean"></a>
|
1048
1050
|
Whether to automatically detect the language of the uploaded audio file.
|
1049
1051
|
|
1052
|
+
##### media_type: [`FileContentTypesNullable`](./lib/carbon_ruby_sdk/models/file_content_types_nullable.rb)<a id="media_type-filecontenttypesnullablelibcarbon_ruby_sdkmodelsfile_content_types_nullablerb"></a>
|
1053
|
+
The media type of the file. If not provided, it will be inferred from the file
|
1054
|
+
extension.
|
1055
|
+
|
1050
1056
|
#### 🔄 Return<a id="🔄-return"></a>
|
1051
1057
|
|
1052
1058
|
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
@@ -1208,7 +1214,7 @@ result = carbon.integrations.connect_data_source(
|
|
1208
1214
|
"prepend_filename_to_chunks" => false,
|
1209
1215
|
"sync_files_on_connection" => true,
|
1210
1216
|
"set_page_as_boundary" => false,
|
1211
|
-
"request_id" => "
|
1217
|
+
"request_id" => "fceb0182-329c-4e45-953b-885c747cf4a3",
|
1212
1218
|
"enable_file_picker" => true,
|
1213
1219
|
"sync_source_items" => true,
|
1214
1220
|
"incremental_sync" => false,
|
@@ -1427,7 +1433,7 @@ result = carbon.integrations.get_oauth_url(
|
|
1427
1433
|
set_page_as_boundary: false,
|
1428
1434
|
data_source_id: 1,
|
1429
1435
|
connecting_new_account: false,
|
1430
|
-
request_id: "
|
1436
|
+
request_id: "ce1b1ec8-be64-491c-9159-c40f85fa0073",
|
1431
1437
|
use_ocr: false,
|
1432
1438
|
parse_pdf_tables_with_ocr: false,
|
1433
1439
|
enable_file_picker: true,
|
@@ -1487,7 +1493,7 @@ Enable OCR for files that support it. Supported formats: pdf
|
|
1487
1493
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1488
1494
|
##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
|
1489
1495
|
Enable integration's file picker for sources that support it. Supported sources:
|
1490
|
-
|
1496
|
+
DROPBOX, SHAREPOINT, ONEDRIVE, BOX, GOOGLE_DRIVE
|
1491
1497
|
|
1492
1498
|
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1493
1499
|
Enabling this flag will fetch all available content from the source to be listed
|
@@ -1749,7 +1755,7 @@ result = carbon.integrations.sync_confluence(
|
|
1749
1755
|
prepend_filename_to_chunks: false,
|
1750
1756
|
max_items_per_chunk: 1,
|
1751
1757
|
set_page_as_boundary: false,
|
1752
|
-
request_id: "
|
1758
|
+
request_id: "9fe9190e-384f-4baa-a416-d51ed93d1be7",
|
1753
1759
|
use_ocr: false,
|
1754
1760
|
parse_pdf_tables_with_ocr: false,
|
1755
1761
|
incremental_sync: false,
|
@@ -1852,7 +1858,7 @@ result = carbon.integrations.sync_files(
|
|
1852
1858
|
prepend_filename_to_chunks: false,
|
1853
1859
|
max_items_per_chunk: 1,
|
1854
1860
|
set_page_as_boundary: false,
|
1855
|
-
request_id: "
|
1861
|
+
request_id: "9fe9190e-384f-4baa-a416-d51ed93d1be7",
|
1856
1862
|
use_ocr: false,
|
1857
1863
|
parse_pdf_tables_with_ocr: false,
|
1858
1864
|
incremental_sync: false,
|
@@ -2408,6 +2414,33 @@ p result
|
|
2408
2414
|
---
|
2409
2415
|
|
2410
2416
|
|
2417
|
+
### `carbon.organizations.update_stats`<a id="carbonorganizationsupdate_stats"></a>
|
2418
|
+
|
2419
|
+
Use this endpoint to reaggregate the statistics for an organization, for example aggregate_file_size. The reaggregation
|
2420
|
+
process is asyncronous so a webhook will be sent with the event type being FILE_STATISTICS_AGGREGATED to notify when the
|
2421
|
+
process is complee. After this aggregation is complete, the updated statistics can be retrieved using the /organization
|
2422
|
+
endpoint. The response of /organization willalso contain a timestamp of the last time the statistics were reaggregated.
|
2423
|
+
|
2424
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
2425
|
+
|
2426
|
+
```ruby
|
2427
|
+
result = carbon.organizations.update_stats
|
2428
|
+
p result
|
2429
|
+
```
|
2430
|
+
|
2431
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
2432
|
+
|
2433
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
2434
|
+
|
2435
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
2436
|
+
|
2437
|
+
`/organization/statistics` `POST`
|
2438
|
+
|
2439
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
2440
|
+
|
2441
|
+
---
|
2442
|
+
|
2443
|
+
|
2411
2444
|
### `carbon.users.delete`<a id="carbonusersdelete"></a>
|
2412
2445
|
|
2413
2446
|
Delete Users
|
@@ -1166,16 +1166,17 @@ module Carbon
|
|
1166
1166
|
# @param chunk_overlap [Integer] Chunk overlap in tiktoken tokens to be used when processing file.
|
1167
1167
|
# @param skip_embedding_generation [Boolean] Flag to control whether or not embeddings should be generated and stored when processing file.
|
1168
1168
|
# @param set_page_as_boundary [Boolean] Flag to control whether or not to set the a page's worth of content as the maximum amount of content that can appear in a chunk. Only valid for PDFs. See description route description for more information.
|
1169
|
-
# @param embedding_model [
|
1169
|
+
# @param embedding_model [EmbeddingModel] Embedding model that will be used to embed file chunks.
|
1170
1170
|
# @param use_ocr [Boolean] Whether or not to use OCR when processing files. Only valid for PDFs. Useful for documents with tables, images, and/or scanned text.
|
1171
1171
|
# @param generate_sparse_vectors [Boolean] Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search.
|
1172
1172
|
# @param prepend_filename_to_chunks [Boolean] Whether or not to prepend the file's name to chunks.
|
1173
1173
|
# @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1174
1174
|
# @param parse_pdf_tables_with_ocr [Boolean] Whether to use rich table parsing when `use_ocr` is enabled.
|
1175
1175
|
# @param detect_audio_language [Boolean] Whether to automatically detect the language of the uploaded audio file.
|
1176
|
+
# @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
|
1176
1177
|
# @param body [BodyCreateUploadFileUploadfilePost]
|
1177
1178
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1178
|
-
def upload(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model:
|
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
1180
|
_body = {}
|
1180
1181
|
_body[:file] = file if file != SENTINEL
|
1181
1182
|
body_create_upload_file_uploadfile_post = _body
|
@@ -1190,6 +1191,7 @@ module Carbon
|
|
1190
1191
|
extra[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
|
1191
1192
|
extra[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1192
1193
|
extra[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
|
1194
|
+
extra[:media_type] = media_type if media_type != SENTINEL
|
1193
1195
|
api_response = upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, extra)
|
1194
1196
|
api_response.data
|
1195
1197
|
end
|
@@ -1227,16 +1229,17 @@ module Carbon
|
|
1227
1229
|
# @param chunk_overlap [Integer] Chunk overlap in tiktoken tokens to be used when processing file.
|
1228
1230
|
# @param skip_embedding_generation [Boolean] Flag to control whether or not embeddings should be generated and stored when processing file.
|
1229
1231
|
# @param set_page_as_boundary [Boolean] Flag to control whether or not to set the a page's worth of content as the maximum amount of content that can appear in a chunk. Only valid for PDFs. See description route description for more information.
|
1230
|
-
# @param embedding_model [
|
1232
|
+
# @param embedding_model [EmbeddingModel] Embedding model that will be used to embed file chunks.
|
1231
1233
|
# @param use_ocr [Boolean] Whether or not to use OCR when processing files. Only valid for PDFs. Useful for documents with tables, images, and/or scanned text.
|
1232
1234
|
# @param generate_sparse_vectors [Boolean] Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search.
|
1233
1235
|
# @param prepend_filename_to_chunks [Boolean] Whether or not to prepend the file's name to chunks.
|
1234
1236
|
# @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1235
1237
|
# @param parse_pdf_tables_with_ocr [Boolean] Whether to use rich table parsing when `use_ocr` is enabled.
|
1236
1238
|
# @param detect_audio_language [Boolean] Whether to automatically detect the language of the uploaded audio file.
|
1239
|
+
# @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
|
1237
1240
|
# @param body [BodyCreateUploadFileUploadfilePost]
|
1238
1241
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1239
|
-
def upload_with_http_info(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model:
|
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: {})
|
1240
1243
|
_body = {}
|
1241
1244
|
_body[:file] = file if file != SENTINEL
|
1242
1245
|
body_create_upload_file_uploadfile_post = _body
|
@@ -1251,6 +1254,7 @@ module Carbon
|
|
1251
1254
|
extra[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
|
1252
1255
|
extra[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1253
1256
|
extra[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
|
1257
|
+
extra[:media_type] = media_type if media_type != SENTINEL
|
1254
1258
|
upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, extra)
|
1255
1259
|
end
|
1256
1260
|
|
@@ -1263,13 +1267,14 @@ module Carbon
|
|
1263
1267
|
# @option opts [Integer] :chunk_overlap Chunk overlap in tiktoken tokens to be used when processing file.
|
1264
1268
|
# @option opts [Boolean] :skip_embedding_generation Flag to control whether or not embeddings should be generated and stored when processing file. (default to false)
|
1265
1269
|
# @option opts [Boolean] :set_page_as_boundary Flag to control whether or not to set the a page's worth of content as the maximum amount of content that can appear in a chunk. Only valid for PDFs. See description route description for more information. (default to false)
|
1266
|
-
# @option opts [
|
1270
|
+
# @option opts [EmbeddingModel] :embedding_model Embedding model that will be used to embed file chunks. (default to 'OPENAI')
|
1267
1271
|
# @option opts [Boolean] :use_ocr Whether or not to use OCR when processing files. Only valid for PDFs. Useful for documents with tables, images, and/or scanned text. (default to false)
|
1268
1272
|
# @option opts [Boolean] :generate_sparse_vectors Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search. (default to false)
|
1269
1273
|
# @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks. (default to false)
|
1270
1274
|
# @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1271
1275
|
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
|
1272
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')
|
1273
1278
|
# @return [UserFile]
|
1274
1279
|
private def upload_impl(file, body_create_upload_file_uploadfile_post, opts = {})
|
1275
1280
|
data, _status_code, _headers = upload_with_http_info(file, body_create_upload_file_uploadfile_post, opts)
|
@@ -1285,13 +1290,14 @@ module Carbon
|
|
1285
1290
|
# @option opts [Integer] :chunk_overlap Chunk overlap in tiktoken tokens to be used when processing file.
|
1286
1291
|
# @option opts [Boolean] :skip_embedding_generation Flag to control whether or not embeddings should be generated and stored when processing file. (default to false)
|
1287
1292
|
# @option opts [Boolean] :set_page_as_boundary Flag to control whether or not to set the a page's worth of content as the maximum amount of content that can appear in a chunk. Only valid for PDFs. See description route description for more information. (default to false)
|
1288
|
-
# @option opts [
|
1293
|
+
# @option opts [EmbeddingModel] :embedding_model Embedding model that will be used to embed file chunks. (default to 'OPENAI')
|
1289
1294
|
# @option opts [Boolean] :use_ocr Whether or not to use OCR when processing files. Only valid for PDFs. Useful for documents with tables, images, and/or scanned text. (default to false)
|
1290
1295
|
# @option opts [Boolean] :generate_sparse_vectors Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search. (default to false)
|
1291
1296
|
# @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks. (default to false)
|
1292
1297
|
# @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
1293
1298
|
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
|
1294
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')
|
1295
1301
|
# @return [APIResponse] data is UserFile, status code, headers and response
|
1296
1302
|
private def upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, opts = {})
|
1297
1303
|
if @api_client.config.debugging
|
@@ -1321,6 +1327,7 @@ module Carbon
|
|
1321
1327
|
query_params[:'max_items_per_chunk'] = opts[:'max_items_per_chunk'] if !opts[:'max_items_per_chunk'].nil?
|
1322
1328
|
query_params[:'parse_pdf_tables_with_ocr'] = opts[:'parse_pdf_tables_with_ocr'] if !opts[:'parse_pdf_tables_with_ocr'].nil?
|
1323
1329
|
query_params[:'detect_audio_language'] = opts[:'detect_audio_language'] if !opts[:'detect_audio_language'].nil?
|
1330
|
+
query_params[:'media_type'] = opts[:'media_type'] if !opts[:'media_type'].nil?
|
1324
1331
|
|
1325
1332
|
# header parameters
|
1326
1333
|
header_params = opts[:header_params] || {}
|
@@ -561,13 +561,13 @@ module Carbon
|
|
561
561
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
562
562
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
563
563
|
# @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:
|
564
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, SHAREPOINT, ONEDRIVE, BOX, GOOGLE_DRIVE
|
565
565
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
566
566
|
# @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
567
|
# @param file_sync_config [FileSyncConfigNullable]
|
568
568
|
# @param body [OAuthURLRequest]
|
569
569
|
# @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: '
|
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: {})
|
571
571
|
_body = {}
|
572
572
|
_body[:tags] = tags if tags != SENTINEL
|
573
573
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -629,13 +629,13 @@ module Carbon
|
|
629
629
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
630
630
|
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
631
631
|
# @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:
|
632
|
+
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: DROPBOX, SHAREPOINT, ONEDRIVE, BOX, GOOGLE_DRIVE
|
633
633
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
634
634
|
# @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
635
|
# @param file_sync_config [FileSyncConfigNullable]
|
636
636
|
# @param body [OAuthURLRequest]
|
637
637
|
# @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: '
|
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: {})
|
639
639
|
_body = {}
|
640
640
|
_body[:tags] = tags if tags != SENTINEL
|
641
641
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -1431,7 +1431,7 @@ module Carbon
|
|
1431
1431
|
# @param file_sync_config [FileSyncConfigNullable]
|
1432
1432
|
# @param body [SyncFilesRequest]
|
1433
1433
|
# @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: '
|
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: {})
|
1435
1435
|
_body = {}
|
1436
1436
|
_body[:tags] = tags if tags != SENTINEL
|
1437
1437
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1479,7 +1479,7 @@ module Carbon
|
|
1479
1479
|
# @param file_sync_config [FileSyncConfigNullable]
|
1480
1480
|
# @param body [SyncFilesRequest]
|
1481
1481
|
# @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: '
|
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: {})
|
1483
1483
|
_body = {}
|
1484
1484
|
_body[:tags] = tags if tags != SENTINEL
|
1485
1485
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1687,7 +1687,7 @@ module Carbon
|
|
1687
1687
|
# @param file_sync_config [FileSyncConfigNullable]
|
1688
1688
|
# @param body [SyncFilesRequest]
|
1689
1689
|
# @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: '
|
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: {})
|
1691
1691
|
_body = {}
|
1692
1692
|
_body[:tags] = tags if tags != SENTINEL
|
1693
1693
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -1735,7 +1735,7 @@ module Carbon
|
|
1735
1735
|
# @param file_sync_config [FileSyncConfigNullable]
|
1736
1736
|
# @param body [SyncFilesRequest]
|
1737
1737
|
# @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: '
|
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: {})
|
1739
1739
|
_body = {}
|
1740
1740
|
_body[:tags] = tags if tags != SENTINEL
|
1741
1741
|
_body[:data_source_id] = data_source_id if data_source_id != SENTINEL
|
@@ -177,6 +177,89 @@ module Carbon
|
|
177
177
|
end
|
178
178
|
APIResponse::new(data, status_code, headers, response)
|
179
179
|
end
|
180
|
+
|
181
|
+
|
182
|
+
# Update Organization Statistics
|
183
|
+
#
|
184
|
+
# Use this endpoint to reaggregate the statistics for an organization, for example aggregate_file_size. The reaggregation
|
185
|
+
# process is asyncronous so a webhook will be sent with the event type being FILE_STATISTICS_AGGREGATED to notify when the
|
186
|
+
# process is complee. After this aggregation is complete, the updated statistics can be retrieved using the /organization
|
187
|
+
# endpoint. The response of /organization willalso contain a timestamp of the last time the statistics were reaggregated.
|
188
|
+
#
|
189
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
190
|
+
def update_stats(extra: {})
|
191
|
+
api_response = update_stats_with_http_info_impl(extra)
|
192
|
+
api_response.data
|
193
|
+
end
|
194
|
+
|
195
|
+
# Update Organization Statistics
|
196
|
+
#
|
197
|
+
# Use this endpoint to reaggregate the statistics for an organization, for example aggregate_file_size. The reaggregation
|
198
|
+
# process is asyncronous so a webhook will be sent with the event type being FILE_STATISTICS_AGGREGATED to notify when the
|
199
|
+
# process is complee. After this aggregation is complete, the updated statistics can be retrieved using the /organization
|
200
|
+
# endpoint. The response of /organization willalso contain a timestamp of the last time the statistics were reaggregated.
|
201
|
+
#
|
202
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
203
|
+
def update_stats_with_http_info(extra: {})
|
204
|
+
update_stats_with_http_info_impl(extra)
|
205
|
+
end
|
206
|
+
|
207
|
+
# Update Organization Statistics
|
208
|
+
# Use this endpoint to reaggregate the statistics for an organization, for example aggregate_file_size. The reaggregation process is asyncronous so a webhook will be sent with the event type being FILE_STATISTICS_AGGREGATED to notify when the process is complee. After this aggregation is complete, the updated statistics can be retrieved using the /organization endpoint. The response of /organization willalso contain a timestamp of the last time the statistics were reaggregated.
|
209
|
+
# @param [Hash] opts the optional parameters
|
210
|
+
# @return [GenericSuccessResponse]
|
211
|
+
private def update_stats_impl(opts = {})
|
212
|
+
data, _status_code, _headers = update_stats_with_http_info(opts)
|
213
|
+
data
|
214
|
+
end
|
215
|
+
|
216
|
+
# Update Organization Statistics
|
217
|
+
# Use this endpoint to reaggregate the statistics for an organization, for example aggregate_file_size. The reaggregation process is asyncronous so a webhook will be sent with the event type being FILE_STATISTICS_AGGREGATED to notify when the process is complee. After this aggregation is complete, the updated statistics can be retrieved using the /organization endpoint. The response of /organization willalso contain a timestamp of the last time the statistics were reaggregated.
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @return [APIResponse] data is GenericSuccessResponse, status code, headers and response
|
220
|
+
private def update_stats_with_http_info_impl(opts = {})
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.update_stats ...'
|
223
|
+
end
|
224
|
+
# resource path
|
225
|
+
local_var_path = '/organization/statistics'
|
226
|
+
|
227
|
+
# query parameters
|
228
|
+
query_params = opts[:query_params] || {}
|
229
|
+
|
230
|
+
# header parameters
|
231
|
+
header_params = opts[:header_params] || {}
|
232
|
+
# HTTP header 'Accept' (if needed)
|
233
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
234
|
+
|
235
|
+
# form parameters
|
236
|
+
form_params = opts[:form_params] || {}
|
237
|
+
|
238
|
+
# http body (model)
|
239
|
+
post_body = opts[:debug_body]
|
240
|
+
|
241
|
+
# return_type
|
242
|
+
return_type = opts[:debug_return_type] || 'GenericSuccessResponse'
|
243
|
+
|
244
|
+
# auth_names
|
245
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
246
|
+
|
247
|
+
new_options = opts.merge(
|
248
|
+
:operation => :"OrganizationsApi.update_stats",
|
249
|
+
:header_params => header_params,
|
250
|
+
:query_params => query_params,
|
251
|
+
:form_params => form_params,
|
252
|
+
:body => post_body,
|
253
|
+
:auth_names => auth_names,
|
254
|
+
:return_type => return_type
|
255
|
+
)
|
256
|
+
|
257
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
258
|
+
if @api_client.config.debugging
|
259
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#update_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
260
|
+
end
|
261
|
+
APIResponse::new(data, status_code, headers, response)
|
262
|
+
end
|
180
263
|
end
|
181
264
|
|
182
265
|
# top-level client access to avoid having the user to insantiate their own API instances
|
@@ -47,7 +47,6 @@ module Carbon
|
|
47
47
|
PNG = "PNG".freeze
|
48
48
|
JPEG = "JPEG".freeze
|
49
49
|
MP3 = "MP3".freeze
|
50
|
-
MP4 = "MP4".freeze
|
51
50
|
MP2 = "MP2".freeze
|
52
51
|
AAC = "AAC".freeze
|
53
52
|
WAV = "WAV".freeze
|
@@ -56,11 +55,18 @@ module Carbon
|
|
56
55
|
M4_A = "M4A".freeze
|
57
56
|
OGG = "OGG".freeze
|
58
57
|
OPUS = "OPUS".freeze
|
59
|
-
WEBM = "WEBM".freeze
|
60
58
|
MPEG = "MPEG".freeze
|
59
|
+
MPG = "MPG".freeze
|
60
|
+
MP4 = "MP4".freeze
|
61
|
+
WMV = "WMV".freeze
|
62
|
+
AVI = "AVI".freeze
|
63
|
+
MOV = "MOV".freeze
|
64
|
+
MKV = "MKV".freeze
|
65
|
+
FLV = "FLV".freeze
|
66
|
+
WEBM = "WEBM".freeze
|
61
67
|
|
62
68
|
def self.all_vars
|
63
|
-
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, JPEG, MP3,
|
69
|
+
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, JPEG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
64
70
|
end
|
65
71
|
|
66
72
|
# Builds the enum from string
|
@@ -47,7 +47,6 @@ module Carbon
|
|
47
47
|
PNG = "PNG".freeze
|
48
48
|
JPEG = "JPEG".freeze
|
49
49
|
MP3 = "MP3".freeze
|
50
|
-
MP4 = "MP4".freeze
|
51
50
|
MP2 = "MP2".freeze
|
52
51
|
AAC = "AAC".freeze
|
53
52
|
WAV = "WAV".freeze
|
@@ -56,11 +55,18 @@ module Carbon
|
|
56
55
|
M4_A = "M4A".freeze
|
57
56
|
OGG = "OGG".freeze
|
58
57
|
OPUS = "OPUS".freeze
|
59
|
-
WEBM = "WEBM".freeze
|
60
58
|
MPEG = "MPEG".freeze
|
59
|
+
MPG = "MPG".freeze
|
60
|
+
MP4 = "MP4".freeze
|
61
|
+
WMV = "WMV".freeze
|
62
|
+
AVI = "AVI".freeze
|
63
|
+
MOV = "MOV".freeze
|
64
|
+
MKV = "MKV".freeze
|
65
|
+
FLV = "FLV".freeze
|
66
|
+
WEBM = "WEBM".freeze
|
61
67
|
|
62
68
|
def self.all_vars
|
63
|
-
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, JPEG, MP3,
|
69
|
+
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, JPEG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
64
70
|
end
|
65
71
|
|
66
72
|
# Builds the enum from string
|