carbon_ruby_sdk 0.1.22 → 0.1.24
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 +104 -8
- 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 +19 -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 +2 -1
- data/lib/carbon_ruby_sdk/models/sync_options.rb +18 -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/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.1.24-blue)](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,7 +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,
|
1199
|
+
"request_id" => "7f46547c-7585-4463-bdd5-a1f8cde14b89",
|
1195
1200
|
"enable_file_picker" => true,
|
1201
|
+
"sync_source_items" => true,
|
1196
1202
|
},
|
1197
1203
|
)
|
1198
1204
|
p result
|
@@ -1238,6 +1244,7 @@ result = carbon.integrations.connect_freshdesk(
|
|
1238
1244
|
prepend_filename_to_chunks: false,
|
1239
1245
|
sync_files_on_connection: true,
|
1240
1246
|
request_id: "string_example",
|
1247
|
+
sync_source_items: true,
|
1241
1248
|
)
|
1242
1249
|
p result
|
1243
1250
|
```
|
@@ -1255,6 +1262,10 @@ p result
|
|
1255
1262
|
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
1256
1263
|
##### sync_files_on_connection: `Boolean`<a id="sync_files_on_connection-boolean"></a>
|
1257
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
|
+
|
1258
1269
|
#### 🔄 Return<a id="🔄-return"></a>
|
1259
1270
|
|
1260
1271
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1290,6 +1301,7 @@ result = carbon.integrations.connect_gitbook(
|
|
1290
1301
|
prepend_filename_to_chunks: false,
|
1291
1302
|
sync_files_on_connection: true,
|
1292
1303
|
request_id: "string_example",
|
1304
|
+
sync_source_items: true,
|
1293
1305
|
)
|
1294
1306
|
p result
|
1295
1307
|
```
|
@@ -1307,6 +1319,10 @@ p result
|
|
1307
1319
|
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
1308
1320
|
##### sync_files_on_connection: `Boolean`<a id="sync_files_on_connection-boolean"></a>
|
1309
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
|
+
|
1310
1326
|
#### 🔄 Return<a id="🔄-return"></a>
|
1311
1327
|
|
1312
1328
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -1336,6 +1352,7 @@ Once created, generate an access key for this user and share the credentials wit
|
|
1336
1352
|
result = carbon.integrations.create_aws_iam_user(
|
1337
1353
|
access_key: "string_example",
|
1338
1354
|
access_key_secret: "string_example",
|
1355
|
+
sync_source_items: true,
|
1339
1356
|
)
|
1340
1357
|
p result
|
1341
1358
|
```
|
@@ -1344,6 +1361,10 @@ p result
|
|
1344
1361
|
|
1345
1362
|
##### access_key: `String`<a id="access_key-string"></a>
|
1346
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
|
+
|
1347
1368
|
#### 🔄 Return<a id="🔄-return"></a>
|
1348
1369
|
|
1349
1370
|
[OrganizationUserDataSourceAPI](./lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb)
|
@@ -1387,10 +1408,11 @@ result = carbon.integrations.get_oauth_url(
|
|
1387
1408
|
set_page_as_boundary: false,
|
1388
1409
|
data_source_id: 1,
|
1389
1410
|
connecting_new_account: false,
|
1390
|
-
request_id: "
|
1411
|
+
request_id: "ae840422-78ad-45c5-a0bd-019c2b2e8443",
|
1391
1412
|
use_ocr: false,
|
1392
1413
|
parse_pdf_tables_with_ocr: false,
|
1393
1414
|
enable_file_picker: true,
|
1415
|
+
sync_source_items: true,
|
1394
1416
|
)
|
1395
1417
|
p result
|
1396
1418
|
```
|
@@ -1440,7 +1462,11 @@ Enable OCR for files that support it. Supported formats: pdf
|
|
1440
1462
|
##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
|
1441
1463
|
##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
|
1442
1464
|
Enable integration's file picker for sources that support it. Supported sources:
|
1443
|
-
|
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
|
1444
1470
|
|
1445
1471
|
#### 🔄 Return<a id="🔄-return"></a>
|
1446
1472
|
|
@@ -1508,6 +1534,8 @@ result = carbon.integrations.list_data_source_items(
|
|
1508
1534
|
"limit" => 10,
|
1509
1535
|
"offset" => 0,
|
1510
1536
|
},
|
1537
|
+
order_by: "name",
|
1538
|
+
order_dir: "asc",
|
1511
1539
|
)
|
1512
1540
|
p result
|
1513
1541
|
```
|
@@ -1518,6 +1546,8 @@ p result
|
|
1518
1546
|
##### parent_id: `String`<a id="parent_id-string"></a>
|
1519
1547
|
##### filters: [`ListItemsFiltersNullable`](./lib/carbon_ruby_sdk/models/list_items_filters_nullable.rb)<a id="filters-listitemsfiltersnullablelibcarbon_ruby_sdkmodelslist_items_filters_nullablerb"></a>
|
1520
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>
|
1521
1551
|
#### 🔄 Return<a id="🔄-return"></a>
|
1522
1552
|
|
1523
1553
|
[ListDataSourceItemsResponse](./lib/carbon_ruby_sdk/models/list_data_source_items_response.rb)
|
@@ -1634,6 +1664,36 @@ p result
|
|
1634
1664
|
---
|
1635
1665
|
|
1636
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
|
+
|
1637
1697
|
### `carbon.integrations.sync_confluence`<a id="carbonintegrationssync_confluence"></a>
|
1638
1698
|
|
1639
1699
|
After listing pages in a user's Confluence account, the set of selected page `ids` and the
|
@@ -1658,7 +1718,7 @@ result = carbon.integrations.sync_confluence(
|
|
1658
1718
|
prepend_filename_to_chunks: false,
|
1659
1719
|
max_items_per_chunk: 1,
|
1660
1720
|
set_page_as_boundary: false,
|
1661
|
-
request_id: "
|
1721
|
+
request_id: "2da50864-4700-4b70-8098-ddcafcc3267d",
|
1662
1722
|
use_ocr: false,
|
1663
1723
|
parse_pdf_tables_with_ocr: false,
|
1664
1724
|
)
|
@@ -1749,7 +1809,7 @@ result = carbon.integrations.sync_files(
|
|
1749
1809
|
prepend_filename_to_chunks: false,
|
1750
1810
|
max_items_per_chunk: 1,
|
1751
1811
|
set_page_as_boundary: false,
|
1752
|
-
request_id: "
|
1812
|
+
request_id: "2da50864-4700-4b70-8098-ddcafcc3267d",
|
1753
1813
|
use_ocr: false,
|
1754
1814
|
parse_pdf_tables_with_ocr: false,
|
1755
1815
|
)
|
@@ -1799,6 +1859,7 @@ expires you will need to manually update it through this endpoint.
|
|
1799
1859
|
result = carbon.integrations.sync_git_hub(
|
1800
1860
|
username: "string_example",
|
1801
1861
|
access_token: "string_example",
|
1862
|
+
sync_source_items: false,
|
1802
1863
|
)
|
1803
1864
|
p result
|
1804
1865
|
```
|
@@ -1807,6 +1868,10 @@ p result
|
|
1807
1868
|
|
1808
1869
|
##### username: `String`<a id="username-string"></a>
|
1809
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
|
+
|
1810
1875
|
#### 🔄 Return<a id="🔄-return"></a>
|
1811
1876
|
|
1812
1877
|
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
@@ -2074,6 +2139,37 @@ p result
|
|
2074
2139
|
---
|
2075
2140
|
|
2076
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
|
+
|
2077
2173
|
### `carbon.integrations.sync_rss_feed`<a id="carbonintegrationssync_rss_feed"></a>
|
2078
2174
|
|
2079
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: {})
|