carbon_ruby_sdk 0.2.33 → 0.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +159 -2
- data/lib/carbon_ruby_sdk/api/files_api.rb +6 -2
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +310 -4
- data/lib/carbon_ruby_sdk/models/authentication_property.rb +32 -6
- data/lib/carbon_ruby_sdk/models/azure_blob_auth_request.rb +245 -0
- data/lib/carbon_ruby_sdk/models/azure_blob_file_sync_input.rb +379 -0
- data/lib/carbon_ruby_sdk/models/azure_blob_get_file_input.rb +226 -0
- data/lib/carbon_ruby_sdk/models/azure_blob_storage_authentication.rb +244 -0
- data/lib/carbon_ruby_sdk/models/data_source_type.rb +2 -1
- data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/external_file_sync_statuses.rb +2 -1
- data/lib/carbon_ruby_sdk/models/file_sync_config.rb +16 -4
- data/lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb +16 -4
- data/lib/carbon_ruby_sdk/models/gitbook_connect_request.rb +14 -4
- data/lib/carbon_ruby_sdk/models/gitbook_sync_request.rb +15 -5
- data/lib/carbon_ruby_sdk/models/one_drive_authentication.rb +250 -0
- data/lib/carbon_ruby_sdk/models/resync_file_query_input.rb +16 -4
- data/lib/carbon_ruby_sdk/models/sharepoint_authentication.rb +1 -5
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +5 -0
- data/spec/api/integrations_api_spec.rb +24 -0
- data/spec/models/authentication_property_spec.rb +12 -0
- data/spec/models/azure_blob_auth_request_spec.rb +40 -0
- data/spec/models/azure_blob_file_sync_input_spec.rb +112 -0
- data/spec/models/azure_blob_get_file_input_spec.rb +34 -0
- data/spec/models/azure_blob_storage_authentication_spec.rb +40 -0
- data/spec/models/file_sync_config_nullable_spec.rb +6 -0
- data/spec/models/file_sync_config_spec.rb +6 -0
- data/spec/models/gitbook_connect_request_spec.rb +6 -0
- data/spec/models/gitbook_sync_request_spec.rb +6 -0
- data/spec/models/one_drive_authentication_spec.rb +46 -0
- data/spec/models/resync_file_query_input_spec.rb +6 -0
- metadata +169 -154
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8d6fb0f54090c63643bf089a081d545764e9b889db47e92849544392a941e39
|
4
|
+
data.tar.gz: 923f95de1ae3793c444c1b02e1f0cbd09f7c657d1bddde13567146fdeb515d42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '05565949db79a7439f2ff6acaf8c42e51ebf4b64ff54d835b4d508181b2b201a472185f4db8922fe801a53b17e650bd48765936c258c78b1a95b657bf3373494'
|
7
|
+
data.tar.gz: d252a3df6a15280c315dffdadfa2cf0ed2f22a54e2f8e8fe5e43a04f85981c6c25f614ecde43893a9f1329e20d3e3e0a9b30ed563250581f085948395496fb30
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect external data to LLMs, no matter the source.
|
8
8
|
|
9
|
-
[](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.35)
|
10
10
|
|
11
11
|
</div>
|
12
12
|
|
@@ -56,6 +56,8 @@ Connect external data to LLMs, no matter the source.
|
|
56
56
|
* [`carbon.integrations.list_labels`](#carbonintegrationslist_labels)
|
57
57
|
* [`carbon.integrations.list_outlook_categories`](#carbonintegrationslist_outlook_categories)
|
58
58
|
* [`carbon.integrations.list_repos`](#carbonintegrationslist_repos)
|
59
|
+
* [`carbon.integrations.sync_azure_blob_files`](#carbonintegrationssync_azure_blob_files)
|
60
|
+
* [`carbon.integrations.sync_azure_blob_storage`](#carbonintegrationssync_azure_blob_storage)
|
59
61
|
* [`carbon.integrations.sync_confluence`](#carbonintegrationssync_confluence)
|
60
62
|
* [`carbon.integrations.sync_data_source_items`](#carbonintegrationssync_data_source_items)
|
61
63
|
* [`carbon.integrations.sync_files`](#carbonintegrationssync_files)
|
@@ -94,7 +96,7 @@ Connect external data to LLMs, no matter the source.
|
|
94
96
|
Add to Gemfile:
|
95
97
|
|
96
98
|
```ruby
|
97
|
-
gem 'carbon_ruby_sdk', '~> 0.2.
|
99
|
+
gem 'carbon_ruby_sdk', '~> 0.2.35'
|
98
100
|
```
|
99
101
|
|
100
102
|
## Getting Started<a id="getting-started"></a>
|
@@ -1080,6 +1082,7 @@ result = carbon.files.resync(
|
|
1080
1082
|
chunk_size: 1,
|
1081
1083
|
chunk_overlap: 1,
|
1082
1084
|
force_embedding_generation: false,
|
1085
|
+
skip_file_processing: false,
|
1083
1086
|
)
|
1084
1087
|
p result
|
1085
1088
|
```
|
@@ -1090,6 +1093,7 @@ p result
|
|
1090
1093
|
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
1091
1094
|
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
1092
1095
|
##### force_embedding_generation: `Boolean`<a id="force_embedding_generation-boolean"></a>
|
1096
|
+
##### skip_file_processing: `Boolean`<a id="skip_file_processing-boolean"></a>
|
1093
1097
|
#### 🔄 Return<a id="🔄-return"></a>
|
1094
1098
|
|
1095
1099
|
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
@@ -1479,6 +1483,7 @@ result = carbon.integrations.connect_freshdesk(
|
|
1479
1483
|
"include_speaker_labels" => false,
|
1480
1484
|
"split_rows" => false,
|
1481
1485
|
"generate_chunks_only" => false,
|
1486
|
+
"skip_file_processing" => false,
|
1482
1487
|
},
|
1483
1488
|
)
|
1484
1489
|
p result
|
@@ -1538,6 +1543,16 @@ result = carbon.integrations.connect_gitbook(
|
|
1538
1543
|
sync_files_on_connection: true,
|
1539
1544
|
request_id: "string_example",
|
1540
1545
|
sync_source_items: true,
|
1546
|
+
file_sync_config: {
|
1547
|
+
"auto_synced_source_types" => ["ARTICLE"],
|
1548
|
+
"sync_attachments" => false,
|
1549
|
+
"detect_audio_language" => false,
|
1550
|
+
"transcription_service" => "assemblyai",
|
1551
|
+
"include_speaker_labels" => false,
|
1552
|
+
"split_rows" => false,
|
1553
|
+
"generate_chunks_only" => false,
|
1554
|
+
"skip_file_processing" => false,
|
1555
|
+
},
|
1541
1556
|
)
|
1542
1557
|
p result
|
1543
1558
|
```
|
@@ -1559,6 +1574,7 @@ p result
|
|
1559
1574
|
Enabling this flag will fetch all available content from the source to be listed
|
1560
1575
|
via list items endpoint
|
1561
1576
|
|
1577
|
+
##### file_sync_config: [`FileSyncConfigNullable`](./lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb)<a id="file_sync_config-filesyncconfignullablelibcarbon_ruby_sdkmodelsfile_sync_config_nullablerb"></a>
|
1562
1578
|
#### 🔄 Return<a id="🔄-return"></a>
|
1563
1579
|
|
1564
1580
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1601,6 +1617,7 @@ result = carbon.integrations.connect_guru(
|
|
1601
1617
|
"include_speaker_labels" => false,
|
1602
1618
|
"split_rows" => false,
|
1603
1619
|
"generate_chunks_only" => false,
|
1620
|
+
"skip_file_processing" => false,
|
1604
1621
|
},
|
1605
1622
|
)
|
1606
1623
|
p result
|
@@ -1732,6 +1749,7 @@ result = carbon.integrations.get_oauth_url(
|
|
1732
1749
|
"include_speaker_labels" => false,
|
1733
1750
|
"split_rows" => false,
|
1734
1751
|
"generate_chunks_only" => false,
|
1752
|
+
"skip_file_processing" => false,
|
1735
1753
|
},
|
1736
1754
|
automatically_open_file_picker: true,
|
1737
1755
|
gong_account_email: "string_example",
|
@@ -2080,6 +2098,129 @@ p result
|
|
2080
2098
|
---
|
2081
2099
|
|
2082
2100
|
|
2101
|
+
### `carbon.integrations.sync_azure_blob_files`<a id="carbonintegrationssync_azure_blob_files"></a>
|
2102
|
+
|
2103
|
+
After optionally loading the items via /integrations/items/sync and integrations/items/list, use the container name
|
2104
|
+
and file name as the ID in this endpoint to sync them into Carbon. Additional parameters below can associate
|
2105
|
+
data with the selected items or modify the sync behavior
|
2106
|
+
|
2107
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
2108
|
+
|
2109
|
+
```ruby
|
2110
|
+
result = carbon.integrations.sync_azure_blob_files(
|
2111
|
+
ids: [
|
2112
|
+
{
|
2113
|
+
}
|
2114
|
+
],
|
2115
|
+
tags: {},
|
2116
|
+
chunk_size: 1500,
|
2117
|
+
chunk_overlap: 20,
|
2118
|
+
skip_embedding_generation: false,
|
2119
|
+
embedding_model: "OPENAI",
|
2120
|
+
generate_sparse_vectors: false,
|
2121
|
+
prepend_filename_to_chunks: false,
|
2122
|
+
max_items_per_chunk: 1,
|
2123
|
+
set_page_as_boundary: false,
|
2124
|
+
data_source_id: 1,
|
2125
|
+
request_id: "string_example",
|
2126
|
+
use_ocr: false,
|
2127
|
+
parse_pdf_tables_with_ocr: false,
|
2128
|
+
file_sync_config: {
|
2129
|
+
"auto_synced_source_types" => ["ARTICLE"],
|
2130
|
+
"sync_attachments" => false,
|
2131
|
+
"detect_audio_language" => false,
|
2132
|
+
"transcription_service" => "assemblyai",
|
2133
|
+
"include_speaker_labels" => false,
|
2134
|
+
"split_rows" => false,
|
2135
|
+
"generate_chunks_only" => false,
|
2136
|
+
"skip_file_processing" => false,
|
2137
|
+
},
|
2138
|
+
)
|
2139
|
+
p result
|
2140
|
+
```
|
2141
|
+
|
2142
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
2143
|
+
|
2144
|
+
##### ids: Array<[`AzureBlobGetFileInput`](./lib/carbon_ruby_sdk/models/azure_blob_get_file_input.rb)><a id="ids-array"></a>
|
2145
|
+
##### tags: `Object`<a id="tags-object"></a>
|
2146
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
2147
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
2148
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
2149
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
2150
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
2151
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
2152
|
+
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
2153
|
+
Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
2154
|
+
|
2155
|
+
##### set_page_as_boundary: `Boolean`<a id="set_page_as_boundary-boolean"></a>
|
2156
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
2157
|
+
##### request_id: `String`<a id="request_id-string"></a>
|
2158
|
+
##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
|
2159
|
+
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
2160
|
+
##### file_sync_config: [`FileSyncConfigNullable`](./lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb)<a id="file_sync_config-filesyncconfignullablelibcarbon_ruby_sdkmodelsfile_sync_config_nullablerb"></a>
|
2161
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
2162
|
+
|
2163
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
2164
|
+
|
2165
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
2166
|
+
|
2167
|
+
`/integrations/azure_blob_storage/files` `POST`
|
2168
|
+
|
2169
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
2170
|
+
|
2171
|
+
---
|
2172
|
+
|
2173
|
+
|
2174
|
+
### `carbon.integrations.sync_azure_blob_storage`<a id="carbonintegrationssync_azure_blob_storage"></a>
|
2175
|
+
|
2176
|
+
This endpoint can be used to connect Azure Blob Storage.
|
2177
|
+
|
2178
|
+
For Azure Blob Storage, follow these steps:
|
2179
|
+
<ol>
|
2180
|
+
<li>Create a new Azure Storage account and grant the following permissions:
|
2181
|
+
<ul>
|
2182
|
+
<li>List containers.</li>
|
2183
|
+
<li>Read from specific containers and blobs to sync with Carbon. Ensure any future containers or blobs carry the same permissions.</li>
|
2184
|
+
</ul>
|
2185
|
+
</li>
|
2186
|
+
<li>Generate a shared access signature (SAS) token or an access key for the storage account.</li>
|
2187
|
+
</ol>
|
2188
|
+
|
2189
|
+
Once created, provide us with the following details to generate the connection URL:
|
2190
|
+
<ol>
|
2191
|
+
<li>Storage Account KeyName.</li>
|
2192
|
+
<li>Storage Account Name.</li>
|
2193
|
+
</ol>
|
2194
|
+
|
2195
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
2196
|
+
|
2197
|
+
```ruby
|
2198
|
+
result = carbon.integrations.sync_azure_blob_storage(
|
2199
|
+
account_name: "string_example",
|
2200
|
+
account_key: "string_example",
|
2201
|
+
sync_source_items: true,
|
2202
|
+
)
|
2203
|
+
p result
|
2204
|
+
```
|
2205
|
+
|
2206
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
2207
|
+
|
2208
|
+
##### account_name: `String`<a id="account_name-string"></a>
|
2209
|
+
##### account_key: `String`<a id="account_key-string"></a>
|
2210
|
+
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
2211
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
2212
|
+
|
2213
|
+
[OrganizationUserDataSourceAPI](./lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb)
|
2214
|
+
|
2215
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
2216
|
+
|
2217
|
+
`/integrations/azure_blob_storage` `POST`
|
2218
|
+
|
2219
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
2220
|
+
|
2221
|
+
---
|
2222
|
+
|
2223
|
+
|
2083
2224
|
### `carbon.integrations.sync_confluence`<a id="carbonintegrationssync_confluence"></a>
|
2084
2225
|

|
2085
2226
|
|
@@ -2119,6 +2260,7 @@ result = carbon.integrations.sync_confluence(
|
|
2119
2260
|
"include_speaker_labels" => false,
|
2120
2261
|
"split_rows" => false,
|
2121
2262
|
"generate_chunks_only" => false,
|
2263
|
+
"skip_file_processing" => false,
|
2122
2264
|
},
|
2123
2265
|
)
|
2124
2266
|
p result
|
@@ -2227,6 +2369,7 @@ result = carbon.integrations.sync_files(
|
|
2227
2369
|
"include_speaker_labels" => false,
|
2228
2370
|
"split_rows" => false,
|
2229
2371
|
"generate_chunks_only" => false,
|
2372
|
+
"skip_file_processing" => false,
|
2230
2373
|
},
|
2231
2374
|
)
|
2232
2375
|
p result
|
@@ -2329,6 +2472,16 @@ result = carbon.integrations.sync_gitbook(
|
|
2329
2472
|
generate_sparse_vectors: false,
|
2330
2473
|
prepend_filename_to_chunks: false,
|
2331
2474
|
request_id: "string_example",
|
2475
|
+
file_sync_config: {
|
2476
|
+
"auto_synced_source_types" => ["ARTICLE"],
|
2477
|
+
"sync_attachments" => false,
|
2478
|
+
"detect_audio_language" => false,
|
2479
|
+
"transcription_service" => "assemblyai",
|
2480
|
+
"include_speaker_labels" => false,
|
2481
|
+
"split_rows" => false,
|
2482
|
+
"generate_chunks_only" => false,
|
2483
|
+
"skip_file_processing" => false,
|
2484
|
+
},
|
2332
2485
|
)
|
2333
2486
|
p result
|
2334
2487
|
```
|
@@ -2345,6 +2498,7 @@ p result
|
|
2345
2498
|
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
2346
2499
|
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
2347
2500
|
##### request_id: `String`<a id="request_id-string"></a>
|
2501
|
+
##### file_sync_config: [`FileSyncConfigNullable`](./lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb)<a id="file_sync_config-filesyncconfignullablelibcarbon_ruby_sdkmodelsfile_sync_config_nullablerb"></a>
|
2348
2502
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
2349
2503
|
|
2350
2504
|
`/integrations/gitbook/sync` `POST`
|
@@ -2434,6 +2588,7 @@ result = carbon.integrations.sync_gmail(
|
|
2434
2588
|
"include_speaker_labels" => false,
|
2435
2589
|
"split_rows" => false,
|
2436
2590
|
"generate_chunks_only" => false,
|
2591
|
+
"skip_file_processing" => false,
|
2437
2592
|
},
|
2438
2593
|
incremental_sync: false,
|
2439
2594
|
)
|
@@ -2556,6 +2711,7 @@ result = carbon.integrations.sync_outlook(
|
|
2556
2711
|
"include_speaker_labels" => false,
|
2557
2712
|
"split_rows" => false,
|
2558
2713
|
"generate_chunks_only" => false,
|
2714
|
+
"skip_file_processing" => false,
|
2559
2715
|
},
|
2560
2716
|
incremental_sync: false,
|
2561
2717
|
)
|
@@ -2702,6 +2858,7 @@ result = carbon.integrations.sync_s3_files(
|
|
2702
2858
|
"include_speaker_labels" => false,
|
2703
2859
|
"split_rows" => false,
|
2704
2860
|
"generate_chunks_only" => false,
|
2861
|
+
"skip_file_processing" => false,
|
2705
2862
|
},
|
2706
2863
|
)
|
2707
2864
|
p result
|
@@ -1231,14 +1231,16 @@ module Carbon
|
|
1231
1231
|
# @param chunk_size [Integer]
|
1232
1232
|
# @param chunk_overlap [Integer]
|
1233
1233
|
# @param force_embedding_generation [Boolean]
|
1234
|
+
# @param skip_file_processing [Boolean]
|
1234
1235
|
# @param body [ResyncFileQueryInput]
|
1235
1236
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1236
|
-
def resync(file_id:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, force_embedding_generation: false, extra: {})
|
1237
|
+
def resync(file_id:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, force_embedding_generation: false, skip_file_processing: false, extra: {})
|
1237
1238
|
_body = {}
|
1238
1239
|
_body[:file_id] = file_id if file_id != SENTINEL
|
1239
1240
|
_body[:chunk_size] = chunk_size if chunk_size != SENTINEL
|
1240
1241
|
_body[:chunk_overlap] = chunk_overlap if chunk_overlap != SENTINEL
|
1241
1242
|
_body[:force_embedding_generation] = force_embedding_generation if force_embedding_generation != SENTINEL
|
1243
|
+
_body[:skip_file_processing] = skip_file_processing if skip_file_processing != SENTINEL
|
1242
1244
|
resync_file_query_input = _body
|
1243
1245
|
api_response = resync_with_http_info_impl(resync_file_query_input, extra)
|
1244
1246
|
api_response.data
|
@@ -1250,14 +1252,16 @@ module Carbon
|
|
1250
1252
|
# @param chunk_size [Integer]
|
1251
1253
|
# @param chunk_overlap [Integer]
|
1252
1254
|
# @param force_embedding_generation [Boolean]
|
1255
|
+
# @param skip_file_processing [Boolean]
|
1253
1256
|
# @param body [ResyncFileQueryInput]
|
1254
1257
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1255
|
-
def resync_with_http_info(file_id:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, force_embedding_generation: false, extra: {})
|
1258
|
+
def resync_with_http_info(file_id:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, force_embedding_generation: false, skip_file_processing: false, extra: {})
|
1256
1259
|
_body = {}
|
1257
1260
|
_body[:file_id] = file_id if file_id != SENTINEL
|
1258
1261
|
_body[:chunk_size] = chunk_size if chunk_size != SENTINEL
|
1259
1262
|
_body[:chunk_overlap] = chunk_overlap if chunk_overlap != SENTINEL
|
1260
1263
|
_body[:force_embedding_generation] = force_embedding_generation if force_embedding_generation != SENTINEL
|
1264
|
+
_body[:skip_file_processing] = skip_file_processing if skip_file_processing != SENTINEL
|
1261
1265
|
resync_file_query_input = _body
|
1262
1266
|
resync_with_http_info_impl(resync_file_query_input, extra)
|
1263
1267
|
end
|