carbon_ruby_sdk 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a619d3a93e65901cc357afe3bbdd8baa1aceda53801e87dd98f979b479dec97
4
- data.tar.gz: e504c2c304dc8ab8c38a79cc36d0f31e332660a4fc3d0263c8f7f5dd1f175412
3
+ metadata.gz: 48a58cba1f17ea688e80ef5572f4944be16851ffe4ab0bed12010fe0f8b12f3e
4
+ data.tar.gz: 637e68cdedc5092c2c3de53c87f99b732cb2ba2eea49f6e0296220cd741dc217
5
5
  SHA512:
6
- metadata.gz: 40d6938fe03dea03f242e913c6061093a56e8929d938038482b1e2691206b71327b42c6ce2f5d11a4d612496c36bd7a5f08da953e3f2a25bf0e520a51bcf2e53
7
- data.tar.gz: 3bd4f9fd552a4feb8cadd2854d9fa80b0ab3a9c9009857de079d196eacbd26e290ddc8444b362a0b783605d308780ca61574e808b2413ca27bcb96f19a21aedb
6
+ metadata.gz: a3ca1057eaaa76eac67308c1f22a46828e1abc53732e8ab309d4d9fe53f87a59cd9712e9d541d2ef7f3b05854dbef675ab80fbf38ea7cd2b54b1cb2cab41f002
7
+ data.tar.gz: 4354aafdeb4fdd30b24c74b266b0c839eadcba4776590a412b77f54bff85465e49f734e538bc634f3d176d20c1157932a9dc7470acb3cbebc3572619bdceb0e2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carbon_ruby_sdk (0.1.34)
4
+ carbon_ruby_sdk (0.2.1)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect external data to LLMs, no matter the source.
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v0.2.0-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.0)
9
+ [![npm](https://img.shields.io/badge/gem-v0.2.2-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.2)
10
10
 
11
11
  </div>
12
12
 
@@ -39,6 +39,7 @@ Connect external data to LLMs, no matter the source.
39
39
  * [`carbon.files.upload_from_url`](#carbonfilesupload_from_url)
40
40
  * [`carbon.files.upload_text`](#carbonfilesupload_text)
41
41
  * [`carbon.health.check`](#carbonhealthcheck)
42
+ * [`carbon.integrations.cancel`](#carbonintegrationscancel)
42
43
  * [`carbon.integrations.connect_data_source`](#carbonintegrationsconnect_data_source)
43
44
  * [`carbon.integrations.connect_freshdesk`](#carbonintegrationsconnect_freshdesk)
44
45
  * [`carbon.integrations.connect_gitbook`](#carbonintegrationsconnect_gitbook)
@@ -85,7 +86,7 @@ Connect external data to LLMs, no matter the source.
85
86
  Add to Gemfile:
86
87
 
87
88
  ```ruby
88
- gem 'carbon_ruby_sdk', '~> 0.2.0'
89
+ gem 'carbon_ruby_sdk', '~> 0.2.2'
89
90
  ```
90
91
 
91
92
  ## Getting Started<a id="getting-started"></a>
@@ -426,12 +427,6 @@ Flag to control whether or not to perform hybrid search.
426
427
 
427
428
  ##### hybrid_search_tuning_parameters: [`HybridSearchTuningParamsNullable`](./lib/carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable.rb)<a id="hybrid_search_tuning_parameters-hybridsearchtuningparamsnullablelibcarbon_ruby_sdkmodelshybrid_search_tuning_params_nullablerb"></a>
428
429
  ##### media_type: [`FileContentTypesNullable`](./lib/carbon_ruby_sdk/models/file_content_types_nullable.rb)<a id="media_type-filecontenttypesnullablelibcarbon_ruby_sdkmodelsfile_content_types_nullablerb"></a>
429
- Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform
430
- the search. Also plays a role in determining what embedding model is used to
431
- embed the query. If `IMAGE` is chosen as the media type, then the embedding
432
- model used will be an embedding model that is not text-only, *regardless* of
433
- what value is passed for `embedding_model`.
434
-
435
430
  ##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
436
431
  #### 🔄 Return<a id="🔄-return"></a>
437
432
 
@@ -996,7 +991,7 @@ result = carbon.files.upload(
996
991
  chunk_overlap: 1,
997
992
  skip_embedding_generation: false,
998
993
  set_page_as_boundary: false,
999
- embedding_model: "OPENAI",
994
+ embedding_model: "string_example",
1000
995
  use_ocr: false,
1001
996
  generate_sparse_vectors: false,
1002
997
  prepend_filename_to_chunks: false,
@@ -1026,7 +1021,7 @@ Flag to control whether or not to set the a page's worth of content as the
1026
1021
  maximum amount of content that can appear in a chunk. Only valid for PDFs. See
1027
1022
  description route description for more information.
1028
1023
 
1029
- ##### embedding_model: [`TextEmbeddingGenerators`](./lib/carbon_ruby_sdk/models/text_embedding_generators.rb)<a id="embedding_model-textembeddinggeneratorslibcarbon_ruby_sdkmodelstext_embedding_generatorsrb"></a>
1024
+ ##### embedding_model: [`EmbeddingModel`](./lib/carbon_ruby_sdk/models/embedding_model.rb)<a id="embedding_model-embeddingmodellibcarbon_ruby_sdkmodelsembedding_modelrb"></a>
1030
1025
  Embedding model that will be used to embed file chunks.
1031
1026
 
1032
1027
  ##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
@@ -1087,6 +1082,7 @@ result = carbon.files.upload_from_url(
1087
1082
  max_items_per_chunk: 1,
1088
1083
  parse_pdf_tables_with_ocr: false,
1089
1084
  detect_audio_language: false,
1085
+ media_type: "TEXT",
1090
1086
  )
1091
1087
  p result
1092
1088
  ```
@@ -1108,6 +1104,7 @@ Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1108
1104
 
1109
1105
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1110
1106
  ##### detect_audio_language: `Boolean`<a id="detect_audio_language-boolean"></a>
1107
+ ##### media_type: [`FileContentTypesNullable`](./lib/carbon_ruby_sdk/models/file_content_types_nullable.rb)<a id="media_type-filecontenttypesnullablelibcarbon_ruby_sdkmodelsfile_content_types_nullablerb"></a>
1111
1108
  #### 🔄 Return<a id="🔄-return"></a>
1112
1109
 
1113
1110
  [UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
@@ -1193,6 +1190,35 @@ p result
1193
1190
  ---
1194
1191
 
1195
1192
 
1193
+ ### `carbon.integrations.cancel`<a id="carbonintegrationscancel"></a>
1194
+
1195
+ Cancel Data Source Items Sync
1196
+
1197
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1198
+
1199
+ ```ruby
1200
+ result = carbon.integrations.cancel(
1201
+ data_source_id: 1,
1202
+ )
1203
+ p result
1204
+ ```
1205
+
1206
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1207
+
1208
+ ##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
1209
+ #### 🔄 Return<a id="🔄-return"></a>
1210
+
1211
+ [OrganizationUserDataSourceAPI](./lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb)
1212
+
1213
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1214
+
1215
+ `/integrations/items/sync/cancel` `POST`
1216
+
1217
+ [🔙 **Back to Table of Contents**](#table-of-contents)
1218
+
1219
+ ---
1220
+
1221
+
1196
1222
  ### `carbon.integrations.connect_data_source`<a id="carbonintegrationsconnect_data_source"></a>
1197
1223
 
1198
1224
  Connect Data Source
@@ -1214,7 +1240,7 @@ result = carbon.integrations.connect_data_source(
1214
1240
  "prepend_filename_to_chunks" => false,
1215
1241
  "sync_files_on_connection" => true,
1216
1242
  "set_page_as_boundary" => false,
1217
- "request_id" => "f5552316-5da3-46e6-ad9f-2f94e30d02cd",
1243
+ "request_id" => "368135ce-5cca-4fb5-a19d-42b9a409af35",
1218
1244
  "enable_file_picker" => true,
1219
1245
  "sync_source_items" => true,
1220
1246
  "incremental_sync" => false,
@@ -1433,7 +1459,7 @@ result = carbon.integrations.get_oauth_url(
1433
1459
  set_page_as_boundary: false,
1434
1460
  data_source_id: 1,
1435
1461
  connecting_new_account: false,
1436
- request_id: "273420dd-e05c-463f-a3cf-0ff28029639e",
1462
+ request_id: "2e662fad-1193-4482-a2d7-ec7b821a9d2b",
1437
1463
  use_ocr: false,
1438
1464
  parse_pdf_tables_with_ocr: false,
1439
1465
  enable_file_picker: true,
@@ -1493,7 +1519,7 @@ Enable OCR for files that support it. Supported formats: pdf
1493
1519
  ##### parse_pdf_tables_with_ocr: `Boolean`<a id="parse_pdf_tables_with_ocr-boolean"></a>
1494
1520
  ##### enable_file_picker: `Boolean`<a id="enable_file_picker-boolean"></a>
1495
1521
  Enable integration's file picker for sources that support it. Supported sources:
1496
- SHAREPOINT, DROPBOX, GOOGLE_DRIVE, BOX, ONEDRIVE
1522
+ SHAREPOINT, BOX, ONEDRIVE, GOOGLE_DRIVE, DROPBOX
1497
1523
 
1498
1524
  ##### sync_source_items: `Boolean`<a id="sync_source_items-boolean"></a>
1499
1525
  Enabling this flag will fetch all available content from the source to be listed
@@ -1755,7 +1781,7 @@ result = carbon.integrations.sync_confluence(
1755
1781
  prepend_filename_to_chunks: false,
1756
1782
  max_items_per_chunk: 1,
1757
1783
  set_page_as_boundary: false,
1758
- request_id: "2782cb96-1bf6-452c-a8d9-60c2378fd079",
1784
+ request_id: "dd2130b5-0f9f-4f3a-b450-f3fa458763ae",
1759
1785
  use_ocr: false,
1760
1786
  parse_pdf_tables_with_ocr: false,
1761
1787
  incremental_sync: false,
@@ -1858,7 +1884,7 @@ result = carbon.integrations.sync_files(
1858
1884
  prepend_filename_to_chunks: false,
1859
1885
  max_items_per_chunk: 1,
1860
1886
  set_page_as_boundary: false,
1861
- request_id: "2782cb96-1bf6-452c-a8d9-60c2378fd079",
1887
+ request_id: "dd2130b5-0f9f-4f3a-b450-f3fa458763ae",
1862
1888
  use_ocr: false,
1863
1889
  parse_pdf_tables_with_ocr: false,
1864
1890
  incremental_sync: false,
@@ -126,11 +126,11 @@ module Carbon
126
126
  # @param include_raw_file [Boolean] Flag to control whether or not to include a signed URL to the raw file containing each chunk in the response.
127
127
  # @param hybrid_search [Boolean] Flag to control whether or not to perform hybrid search.
128
128
  # @param hybrid_search_tuning_parameters [HybridSearchTuningParamsNullable]
129
- # @param media_type [FileContentTypesNullable] Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform the search. Also plays a role in determining what embedding model is used to embed the query. If `IMAGE` is chosen as the media type, then the embedding model used will be an embedding model that is not text-only, *regardless* of what value is passed for `embedding_model`.
129
+ # @param media_type [FileContentTypesNullable]
130
130
  # @param embedding_model [EmbeddingGeneratorsNullable]
131
131
  # @param body [GetEmbeddingDocumentsBody]
132
132
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
133
- def get_documents(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
133
+ def get_documents(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: SENTINEL, embedding_model: 'OPENAI', extra: {})
134
134
  _body = {}
135
135
  _body[:tags] = tags if tags != SENTINEL
136
136
  _body[:query] = query if query != SENTINEL
@@ -262,11 +262,11 @@ module Carbon
262
262
  # @param include_raw_file [Boolean] Flag to control whether or not to include a signed URL to the raw file containing each chunk in the response.
263
263
  # @param hybrid_search [Boolean] Flag to control whether or not to perform hybrid search.
264
264
  # @param hybrid_search_tuning_parameters [HybridSearchTuningParamsNullable]
265
- # @param media_type [FileContentTypesNullable] Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform the search. Also plays a role in determining what embedding model is used to embed the query. If `IMAGE` is chosen as the media type, then the embedding model used will be an embedding model that is not text-only, *regardless* of what value is passed for `embedding_model`.
265
+ # @param media_type [FileContentTypesNullable]
266
266
  # @param embedding_model [EmbeddingGeneratorsNullable]
267
267
  # @param body [GetEmbeddingDocumentsBody]
268
268
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
269
- def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: 'TEXT', embedding_model: 'OPENAI', extra: {})
269
+ def get_documents_with_http_info(query:, k:, tags: SENTINEL, query_vector: SENTINEL, file_ids: SENTINEL, parent_file_ids: SENTINEL, include_all_children: false, tags_v2: SENTINEL, include_tags: SENTINEL, include_vectors: SENTINEL, include_raw_file: SENTINEL, hybrid_search: SENTINEL, hybrid_search_tuning_parameters: SENTINEL, media_type: SENTINEL, embedding_model: 'OPENAI', extra: {})
270
270
  _body = {}
271
271
  _body[:tags] = tags if tags != SENTINEL
272
272
  _body[:query] = query if query != SENTINEL
@@ -1166,7 +1166,7 @@ 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 [TextEmbeddingGenerators] Embedding model that will be used to embed file chunks.
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.
@@ -1176,7 +1176,7 @@ module Carbon
1176
1176
  # @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
1177
1177
  # @param body [BodyCreateUploadFileUploadfilePost]
1178
1178
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1179
- def upload(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: SENTINEL, use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: 'TEXT', extra: {})
1179
+ def upload(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1180
1180
  _body = {}
1181
1181
  _body[:file] = file if file != SENTINEL
1182
1182
  body_create_upload_file_uploadfile_post = _body
@@ -1229,7 +1229,7 @@ module Carbon
1229
1229
  # @param chunk_overlap [Integer] Chunk overlap in tiktoken tokens to be used when processing file.
1230
1230
  # @param skip_embedding_generation [Boolean] Flag to control whether or not embeddings should be generated and stored when processing file.
1231
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.
1232
- # @param embedding_model [TextEmbeddingGenerators] Embedding model that will be used to embed file chunks.
1232
+ # @param embedding_model [EmbeddingModel] Embedding model that will be used to embed file chunks.
1233
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.
1234
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.
1235
1235
  # @param prepend_filename_to_chunks [Boolean] Whether or not to prepend the file's name to chunks.
@@ -1239,7 +1239,7 @@ module Carbon
1239
1239
  # @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
1240
1240
  # @param body [BodyCreateUploadFileUploadfilePost]
1241
1241
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1242
- def upload_with_http_info(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: SENTINEL, use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: 'TEXT', extra: {})
1242
+ def upload_with_http_info(file:, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', use_ocr: false, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1243
1243
  _body = {}
1244
1244
  _body[:file] = file if file != SENTINEL
1245
1245
  body_create_upload_file_uploadfile_post = _body
@@ -1267,14 +1267,14 @@ module Carbon
1267
1267
  # @option opts [Integer] :chunk_overlap Chunk overlap in tiktoken tokens to be used when processing file.
1268
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)
1269
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)
1270
- # @option opts [TextEmbeddingGenerators] :embedding_model Embedding model that will be used to embed file chunks.
1270
+ # @option opts [EmbeddingModel] :embedding_model Embedding model that will be used to embed file chunks. (default to 'OPENAI')
1271
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)
1272
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)
1273
1273
  # @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks. (default to false)
1274
1274
  # @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1275
1275
  # @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
1276
1276
  # @option opts [Boolean] :detect_audio_language Whether to automatically detect the language of the uploaded audio file. (default to false)
1277
- # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension. (default to 'TEXT')
1277
+ # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
1278
1278
  # @return [UserFile]
1279
1279
  private def upload_impl(file, body_create_upload_file_uploadfile_post, opts = {})
1280
1280
  data, _status_code, _headers = upload_with_http_info(file, body_create_upload_file_uploadfile_post, opts)
@@ -1290,14 +1290,14 @@ module Carbon
1290
1290
  # @option opts [Integer] :chunk_overlap Chunk overlap in tiktoken tokens to be used when processing file.
1291
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)
1292
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)
1293
- # @option opts [TextEmbeddingGenerators] :embedding_model Embedding model that will be used to embed file chunks.
1293
+ # @option opts [EmbeddingModel] :embedding_model Embedding model that will be used to embed file chunks. (default to 'OPENAI')
1294
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)
1295
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)
1296
1296
  # @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks. (default to false)
1297
1297
  # @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1298
1298
  # @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
1299
1299
  # @option opts [Boolean] :detect_audio_language Whether to automatically detect the language of the uploaded audio file. (default to false)
1300
- # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension. (default to 'TEXT')
1300
+ # @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
1301
1301
  # @return [APIResponse] data is UserFile, status code, headers and response
1302
1302
  private def upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, opts = {})
1303
1303
  if @api_client.config.debugging
@@ -1385,9 +1385,10 @@ module Carbon
1385
1385
  # @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1386
1386
  # @param parse_pdf_tables_with_ocr [Boolean]
1387
1387
  # @param detect_audio_language [Boolean]
1388
+ # @param media_type [FileContentTypesNullable]
1388
1389
  # @param body [UploadFileFromUrlInput]
1389
1390
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1390
- def upload_from_url(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, extra: {})
1391
+ def upload_from_url(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1391
1392
  _body = {}
1392
1393
  _body[:url] = url if url != SENTINEL
1393
1394
  _body[:file_name] = file_name if file_name != SENTINEL
@@ -1402,6 +1403,7 @@ module Carbon
1402
1403
  _body[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
1403
1404
  _body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
1404
1405
  _body[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
1406
+ _body[:media_type] = media_type if media_type != SENTINEL
1405
1407
  upload_file_from_url_input = _body
1406
1408
  api_response = upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
1407
1409
  api_response.data
@@ -1422,9 +1424,10 @@ module Carbon
1422
1424
  # @param max_items_per_chunk [Integer] Number of objects per chunk. For csv, tsv, xlsx, and json files only.
1423
1425
  # @param parse_pdf_tables_with_ocr [Boolean]
1424
1426
  # @param detect_audio_language [Boolean]
1427
+ # @param media_type [FileContentTypesNullable]
1425
1428
  # @param body [UploadFileFromUrlInput]
1426
1429
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1427
- def upload_from_url_with_http_info(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, extra: {})
1430
+ def upload_from_url_with_http_info(url:, file_name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, set_page_as_boundary: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, use_textract: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, parse_pdf_tables_with_ocr: false, detect_audio_language: false, media_type: SENTINEL, extra: {})
1428
1431
  _body = {}
1429
1432
  _body[:url] = url if url != SENTINEL
1430
1433
  _body[:file_name] = file_name if file_name != SENTINEL
@@ -1439,6 +1442,7 @@ module Carbon
1439
1442
  _body[:max_items_per_chunk] = max_items_per_chunk if max_items_per_chunk != SENTINEL
1440
1443
  _body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
1441
1444
  _body[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
1445
+ _body[:media_type] = media_type if media_type != SENTINEL
1442
1446
  upload_file_from_url_input = _body
1443
1447
  upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
1444
1448
  end
@@ -16,6 +16,98 @@ module Carbon
16
16
  @api_client = api_client
17
17
  end
18
18
 
19
+ # Cancel Data Source Items Sync
20
+ #
21
+ # @param data_source_id [Integer]
22
+ # @param body [SyncDirectoryRequest]
23
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
24
+ def cancel(data_source_id:, extra: {})
25
+ _body = {}
26
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
27
+ sync_directory_request = _body
28
+ api_response = cancel_with_http_info_impl(sync_directory_request, extra)
29
+ api_response.data
30
+ end
31
+
32
+ # Cancel Data Source Items Sync
33
+ #
34
+ # @param data_source_id [Integer]
35
+ # @param body [SyncDirectoryRequest]
36
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
37
+ def cancel_with_http_info(data_source_id:, extra: {})
38
+ _body = {}
39
+ _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
40
+ sync_directory_request = _body
41
+ cancel_with_http_info_impl(sync_directory_request, extra)
42
+ end
43
+
44
+ # Cancel Data Source Items Sync
45
+ # @param sync_directory_request [SyncDirectoryRequest]
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [OrganizationUserDataSourceAPI]
48
+ private def cancel_impl(sync_directory_request, opts = {})
49
+ data, _status_code, _headers = cancel_with_http_info(sync_directory_request, opts)
50
+ data
51
+ end
52
+
53
+ # Cancel Data Source Items Sync
54
+ # @param sync_directory_request [SyncDirectoryRequest]
55
+ # @param [Hash] opts the optional parameters
56
+ # @return [APIResponse] data is OrganizationUserDataSourceAPI, status code, headers and response
57
+ private def cancel_with_http_info_impl(sync_directory_request, opts = {})
58
+ if @api_client.config.debugging
59
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.cancel ...'
60
+ end
61
+ # verify the required parameter 'sync_directory_request' is set
62
+ if @api_client.config.client_side_validation && sync_directory_request.nil?
63
+ fail ArgumentError, "Missing the required parameter 'sync_directory_request' when calling IntegrationsApi.cancel"
64
+ end
65
+ # resource path
66
+ local_var_path = '/integrations/items/sync/cancel'
67
+
68
+ # query parameters
69
+ query_params = opts[:query_params] || {}
70
+
71
+ # header parameters
72
+ header_params = opts[:header_params] || {}
73
+ # HTTP header 'Accept' (if needed)
74
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
75
+ # HTTP header 'Content-Type'
76
+ content_type = @api_client.select_header_content_type(['application/json'])
77
+ if !content_type.nil?
78
+ header_params['Content-Type'] = content_type
79
+ end
80
+
81
+ # form parameters
82
+ form_params = opts[:form_params] || {}
83
+
84
+ # http body (model)
85
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sync_directory_request)
86
+
87
+ # return_type
88
+ return_type = opts[:debug_return_type] || 'OrganizationUserDataSourceAPI'
89
+
90
+ # auth_names
91
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
92
+
93
+ new_options = opts.merge(
94
+ :operation => :"IntegrationsApi.cancel",
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :form_params => form_params,
98
+ :body => post_body,
99
+ :auth_names => auth_names,
100
+ :return_type => return_type
101
+ )
102
+
103
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug "API called: IntegrationsApi#cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
106
+ end
107
+ APIResponse::new(data, status_code, headers, response)
108
+ end
109
+
110
+
19
111
  # Connect Data Source
20
112
  #
21
113
  # @param authentication [AuthenticationProperty]
@@ -561,13 +653,13 @@ module Carbon
561
653
  # @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
562
654
  # @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
563
655
  # @param parse_pdf_tables_with_ocr [Boolean]
564
- # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, DROPBOX, GOOGLE_DRIVE, BOX, ONEDRIVE
656
+ # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, BOX, ONEDRIVE, GOOGLE_DRIVE, DROPBOX
565
657
  # @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
566
658
  # @param incremental_sync [Boolean] Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
567
659
  # @param file_sync_config [FileSyncConfigNullable]
568
660
  # @param body [OAuthURLRequest]
569
661
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
570
- def get_oauth_url(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: '273420dd-e05c-463f-a3cf-0ff28029639e', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
662
+ def get_oauth_url(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: '2e662fad-1193-4482-a2d7-ec7b821a9d2b', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
571
663
  _body = {}
572
664
  _body[:tags] = tags if tags != SENTINEL
573
665
  _body[:scope] = scope if scope != SENTINEL
@@ -629,13 +721,13 @@ module Carbon
629
721
  # @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
630
722
  # @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
631
723
  # @param parse_pdf_tables_with_ocr [Boolean]
632
- # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, DROPBOX, GOOGLE_DRIVE, BOX, ONEDRIVE
724
+ # @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, BOX, ONEDRIVE, GOOGLE_DRIVE, DROPBOX
633
725
  # @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
634
726
  # @param incremental_sync [Boolean] Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
635
727
  # @param file_sync_config [FileSyncConfigNullable]
636
728
  # @param body [OAuthURLRequest]
637
729
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
638
- def get_oauth_url_with_http_info(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: '273420dd-e05c-463f-a3cf-0ff28029639e', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
730
+ def get_oauth_url_with_http_info(service:, tags: SENTINEL, scope: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', zendesk_subdomain: SENTINEL, microsoft_tenant: SENTINEL, sharepoint_site_name: SENTINEL, confluence_subdomain: SENTINEL, generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, salesforce_domain: SENTINEL, sync_files_on_connection: true, set_page_as_boundary: false, data_source_id: SENTINEL, connecting_new_account: false, request_id: '2e662fad-1193-4482-a2d7-ec7b821a9d2b', use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
639
731
  _body = {}
640
732
  _body[:tags] = tags if tags != SENTINEL
641
733
  _body[:scope] = scope if scope != SENTINEL
@@ -1431,7 +1523,7 @@ module Carbon
1431
1523
  # @param file_sync_config [FileSyncConfigNullable]
1432
1524
  # @param body [SyncFilesRequest]
1433
1525
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1434
- def sync_confluence(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '2782cb96-1bf6-452c-a8d9-60c2378fd079', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1526
+ def sync_confluence(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: 'dd2130b5-0f9f-4f3a-b450-f3fa458763ae', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1435
1527
  _body = {}
1436
1528
  _body[:tags] = tags if tags != SENTINEL
1437
1529
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -1479,7 +1571,7 @@ module Carbon
1479
1571
  # @param file_sync_config [FileSyncConfigNullable]
1480
1572
  # @param body [SyncFilesRequest]
1481
1573
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1482
- def sync_confluence_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '2782cb96-1bf6-452c-a8d9-60c2378fd079', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1574
+ def sync_confluence_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: 'dd2130b5-0f9f-4f3a-b450-f3fa458763ae', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1483
1575
  _body = {}
1484
1576
  _body[:tags] = tags if tags != SENTINEL
1485
1577
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -1687,7 +1779,7 @@ module Carbon
1687
1779
  # @param file_sync_config [FileSyncConfigNullable]
1688
1780
  # @param body [SyncFilesRequest]
1689
1781
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1690
- def sync_files(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '2782cb96-1bf6-452c-a8d9-60c2378fd079', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1782
+ def sync_files(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: 'dd2130b5-0f9f-4f3a-b450-f3fa458763ae', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1691
1783
  _body = {}
1692
1784
  _body[:tags] = tags if tags != SENTINEL
1693
1785
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -1735,7 +1827,7 @@ module Carbon
1735
1827
  # @param file_sync_config [FileSyncConfigNullable]
1736
1828
  # @param body [SyncFilesRequest]
1737
1829
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1738
- def sync_files_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: '2782cb96-1bf6-452c-a8d9-60c2378fd079', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1830
+ def sync_files_with_http_info(data_source_id:, ids:, tags: SENTINEL, chunk_size: 1500, chunk_overlap: 20, skip_embedding_generation: false, embedding_model: 'OPENAI', generate_sparse_vectors: false, prepend_filename_to_chunks: false, max_items_per_chunk: SENTINEL, set_page_as_boundary: false, request_id: 'dd2130b5-0f9f-4f3a-b450-f3fa458763ae', use_ocr: false, parse_pdf_tables_with_ocr: false, incremental_sync: false, file_sync_config: SENTINEL, extra: {})
1739
1831
  _body = {}
1740
1832
  _body[:tags] = tags if tags != SENTINEL
1741
1833
  _body[:data_source_id] = data_source_id if data_source_id != SENTINEL
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Carbon
13
+ # Embedding model that will be used to embed file chunks.
14
+ class EmbeddingModel
15
+ # Attribute mapping from ruby-style variable name to JSON key.
16
+ def self.attribute_map
17
+ {
18
+ }
19
+ end
20
+
21
+ # Returns all the JSON keys this model knows about
22
+ def self.acceptable_attributes
23
+ attribute_map.values
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new([
35
+ ])
36
+ end
37
+
38
+ # List of class defined in anyOf (OpenAPI v3)
39
+ def self.openapi_any_of
40
+ [
41
+ :'String',
42
+ :'TextEmbeddingGenerators'
43
+ ]
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::EmbeddingModel` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::EmbeddingModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ _any_of_found = false
73
+ self.class.openapi_any_of.each do |_class|
74
+ _any_of = Carbon.const_get(_class).build_from_hash(self.to_hash)
75
+ if _any_of.valid?
76
+ _any_of_found = true
77
+ end
78
+ end
79
+
80
+ if !_any_of_found
81
+ return false
82
+ end
83
+
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ new.build_from_hash(attributes)
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ attributes = attributes.transform_keys(&:to_sym)
119
+ self.class.openapi_types.each_pair do |key, type|
120
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = Carbon.const_get(type)
175
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -49,7 +49,6 @@ module Carbon
49
49
 
50
50
  attr_accessor :hybrid_search_tuning_parameters
51
51
 
52
- # Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform the search. Also plays a role in determining what embedding model is used to embed the query. If `IMAGE` is chosen as the media type, then the embedding model used will be an embedding model that is not text-only, *regardless* of what value is passed for `embedding_model`.
53
52
  attr_accessor :media_type
54
53
 
55
54
  attr_accessor :embedding_model
@@ -198,8 +197,6 @@ module Carbon
198
197
 
199
198
  if attributes.key?(:'media_type')
200
199
  self.media_type = attributes[:'media_type']
201
- else
202
- self.media_type = 'TEXT'
203
200
  end
204
201
 
205
202
  if attributes.key?(:'embedding_model')
@@ -61,7 +61,7 @@ module Carbon
61
61
 
62
62
  attr_accessor :parse_pdf_tables_with_ocr
63
63
 
64
- # Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, DROPBOX, GOOGLE_DRIVE, BOX, ONEDRIVE
64
+ # Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, BOX, ONEDRIVE, GOOGLE_DRIVE, DROPBOX
65
65
  attr_accessor :enable_file_picker
66
66
 
67
67
  # Enabling this flag will fetch all available content from the source to be listed via list items endpoint
@@ -279,7 +279,7 @@ module Carbon
279
279
  if attributes.key?(:'request_id')
280
280
  self.request_id = attributes[:'request_id']
281
281
  else
282
- self.request_id = '273420dd-e05c-463f-a3cf-0ff28029639e'
282
+ self.request_id = '2e662fad-1193-4482-a2d7-ec7b821a9d2b'
283
283
  end
284
284
 
285
285
  if attributes.key?(:'use_ocr')
@@ -187,7 +187,7 @@ module Carbon
187
187
  if attributes.key?(:'request_id')
188
188
  self.request_id = attributes[:'request_id']
189
189
  else
190
- self.request_id = '2782cb96-1bf6-452c-a8d9-60c2378fd079'
190
+ self.request_id = 'dd2130b5-0f9f-4f3a-b450-f3fa458763ae'
191
191
  end
192
192
 
193
193
  if attributes.key?(:'use_ocr')
@@ -182,7 +182,7 @@ module Carbon
182
182
  if attributes.key?(:'request_id')
183
183
  self.request_id = attributes[:'request_id']
184
184
  else
185
- self.request_id = 'f5552316-5da3-46e6-ad9f-2f94e30d02cd'
185
+ self.request_id = '368135ce-5cca-4fb5-a19d-42b9a409af35'
186
186
  end
187
187
 
188
188
  if attributes.key?(:'enable_file_picker')
@@ -38,6 +38,8 @@ module Carbon
38
38
 
39
39
  attr_accessor :detect_audio_language
40
40
 
41
+ attr_accessor :media_type
42
+
41
43
  # Attribute mapping from ruby-style variable name to JSON key.
42
44
  def self.attribute_map
43
45
  {
@@ -53,7 +55,8 @@ module Carbon
53
55
  :'prepend_filename_to_chunks' => :'prepend_filename_to_chunks',
54
56
  :'max_items_per_chunk' => :'max_items_per_chunk',
55
57
  :'parse_pdf_tables_with_ocr' => :'parse_pdf_tables_with_ocr',
56
- :'detect_audio_language' => :'detect_audio_language'
58
+ :'detect_audio_language' => :'detect_audio_language',
59
+ :'media_type' => :'media_type'
57
60
  }
58
61
  end
59
62
 
@@ -77,7 +80,8 @@ module Carbon
77
80
  :'prepend_filename_to_chunks' => :'Boolean',
78
81
  :'max_items_per_chunk' => :'Integer',
79
82
  :'parse_pdf_tables_with_ocr' => :'Boolean',
80
- :'detect_audio_language' => :'Boolean'
83
+ :'detect_audio_language' => :'Boolean',
84
+ :'media_type' => :'FileContentTypesNullable'
81
85
  }
82
86
  end
83
87
 
@@ -88,6 +92,7 @@ module Carbon
88
92
  :'chunk_size',
89
93
  :'chunk_overlap',
90
94
  :'max_items_per_chunk',
95
+ :'media_type'
91
96
  ])
92
97
  end
93
98
 
@@ -173,6 +178,10 @@ module Carbon
173
178
  else
174
179
  self.detect_audio_language = false
175
180
  end
181
+
182
+ if attributes.key?(:'media_type')
183
+ self.media_type = attributes[:'media_type']
184
+ end
176
185
  end
177
186
 
178
187
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -210,7 +219,8 @@ module Carbon
210
219
  prepend_filename_to_chunks == o.prepend_filename_to_chunks &&
211
220
  max_items_per_chunk == o.max_items_per_chunk &&
212
221
  parse_pdf_tables_with_ocr == o.parse_pdf_tables_with_ocr &&
213
- detect_audio_language == o.detect_audio_language
222
+ detect_audio_language == o.detect_audio_language &&
223
+ media_type == o.media_type
214
224
  end
215
225
 
216
226
  # @see the `==` method
@@ -222,7 +232,7 @@ module Carbon
222
232
  # Calculates hash code according to all attributes.
223
233
  # @return [Integer] Hash code
224
234
  def hash
225
- [url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk, parse_pdf_tables_with_ocr, detect_audio_language].hash
235
+ [url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk, parse_pdf_tables_with_ocr, detect_audio_language, media_type].hash
226
236
  end
227
237
 
228
238
  # Builds the object from hash
@@ -7,5 +7,5 @@ The version of the OpenAPI document: 1.0.0
7
7
  =end
8
8
 
9
9
  module Carbon
10
- VERSION = '0.2.0'
10
+ VERSION = '0.2.2'
11
11
  end
@@ -40,6 +40,7 @@ require 'carbon_ruby_sdk/models/document_response_list'
40
40
  require 'carbon_ruby_sdk/models/embedding_and_chunk'
41
41
  require 'carbon_ruby_sdk/models/embedding_generators'
42
42
  require 'carbon_ruby_sdk/models/embedding_generators_nullable'
43
+ require 'carbon_ruby_sdk/models/embedding_model'
43
44
  require 'carbon_ruby_sdk/models/embedding_properties'
44
45
  require 'carbon_ruby_sdk/models/embeddings_and_chunks_filters'
45
46
  require 'carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns'
@@ -151,7 +151,7 @@ describe 'FilesApi' do
151
151
  # @option opts [Integer] :chunk_overlap Chunk overlap in tiktoken tokens to be used when processing file.
152
152
  # @option opts [Boolean] :skip_embedding_generation Flag to control whether or not embeddings should be generated and stored when processing file.
153
153
  # @option opts [Boolean] :set_page_as_boundary Flag to control whether or not to set the a page&#39;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.
154
- # @option opts [TextEmbeddingGenerators] :embedding_model Embedding model that will be used to embed file chunks.
154
+ # @option opts [EmbeddingModel] :embedding_model Embedding model that will be used to embed file chunks.
155
155
  # @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.
156
156
  # @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.
157
157
  # @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file&#39;s name to chunks.
@@ -26,6 +26,17 @@ describe 'IntegrationsApi' do
26
26
  end
27
27
  end
28
28
 
29
+ # unit tests for cancel
30
+ # Cancel Data Source Items Sync
31
+ # @param sync_directory_request
32
+ # @param [Hash] opts the optional parameters
33
+ # @return [OrganizationUserDataSourceAPI]
34
+ describe 'cancel test' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
29
40
  # unit tests for connect_data_source
30
41
  # Connect Data Source
31
42
  # @param connect_data_source_input
@@ -0,0 +1,22 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'spec_helper'
10
+ require 'json'
11
+ require 'date'
12
+
13
+ # Unit tests for Carbon::EmbeddingModel
14
+ describe Carbon::EmbeddingModel do
15
+ let(:instance) { Carbon::EmbeddingModel.new }
16
+
17
+ describe 'test an instance of EmbeddingModel' do
18
+ it 'should create an instance of EmbeddingModel' do
19
+ expect(instance).to be_instance_of(Carbon::EmbeddingModel)
20
+ end
21
+ end
22
+ end
@@ -97,4 +97,10 @@ describe Carbon::UploadFileFromUrlInput do
97
97
  end
98
98
  end
99
99
 
100
+ describe 'test attribute "media_type"' do
101
+ it 'should work' do
102
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
103
+ end
104
+ end
105
+
100
106
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carbon_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konfig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2024-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -123,6 +123,7 @@ files:
123
123
  - lib/carbon_ruby_sdk/models/embedding_and_chunk.rb
124
124
  - lib/carbon_ruby_sdk/models/embedding_generators.rb
125
125
  - lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb
126
+ - lib/carbon_ruby_sdk/models/embedding_model.rb
126
127
  - lib/carbon_ruby_sdk/models/embedding_properties.rb
127
128
  - lib/carbon_ruby_sdk/models/embeddings_and_chunks_filters.rb
128
129
  - lib/carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns.rb
@@ -269,6 +270,7 @@ files:
269
270
  - spec/models/embedding_and_chunk_spec.rb
270
271
  - spec/models/embedding_generators_nullable_spec.rb
271
272
  - spec/models/embedding_generators_spec.rb
273
+ - spec/models/embedding_model_spec.rb
272
274
  - spec/models/embedding_properties_spec.rb
273
275
  - spec/models/embeddings_and_chunks_filters_spec.rb
274
276
  - spec/models/embeddings_and_chunks_order_by_columns_spec.rb
@@ -440,6 +442,7 @@ test_files:
440
442
  - spec/models/update_organization_input_spec.rb
441
443
  - spec/models/user_request_content_spec.rb
442
444
  - spec/models/gmail_sync_input_spec.rb
445
+ - spec/models/embedding_model_spec.rb
443
446
  - spec/models/delete_files_query_input_spec.rb
444
447
  - spec/models/webhook_query_input_spec.rb
445
448
  - spec/models/text_embedding_generators_spec.rb