carbon_ruby_sdk 0.1.23 → 0.1.24
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/README.md +104 -9
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +2 -2
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +252 -18
- data/lib/carbon_ruby_sdk/models/chunks_and_embeddings_upload_input.rb +4 -2
- data/lib/carbon_ruby_sdk/models/custom_credentials_type.rb +39 -0
- data/lib/carbon_ruby_sdk/models/embedding_generators.rb +2 -1
- data/lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/external_source_items_order_by.rb +37 -0
- data/lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb +17 -5
- data/lib/carbon_ruby_sdk/models/gitbook_connect_request.rb +17 -5
- data/lib/carbon_ruby_sdk/models/github_connect_request.rb +16 -4
- data/lib/carbon_ruby_sdk/models/github_fetch_repos_request.rb +260 -0
- data/lib/carbon_ruby_sdk/models/list_data_source_items_request.rb +26 -4
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +18 -6
- data/lib/carbon_ruby_sdk/models/order_dir_v2.rb +36 -0
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb +19 -5
- data/lib/carbon_ruby_sdk/models/s3_auth_request.rb +16 -4
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +1 -1
- data/lib/carbon_ruby_sdk/models/sync_options.rb +17 -5
- data/lib/carbon_ruby_sdk/models/text_embedding_generators.rb +7 -1
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +4 -0
- data/spec/api/integrations_api_spec.rb +26 -0
- data/spec/models/custom_credentials_type_spec.rb +22 -0
- data/spec/models/external_source_items_order_by_spec.rb +22 -0
- data/spec/models/fresh_desk_connect_request_spec.rb +6 -0
- data/spec/models/gitbook_connect_request_spec.rb +6 -0
- data/spec/models/github_connect_request_spec.rb +6 -0
- data/spec/models/github_fetch_repos_request_spec.rb +34 -0
- data/spec/models/list_data_source_items_request_spec.rb +12 -0
- data/spec/models/o_auth_url_request_spec.rb +6 -0
- data/spec/models/order_dir_v2_spec.rb +22 -0
- data/spec/models/organization_user_data_source_api_spec.rb +6 -0
- data/spec/models/s3_auth_request_spec.rb +6 -0
- data/spec/models/sync_options_spec.rb +6 -0
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b8e4e4279dc07f126e9253d8ac4f47ee98c5fc5b1f2b68a31c14bc0358a304b
|
4
|
+
data.tar.gz: b27e8b1c101df1112edfa1db036bd2e9afc324dc6e5be9d56f82685fa7466a12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e46731a73d27839bd352e8f6999d6a85986a8f817d0ee028d1aac1d08e473a607ba3345342014b1aee99b76ecbe7efbc3673506a6a36ad6f7d381c7c677c1571
|
7
|
+
data.tar.gz: 789a798c536144168f74adb9725cdc192d7d82cb7da8746f9aace750034ce3817c58ff61c4eedb12c027b2ea0b003e889c9577dbeb78695c6622869655663cf8
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect external data to LLMs, no matter the source.
|
8
8
|
|
9
|
-
[](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.24)
|
10
10
|
|
11
11
|
</div>
|
12
12
|
|
@@ -50,6 +50,7 @@ Connect external data to LLMs, no matter the source.
|
|
50
50
|
* [`carbon.integrations.list_gitbook_spaces`](#carbonintegrationslist_gitbook_spaces)
|
51
51
|
* [`carbon.integrations.list_labels`](#carbonintegrationslist_labels)
|
52
52
|
* [`carbon.integrations.list_outlook_categories`](#carbonintegrationslist_outlook_categories)
|
53
|
+
* [`carbon.integrations.list_repos`](#carbonintegrationslist_repos)
|
53
54
|
* [`carbon.integrations.sync_confluence`](#carbonintegrationssync_confluence)
|
54
55
|
* [`carbon.integrations.sync_data_source_items`](#carbonintegrationssync_data_source_items)
|
55
56
|
* [`carbon.integrations.sync_files`](#carbonintegrationssync_files)
|
@@ -57,6 +58,7 @@ Connect external data to LLMs, no matter the source.
|
|
57
58
|
* [`carbon.integrations.sync_gitbook`](#carbonintegrationssync_gitbook)
|
58
59
|
* [`carbon.integrations.sync_gmail`](#carbonintegrationssync_gmail)
|
59
60
|
* [`carbon.integrations.sync_outlook`](#carbonintegrationssync_outlook)
|
61
|
+
* [`carbon.integrations.sync_repos`](#carbonintegrationssync_repos)
|
60
62
|
* [`carbon.integrations.sync_rss_feed`](#carbonintegrationssync_rss_feed)
|
61
63
|
* [`carbon.integrations.sync_s3_files`](#carbonintegrationssync_s3_files)
|
62
64
|
* [`carbon.organizations.get`](#carbonorganizationsget)
|
@@ -81,7 +83,7 @@ Connect external data to LLMs, no matter the source.
|
|
81
83
|
Add to Gemfile:
|
82
84
|
|
83
85
|
```ruby
|
84
|
-
gem 'carbon_ruby_sdk', '~> 0.1.
|
86
|
+
gem 'carbon_ruby_sdk', '~> 0.1.24'
|
85
87
|
```
|
86
88
|
|
87
89
|
## Getting Started<a id="getting-started"></a>
|
@@ -507,7 +509,9 @@ result = carbon.embeddings.upload_chunks_and_embeddings(
|
|
507
509
|
],
|
508
510
|
overwrite_existing: false,
|
509
511
|
chunks_only: false,
|
510
|
-
custom_credentials: {
|
512
|
+
custom_credentials: {
|
513
|
+
"key": {},
|
514
|
+
},
|
511
515
|
)
|
512
516
|
p result
|
513
517
|
```
|
@@ -518,7 +522,7 @@ p result
|
|
518
522
|
##### chunks_and_embeddings: Array<[`SingleChunksAndEmbeddingsUploadInput`](./lib/carbon_ruby_sdk/models/single_chunks_and_embeddings_upload_input.rb)><a id="chunks_and_embeddings-array"></a>
|
519
523
|
##### overwrite_existing: `Boolean`<a id="overwrite_existing-boolean"></a>
|
520
524
|
##### chunks_only: `Boolean`<a id="chunks_only-boolean"></a>
|
521
|
-
##### custom_credentials: `Object
|
525
|
+
##### custom_credentials: `Hash<String, Object>`<a id="custom_credentials-hash"></a>
|
522
526
|
#### 🔄 Return<a id="🔄-return"></a>
|
523
527
|
|
524
528
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1192,8 +1196,9 @@ result = carbon.integrations.connect_data_source(
|
|
1192
1196
|
"prepend_filename_to_chunks" => false,
|
1193
1197
|
"sync_files_on_connection" => true,
|
1194
1198
|
"set_page_as_boundary" => false,
|
1195
|
-
"request_id" => "
|
1199
|
+
"request_id" => "7f46547c-7585-4463-bdd5-a1f8cde14b89",
|
1196
1200
|
"enable_file_picker" => true,
|
1201
|
+
"sync_source_items" => true,
|
1197
1202
|
},
|
1198
1203
|
)
|
1199
1204
|
p result
|
@@ -1239,6 +1244,7 @@ result = carbon.integrations.connect_freshdesk(
|
|
1239
1244
|
prepend_filename_to_chunks: false,
|
1240
1245
|
sync_files_on_connection: true,
|
1241
1246
|
request_id: "string_example",
|
1247
|
+
sync_source_items: true,
|
1242
1248
|
)
|
1243
1249
|
p result
|
1244
1250
|
```
|
@@ -1256,6 +1262,10 @@ p result
|
|
1256
1262
|
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
1257
1263
|
##### sync_files_on_connection: `Boolean`<a id="sync_files_on_connection-boolean"></a>
|
1258
1264
|
##### request_id: `String`<a id="request_id-string"></a>
|
1265
|
+
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1266
|
+
Enabling this flag will fetch all available content from the source to be listed
|
1267
|
+
via list items endpoint
|
1268
|
+
|
1259
1269
|
#### 🔄 Return<a id="🔄-return"></a>
|
1260
1270
|
|
1261
1271
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1291,6 +1301,7 @@ result = carbon.integrations.connect_gitbook(
|
|
1291
1301
|
prepend_filename_to_chunks: false,
|
1292
1302
|
sync_files_on_connection: true,
|
1293
1303
|
request_id: "string_example",
|
1304
|
+
sync_source_items: true,
|
1294
1305
|
)
|
1295
1306
|
p result
|
1296
1307
|
```
|
@@ -1308,6 +1319,10 @@ p result
|
|
1308
1319
|
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
1309
1320
|
##### sync_files_on_connection: `Boolean`<a id="sync_files_on_connection-boolean"></a>
|
1310
1321
|
##### request_id: `String`<a id="request_id-string"></a>
|
1322
|
+
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1323
|
+
Enabling this flag will fetch all available content from the source to be listed
|
1324
|
+
via list items endpoint
|
1325
|
+
|
1311
1326
|
#### 🔄 Return<a id="🔄-return"></a>
|
1312
1327
|
|
1313
1328
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1337,6 +1352,7 @@ Once created, generate an access key for this user and share the credentials wit
|
|
1337
1352
|
result = carbon.integrations.create_aws_iam_user(
|
1338
1353
|
access_key: "string_example",
|
1339
1354
|
access_key_secret: "string_example",
|
1355
|
+
sync_source_items: true,
|
1340
1356
|
)
|
1341
1357
|
p result
|
1342
1358
|
```
|
@@ -1345,6 +1361,10 @@ p result
|
|
1345
1361
|
|
1346
1362
|
##### access_key: `String`<a id="access_key-string"></a>
|
1347
1363
|
##### access_key_secret: `String`<a id="access_key_secret-string"></a>
|
1364
|
+
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1365
|
+
Enabling this flag will fetch all available content from the source to be listed
|
1366
|
+
via list items endpoint
|
1367
|
+
|
1348
1368
|
#### 🔄 Return<a id="🔄-return"></a>
|
1349
1369
|
|
1350
1370
|
[OrganizationUserDataSourceAPI](./lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb)
|
@@ -1388,10 +1408,11 @@ result = carbon.integrations.get_oauth_url(
|
|
1388
1408
|
set_page_as_boundary: false,
|
1389
1409
|
data_source_id: 1,
|
1390
1410
|
connecting_new_account: false,
|
1391
|
-
request_id: "
|
1411
|
+
request_id: "ae840422-78ad-45c5-a0bd-019c2b2e8443",
|
1392
1412
|
use_ocr: false,
|
1393
1413
|
parse_pdf_tables_with_ocr: false,
|
1394
1414
|
enable_file_picker: true,
|
1415
|
+
sync_source_items: true,
|
1395
1416
|
)
|
1396
1417
|
p result
|
1397
1418
|
```
|
@@ -1441,7 +1462,11 @@ Enable OCR for files that support it. Supported formats: pdf
|
|
1441
1462
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1442
1463
|
##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
|
1443
1464
|
Enable integration's file picker for sources that support it. Supported sources:
|
1444
|
-
|
1465
|
+
GOOGLE_DRIVE, BOX, ONEDRIVE, DROPBOX, SHAREPOINT
|
1466
|
+
|
1467
|
+
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1468
|
+
Enabling this flag will fetch all available content from the source to be listed
|
1469
|
+
via list items endpoint
|
1445
1470
|
|
1446
1471
|
#### 🔄 Return<a id="🔄-return"></a>
|
1447
1472
|
|
@@ -1509,6 +1534,8 @@ result = carbon.integrations.list_data_source_items(
|
|
1509
1534
|
"limit" => 10,
|
1510
1535
|
"offset" => 0,
|
1511
1536
|
},
|
1537
|
+
order_by: "name",
|
1538
|
+
order_dir: "asc",
|
1512
1539
|
)
|
1513
1540
|
p result
|
1514
1541
|
```
|
@@ -1519,6 +1546,8 @@ p result
|
|
1519
1546
|
##### parent_id: `String`<a id="parent_id-string"></a>
|
1520
1547
|
##### filters: [`ListItemsFiltersNullable`](./lib/carbon_ruby_sdk/models/list_items_filters_nullable.rb)<a id="filters-listitemsfiltersnullablelibcarbon_ruby_sdkmodelslist_items_filters_nullablerb"></a>
|
1521
1548
|
##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
|
1549
|
+
##### order_by: [`ExternalSourceItemsOrderBy`](./lib/carbon_ruby_sdk/models/external_source_items_order_by.rb)<a id="order_by-externalsourceitemsorderbylibcarbon_ruby_sdkmodelsexternal_source_items_order_byrb"></a>
|
1550
|
+
##### order_dir: [`OrderDirV2`](./lib/carbon_ruby_sdk/models/order_dir_v2.rb)<a id="order_dir-orderdirv2libcarbon_ruby_sdkmodelsorder_dir_v2rb"></a>
|
1522
1551
|
#### 🔄 Return<a id="🔄-return"></a>
|
1523
1552
|
|
1524
1553
|
[ListDataSourceItemsResponse](./lib/carbon_ruby_sdk/models/list_data_source_items_response.rb)
|
@@ -1635,6 +1664,36 @@ p result
|
|
1635
1664
|
---
|
1636
1665
|
|
1637
1666
|
|
1667
|
+
### `carbon.integrations.list_repos`<a id="carbonintegrationslist_repos"></a>
|
1668
|
+
|
1669
|
+
Once you have connected your GitHub account, you can use this endpoint to list the
|
1670
|
+
repositories your account has access to. You can use a data source ID or username to fetch from a specific account.
|
1671
|
+
|
1672
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
1673
|
+
|
1674
|
+
```ruby
|
1675
|
+
result = carbon.integrations.list_repos(
|
1676
|
+
per_page: 30,
|
1677
|
+
page: 1,
|
1678
|
+
data_source_id: 1,
|
1679
|
+
)
|
1680
|
+
p result
|
1681
|
+
```
|
1682
|
+
|
1683
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
1684
|
+
|
1685
|
+
##### per_page: `Integer`<a id="per_page-integer"></a>
|
1686
|
+
##### page: `Integer`<a id="page-integer"></a>
|
1687
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
1688
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
1689
|
+
|
1690
|
+
`/integrations/github/repos` `GET`
|
1691
|
+
|
1692
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
1693
|
+
|
1694
|
+
---
|
1695
|
+
|
1696
|
+
|
1638
1697
|
### `carbon.integrations.sync_confluence`<a id="carbonintegrationssync_confluence"></a>
|
1639
1698
|
|
1640
1699
|
After listing pages in a user's Confluence account, the set of selected page `ids` and the
|
@@ -1659,7 +1718,7 @@ result = carbon.integrations.sync_confluence(
|
|
1659
1718
|
prepend_filename_to_chunks: false,
|
1660
1719
|
max_items_per_chunk: 1,
|
1661
1720
|
set_page_as_boundary: false,
|
1662
|
-
request_id: "
|
1721
|
+
request_id: "2da50864-4700-4b70-8098-ddcafcc3267d",
|
1663
1722
|
use_ocr: false,
|
1664
1723
|
parse_pdf_tables_with_ocr: false,
|
1665
1724
|
)
|
@@ -1750,7 +1809,7 @@ result = carbon.integrations.sync_files(
|
|
1750
1809
|
prepend_filename_to_chunks: false,
|
1751
1810
|
max_items_per_chunk: 1,
|
1752
1811
|
set_page_as_boundary: false,
|
1753
|
-
request_id: "
|
1812
|
+
request_id: "2da50864-4700-4b70-8098-ddcafcc3267d",
|
1754
1813
|
use_ocr: false,
|
1755
1814
|
parse_pdf_tables_with_ocr: false,
|
1756
1815
|
)
|
@@ -1800,6 +1859,7 @@ expires you will need to manually update it through this endpoint.
|
|
1800
1859
|
result = carbon.integrations.sync_git_hub(
|
1801
1860
|
username: "string_example",
|
1802
1861
|
access_token: "string_example",
|
1862
|
+
sync_source_items: false,
|
1803
1863
|
)
|
1804
1864
|
p result
|
1805
1865
|
```
|
@@ -1808,6 +1868,10 @@ p result
|
|
1808
1868
|
|
1809
1869
|
##### username: `String`<a id="username-string"></a>
|
1810
1870
|
##### access_token: `String`<a id="access_token-string"></a>
|
1871
|
+
##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
|
1872
|
+
Enabling this flag will fetch all available content from the source to be listed
|
1873
|
+
via list items endpoint
|
1874
|
+
|
1811
1875
|
#### 🔄 Return<a id="🔄-return"></a>
|
1812
1876
|
|
1813
1877
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -2075,6 +2139,37 @@ p result
|
|
2075
2139
|
---
|
2076
2140
|
|
2077
2141
|
|
2142
|
+
### `carbon.integrations.sync_repos`<a id="carbonintegrationssync_repos"></a>
|
2143
|
+
|
2144
|
+
You can retreive repos your token has access to using /integrations/github/repos and sync their content.
|
2145
|
+
You can also pass full name of any public repository (username/repo-name). This will store the repo content with
|
2146
|
+
carbon which can be accessed through /integrations/items/list endpoint. Maximum of 25 repositories are accepted per request.
|
2147
|
+
|
2148
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
2149
|
+
|
2150
|
+
```ruby
|
2151
|
+
result = carbon.integrations.sync_repos(
|
2152
|
+
repos: [
|
2153
|
+
"string_example"
|
2154
|
+
],
|
2155
|
+
data_source_id: 1,
|
2156
|
+
)
|
2157
|
+
p result
|
2158
|
+
```
|
2159
|
+
|
2160
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
2161
|
+
|
2162
|
+
##### repos: Array<`String`><a id="repos-array"></a>
|
2163
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
2164
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
2165
|
+
|
2166
|
+
`/integrations/github/sync_repos` `POST`
|
2167
|
+
|
2168
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
2169
|
+
|
2170
|
+
---
|
2171
|
+
|
2172
|
+
|
2078
2173
|
### `carbon.integrations.sync_rss_feed`<a id="carbonintegrationssync_rss_feed"></a>
|
2079
2174
|
|
2080
2175
|
Rss Feed
|
@@ -470,7 +470,7 @@ module Carbon
|
|
470
470
|
# @param chunks_and_embeddings [Array<SingleChunksAndEmbeddingsUploadInput>]
|
471
471
|
# @param overwrite_existing [Boolean]
|
472
472
|
# @param chunks_only [Boolean]
|
473
|
-
# @param custom_credentials [Object]
|
473
|
+
# @param custom_credentials [Hash<String, Object>]
|
474
474
|
# @param body [ChunksAndEmbeddingsUploadInput]
|
475
475
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
476
476
|
def upload_chunks_and_embeddings(embedding_model:, chunks_and_embeddings:, overwrite_existing: false, chunks_only: false, custom_credentials: SENTINEL, extra: {})
|
@@ -491,7 +491,7 @@ module Carbon
|
|
491
491
|
# @param chunks_and_embeddings [Array<SingleChunksAndEmbeddingsUploadInput>]
|
492
492
|
# @param overwrite_existing [Boolean]
|
493
493
|
# @param chunks_only [Boolean]
|
494
|
-
# @param custom_credentials [Object]
|
494
|
+
# @param custom_credentials [Hash<String, Object>]
|
495
495
|
# @param body [ChunksAndEmbeddingsUploadInput]
|
496
496
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
497
497
|
def upload_chunks_and_embeddings_with_http_info(embedding_model:, chunks_and_embeddings:, overwrite_existing: false, chunks_only: false, custom_credentials: SENTINEL, extra: {})
|