carbon_ruby_sdk 0.2.20 → 0.2.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +108 -3
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +6 -2
- data/lib/carbon_ruby_sdk/api/files_api.rb +231 -6
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +8 -4
- data/lib/carbon_ruby_sdk/models/cold_storage_props.rb +229 -0
- data/lib/carbon_ruby_sdk/models/embedding_storage_status.rb +38 -0
- data/lib/carbon_ruby_sdk/models/file_sync_config.rb +13 -1
- data/lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb +13 -1
- data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +17 -5
- data/lib/carbon_ruby_sdk/models/modify_cold_storage_parameters_query_input.rb +235 -0
- data/lib/carbon_ruby_sdk/models/move_to_hot_storage_query_input.rb +215 -0
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +17 -6
- data/lib/carbon_ruby_sdk/models/raw_text_input.rb +14 -5
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +2 -2
- data/lib/carbon_ruby_sdk/models/sync_options.rb +16 -5
- data/lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb +24 -4
- data/lib/carbon_ruby_sdk/models/user_file.rb +39 -1
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +4 -0
- data/spec/api/files_api_spec.rb +25 -0
- data/spec/models/cold_storage_props_spec.rb +34 -0
- data/spec/models/embedding_storage_status_spec.rb +22 -0
- data/spec/models/file_sync_config_nullable_spec.rb +6 -0
- data/spec/models/file_sync_config_spec.rb +6 -0
- data/spec/models/get_embedding_documents_body_spec.rb +6 -0
- data/spec/models/modify_cold_storage_parameters_query_input_spec.rb +40 -0
- data/spec/models/move_to_hot_storage_query_input_spec.rb +28 -0
- data/spec/models/o_auth_url_request_spec.rb +6 -0
- data/spec/models/raw_text_input_spec.rb +6 -0
- data/spec/models/sent_webhook_payload_spec.rb +1 -1
- data/spec/models/sync_options_spec.rb +6 -0
- data/spec/models/upload_file_from_url_input_spec.rb +12 -0
- data/spec/models/user_file_spec.rb +18 -0
- metadata +14 -2
@@ -691,6 +691,198 @@ module Carbon
|
|
691
691
|
end
|
692
692
|
|
693
693
|
|
694
|
+
# Modify Cold Storage Parameters
|
695
|
+
#
|
696
|
+
# @param filters [OrganizationUserFilesToSyncFilters]
|
697
|
+
# @param enable_cold_storage [Boolean]
|
698
|
+
# @param hot_storage_time_to_live [Integer]
|
699
|
+
# @param body [ModifyColdStorageParametersQueryInput]
|
700
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
701
|
+
def modify_cold_storage_parameters(filters: SENTINEL, enable_cold_storage: SENTINEL, hot_storage_time_to_live: SENTINEL, extra: {})
|
702
|
+
_body = {}
|
703
|
+
_body[:filters] = filters if filters != SENTINEL
|
704
|
+
_body[:enable_cold_storage] = enable_cold_storage if enable_cold_storage != SENTINEL
|
705
|
+
_body[:hot_storage_time_to_live] = hot_storage_time_to_live if hot_storage_time_to_live != SENTINEL
|
706
|
+
modify_cold_storage_parameters_query_input = _body
|
707
|
+
api_response = modify_cold_storage_parameters_with_http_info_impl(modify_cold_storage_parameters_query_input, extra)
|
708
|
+
api_response.data
|
709
|
+
end
|
710
|
+
|
711
|
+
# Modify Cold Storage Parameters
|
712
|
+
#
|
713
|
+
# @param filters [OrganizationUserFilesToSyncFilters]
|
714
|
+
# @param enable_cold_storage [Boolean]
|
715
|
+
# @param hot_storage_time_to_live [Integer]
|
716
|
+
# @param body [ModifyColdStorageParametersQueryInput]
|
717
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
718
|
+
def modify_cold_storage_parameters_with_http_info(filters: SENTINEL, enable_cold_storage: SENTINEL, hot_storage_time_to_live: SENTINEL, extra: {})
|
719
|
+
_body = {}
|
720
|
+
_body[:filters] = filters if filters != SENTINEL
|
721
|
+
_body[:enable_cold_storage] = enable_cold_storage if enable_cold_storage != SENTINEL
|
722
|
+
_body[:hot_storage_time_to_live] = hot_storage_time_to_live if hot_storage_time_to_live != SENTINEL
|
723
|
+
modify_cold_storage_parameters_query_input = _body
|
724
|
+
modify_cold_storage_parameters_with_http_info_impl(modify_cold_storage_parameters_query_input, extra)
|
725
|
+
end
|
726
|
+
|
727
|
+
# Modify Cold Storage Parameters
|
728
|
+
# @param modify_cold_storage_parameters_query_input [ModifyColdStorageParametersQueryInput]
|
729
|
+
# @param [Hash] opts the optional parameters
|
730
|
+
# @return [Boolean]
|
731
|
+
private def modify_cold_storage_parameters_impl(modify_cold_storage_parameters_query_input, opts = {})
|
732
|
+
data, _status_code, _headers = modify_cold_storage_parameters_with_http_info(modify_cold_storage_parameters_query_input, opts)
|
733
|
+
data
|
734
|
+
end
|
735
|
+
|
736
|
+
# Modify Cold Storage Parameters
|
737
|
+
# @param modify_cold_storage_parameters_query_input [ModifyColdStorageParametersQueryInput]
|
738
|
+
# @param [Hash] opts the optional parameters
|
739
|
+
# @return [APIResponse] data is Boolean, status code, headers and response
|
740
|
+
private def modify_cold_storage_parameters_with_http_info_impl(modify_cold_storage_parameters_query_input, opts = {})
|
741
|
+
if @api_client.config.debugging
|
742
|
+
@api_client.config.logger.debug 'Calling API: FilesApi.modify_cold_storage_parameters ...'
|
743
|
+
end
|
744
|
+
# verify the required parameter 'modify_cold_storage_parameters_query_input' is set
|
745
|
+
if @api_client.config.client_side_validation && modify_cold_storage_parameters_query_input.nil?
|
746
|
+
fail ArgumentError, "Missing the required parameter 'modify_cold_storage_parameters_query_input' when calling FilesApi.modify_cold_storage_parameters"
|
747
|
+
end
|
748
|
+
# resource path
|
749
|
+
local_var_path = '/modify_cold_storage_parameters'
|
750
|
+
|
751
|
+
# query parameters
|
752
|
+
query_params = opts[:query_params] || {}
|
753
|
+
|
754
|
+
# header parameters
|
755
|
+
header_params = opts[:header_params] || {}
|
756
|
+
# HTTP header 'Accept' (if needed)
|
757
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
758
|
+
# HTTP header 'Content-Type'
|
759
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
760
|
+
if !content_type.nil?
|
761
|
+
header_params['Content-Type'] = content_type
|
762
|
+
end
|
763
|
+
|
764
|
+
# form parameters
|
765
|
+
form_params = opts[:form_params] || {}
|
766
|
+
|
767
|
+
# http body (model)
|
768
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(modify_cold_storage_parameters_query_input)
|
769
|
+
|
770
|
+
# return_type
|
771
|
+
return_type = opts[:debug_return_type] || 'Boolean'
|
772
|
+
|
773
|
+
# auth_names
|
774
|
+
auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
|
775
|
+
|
776
|
+
new_options = opts.merge(
|
777
|
+
:operation => :"FilesApi.modify_cold_storage_parameters",
|
778
|
+
:header_params => header_params,
|
779
|
+
:query_params => query_params,
|
780
|
+
:form_params => form_params,
|
781
|
+
:body => post_body,
|
782
|
+
:auth_names => auth_names,
|
783
|
+
:return_type => return_type
|
784
|
+
)
|
785
|
+
|
786
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
787
|
+
if @api_client.config.debugging
|
788
|
+
@api_client.config.logger.debug "API called: FilesApi#modify_cold_storage_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
789
|
+
end
|
790
|
+
APIResponse::new(data, status_code, headers, response)
|
791
|
+
end
|
792
|
+
|
793
|
+
|
794
|
+
# Move To Hot Storage
|
795
|
+
#
|
796
|
+
# @param filters [OrganizationUserFilesToSyncFilters]
|
797
|
+
# @param body [MoveToHotStorageQueryInput]
|
798
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
799
|
+
def move_to_hot_storage(filters: SENTINEL, extra: {})
|
800
|
+
_body = {}
|
801
|
+
_body[:filters] = filters if filters != SENTINEL
|
802
|
+
move_to_hot_storage_query_input = _body
|
803
|
+
api_response = move_to_hot_storage_with_http_info_impl(move_to_hot_storage_query_input, extra)
|
804
|
+
api_response.data
|
805
|
+
end
|
806
|
+
|
807
|
+
# Move To Hot Storage
|
808
|
+
#
|
809
|
+
# @param filters [OrganizationUserFilesToSyncFilters]
|
810
|
+
# @param body [MoveToHotStorageQueryInput]
|
811
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
812
|
+
def move_to_hot_storage_with_http_info(filters: SENTINEL, extra: {})
|
813
|
+
_body = {}
|
814
|
+
_body[:filters] = filters if filters != SENTINEL
|
815
|
+
move_to_hot_storage_query_input = _body
|
816
|
+
move_to_hot_storage_with_http_info_impl(move_to_hot_storage_query_input, extra)
|
817
|
+
end
|
818
|
+
|
819
|
+
# Move To Hot Storage
|
820
|
+
# @param move_to_hot_storage_query_input [MoveToHotStorageQueryInput]
|
821
|
+
# @param [Hash] opts the optional parameters
|
822
|
+
# @return [Boolean]
|
823
|
+
private def move_to_hot_storage_impl(move_to_hot_storage_query_input, opts = {})
|
824
|
+
data, _status_code, _headers = move_to_hot_storage_with_http_info(move_to_hot_storage_query_input, opts)
|
825
|
+
data
|
826
|
+
end
|
827
|
+
|
828
|
+
# Move To Hot Storage
|
829
|
+
# @param move_to_hot_storage_query_input [MoveToHotStorageQueryInput]
|
830
|
+
# @param [Hash] opts the optional parameters
|
831
|
+
# @return [APIResponse] data is Boolean, status code, headers and response
|
832
|
+
private def move_to_hot_storage_with_http_info_impl(move_to_hot_storage_query_input, opts = {})
|
833
|
+
if @api_client.config.debugging
|
834
|
+
@api_client.config.logger.debug 'Calling API: FilesApi.move_to_hot_storage ...'
|
835
|
+
end
|
836
|
+
# verify the required parameter 'move_to_hot_storage_query_input' is set
|
837
|
+
if @api_client.config.client_side_validation && move_to_hot_storage_query_input.nil?
|
838
|
+
fail ArgumentError, "Missing the required parameter 'move_to_hot_storage_query_input' when calling FilesApi.move_to_hot_storage"
|
839
|
+
end
|
840
|
+
# resource path
|
841
|
+
local_var_path = '/move_to_hot_storage'
|
842
|
+
|
843
|
+
# query parameters
|
844
|
+
query_params = opts[:query_params] || {}
|
845
|
+
|
846
|
+
# header parameters
|
847
|
+
header_params = opts[:header_params] || {}
|
848
|
+
# HTTP header 'Accept' (if needed)
|
849
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
850
|
+
# HTTP header 'Content-Type'
|
851
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
852
|
+
if !content_type.nil?
|
853
|
+
header_params['Content-Type'] = content_type
|
854
|
+
end
|
855
|
+
|
856
|
+
# form parameters
|
857
|
+
form_params = opts[:form_params] || {}
|
858
|
+
|
859
|
+
# http body (model)
|
860
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(move_to_hot_storage_query_input)
|
861
|
+
|
862
|
+
# return_type
|
863
|
+
return_type = opts[:debug_return_type] || 'Boolean'
|
864
|
+
|
865
|
+
# auth_names
|
866
|
+
auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
|
867
|
+
|
868
|
+
new_options = opts.merge(
|
869
|
+
:operation => :"FilesApi.move_to_hot_storage",
|
870
|
+
:header_params => header_params,
|
871
|
+
:query_params => query_params,
|
872
|
+
:form_params => form_params,
|
873
|
+
:body => post_body,
|
874
|
+
:auth_names => auth_names,
|
875
|
+
:return_type => return_type
|
876
|
+
)
|
877
|
+
|
878
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
879
|
+
if @api_client.config.debugging
|
880
|
+
@api_client.config.logger.debug "API called: FilesApi#move_to_hot_storage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
881
|
+
end
|
882
|
+
APIResponse::new(data, status_code, headers, response)
|
883
|
+
end
|
884
|
+
|
885
|
+
|
694
886
|
# User Files V2
|
695
887
|
#
|
696
888
|
# For pre-filtering documents, using `tags_v2` is preferred to using `tags` (which is now deprecated). If both `tags_v2`
|
@@ -1178,11 +1370,14 @@ module Carbon
|
|
1178
1370
|
# @param parse_pdf_tables_with_ocr [Boolean] Whether to use rich table parsing when `use_ocr` is enabled.
|
1179
1371
|
# @param detect_audio_language [Boolean] Whether to automatically detect the language of the uploaded audio file.
|
1180
1372
|
# @param transcription_service [TranscriptionServiceNullable] The transcription service to use for audio files. If no service is specified, 'deepgram' will be used.
|
1373
|
+
# @param include_speaker_labels [Boolean] Detect multiple speakers and label segments of speech by speaker for audio files.
|
1181
1374
|
# @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
|
1182
1375
|
# @param split_rows [Boolean] Whether to split tabular rows into chunks. Currently only valid for CSV, TSV, and XLSX files.
|
1376
|
+
# @param enable_cold_storage [Boolean] Enable cold storage for the file. If set to true, the file will be moved to cold storage after a certain period of inactivity. Default is false.
|
1377
|
+
# @param hot_storage_time_to_live [Integer] Time in seconds after which the file will be moved to cold storage.
|
1183
1378
|
# @param body [BodyCreateUploadFileUploadfilePost]
|
1184
1379
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1185
|
-
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, transcription_service: SENTINEL, media_type: SENTINEL, split_rows: false, extra: {})
|
1380
|
+
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, transcription_service: SENTINEL, include_speaker_labels: false, media_type: SENTINEL, split_rows: false, enable_cold_storage: false, hot_storage_time_to_live: SENTINEL, extra: {})
|
1186
1381
|
_body = {}
|
1187
1382
|
_body[:file] = file if file != SENTINEL
|
1188
1383
|
body_create_upload_file_uploadfile_post = _body
|
@@ -1198,8 +1393,11 @@ module Carbon
|
|
1198
1393
|
extra[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1199
1394
|
extra[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
|
1200
1395
|
extra[:transcription_service] = transcription_service if transcription_service != SENTINEL
|
1396
|
+
extra[:include_speaker_labels] = include_speaker_labels if include_speaker_labels != SENTINEL
|
1201
1397
|
extra[:media_type] = media_type if media_type != SENTINEL
|
1202
1398
|
extra[:split_rows] = split_rows if split_rows != SENTINEL
|
1399
|
+
extra[:enable_cold_storage] = enable_cold_storage if enable_cold_storage != SENTINEL
|
1400
|
+
extra[:hot_storage_time_to_live] = hot_storage_time_to_live if hot_storage_time_to_live != SENTINEL
|
1203
1401
|
api_response = upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, extra)
|
1204
1402
|
api_response.data
|
1205
1403
|
end
|
@@ -1245,11 +1443,14 @@ module Carbon
|
|
1245
1443
|
# @param parse_pdf_tables_with_ocr [Boolean] Whether to use rich table parsing when `use_ocr` is enabled.
|
1246
1444
|
# @param detect_audio_language [Boolean] Whether to automatically detect the language of the uploaded audio file.
|
1247
1445
|
# @param transcription_service [TranscriptionServiceNullable] The transcription service to use for audio files. If no service is specified, 'deepgram' will be used.
|
1446
|
+
# @param include_speaker_labels [Boolean] Detect multiple speakers and label segments of speech by speaker for audio files.
|
1248
1447
|
# @param media_type [FileContentTypesNullable] The media type of the file. If not provided, it will be inferred from the file extension.
|
1249
1448
|
# @param split_rows [Boolean] Whether to split tabular rows into chunks. Currently only valid for CSV, TSV, and XLSX files.
|
1449
|
+
# @param enable_cold_storage [Boolean] Enable cold storage for the file. If set to true, the file will be moved to cold storage after a certain period of inactivity. Default is false.
|
1450
|
+
# @param hot_storage_time_to_live [Integer] Time in seconds after which the file will be moved to cold storage.
|
1250
1451
|
# @param body [BodyCreateUploadFileUploadfilePost]
|
1251
1452
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1252
|
-
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, transcription_service: SENTINEL, media_type: SENTINEL, split_rows: false, extra: {})
|
1453
|
+
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, transcription_service: SENTINEL, include_speaker_labels: false, media_type: SENTINEL, split_rows: false, enable_cold_storage: false, hot_storage_time_to_live: SENTINEL, extra: {})
|
1253
1454
|
_body = {}
|
1254
1455
|
_body[:file] = file if file != SENTINEL
|
1255
1456
|
body_create_upload_file_uploadfile_post = _body
|
@@ -1265,8 +1466,11 @@ module Carbon
|
|
1265
1466
|
extra[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1266
1467
|
extra[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
|
1267
1468
|
extra[:transcription_service] = transcription_service if transcription_service != SENTINEL
|
1469
|
+
extra[:include_speaker_labels] = include_speaker_labels if include_speaker_labels != SENTINEL
|
1268
1470
|
extra[:media_type] = media_type if media_type != SENTINEL
|
1269
1471
|
extra[:split_rows] = split_rows if split_rows != SENTINEL
|
1472
|
+
extra[:enable_cold_storage] = enable_cold_storage if enable_cold_storage != SENTINEL
|
1473
|
+
extra[:hot_storage_time_to_live] = hot_storage_time_to_live if hot_storage_time_to_live != SENTINEL
|
1270
1474
|
upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, extra)
|
1271
1475
|
end
|
1272
1476
|
|
@@ -1287,8 +1491,11 @@ module Carbon
|
|
1287
1491
|
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
|
1288
1492
|
# @option opts [Boolean] :detect_audio_language Whether to automatically detect the language of the uploaded audio file. (default to false)
|
1289
1493
|
# @option opts [TranscriptionServiceNullable] :transcription_service The transcription service to use for audio files. If no service is specified, 'deepgram' will be used.
|
1494
|
+
# @option opts [Boolean] :include_speaker_labels Detect multiple speakers and label segments of speech by speaker for audio files. (default to false)
|
1290
1495
|
# @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
|
1291
1496
|
# @option opts [Boolean] :split_rows Whether to split tabular rows into chunks. Currently only valid for CSV, TSV, and XLSX files. (default to false)
|
1497
|
+
# @option opts [Boolean] :enable_cold_storage Enable cold storage for the file. If set to true, the file will be moved to cold storage after a certain period of inactivity. Default is false. (default to false)
|
1498
|
+
# @option opts [Integer] :hot_storage_time_to_live Time in seconds after which the file will be moved to cold storage.
|
1292
1499
|
# @return [UserFile]
|
1293
1500
|
private def upload_impl(file, body_create_upload_file_uploadfile_post, opts = {})
|
1294
1501
|
data, _status_code, _headers = upload_with_http_info(file, body_create_upload_file_uploadfile_post, opts)
|
@@ -1312,8 +1519,11 @@ module Carbon
|
|
1312
1519
|
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled. (default to false)
|
1313
1520
|
# @option opts [Boolean] :detect_audio_language Whether to automatically detect the language of the uploaded audio file. (default to false)
|
1314
1521
|
# @option opts [TranscriptionServiceNullable] :transcription_service The transcription service to use for audio files. If no service is specified, 'deepgram' will be used.
|
1522
|
+
# @option opts [Boolean] :include_speaker_labels Detect multiple speakers and label segments of speech by speaker for audio files. (default to false)
|
1315
1523
|
# @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
|
1316
1524
|
# @option opts [Boolean] :split_rows Whether to split tabular rows into chunks. Currently only valid for CSV, TSV, and XLSX files. (default to false)
|
1525
|
+
# @option opts [Boolean] :enable_cold_storage Enable cold storage for the file. If set to true, the file will be moved to cold storage after a certain period of inactivity. Default is false. (default to false)
|
1526
|
+
# @option opts [Integer] :hot_storage_time_to_live Time in seconds after which the file will be moved to cold storage.
|
1317
1527
|
# @return [APIResponse] data is UserFile, status code, headers and response
|
1318
1528
|
private def upload_with_http_info_impl(file, body_create_upload_file_uploadfile_post, opts = {})
|
1319
1529
|
if @api_client.config.debugging
|
@@ -1344,8 +1554,11 @@ module Carbon
|
|
1344
1554
|
query_params[:'parse_pdf_tables_with_ocr'] = opts[:'parse_pdf_tables_with_ocr'] if !opts[:'parse_pdf_tables_with_ocr'].nil?
|
1345
1555
|
query_params[:'detect_audio_language'] = opts[:'detect_audio_language'] if !opts[:'detect_audio_language'].nil?
|
1346
1556
|
query_params[:'transcription_service'] = opts[:'transcription_service'] if !opts[:'transcription_service'].nil?
|
1557
|
+
query_params[:'include_speaker_labels'] = opts[:'include_speaker_labels'] if !opts[:'include_speaker_labels'].nil?
|
1347
1558
|
query_params[:'media_type'] = opts[:'media_type'] if !opts[:'media_type'].nil?
|
1348
1559
|
query_params[:'split_rows'] = opts[:'split_rows'] if !opts[:'split_rows'].nil?
|
1560
|
+
query_params[:'enable_cold_storage'] = opts[:'enable_cold_storage'] if !opts[:'enable_cold_storage'].nil?
|
1561
|
+
query_params[:'hot_storage_time_to_live'] = opts[:'hot_storage_time_to_live'] if !opts[:'hot_storage_time_to_live'].nil?
|
1349
1562
|
|
1350
1563
|
# header parameters
|
1351
1564
|
header_params = opts[:header_params] || {}
|
@@ -1404,11 +1617,13 @@ module Carbon
|
|
1404
1617
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
1405
1618
|
# @param detect_audio_language [Boolean]
|
1406
1619
|
# @param transcription_service [TranscriptionServiceNullable]
|
1620
|
+
# @param include_speaker_labels [Boolean]
|
1407
1621
|
# @param media_type [FileContentTypesNullable]
|
1408
1622
|
# @param split_rows [Boolean]
|
1623
|
+
# @param cold_storage_params [ColdStorageProps]
|
1409
1624
|
# @param body [UploadFileFromUrlInput]
|
1410
1625
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1411
|
-
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, transcription_service: SENTINEL, media_type: SENTINEL, split_rows: false, extra: {})
|
1626
|
+
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, transcription_service: SENTINEL, include_speaker_labels: false, media_type: SENTINEL, split_rows: false, cold_storage_params: SENTINEL, extra: {})
|
1412
1627
|
_body = {}
|
1413
1628
|
_body[:url] = url if url != SENTINEL
|
1414
1629
|
_body[:file_name] = file_name if file_name != SENTINEL
|
@@ -1424,8 +1639,10 @@ module Carbon
|
|
1424
1639
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1425
1640
|
_body[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
|
1426
1641
|
_body[:transcription_service] = transcription_service if transcription_service != SENTINEL
|
1642
|
+
_body[:include_speaker_labels] = include_speaker_labels if include_speaker_labels != SENTINEL
|
1427
1643
|
_body[:media_type] = media_type if media_type != SENTINEL
|
1428
1644
|
_body[:split_rows] = split_rows if split_rows != SENTINEL
|
1645
|
+
_body[:cold_storage_params] = cold_storage_params if cold_storage_params != SENTINEL
|
1429
1646
|
upload_file_from_url_input = _body
|
1430
1647
|
api_response = upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
|
1431
1648
|
api_response.data
|
@@ -1447,11 +1664,13 @@ module Carbon
|
|
1447
1664
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
1448
1665
|
# @param detect_audio_language [Boolean]
|
1449
1666
|
# @param transcription_service [TranscriptionServiceNullable]
|
1667
|
+
# @param include_speaker_labels [Boolean]
|
1450
1668
|
# @param media_type [FileContentTypesNullable]
|
1451
1669
|
# @param split_rows [Boolean]
|
1670
|
+
# @param cold_storage_params [ColdStorageProps]
|
1452
1671
|
# @param body [UploadFileFromUrlInput]
|
1453
1672
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1454
|
-
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, transcription_service: SENTINEL, media_type: SENTINEL, split_rows: false, extra: {})
|
1673
|
+
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, transcription_service: SENTINEL, include_speaker_labels: false, media_type: SENTINEL, split_rows: false, cold_storage_params: SENTINEL, extra: {})
|
1455
1674
|
_body = {}
|
1456
1675
|
_body[:url] = url if url != SENTINEL
|
1457
1676
|
_body[:file_name] = file_name if file_name != SENTINEL
|
@@ -1467,8 +1686,10 @@ module Carbon
|
|
1467
1686
|
_body[:parse_pdf_tables_with_ocr] = parse_pdf_tables_with_ocr if parse_pdf_tables_with_ocr != SENTINEL
|
1468
1687
|
_body[:detect_audio_language] = detect_audio_language if detect_audio_language != SENTINEL
|
1469
1688
|
_body[:transcription_service] = transcription_service if transcription_service != SENTINEL
|
1689
|
+
_body[:include_speaker_labels] = include_speaker_labels if include_speaker_labels != SENTINEL
|
1470
1690
|
_body[:media_type] = media_type if media_type != SENTINEL
|
1471
1691
|
_body[:split_rows] = split_rows if split_rows != SENTINEL
|
1692
|
+
_body[:cold_storage_params] = cold_storage_params if cold_storage_params != SENTINEL
|
1472
1693
|
upload_file_from_url_input = _body
|
1473
1694
|
upload_from_url_with_http_info_impl(upload_file_from_url_input, extra)
|
1474
1695
|
end
|
@@ -1561,9 +1782,10 @@ module Carbon
|
|
1561
1782
|
# @param overwrite_file_id [Integer]
|
1562
1783
|
# @param embedding_model [EmbeddingGeneratorsNullable]
|
1563
1784
|
# @param generate_sparse_vectors [Boolean]
|
1785
|
+
# @param cold_storage_params [ColdStorageProps]
|
1564
1786
|
# @param body [RawTextInput]
|
1565
1787
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1566
|
-
def upload_text(contents:, name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, overwrite_file_id: SENTINEL, embedding_model: 'OPENAI', generate_sparse_vectors: false, extra: {})
|
1788
|
+
def upload_text(contents:, name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, overwrite_file_id: SENTINEL, embedding_model: 'OPENAI', generate_sparse_vectors: false, cold_storage_params: SENTINEL, extra: {})
|
1567
1789
|
_body = {}
|
1568
1790
|
_body[:contents] = contents if contents != SENTINEL
|
1569
1791
|
_body[:name] = name if name != SENTINEL
|
@@ -1573,6 +1795,7 @@ module Carbon
|
|
1573
1795
|
_body[:overwrite_file_id] = overwrite_file_id if overwrite_file_id != SENTINEL
|
1574
1796
|
_body[:embedding_model] = embedding_model if embedding_model != SENTINEL
|
1575
1797
|
_body[:generate_sparse_vectors] = generate_sparse_vectors if generate_sparse_vectors != SENTINEL
|
1798
|
+
_body[:cold_storage_params] = cold_storage_params if cold_storage_params != SENTINEL
|
1576
1799
|
raw_text_input = _body
|
1577
1800
|
api_response = upload_text_with_http_info_impl(raw_text_input, extra)
|
1578
1801
|
api_response.data
|
@@ -1599,9 +1822,10 @@ module Carbon
|
|
1599
1822
|
# @param overwrite_file_id [Integer]
|
1600
1823
|
# @param embedding_model [EmbeddingGeneratorsNullable]
|
1601
1824
|
# @param generate_sparse_vectors [Boolean]
|
1825
|
+
# @param cold_storage_params [ColdStorageProps]
|
1602
1826
|
# @param body [RawTextInput]
|
1603
1827
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
1604
|
-
def upload_text_with_http_info(contents:, name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, overwrite_file_id: SENTINEL, embedding_model: 'OPENAI', generate_sparse_vectors: false, extra: {})
|
1828
|
+
def upload_text_with_http_info(contents:, name: SENTINEL, chunk_size: SENTINEL, chunk_overlap: SENTINEL, skip_embedding_generation: false, overwrite_file_id: SENTINEL, embedding_model: 'OPENAI', generate_sparse_vectors: false, cold_storage_params: SENTINEL, extra: {})
|
1605
1829
|
_body = {}
|
1606
1830
|
_body[:contents] = contents if contents != SENTINEL
|
1607
1831
|
_body[:name] = name if name != SENTINEL
|
@@ -1611,6 +1835,7 @@ module Carbon
|
|
1611
1835
|
_body[:overwrite_file_id] = overwrite_file_id if overwrite_file_id != SENTINEL
|
1612
1836
|
_body[:embedding_model] = embedding_model if embedding_model != SENTINEL
|
1613
1837
|
_body[:generate_sparse_vectors] = generate_sparse_vectors if generate_sparse_vectors != SENTINEL
|
1838
|
+
_body[:cold_storage_params] = cold_storage_params if cold_storage_params != SENTINEL
|
1614
1839
|
raw_text_input = _body
|
1615
1840
|
upload_text_with_http_info_impl(raw_text_input, extra)
|
1616
1841
|
end
|
@@ -661,15 +661,16 @@ module Carbon
|
|
661
661
|
# @param data_source_id [Integer] Used to specify a data source to sync from if you have multiple connected. It can be skipped if you only have one data source of that type connected or are connecting a new account.
|
662
662
|
# @param connecting_new_account [Boolean] Used to connect a new data source. If not specified, we will attempt to create a sync URL for an existing data source based on type and ID.
|
663
663
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
664
|
-
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
664
|
+
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: jpg, png, pdf
|
665
665
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
666
666
|
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, DROPBOX, GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT
|
667
667
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
668
668
|
# @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, INTERCOM, GMAIL, OUTLOOK, ZENDESK, CONFLUENCE, NOTION, SHAREPOINT. It will be ignored for other data sources.
|
669
669
|
# @param file_sync_config [FileSyncConfigNullable]
|
670
|
+
# @param automatically_open_file_picker [Boolean] Automatically open source file picker after the OAuth flow is complete. This flag is currently supported by BOX, DROPBOX, GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT. It will be ignored for other data sources.
|
670
671
|
# @param body [OAuthURLRequest]
|
671
672
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
672
|
-
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: SENTINEL, 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: {})
|
673
|
+
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: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, automatically_open_file_picker: SENTINEL, extra: {})
|
673
674
|
_body = {}
|
674
675
|
_body[:tags] = tags if tags != SENTINEL
|
675
676
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -697,6 +698,7 @@ module Carbon
|
|
697
698
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
698
699
|
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
699
700
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
701
|
+
_body[:automatically_open_file_picker] = automatically_open_file_picker if automatically_open_file_picker != SENTINEL
|
700
702
|
o_auth_url_request = _body
|
701
703
|
api_response = get_oauth_url_with_http_info_impl(o_auth_url_request, extra)
|
702
704
|
api_response.data
|
@@ -729,15 +731,16 @@ module Carbon
|
|
729
731
|
# @param data_source_id [Integer] Used to specify a data source to sync from if you have multiple connected. It can be skipped if you only have one data source of that type connected or are connecting a new account.
|
730
732
|
# @param connecting_new_account [Boolean] Used to connect a new data source. If not specified, we will attempt to create a sync URL for an existing data source based on type and ID.
|
731
733
|
# @param request_id [String] This request id will be added to all files that get synced using the generated OAuth URL
|
732
|
-
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: pdf
|
734
|
+
# @param use_ocr [Boolean] Enable OCR for files that support it. Supported formats: jpg, png, pdf
|
733
735
|
# @param parse_pdf_tables_with_ocr [Boolean]
|
734
736
|
# @param enable_file_picker [Boolean] Enable integration's file picker for sources that support it. Supported sources: BOX, DROPBOX, GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT
|
735
737
|
# @param sync_source_items [Boolean] Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
736
738
|
# @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, INTERCOM, GMAIL, OUTLOOK, ZENDESK, CONFLUENCE, NOTION, SHAREPOINT. It will be ignored for other data sources.
|
737
739
|
# @param file_sync_config [FileSyncConfigNullable]
|
740
|
+
# @param automatically_open_file_picker [Boolean] Automatically open source file picker after the OAuth flow is complete. This flag is currently supported by BOX, DROPBOX, GOOGLE_DRIVE, ONEDRIVE, SHAREPOINT. It will be ignored for other data sources.
|
738
741
|
# @param body [OAuthURLRequest]
|
739
742
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
740
|
-
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: SENTINEL, 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: {})
|
743
|
+
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: SENTINEL, use_ocr: false, parse_pdf_tables_with_ocr: false, enable_file_picker: true, sync_source_items: true, incremental_sync: false, file_sync_config: SENTINEL, automatically_open_file_picker: SENTINEL, extra: {})
|
741
744
|
_body = {}
|
742
745
|
_body[:tags] = tags if tags != SENTINEL
|
743
746
|
_body[:scope] = scope if scope != SENTINEL
|
@@ -765,6 +768,7 @@ module Carbon
|
|
765
768
|
_body[:sync_source_items] = sync_source_items if sync_source_items != SENTINEL
|
766
769
|
_body[:incremental_sync] = incremental_sync if incremental_sync != SENTINEL
|
767
770
|
_body[:file_sync_config] = file_sync_config if file_sync_config != SENTINEL
|
771
|
+
_body[:automatically_open_file_picker] = automatically_open_file_picker if automatically_open_file_picker != SENTINEL
|
768
772
|
o_auth_url_request = _body
|
769
773
|
get_oauth_url_with_http_info_impl(o_auth_url_request, extra)
|
770
774
|
end
|