carbon_ruby_sdk 0.2.20 → 0.2.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/README.md +107 -2
  4. data/lib/carbon_ruby_sdk/api/embeddings_api.rb +6 -2
  5. data/lib/carbon_ruby_sdk/api/files_api.rb +231 -6
  6. data/lib/carbon_ruby_sdk/api/integrations_api.rb +6 -2
  7. data/lib/carbon_ruby_sdk/models/cold_storage_props.rb +229 -0
  8. data/lib/carbon_ruby_sdk/models/embedding_storage_status.rb +38 -0
  9. data/lib/carbon_ruby_sdk/models/file_sync_config.rb +13 -1
  10. data/lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb +13 -1
  11. data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +17 -5
  12. data/lib/carbon_ruby_sdk/models/modify_cold_storage_parameters_query_input.rb +235 -0
  13. data/lib/carbon_ruby_sdk/models/move_to_hot_storage_query_input.rb +215 -0
  14. data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +16 -5
  15. data/lib/carbon_ruby_sdk/models/raw_text_input.rb +14 -5
  16. data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +2 -2
  17. data/lib/carbon_ruby_sdk/models/sync_options.rb +16 -5
  18. data/lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb +24 -4
  19. data/lib/carbon_ruby_sdk/models/user_file.rb +39 -1
  20. data/lib/carbon_ruby_sdk/version.rb +1 -1
  21. data/lib/carbon_ruby_sdk.rb +4 -0
  22. data/spec/api/files_api_spec.rb +25 -0
  23. data/spec/models/cold_storage_props_spec.rb +34 -0
  24. data/spec/models/embedding_storage_status_spec.rb +22 -0
  25. data/spec/models/file_sync_config_nullable_spec.rb +6 -0
  26. data/spec/models/file_sync_config_spec.rb +6 -0
  27. data/spec/models/get_embedding_documents_body_spec.rb +6 -0
  28. data/spec/models/modify_cold_storage_parameters_query_input_spec.rb +40 -0
  29. data/spec/models/move_to_hot_storage_query_input_spec.rb +28 -0
  30. data/spec/models/o_auth_url_request_spec.rb +6 -0
  31. data/spec/models/raw_text_input_spec.rb +6 -0
  32. data/spec/models/sent_webhook_payload_spec.rb +1 -1
  33. data/spec/models/sync_options_spec.rb +6 -0
  34. data/spec/models/upload_file_from_url_input_spec.rb +12 -0
  35. data/spec/models/user_file_spec.rb +18 -0
  36. 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
@@ -667,9 +667,10 @@ module Carbon
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
@@ -735,9 +737,10 @@ module Carbon
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
@@ -0,0 +1,229 @@
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
+ class ColdStorageProps
14
+ # 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.
15
+ attr_accessor :enable_cold_storage
16
+
17
+ # Time in seconds after which the file will be moved to cold storage.
18
+ attr_accessor :hot_storage_time_to_live
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'enable_cold_storage' => :'enable_cold_storage',
24
+ :'hot_storage_time_to_live' => :'hot_storage_time_to_live'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'enable_cold_storage' => :'Boolean',
37
+ :'hot_storage_time_to_live' => :'Integer'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ :'hot_storage_time_to_live'
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::ColdStorageProps` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::ColdStorageProps`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'enable_cold_storage')
64
+ self.enable_cold_storage = attributes[:'enable_cold_storage']
65
+ else
66
+ self.enable_cold_storage = false
67
+ end
68
+
69
+ if attributes.key?(:'hot_storage_time_to_live')
70
+ self.hot_storage_time_to_live = attributes[:'hot_storage_time_to_live']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
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
+ enable_cold_storage == o.enable_cold_storage &&
93
+ hot_storage_time_to_live == o.hot_storage_time_to_live
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [enable_cold_storage, hot_storage_time_to_live].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ self.class.openapi_types.each_pair do |key, type|
122
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
+ self.send("#{key}=", nil)
124
+ elsif type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = Carbon.const_get(type)
177
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end