carbon_ruby_sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +89 -0
- data/README.md +2325 -0
- data/Rakefile +10 -0
- data/carbon_ruby_sdk.gemspec +39 -0
- data/header.png +0 -0
- data/lib/carbon_ruby_sdk/api/auth_api.rb +177 -0
- data/lib/carbon_ruby_sdk/api/data_sources_api.rb +217 -0
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +565 -0
- data/lib/carbon_ruby_sdk/api/files_api.rb +1526 -0
- data/lib/carbon_ruby_sdk/api/health_api.rb +92 -0
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +2201 -0
- data/lib/carbon_ruby_sdk/api/organizations_api.rb +92 -0
- data/lib/carbon_ruby_sdk/api/users_api.rb +209 -0
- data/lib/carbon_ruby_sdk/api/utilities_api.rb +710 -0
- data/lib/carbon_ruby_sdk/api/webhooks_api.rb +296 -0
- data/lib/carbon_ruby_sdk/api_client.rb +436 -0
- data/lib/carbon_ruby_sdk/api_client_custom.rb +14 -0
- data/lib/carbon_ruby_sdk/api_error.rb +53 -0
- data/lib/carbon_ruby_sdk/configuration.rb +354 -0
- data/lib/carbon_ruby_sdk/models/add_webhook_props.rb +220 -0
- data/lib/carbon_ruby_sdk/models/body_create_upload_file_uploadfile_post.rb +220 -0
- data/lib/carbon_ruby_sdk/models/chunk_properties.rb +248 -0
- data/lib/carbon_ruby_sdk/models/chunk_properties_nullable.rb +248 -0
- data/lib/carbon_ruby_sdk/models/chunks_and_embeddings.rb +246 -0
- data/lib/carbon_ruby_sdk/models/chunks_and_embeddings_upload_input.rb +247 -0
- data/lib/carbon_ruby_sdk/models/data_source_last_sync_actions.rb +38 -0
- data/lib/carbon_ruby_sdk/models/data_source_sync_statuses.rb +38 -0
- data/lib/carbon_ruby_sdk/models/data_source_type.rb +76 -0
- data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +76 -0
- data/lib/carbon_ruby_sdk/models/delete_files_query_input.rb +252 -0
- data/lib/carbon_ruby_sdk/models/directory_item.rb +266 -0
- data/lib/carbon_ruby_sdk/models/document_response.rb +328 -0
- data/lib/carbon_ruby_sdk/models/document_response_list.rb +222 -0
- data/lib/carbon_ruby_sdk/models/embedding_and_chunk.rb +256 -0
- data/lib/carbon_ruby_sdk/models/embedding_generators.rb +43 -0
- data/lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb +43 -0
- data/lib/carbon_ruby_sdk/models/embedding_properties.rb +226 -0
- data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_filters.rb +232 -0
- data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns.rb +37 -0
- data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_query_input.rb +262 -0
- data/lib/carbon_ruby_sdk/models/embeddings_and_chunks_response.rb +236 -0
- data/lib/carbon_ruby_sdk/models/external_file_sync_statuses.rb +43 -0
- data/lib/carbon_ruby_sdk/models/external_source_item.rb +420 -0
- data/lib/carbon_ruby_sdk/models/fetch_urls_response.rb +236 -0
- data/lib/carbon_ruby_sdk/models/file_content_types.rb +36 -0
- data/lib/carbon_ruby_sdk/models/file_content_types_nullable.rb +36 -0
- data/lib/carbon_ruby_sdk/models/file_formats.rb +76 -0
- data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +76 -0
- data/lib/carbon_ruby_sdk/models/file_statistics.rb +256 -0
- data/lib/carbon_ruby_sdk/models/file_statistics_nullable.rb +256 -0
- data/lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb +316 -0
- data/lib/carbon_ruby_sdk/models/generic_success_response.rb +220 -0
- data/lib/carbon_ruby_sdk/models/get_embedding_documents_body.rb +416 -0
- data/lib/carbon_ruby_sdk/models/gitbook_connect_request.rb +234 -0
- data/lib/carbon_ruby_sdk/models/gitbook_sync_request.rb +336 -0
- data/lib/carbon_ruby_sdk/models/gmail_sync_input.rb +301 -0
- data/lib/carbon_ruby_sdk/models/http_validation_error.rb +217 -0
- data/lib/carbon_ruby_sdk/models/hybrid_search_tuning_params.rb +234 -0
- data/lib/carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable.rb +235 -0
- data/lib/carbon_ruby_sdk/models/list_data_source_items_request.rb +239 -0
- data/lib/carbon_ruby_sdk/models/list_data_source_items_response.rb +236 -0
- data/lib/carbon_ruby_sdk/models/list_request.rb +230 -0
- data/lib/carbon_ruby_sdk/models/list_response.rb +222 -0
- data/lib/carbon_ruby_sdk/models/location_property_inner.rb +226 -0
- data/lib/carbon_ruby_sdk/models/modify_user_configuration_input.rb +234 -0
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +362 -0
- data/lib/carbon_ruby_sdk/models/order_dir.rb +36 -0
- data/lib/carbon_ruby_sdk/models/organization_response.rb +362 -0
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb +380 -0
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_filters.rb +238 -0
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_order_by_columns.rb +36 -0
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_query_input.rb +246 -0
- data/lib/carbon_ruby_sdk/models/organization_user_data_source_response.rb +236 -0
- data/lib/carbon_ruby_sdk/models/organization_user_file_tag_create.rb +236 -0
- data/lib/carbon_ruby_sdk/models/organization_user_file_tags_remove.rb +236 -0
- data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +330 -0
- data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_order_by_types.rb +39 -0
- data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_query_input.rb +276 -0
- data/lib/carbon_ruby_sdk/models/outlook_sync_input.rb +313 -0
- data/lib/carbon_ruby_sdk/models/pagination.rb +228 -0
- data/lib/carbon_ruby_sdk/models/presigned_url_response.rb +220 -0
- data/lib/carbon_ruby_sdk/models/rank_property.rb +226 -0
- data/lib/carbon_ruby_sdk/models/raw_text_input.rb +295 -0
- data/lib/carbon_ruby_sdk/models/raw_transcript_property_inner_value.rb +226 -0
- data/lib/carbon_ruby_sdk/models/resync_file_query_input.rb +240 -0
- data/lib/carbon_ruby_sdk/models/revoke_access_token_input.rb +220 -0
- data/lib/carbon_ruby_sdk/models/rss_feed_input.rb +301 -0
- data/lib/carbon_ruby_sdk/models/s3_auth_request.rb +234 -0
- data/lib/carbon_ruby_sdk/models/s3_file_sync_input.rb +313 -0
- data/lib/carbon_ruby_sdk/models/s3_get_file_input.rb +226 -0
- data/lib/carbon_ruby_sdk/models/single_chunks_and_embeddings_upload_input.rb +256 -0
- data/lib/carbon_ruby_sdk/models/sitemap_scrape_request.rb +361 -0
- data/lib/carbon_ruby_sdk/models/source_property.rb +226 -0
- data/lib/carbon_ruby_sdk/models/sync_directory_request.rb +220 -0
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +328 -0
- data/lib/carbon_ruby_sdk/models/tags.rb +232 -0
- data/lib/carbon_ruby_sdk/models/tags1.rb +230 -0
- data/lib/carbon_ruby_sdk/models/text_embedding_generators.rb +42 -0
- data/lib/carbon_ruby_sdk/models/token_response.rb +234 -0
- data/lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb +326 -0
- data/lib/carbon_ruby_sdk/models/user_file.rb +524 -0
- data/lib/carbon_ruby_sdk/models/user_files_v2.rb +236 -0
- data/lib/carbon_ruby_sdk/models/user_request_content.rb +220 -0
- data/lib/carbon_ruby_sdk/models/user_response.rb +354 -0
- data/lib/carbon_ruby_sdk/models/validation_error.rb +250 -0
- data/lib/carbon_ruby_sdk/models/webhook.rb +290 -0
- data/lib/carbon_ruby_sdk/models/webhook_filters.rb +218 -0
- data/lib/carbon_ruby_sdk/models/webhook_no_key.rb +276 -0
- data/lib/carbon_ruby_sdk/models/webhook_order_by_columns.rb +36 -0
- data/lib/carbon_ruby_sdk/models/webhook_query_input.rb +246 -0
- data/lib/carbon_ruby_sdk/models/webhook_query_response.rb +236 -0
- data/lib/carbon_ruby_sdk/models/webscrape_request.rb +375 -0
- data/lib/carbon_ruby_sdk/models/white_labeling_response.rb +234 -0
- data/lib/carbon_ruby_sdk/models/youtube_transcript_response.rb +252 -0
- data/lib/carbon_ruby_sdk/version.rb +11 -0
- data/lib/carbon_ruby_sdk.rb +207 -0
- data/spec/api/auth_api_spec.rb +50 -0
- data/spec/api/data_sources_api_spec.rb +51 -0
- data/spec/api/embeddings_api_spec.rb +63 -0
- data/spec/api/files_api_spec.rb +178 -0
- data/spec/api/health_api_spec.rb +39 -0
- data/spec/api/integrations_api_spec.rb +226 -0
- data/spec/api/organizations_api_spec.rb +39 -0
- data/spec/api/users_api_spec.rb +51 -0
- data/spec/api/utilities_api_spec.rb +102 -0
- data/spec/api/webhooks_api_spec.rb +62 -0
- data/spec/api_client_spec.rb +191 -0
- data/spec/configuration_spec.rb +38 -0
- data/spec/getting_started_spec.rb +196 -0
- data/spec/models/add_webhook_props_spec.rb +28 -0
- data/spec/models/body_create_upload_file_uploadfile_post_spec.rb +28 -0
- data/spec/models/chunk_properties_nullable_spec.rb +40 -0
- data/spec/models/chunk_properties_spec.rb +40 -0
- data/spec/models/chunks_and_embeddings_spec.rb +40 -0
- data/spec/models/chunks_and_embeddings_upload_input_spec.rb +40 -0
- data/spec/models/data_source_last_sync_actions_spec.rb +22 -0
- data/spec/models/data_source_sync_statuses_spec.rb +22 -0
- data/spec/models/data_source_type_nullable_spec.rb +22 -0
- data/spec/models/data_source_type_spec.rb +22 -0
- data/spec/models/delete_files_query_input_spec.rb +46 -0
- data/spec/models/directory_item_spec.rb +46 -0
- data/spec/models/document_response_list_spec.rb +28 -0
- data/spec/models/document_response_spec.rb +88 -0
- data/spec/models/embedding_and_chunk_spec.rb +46 -0
- data/spec/models/embedding_generators_nullable_spec.rb +22 -0
- data/spec/models/embedding_generators_spec.rb +22 -0
- data/spec/models/embedding_properties_spec.rb +34 -0
- data/spec/models/embeddings_and_chunks_filters_spec.rb +34 -0
- data/spec/models/embeddings_and_chunks_order_by_columns_spec.rb +22 -0
- data/spec/models/embeddings_and_chunks_query_input_spec.rb +52 -0
- data/spec/models/embeddings_and_chunks_response_spec.rb +34 -0
- data/spec/models/external_file_sync_statuses_spec.rb +22 -0
- data/spec/models/external_source_item_spec.rb +124 -0
- data/spec/models/fetch_urls_response_spec.rb +34 -0
- data/spec/models/file_content_types_nullable_spec.rb +22 -0
- data/spec/models/file_content_types_spec.rb +22 -0
- data/spec/models/file_formats_nullable_spec.rb +22 -0
- data/spec/models/file_formats_spec.rb +22 -0
- data/spec/models/file_statistics_nullable_spec.rb +52 -0
- data/spec/models/file_statistics_spec.rb +52 -0
- data/spec/models/fresh_desk_connect_request_spec.rb +76 -0
- data/spec/models/generic_success_response_spec.rb +28 -0
- data/spec/models/get_embedding_documents_body_spec.rb +106 -0
- data/spec/models/gitbook_connect_request_spec.rb +34 -0
- data/spec/models/gitbook_sync_request_spec.rb +76 -0
- data/spec/models/gmail_sync_input_spec.rb +70 -0
- data/spec/models/http_validation_error_spec.rb +28 -0
- data/spec/models/hybrid_search_tuning_params_nullable_spec.rb +34 -0
- data/spec/models/hybrid_search_tuning_params_spec.rb +34 -0
- data/spec/models/list_data_source_items_request_spec.rb +40 -0
- data/spec/models/list_data_source_items_response_spec.rb +34 -0
- data/spec/models/list_request_spec.rb +34 -0
- data/spec/models/list_response_spec.rb +28 -0
- data/spec/models/location_property_inner_spec.rb +22 -0
- data/spec/models/modify_user_configuration_input_spec.rb +34 -0
- data/spec/models/o_auth_url_request_spec.rb +106 -0
- data/spec/models/order_dir_spec.rb +22 -0
- data/spec/models/organization_response_spec.rb +94 -0
- data/spec/models/organization_user_data_source_api_spec.rb +100 -0
- data/spec/models/organization_user_data_source_filters_spec.rb +40 -0
- data/spec/models/organization_user_data_source_order_by_columns_spec.rb +22 -0
- data/spec/models/organization_user_data_source_query_input_spec.rb +46 -0
- data/spec/models/organization_user_data_source_response_spec.rb +34 -0
- data/spec/models/organization_user_file_tag_create_spec.rb +34 -0
- data/spec/models/organization_user_file_tags_remove_spec.rb +34 -0
- data/spec/models/organization_user_files_to_sync_filters_spec.rb +88 -0
- data/spec/models/organization_user_files_to_sync_order_by_types_spec.rb +22 -0
- data/spec/models/organization_user_files_to_sync_query_input_spec.rb +64 -0
- data/spec/models/outlook_sync_input_spec.rb +76 -0
- data/spec/models/pagination_spec.rb +34 -0
- data/spec/models/presigned_url_response_spec.rb +28 -0
- data/spec/models/rank_property_spec.rb +22 -0
- data/spec/models/raw_text_input_spec.rb +70 -0
- data/spec/models/raw_transcript_property_inner_value_spec.rb +22 -0
- data/spec/models/resync_file_query_input_spec.rb +40 -0
- data/spec/models/revoke_access_token_input_spec.rb +28 -0
- data/spec/models/rss_feed_input_spec.rb +70 -0
- data/spec/models/s3_auth_request_spec.rb +34 -0
- data/spec/models/s3_file_sync_input_spec.rb +76 -0
- data/spec/models/s3_get_file_input_spec.rb +34 -0
- data/spec/models/single_chunks_and_embeddings_upload_input_spec.rb +46 -0
- data/spec/models/sitemap_scrape_request_spec.rb +100 -0
- data/spec/models/source_property_spec.rb +22 -0
- data/spec/models/sync_directory_request_spec.rb +28 -0
- data/spec/models/sync_files_request_spec.rb +82 -0
- data/spec/models/tags1_spec.rb +22 -0
- data/spec/models/tags_spec.rb +22 -0
- data/spec/models/text_embedding_generators_spec.rb +22 -0
- data/spec/models/token_response_spec.rb +34 -0
- data/spec/models/upload_file_from_url_input_spec.rb +88 -0
- data/spec/models/user_file_spec.rb +190 -0
- data/spec/models/user_files_v2_spec.rb +34 -0
- data/spec/models/user_request_content_spec.rb +28 -0
- data/spec/models/user_response_spec.rb +88 -0
- data/spec/models/validation_error_spec.rb +40 -0
- data/spec/models/webhook_filters_spec.rb +28 -0
- data/spec/models/webhook_no_key_spec.rb +52 -0
- data/spec/models/webhook_order_by_columns_spec.rb +22 -0
- data/spec/models/webhook_query_input_spec.rb +46 -0
- data/spec/models/webhook_query_response_spec.rb +34 -0
- data/spec/models/webhook_spec.rb +58 -0
- data/spec/models/webscrape_request_spec.rb +106 -0
- data/spec/models/white_labeling_response_spec.rb +34 -0
- data/spec/models/youtube_transcript_response_spec.rb +46 -0
- data/spec/spec_helper.rb +107 -0
- metadata +440 -0
data/README.md
ADDED
|
@@ -0,0 +1,2325 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
[](https://carbon.ai)
|
|
4
|
+
|
|
5
|
+
# [Carbon](https://carbon.ai)<a id="carbon"></a>
|
|
6
|
+
|
|
7
|
+
Connect external data to LLMs, no matter the source.
|
|
8
|
+
|
|
9
|
+
[](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.1.0)
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Table of Contents<a id="table-of-contents"></a>
|
|
14
|
+
|
|
15
|
+
<!-- toc -->
|
|
16
|
+
|
|
17
|
+
- [Installation](#installation)
|
|
18
|
+
- [Getting Started](#getting-started)
|
|
19
|
+
- [Raw HTTP Response](#raw-http-response)
|
|
20
|
+
- [Reference](#reference)
|
|
21
|
+
* [`carbon.auth.get_access_token`](#carbonauthget_access_token)
|
|
22
|
+
* [`carbon.auth.get_white_labeling`](#carbonauthget_white_labeling)
|
|
23
|
+
* [`carbon.data_sources.query_user_data_sources`](#carbondata_sourcesquery_user_data_sources)
|
|
24
|
+
* [`carbon.data_sources.revoke_access_token`](#carbondata_sourcesrevoke_access_token)
|
|
25
|
+
* [`carbon.embeddings.get_documents`](#carbonembeddingsget_documents)
|
|
26
|
+
* [`carbon.embeddings.get_embeddings_and_chunks`](#carbonembeddingsget_embeddings_and_chunks)
|
|
27
|
+
* [`carbon.embeddings.upload_chunks_and_embeddings`](#carbonembeddingsupload_chunks_and_embeddings)
|
|
28
|
+
* [`carbon.files.create_user_file_tags`](#carbonfilescreate_user_file_tags)
|
|
29
|
+
* [`carbon.files.delete`](#carbonfilesdelete)
|
|
30
|
+
* [`carbon.files.delete_file_tags`](#carbonfilesdelete_file_tags)
|
|
31
|
+
* [`carbon.files.delete_many`](#carbonfilesdelete_many)
|
|
32
|
+
* [`carbon.files.get_parsed_file`](#carbonfilesget_parsed_file)
|
|
33
|
+
* [`carbon.files.get_raw_file`](#carbonfilesget_raw_file)
|
|
34
|
+
* [`carbon.files.query_user_files`](#carbonfilesquery_user_files)
|
|
35
|
+
* [`carbon.files.query_user_files_deprecated`](#carbonfilesquery_user_files_deprecated)
|
|
36
|
+
* [`carbon.files.resync`](#carbonfilesresync)
|
|
37
|
+
* [`carbon.files.upload`](#carbonfilesupload)
|
|
38
|
+
* [`carbon.files.upload_from_url`](#carbonfilesupload_from_url)
|
|
39
|
+
* [`carbon.files.upload_text`](#carbonfilesupload_text)
|
|
40
|
+
* [`carbon.health.check`](#carbonhealthcheck)
|
|
41
|
+
* [`carbon.integrations.connect_freshdesk`](#carbonintegrationsconnect_freshdesk)
|
|
42
|
+
* [`carbon.integrations.connect_gitbook`](#carbonintegrationsconnect_gitbook)
|
|
43
|
+
* [`carbon.integrations.create_aws_iam_user`](#carbonintegrationscreate_aws_iam_user)
|
|
44
|
+
* [`carbon.integrations.get_oauth_url`](#carbonintegrationsget_oauth_url)
|
|
45
|
+
* [`carbon.integrations.list_confluence_pages`](#carbonintegrationslist_confluence_pages)
|
|
46
|
+
* [`carbon.integrations.list_data_source_items`](#carbonintegrationslist_data_source_items)
|
|
47
|
+
* [`carbon.integrations.list_folders`](#carbonintegrationslist_folders)
|
|
48
|
+
* [`carbon.integrations.list_gitbook_spaces`](#carbonintegrationslist_gitbook_spaces)
|
|
49
|
+
* [`carbon.integrations.list_labels`](#carbonintegrationslist_labels)
|
|
50
|
+
* [`carbon.integrations.sync_confluence`](#carbonintegrationssync_confluence)
|
|
51
|
+
* [`carbon.integrations.sync_data_source_items`](#carbonintegrationssync_data_source_items)
|
|
52
|
+
* [`carbon.integrations.sync_files`](#carbonintegrationssync_files)
|
|
53
|
+
* [`carbon.integrations.sync_gitbook`](#carbonintegrationssync_gitbook)
|
|
54
|
+
* [`carbon.integrations.sync_gmail`](#carbonintegrationssync_gmail)
|
|
55
|
+
* [`carbon.integrations.sync_outlook`](#carbonintegrationssync_outlook)
|
|
56
|
+
* [`carbon.integrations.sync_rss_feed`](#carbonintegrationssync_rss_feed)
|
|
57
|
+
* [`carbon.integrations.sync_s3_files`](#carbonintegrationssync_s3_files)
|
|
58
|
+
* [`carbon.organizations.get`](#carbonorganizationsget)
|
|
59
|
+
* [`carbon.users.get`](#carbonusersget)
|
|
60
|
+
* [`carbon.users.toggle_user_features`](#carbonuserstoggle_user_features)
|
|
61
|
+
* [`carbon.utilities.fetch_urls`](#carbonutilitiesfetch_urls)
|
|
62
|
+
* [`carbon.utilities.fetch_youtube_transcripts`](#carbonutilitiesfetch_youtube_transcripts)
|
|
63
|
+
* [`carbon.utilities.process_sitemap`](#carbonutilitiesprocess_sitemap)
|
|
64
|
+
* [`carbon.utilities.scrape_sitemap`](#carbonutilitiesscrape_sitemap)
|
|
65
|
+
* [`carbon.utilities.scrape_web`](#carbonutilitiesscrape_web)
|
|
66
|
+
* [`carbon.utilities.search_urls`](#carbonutilitiessearch_urls)
|
|
67
|
+
* [`carbon.webhooks.add_url`](#carbonwebhooksadd_url)
|
|
68
|
+
* [`carbon.webhooks.delete_url`](#carbonwebhooksdelete_url)
|
|
69
|
+
* [`carbon.webhooks.urls`](#carbonwebhooksurls)
|
|
70
|
+
|
|
71
|
+
<!-- tocstop -->
|
|
72
|
+
|
|
73
|
+
## Installation<a id="installation"></a>
|
|
74
|
+
|
|
75
|
+
Add to Gemfile:
|
|
76
|
+
|
|
77
|
+
```ruby
|
|
78
|
+
gem 'carbon_ruby_sdk', '~> 0.1.0'
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Getting Started<a id="getting-started"></a>
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
require 'carbon_ruby_sdk'
|
|
85
|
+
|
|
86
|
+
# 1) Get an access token for a customer
|
|
87
|
+
configuration = Carbon::Configuration.new
|
|
88
|
+
configuration.api_key = "YOUR_API_KEY"
|
|
89
|
+
configuration.customer_id = "YOUR_CUSTOMER_ID"
|
|
90
|
+
carbon = Carbon::Client.new(configuration)
|
|
91
|
+
|
|
92
|
+
token = carbon.auth.get_access_token
|
|
93
|
+
|
|
94
|
+
# 2) Use the access token to authenticate moving forward
|
|
95
|
+
configuration = Carbon::Configuration.new
|
|
96
|
+
configuration.access_token = token.access_token
|
|
97
|
+
carbon = Carbon::Client.new(configuration)
|
|
98
|
+
|
|
99
|
+
# use SDK as usual
|
|
100
|
+
white_labeling = carbon.auth.get_white_labeling
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Raw HTTP Response<a id="raw-http-response"></a>
|
|
104
|
+
|
|
105
|
+
To access the raw HTTP response, suffix any method with `_with_http_info`.
|
|
106
|
+
|
|
107
|
+
```ruby
|
|
108
|
+
result = carbon.auth.get_access_token_with_http_info
|
|
109
|
+
p result.data # [TokenResponse] Deserialized data
|
|
110
|
+
p.result.status_code # [Integer] HTTP status code
|
|
111
|
+
p.result.headers # [Hash] HTTP headers
|
|
112
|
+
p.result.response # [Faraday::Response] Raw HTTP response
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Reference<a id="reference"></a>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### `carbon.auth.get_access_token`<a id="carbonauthget_access_token"></a>
|
|
119
|
+
|
|
120
|
+
Get Access Token
|
|
121
|
+
|
|
122
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
123
|
+
|
|
124
|
+
```ruby
|
|
125
|
+
result = carbon.auth.get_access_token
|
|
126
|
+
p result
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### π Return<a id="π-return"></a>
|
|
130
|
+
|
|
131
|
+
[TokenResponse](./lib/carbon_ruby_sdk/models/token_response.rb)
|
|
132
|
+
|
|
133
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
134
|
+
|
|
135
|
+
`/auth/v1/access_token` `GET`
|
|
136
|
+
|
|
137
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### `carbon.auth.get_white_labeling`<a id="carbonauthget_white_labeling"></a>
|
|
143
|
+
|
|
144
|
+
Returns whether or not the organization is white labeled and which integrations are white labeled
|
|
145
|
+
|
|
146
|
+
:param current_user: the current user
|
|
147
|
+
:param db: the database session
|
|
148
|
+
:return: a WhiteLabelingResponse
|
|
149
|
+
|
|
150
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
151
|
+
|
|
152
|
+
```ruby
|
|
153
|
+
result = carbon.auth.get_white_labeling
|
|
154
|
+
p result
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### π Return<a id="π-return"></a>
|
|
158
|
+
|
|
159
|
+
[WhiteLabelingResponse](./lib/carbon_ruby_sdk/models/white_labeling_response.rb)
|
|
160
|
+
|
|
161
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
162
|
+
|
|
163
|
+
`/auth/v1/white_labeling` `GET`
|
|
164
|
+
|
|
165
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### `carbon.data_sources.query_user_data_sources`<a id="carbondata_sourcesquery_user_data_sources"></a>
|
|
171
|
+
|
|
172
|
+
User Data Sources
|
|
173
|
+
|
|
174
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
175
|
+
|
|
176
|
+
```ruby
|
|
177
|
+
result = carbon.data_sources.query_user_data_sources(
|
|
178
|
+
pagination: {
|
|
179
|
+
"limit" => 10,
|
|
180
|
+
"offset" => 0,
|
|
181
|
+
},
|
|
182
|
+
order_by: "created_at",
|
|
183
|
+
order_dir: "desc",
|
|
184
|
+
filters: {
|
|
185
|
+
"source" => "GOOGLE_DRIVE",
|
|
186
|
+
},
|
|
187
|
+
)
|
|
188
|
+
p result
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
192
|
+
|
|
193
|
+
##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
|
|
194
|
+
##### order_by: [`OrganizationUserDataSourceOrderByColumns`](./lib/carbon_ruby_sdk/models/organization_user_data_source_order_by_columns.rb)<a id="order_by-organizationuserdatasourceorderbycolumnslibcarbon_ruby_sdkmodelsorganization_user_data_source_order_by_columnsrb"></a>
|
|
195
|
+
##### order_dir: [`OrderDir`](./lib/carbon_ruby_sdk/models/order_dir.rb)<a id="order_dir-orderdirlibcarbon_ruby_sdkmodelsorder_dirrb"></a>
|
|
196
|
+
##### filters: [`OrganizationUserDataSourceFilters`](./lib/carbon_ruby_sdk/models/organization_user_data_source_filters.rb)<a id="filters-organizationuserdatasourcefilterslibcarbon_ruby_sdkmodelsorganization_user_data_source_filtersrb"></a>
|
|
197
|
+
#### π Return<a id="π-return"></a>
|
|
198
|
+
|
|
199
|
+
[OrganizationUserDataSourceResponse](./lib/carbon_ruby_sdk/models/organization_user_data_source_response.rb)
|
|
200
|
+
|
|
201
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
202
|
+
|
|
203
|
+
`/user_data_sources` `POST`
|
|
204
|
+
|
|
205
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
### `carbon.data_sources.revoke_access_token`<a id="carbondata_sourcesrevoke_access_token"></a>
|
|
211
|
+
|
|
212
|
+
Revoke Access Token
|
|
213
|
+
|
|
214
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
215
|
+
|
|
216
|
+
```ruby
|
|
217
|
+
result = carbon.data_sources.revoke_access_token(
|
|
218
|
+
data_source_id: 1,
|
|
219
|
+
)
|
|
220
|
+
p result
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
224
|
+
|
|
225
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
226
|
+
#### π Return<a id="π-return"></a>
|
|
227
|
+
|
|
228
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
229
|
+
|
|
230
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
231
|
+
|
|
232
|
+
`/revoke_access_token` `POST`
|
|
233
|
+
|
|
234
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
### `carbon.embeddings.get_documents`<a id="carbonembeddingsget_documents"></a>
|
|
240
|
+
|
|
241
|
+
For pre-filtering documents, using `tags_v2` is preferred to using `tags` (which is now deprecated). If both `tags_v2`
|
|
242
|
+
and `tags` are specified, `tags` is ignored. `tags_v2` enables
|
|
243
|
+
building complex filters through the use of "AND", "OR", and negation logic. Take the below input as an example:
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"OR": [
|
|
247
|
+
{
|
|
248
|
+
"key": "subject",
|
|
249
|
+
"value": "holy-bible",
|
|
250
|
+
"negate": false
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"key": "person-of-interest",
|
|
254
|
+
"value": "jesus christ",
|
|
255
|
+
"negate": false
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"key": "genre",
|
|
259
|
+
"value": "religion",
|
|
260
|
+
"negate": true
|
|
261
|
+
}
|
|
262
|
+
{
|
|
263
|
+
"AND": [
|
|
264
|
+
{
|
|
265
|
+
"key": "subject",
|
|
266
|
+
"value": "tao-te-ching",
|
|
267
|
+
"negate": false
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"key": "author",
|
|
271
|
+
"value": "lao-tzu",
|
|
272
|
+
"negate": false
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
In this case, files will be filtered such that:
|
|
280
|
+
1. "subject" = "holy-bible" OR
|
|
281
|
+
2. "person-of-interest" = "jesus christ" OR
|
|
282
|
+
3. "genre" != "religion" OR
|
|
283
|
+
4. "subject" = "tao-te-ching" AND "author" = "lao-tzu"
|
|
284
|
+
|
|
285
|
+
Note that the top level of the query must be either an "OR" or "AND" array. Currently, nesting is limited to 3.
|
|
286
|
+
For tag blocks (those with "key", "value", and "negate" keys), the following typing rules apply:
|
|
287
|
+
1. "key" isn't optional and must be a `string`
|
|
288
|
+
2. "value" isn't optional and can be `any` or list[`any`]
|
|
289
|
+
3. "negate" is optional and must be `true` or `false`. If present and `true`, then the filter block is negated in
|
|
290
|
+
the resulting query. It is `false` by default.
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
When querying embeddings, you can optionally specify the `media_type` parameter in your request. By default (if
|
|
294
|
+
not set), it is equal to "TEXT". This means that the query will be performed over files that have
|
|
295
|
+
been parsed as text (for now, this covers all files except image files). If it is equal to "IMAGE",
|
|
296
|
+
the query will be performed over image files (for now, `.jpg` and `.png` files). You can think of this
|
|
297
|
+
field as an additional filter on top of any filters set in `file_ids` and
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
When `hybrid_search` is set to true, a combination of keyword search and semantic search are used to rank
|
|
301
|
+
and select candidate embeddings during information retrieval. By default, these search methods are weighted
|
|
302
|
+
equally during the ranking process. To adjust the weight (or "importance") of each search method, you can use
|
|
303
|
+
the `hybrid_search_tuning_parameters` property. The description for the different tuning parameters are:
|
|
304
|
+
- `weight_a`: weight to assign to semantic search
|
|
305
|
+
- `weight_b`: weight to assign to keyword search
|
|
306
|
+
|
|
307
|
+
You must ensure that `sum(weight_a, weight_b,..., weight_n)` for all *n* weights is equal to 1. The equality
|
|
308
|
+
has an error tolerance of 0.001 to account for possible floating point issues.
|
|
309
|
+
|
|
310
|
+
In order to use hybrid search for a customer across a set of documents, two flags need to be enabled:
|
|
311
|
+
1. Use the `/modify_user_configuration` endpoint to to enable `sparse_vectors` for the customer. The payload
|
|
312
|
+
body for this request is below:
|
|
313
|
+
```
|
|
314
|
+
{
|
|
315
|
+
"configuration_key_name": "sparse_vectors",
|
|
316
|
+
"value": {
|
|
317
|
+
"enabled": true
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
2. Make sure hybrid search is enabled for the documents across which you want to perform the search. For the
|
|
322
|
+
`/uploadfile` endpoint, this can be done by setting the following query parameter: `generate_sparse_vectors=true`
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
Carbon supports multiple models for use in generating embeddings for files. For images, we support Vertex AI's
|
|
326
|
+
multimodal model; for text, we support OpenAI's `text-embedding-ada-002` and Cohere's embed-multilingual-v3.0.
|
|
327
|
+
The model can be specified via the `embedding_model` parameter (in the POST body for `/embeddings`, and a query
|
|
328
|
+
parameter in `/uploadfile`). If no model is supplied, the `text-embedding-ada-002` is used by default. When performing
|
|
329
|
+
embedding queries, embeddings from files that used the specified model will be considered in the query.
|
|
330
|
+
For example, if files A and B have embeddings generated with `OPENAI`, and files C and D have embeddings generated with
|
|
331
|
+
`COHERE_MULTILINGUAL_V3`, then by default, queries will only consider files A and B. If `COHERE_MULTILINGUAL_V3` is
|
|
332
|
+
specified as the `embedding_model` in `/embeddings`, then only files C and D will be considered. Make sure that
|
|
333
|
+
the set of all files you want considered for a query have embeddings generated via the same model. For now, **do not**
|
|
334
|
+
set `VERTEX_MULTIMODAL` as an `embedding_model`. This model is used automatically by Carbon when it detects an image file.
|
|
335
|
+
|
|
336
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
337
|
+
|
|
338
|
+
```ruby
|
|
339
|
+
result = carbon.embeddings.get_documents(
|
|
340
|
+
query: "a",
|
|
341
|
+
k: 1,
|
|
342
|
+
tags: {
|
|
343
|
+
"key": "string_example",
|
|
344
|
+
},
|
|
345
|
+
query_vector: [
|
|
346
|
+
3.14
|
|
347
|
+
],
|
|
348
|
+
file_ids: [
|
|
349
|
+
1
|
|
350
|
+
],
|
|
351
|
+
parent_file_ids: [
|
|
352
|
+
1
|
|
353
|
+
],
|
|
354
|
+
tags_v2: {
|
|
355
|
+
},
|
|
356
|
+
include_tags: true,
|
|
357
|
+
include_vectors: true,
|
|
358
|
+
include_raw_file: true,
|
|
359
|
+
hybrid_search: true,
|
|
360
|
+
hybrid_search_tuning_parameters: {
|
|
361
|
+
"weight_a" => 0.5,
|
|
362
|
+
"weight_b" => 0.5,
|
|
363
|
+
},
|
|
364
|
+
media_type: "TEXT",
|
|
365
|
+
embedding_model: "OPENAI",
|
|
366
|
+
)
|
|
367
|
+
p result
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
371
|
+
|
|
372
|
+
##### query: `String`<a id="query-string"></a>
|
|
373
|
+
Query for which to get related chunks and embeddings.
|
|
374
|
+
|
|
375
|
+
##### k: `Integer`<a id="k-integer"></a>
|
|
376
|
+
Number of related chunks to return.
|
|
377
|
+
|
|
378
|
+
##### tags: Hash<string, [`Tags1`](./lib/carbon_ruby_sdk/models/tags1.rb)><a id="tags-hash"></a>
|
|
379
|
+
A set of tags to limit the search to. Deprecated and may be removed in the
|
|
380
|
+
future.
|
|
381
|
+
|
|
382
|
+
##### query_vector: Array<`Float`><a id="query_vector-array"></a>
|
|
383
|
+
Optional query vector for which to get related chunks and embeddings. It must
|
|
384
|
+
have been generated by the same model used to generate the embeddings across
|
|
385
|
+
which the search is being conducted. Cannot provide both `query` and
|
|
386
|
+
`query_vector`.
|
|
387
|
+
|
|
388
|
+
##### file_ids: Array<`Integer`><a id="file_ids-array"></a>
|
|
389
|
+
Optional list of file IDs to limit the search to
|
|
390
|
+
|
|
391
|
+
##### parent_file_ids: Array<`Integer`><a id="parent_file_ids-array"></a>
|
|
392
|
+
Optional list of parent file IDs to limit the search to. A parent file describes
|
|
393
|
+
a file to which another file belongs (e.g. a folder)
|
|
394
|
+
|
|
395
|
+
##### tags_v2: `Object`<a id="tags_v2-object"></a>
|
|
396
|
+
A set of tags to limit the search to. Use this instead of `tags`, which is
|
|
397
|
+
deprecated.
|
|
398
|
+
|
|
399
|
+
##### include_tags: `Boolean`<a id="include_tags-boolean"></a>
|
|
400
|
+
Flag to control whether or not to include tags for each chunk in the response.
|
|
401
|
+
|
|
402
|
+
##### include_vectors: `Boolean`<a id="include_vectors-boolean"></a>
|
|
403
|
+
Flag to control whether or not to include embedding vectors in the response.
|
|
404
|
+
|
|
405
|
+
##### include_raw_file: `Boolean`<a id="include_raw_file-boolean"></a>
|
|
406
|
+
Flag to control whether or not to include a signed URL to the raw file
|
|
407
|
+
containing each chunk in the response.
|
|
408
|
+
|
|
409
|
+
##### hybrid_search: `Boolean`<a id="hybrid_search-boolean"></a>
|
|
410
|
+
Flag to control whether or not to perform hybrid search.
|
|
411
|
+
|
|
412
|
+
##### 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>
|
|
413
|
+
##### media_type: [`FileContentTypesNullable`](./lib/carbon_ruby_sdk/models/file_content_types_nullable.rb)<a id="media_type-filecontenttypesnullablelibcarbon_ruby_sdkmodelsfile_content_types_nullablerb"></a>
|
|
414
|
+
Used to filter the kind of files (e.g. `TEXT` or `IMAGE`) over which to perform
|
|
415
|
+
the search. Also plays a role in determining what embedding model is used to
|
|
416
|
+
embed the query. If `IMAGE` is chosen as the media type, then the embedding
|
|
417
|
+
model used will be an embedding model that is not text-only, *regardless* of
|
|
418
|
+
what value is passed for `embedding_model`.
|
|
419
|
+
|
|
420
|
+
##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
|
|
421
|
+
#### π Return<a id="π-return"></a>
|
|
422
|
+
|
|
423
|
+
[DocumentResponseList](./lib/carbon_ruby_sdk/models/document_response_list.rb)
|
|
424
|
+
|
|
425
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
426
|
+
|
|
427
|
+
`/embeddings` `POST`
|
|
428
|
+
|
|
429
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
### `carbon.embeddings.get_embeddings_and_chunks`<a id="carbonembeddingsget_embeddings_and_chunks"></a>
|
|
435
|
+
|
|
436
|
+
Retrieve Embeddings And Content
|
|
437
|
+
|
|
438
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
439
|
+
|
|
440
|
+
```ruby
|
|
441
|
+
result = carbon.embeddings.get_embeddings_and_chunks(
|
|
442
|
+
filters: {
|
|
443
|
+
"user_file_id" => 1,
|
|
444
|
+
"embedding_model" => "OPENAI",
|
|
445
|
+
},
|
|
446
|
+
pagination: {
|
|
447
|
+
"limit" => 10,
|
|
448
|
+
"offset" => 0,
|
|
449
|
+
},
|
|
450
|
+
order_by: "created_at",
|
|
451
|
+
order_dir: "desc",
|
|
452
|
+
include_vectors: false,
|
|
453
|
+
)
|
|
454
|
+
p result
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
458
|
+
|
|
459
|
+
##### filters: [`EmbeddingsAndChunksFilters`](./lib/carbon_ruby_sdk/models/embeddings_and_chunks_filters.rb)<a id="filters-embeddingsandchunksfilterslibcarbon_ruby_sdkmodelsembeddings_and_chunks_filtersrb"></a>
|
|
460
|
+
##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
|
|
461
|
+
##### order_by: [`EmbeddingsAndChunksOrderByColumns`](./lib/carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns.rb)<a id="order_by-embeddingsandchunksorderbycolumnslibcarbon_ruby_sdkmodelsembeddings_and_chunks_order_by_columnsrb"></a>
|
|
462
|
+
##### order_dir: [`OrderDir`](./lib/carbon_ruby_sdk/models/order_dir.rb)<a id="order_dir-orderdirlibcarbon_ruby_sdkmodelsorder_dirrb"></a>
|
|
463
|
+
##### include_vectors: `Boolean`<a id="include_vectors-boolean"></a>
|
|
464
|
+
#### π Return<a id="π-return"></a>
|
|
465
|
+
|
|
466
|
+
[EmbeddingsAndChunksResponse](./lib/carbon_ruby_sdk/models/embeddings_and_chunks_response.rb)
|
|
467
|
+
|
|
468
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
469
|
+
|
|
470
|
+
`/text_chunks` `POST`
|
|
471
|
+
|
|
472
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
### `carbon.embeddings.upload_chunks_and_embeddings`<a id="carbonembeddingsupload_chunks_and_embeddings"></a>
|
|
478
|
+
|
|
479
|
+
Upload Chunks And Embeddings
|
|
480
|
+
|
|
481
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
482
|
+
|
|
483
|
+
```ruby
|
|
484
|
+
result = carbon.embeddings.upload_chunks_and_embeddings(
|
|
485
|
+
embedding_model: "OPENAI",
|
|
486
|
+
chunks_and_embeddings: [
|
|
487
|
+
{
|
|
488
|
+
"file_id" => 1,
|
|
489
|
+
"chunks_and_embeddings" => [
|
|
490
|
+
{
|
|
491
|
+
"chunk_number" => 1,
|
|
492
|
+
"chunk" => "chunk_example",
|
|
493
|
+
"embedding" => [
|
|
494
|
+
3.14
|
|
495
|
+
],
|
|
496
|
+
}
|
|
497
|
+
],
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
overwrite_existing: false,
|
|
501
|
+
)
|
|
502
|
+
p result
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
506
|
+
|
|
507
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
508
|
+
##### chunks_and_embeddings: Array<[`SingleChunksAndEmbeddingsUploadInput`](./lib/carbon_ruby_sdk/models/single_chunks_and_embeddings_upload_input.rb)><a id="chunks_and_embeddings-array"></a>
|
|
509
|
+
##### overwrite_existing: `Boolean`<a id="overwrite_existing-boolean"></a>
|
|
510
|
+
#### π Return<a id="π-return"></a>
|
|
511
|
+
|
|
512
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
513
|
+
|
|
514
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
515
|
+
|
|
516
|
+
`/upload_chunks_and_embeddings` `POST`
|
|
517
|
+
|
|
518
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
### `carbon.files.create_user_file_tags`<a id="carbonfilescreate_user_file_tags"></a>
|
|
524
|
+
|
|
525
|
+
A tag is a key-value pair that can be added to a file. This pair can then be used
|
|
526
|
+
for searches (e.g. embedding searches) in order to narrow down the scope of the search.
|
|
527
|
+
A file can have any number of tags. The following are reserved keys that cannot be used:
|
|
528
|
+
- db_embedding_id
|
|
529
|
+
- organization_id
|
|
530
|
+
- user_id
|
|
531
|
+
- organization_user_file_id
|
|
532
|
+
|
|
533
|
+
Carbon currently supports two data types for tag values - `string` and `list<string>`.
|
|
534
|
+
Keys can only be `string`. If values other than `string` and `list<string>` are used,
|
|
535
|
+
they're automatically converted to strings (e.g. 4 will become "4").
|
|
536
|
+
|
|
537
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
538
|
+
|
|
539
|
+
```ruby
|
|
540
|
+
result = carbon.files.create_user_file_tags(
|
|
541
|
+
tags: {
|
|
542
|
+
"key": "string_example",
|
|
543
|
+
},
|
|
544
|
+
organization_user_file_id: 1,
|
|
545
|
+
)
|
|
546
|
+
p result
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
550
|
+
|
|
551
|
+
##### tags: Hash<string, [`Tags1`](./lib/carbon_ruby_sdk/models/tags1.rb)><a id="tags-hash"></a>
|
|
552
|
+
##### organization_user_file_id: `Integer`<a id="organization_user_file_id-integer"></a>
|
|
553
|
+
#### π Return<a id="π-return"></a>
|
|
554
|
+
|
|
555
|
+
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
|
556
|
+
|
|
557
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
558
|
+
|
|
559
|
+
`/create_user_file_tags` `POST`
|
|
560
|
+
|
|
561
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
### `carbon.files.delete`<a id="carbonfilesdelete"></a>
|
|
567
|
+
|
|
568
|
+
Delete File Endpoint
|
|
569
|
+
|
|
570
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
571
|
+
|
|
572
|
+
```ruby
|
|
573
|
+
result = carbon.files.delete(
|
|
574
|
+
file_id: 1,
|
|
575
|
+
)
|
|
576
|
+
p result
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
580
|
+
|
|
581
|
+
##### file_id: `Integer`<a id="file_id-integer"></a>
|
|
582
|
+
#### π Return<a id="π-return"></a>
|
|
583
|
+
|
|
584
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
585
|
+
|
|
586
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
587
|
+
|
|
588
|
+
`/deletefile/{file_id}` `DELETE`
|
|
589
|
+
|
|
590
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
591
|
+
|
|
592
|
+
---
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
### `carbon.files.delete_file_tags`<a id="carbonfilesdelete_file_tags"></a>
|
|
596
|
+
|
|
597
|
+
Delete File Tags
|
|
598
|
+
|
|
599
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
600
|
+
|
|
601
|
+
```ruby
|
|
602
|
+
result = carbon.files.delete_file_tags(
|
|
603
|
+
tags: [
|
|
604
|
+
"string_example"
|
|
605
|
+
],
|
|
606
|
+
organization_user_file_id: 1,
|
|
607
|
+
)
|
|
608
|
+
p result
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
612
|
+
|
|
613
|
+
##### tags: Array<`String`><a id="tags-array"></a>
|
|
614
|
+
##### organization_user_file_id: `Integer`<a id="organization_user_file_id-integer"></a>
|
|
615
|
+
#### π Return<a id="π-return"></a>
|
|
616
|
+
|
|
617
|
+
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
|
618
|
+
|
|
619
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
620
|
+
|
|
621
|
+
`/delete_user_file_tags` `POST`
|
|
622
|
+
|
|
623
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
624
|
+
|
|
625
|
+
---
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
### `carbon.files.delete_many`<a id="carbonfilesdelete_many"></a>
|
|
629
|
+
|
|
630
|
+
Delete Files Endpoint
|
|
631
|
+
|
|
632
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
633
|
+
|
|
634
|
+
```ruby
|
|
635
|
+
result = carbon.files.delete_many(
|
|
636
|
+
file_ids: [
|
|
637
|
+
1
|
|
638
|
+
],
|
|
639
|
+
sync_statuses: [
|
|
640
|
+
"string_example"
|
|
641
|
+
],
|
|
642
|
+
delete_non_synced_only: false,
|
|
643
|
+
send_webhook: false,
|
|
644
|
+
)
|
|
645
|
+
p result
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
649
|
+
|
|
650
|
+
##### file_ids: Array<`Integer`><a id="file_ids-array"></a>
|
|
651
|
+
##### sync_statuses: Array<[`ExternalFileSyncStatuses`](./lib/carbon_ruby_sdk/models/external_file_sync_statuses.rb)><a id="sync_statuses-array"></a>
|
|
652
|
+
##### delete_non_synced_only: `Boolean`<a id="delete_non_synced_only-boolean"></a>
|
|
653
|
+
##### send_webhook: `Boolean`<a id="send_webhook-boolean"></a>
|
|
654
|
+
#### π Return<a id="π-return"></a>
|
|
655
|
+
|
|
656
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
657
|
+
|
|
658
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
659
|
+
|
|
660
|
+
`/delete_files` `POST`
|
|
661
|
+
|
|
662
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
### `carbon.files.get_parsed_file`<a id="carbonfilesget_parsed_file"></a>
|
|
668
|
+
|
|
669
|
+
This route is deprecated. Use `/user_files_v2` instead.
|
|
670
|
+
|
|
671
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
672
|
+
|
|
673
|
+
```ruby
|
|
674
|
+
result = carbon.files.get_parsed_file(
|
|
675
|
+
file_id: 1,
|
|
676
|
+
)
|
|
677
|
+
p result
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
681
|
+
|
|
682
|
+
##### file_id: `Integer`<a id="file_id-integer"></a>
|
|
683
|
+
#### π Return<a id="π-return"></a>
|
|
684
|
+
|
|
685
|
+
[PresignedURLResponse](./lib/carbon_ruby_sdk/models/presigned_url_response.rb)
|
|
686
|
+
|
|
687
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
688
|
+
|
|
689
|
+
`/parsed_file/{file_id}` `GET`
|
|
690
|
+
|
|
691
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
692
|
+
|
|
693
|
+
---
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
### `carbon.files.get_raw_file`<a id="carbonfilesget_raw_file"></a>
|
|
697
|
+
|
|
698
|
+
This route is deprecated. Use `/user_files_v2` instead.
|
|
699
|
+
|
|
700
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
701
|
+
|
|
702
|
+
```ruby
|
|
703
|
+
result = carbon.files.get_raw_file(
|
|
704
|
+
file_id: 1,
|
|
705
|
+
)
|
|
706
|
+
p result
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
710
|
+
|
|
711
|
+
##### file_id: `Integer`<a id="file_id-integer"></a>
|
|
712
|
+
#### π Return<a id="π-return"></a>
|
|
713
|
+
|
|
714
|
+
[PresignedURLResponse](./lib/carbon_ruby_sdk/models/presigned_url_response.rb)
|
|
715
|
+
|
|
716
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
717
|
+
|
|
718
|
+
`/raw_file/{file_id}` `GET`
|
|
719
|
+
|
|
720
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
721
|
+
|
|
722
|
+
---
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
### `carbon.files.query_user_files`<a id="carbonfilesquery_user_files"></a>
|
|
726
|
+
|
|
727
|
+
For pre-filtering documents, using `tags_v2` is preferred to using `tags` (which is now deprecated). If both `tags_v2`
|
|
728
|
+
and `tags` are specified, `tags` is ignored. `tags_v2` enables
|
|
729
|
+
building complex filters through the use of "AND", "OR", and negation logic. Take the below input as an example:
|
|
730
|
+
```json
|
|
731
|
+
{
|
|
732
|
+
"OR": [
|
|
733
|
+
{
|
|
734
|
+
"key": "subject",
|
|
735
|
+
"value": "holy-bible",
|
|
736
|
+
"negate": false
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
"key": "person-of-interest",
|
|
740
|
+
"value": "jesus christ",
|
|
741
|
+
"negate": false
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"key": "genre",
|
|
745
|
+
"value": "religion",
|
|
746
|
+
"negate": true
|
|
747
|
+
}
|
|
748
|
+
{
|
|
749
|
+
"AND": [
|
|
750
|
+
{
|
|
751
|
+
"key": "subject",
|
|
752
|
+
"value": "tao-te-ching",
|
|
753
|
+
"negate": false
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"key": "author",
|
|
757
|
+
"value": "lao-tzu",
|
|
758
|
+
"negate": false
|
|
759
|
+
}
|
|
760
|
+
]
|
|
761
|
+
}
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
```
|
|
765
|
+
In this case, files will be filtered such that:
|
|
766
|
+
1. "subject" = "holy-bible" OR
|
|
767
|
+
2. "person-of-interest" = "jesus christ" OR
|
|
768
|
+
3. "genre" != "religion" OR
|
|
769
|
+
4. "subject" = "tao-te-ching" AND "author" = "lao-tzu"
|
|
770
|
+
|
|
771
|
+
Note that the top level of the query must be either an "OR" or "AND" array. Currently, nesting is limited to 3.
|
|
772
|
+
For tag blocks (those with "key", "value", and "negate" keys), the following typing rules apply:
|
|
773
|
+
1. "key" isn't optional and must be a `string`
|
|
774
|
+
2. "value" isn't optional and can be `any` or list[`any`]
|
|
775
|
+
3. "negate" is optional and must be `true` or `false`. If present and `true`, then the filter block is negated in
|
|
776
|
+
the resulting query. It is `false` by default.
|
|
777
|
+
|
|
778
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
779
|
+
|
|
780
|
+
```ruby
|
|
781
|
+
result = carbon.files.query_user_files(
|
|
782
|
+
pagination: {
|
|
783
|
+
"limit" => 10,
|
|
784
|
+
"offset" => 0,
|
|
785
|
+
},
|
|
786
|
+
order_by: "created_at",
|
|
787
|
+
order_dir: "desc",
|
|
788
|
+
filters: {
|
|
789
|
+
},
|
|
790
|
+
include_raw_file: true,
|
|
791
|
+
include_parsed_text_file: true,
|
|
792
|
+
include_additional_files: true,
|
|
793
|
+
)
|
|
794
|
+
p result
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
798
|
+
|
|
799
|
+
##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
|
|
800
|
+
##### order_by: [`OrganizationUserFilesToSyncOrderByTypes`](./lib/carbon_ruby_sdk/models/organization_user_files_to_sync_order_by_types.rb)<a id="order_by-organizationuserfilestosyncorderbytypeslibcarbon_ruby_sdkmodelsorganization_user_files_to_sync_order_by_typesrb"></a>
|
|
801
|
+
##### order_dir: [`OrderDir`](./lib/carbon_ruby_sdk/models/order_dir.rb)<a id="order_dir-orderdirlibcarbon_ruby_sdkmodelsorder_dirrb"></a>
|
|
802
|
+
##### filters: [`OrganizationUserFilesToSyncFilters`](./lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb)<a id="filters-organizationuserfilestosyncfilterslibcarbon_ruby_sdkmodelsorganization_user_files_to_sync_filtersrb"></a>
|
|
803
|
+
##### include_raw_file: `Boolean`<a id="include_raw_file-boolean"></a>
|
|
804
|
+
##### include_parsed_text_file: `Boolean`<a id="include_parsed_text_file-boolean"></a>
|
|
805
|
+
##### include_additional_files: `Boolean`<a id="include_additional_files-boolean"></a>
|
|
806
|
+
#### π Return<a id="π-return"></a>
|
|
807
|
+
|
|
808
|
+
[UserFilesV2](./lib/carbon_ruby_sdk/models/user_files_v2.rb)
|
|
809
|
+
|
|
810
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
811
|
+
|
|
812
|
+
`/user_files_v2` `POST`
|
|
813
|
+
|
|
814
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
815
|
+
|
|
816
|
+
---
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
### `carbon.files.query_user_files_deprecated`<a id="carbonfilesquery_user_files_deprecated"></a>
|
|
820
|
+
|
|
821
|
+
This route is deprecated. Use `/user_files_v2` instead.
|
|
822
|
+
|
|
823
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
824
|
+
|
|
825
|
+
```ruby
|
|
826
|
+
result = carbon.files.query_user_files_deprecated(
|
|
827
|
+
pagination: {
|
|
828
|
+
"limit" => 10,
|
|
829
|
+
"offset" => 0,
|
|
830
|
+
},
|
|
831
|
+
order_by: "created_at",
|
|
832
|
+
order_dir: "desc",
|
|
833
|
+
filters: {
|
|
834
|
+
},
|
|
835
|
+
include_raw_file: true,
|
|
836
|
+
include_parsed_text_file: true,
|
|
837
|
+
include_additional_files: true,
|
|
838
|
+
)
|
|
839
|
+
p result
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
843
|
+
|
|
844
|
+
##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
|
|
845
|
+
##### order_by: [`OrganizationUserFilesToSyncOrderByTypes`](./lib/carbon_ruby_sdk/models/organization_user_files_to_sync_order_by_types.rb)<a id="order_by-organizationuserfilestosyncorderbytypeslibcarbon_ruby_sdkmodelsorganization_user_files_to_sync_order_by_typesrb"></a>
|
|
846
|
+
##### order_dir: [`OrderDir`](./lib/carbon_ruby_sdk/models/order_dir.rb)<a id="order_dir-orderdirlibcarbon_ruby_sdkmodelsorder_dirrb"></a>
|
|
847
|
+
##### filters: [`OrganizationUserFilesToSyncFilters`](./lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb)<a id="filters-organizationuserfilestosyncfilterslibcarbon_ruby_sdkmodelsorganization_user_files_to_sync_filtersrb"></a>
|
|
848
|
+
##### include_raw_file: `Boolean`<a id="include_raw_file-boolean"></a>
|
|
849
|
+
##### include_parsed_text_file: `Boolean`<a id="include_parsed_text_file-boolean"></a>
|
|
850
|
+
##### include_additional_files: `Boolean`<a id="include_additional_files-boolean"></a>
|
|
851
|
+
#### π Return<a id="π-return"></a>
|
|
852
|
+
|
|
853
|
+
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
|
854
|
+
|
|
855
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
856
|
+
|
|
857
|
+
`/user_files` `POST`
|
|
858
|
+
|
|
859
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
860
|
+
|
|
861
|
+
---
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
### `carbon.files.resync`<a id="carbonfilesresync"></a>
|
|
865
|
+
|
|
866
|
+
Resync File
|
|
867
|
+
|
|
868
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
869
|
+
|
|
870
|
+
```ruby
|
|
871
|
+
result = carbon.files.resync(
|
|
872
|
+
file_id: 1,
|
|
873
|
+
chunk_size: 1,
|
|
874
|
+
chunk_overlap: 1,
|
|
875
|
+
)
|
|
876
|
+
p result
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
880
|
+
|
|
881
|
+
##### file_id: `Integer`<a id="file_id-integer"></a>
|
|
882
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
883
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
884
|
+
#### π Return<a id="π-return"></a>
|
|
885
|
+
|
|
886
|
+
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
|
887
|
+
|
|
888
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
889
|
+
|
|
890
|
+
`/resync_file` `POST`
|
|
891
|
+
|
|
892
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
893
|
+
|
|
894
|
+
---
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
### `carbon.files.upload`<a id="carbonfilesupload"></a>
|
|
898
|
+
|
|
899
|
+
This endpoint is used to directly upload local files to Carbon. The `POST` request should be a multipart form request.
|
|
900
|
+
Note that the `set_page_as_boundary` query parameter is applicable only to PDFs for now. When this value is set,
|
|
901
|
+
PDF chunks are at most one page long. Additional information can be retrieved for each chunk, however, namely the coordinates
|
|
902
|
+
of the bounding box around the chunk (this can be used for things like text highlighting). Following is a description
|
|
903
|
+
of all possible query parameters:
|
|
904
|
+
- `chunk_size`: the chunk size (in tokens) applied when splitting the document
|
|
905
|
+
- `chunk_overlap`: the chunk overlap (in tokens) applied when splitting the document
|
|
906
|
+
- `skip_embedding_generation`: whether or not to skip the generation of chunks and embeddings
|
|
907
|
+
- `set_page_as_boundary`: described above
|
|
908
|
+
- `embedding_model`: the model used to generate embeddings for the document chunks
|
|
909
|
+
- `use_ocr`: whether or not to use OCR as a preprocessing step prior to generating chunks (only valid for PDFs currently)
|
|
910
|
+
- `generate_sparse_vectors`: whether or not to generate sparse vectors for the file. Required for hybrid search.
|
|
911
|
+
- `prepend_filename_to_chunks`: whether or not to prepend the filename to the chunk text
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
Carbon supports multiple models for use in generating embeddings for files. For images, we support Vertex AI's
|
|
915
|
+
multimodal model; for text, we support OpenAI's `text-embedding-ada-002` and Cohere's embed-multilingual-v3.0.
|
|
916
|
+
The model can be specified via the `embedding_model` parameter (in the POST body for `/embeddings`, and a query
|
|
917
|
+
parameter in `/uploadfile`). If no model is supplied, the `text-embedding-ada-002` is used by default. When performing
|
|
918
|
+
embedding queries, embeddings from files that used the specified model will be considered in the query.
|
|
919
|
+
For example, if files A and B have embeddings generated with `OPENAI`, and files C and D have embeddings generated with
|
|
920
|
+
`COHERE_MULTILINGUAL_V3`, then by default, queries will only consider files A and B. If `COHERE_MULTILINGUAL_V3` is
|
|
921
|
+
specified as the `embedding_model` in `/embeddings`, then only files C and D will be considered. Make sure that
|
|
922
|
+
the set of all files you want considered for a query have embeddings generated via the same model. For now, **do not**
|
|
923
|
+
set `VERTEX_MULTIMODAL` as an `embedding_model`. This model is used automatically by Carbon when it detects an image file.
|
|
924
|
+
|
|
925
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
926
|
+
|
|
927
|
+
```ruby
|
|
928
|
+
result = carbon.files.upload(
|
|
929
|
+
file: File.open("path/to/file", "rb"),
|
|
930
|
+
chunk_size: 1,
|
|
931
|
+
chunk_overlap: 1,
|
|
932
|
+
skip_embedding_generation: false,
|
|
933
|
+
set_page_as_boundary: false,
|
|
934
|
+
embedding_model: "OPENAI",
|
|
935
|
+
use_ocr: false,
|
|
936
|
+
generate_sparse_vectors: false,
|
|
937
|
+
prepend_filename_to_chunks: false,
|
|
938
|
+
max_items_per_chunk: 1,
|
|
939
|
+
)
|
|
940
|
+
p result
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
944
|
+
|
|
945
|
+
##### file: `File`<a id="file-file"></a>
|
|
946
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
947
|
+
Chunk size in tiktoken tokens to be used when processing file.
|
|
948
|
+
|
|
949
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
950
|
+
Chunk overlap in tiktoken tokens to be used when processing file.
|
|
951
|
+
|
|
952
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
953
|
+
Flag to control whether or not embeddings should be generated and stored when
|
|
954
|
+
processing file.
|
|
955
|
+
|
|
956
|
+
##### set_page_as_boundary: `Boolean`<a id="set_page_as_boundary-boolean"></a>
|
|
957
|
+
Flag to control whether or not to set the a page's worth of content as the
|
|
958
|
+
maximum amount of content that can appear in a chunk. Only valid for PDFs. See
|
|
959
|
+
description route description for more information.
|
|
960
|
+
|
|
961
|
+
##### embedding_model: [`TextEmbeddingGenerators`](./lib/carbon_ruby_sdk/models/text_embedding_generators.rb)<a id="embedding_model-textembeddinggeneratorslibcarbon_ruby_sdkmodelstext_embedding_generatorsrb"></a>
|
|
962
|
+
Embedding model that will be used to embed file chunks.
|
|
963
|
+
|
|
964
|
+
##### use_ocr: `Boolean`<a id="use_ocr-boolean"></a>
|
|
965
|
+
Whether or not to use OCR when processing files. Only valid for PDFs. Useful for
|
|
966
|
+
documents with tables, images, and/or scanned text.
|
|
967
|
+
|
|
968
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
969
|
+
Whether or not to generate sparse vectors for the file. This is *required* for
|
|
970
|
+
the file to be a candidate for hybrid search.
|
|
971
|
+
|
|
972
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
973
|
+
Whether or not to prepend the file's name to chunks.
|
|
974
|
+
|
|
975
|
+
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
|
976
|
+
Number of objects per chunk. For json files only.
|
|
977
|
+
|
|
978
|
+
#### π Return<a id="π-return"></a>
|
|
979
|
+
|
|
980
|
+
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
|
981
|
+
|
|
982
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
983
|
+
|
|
984
|
+
`/uploadfile` `POST`
|
|
985
|
+
|
|
986
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
987
|
+
|
|
988
|
+
---
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
### `carbon.files.upload_from_url`<a id="carbonfilesupload_from_url"></a>
|
|
992
|
+
|
|
993
|
+
Create Upload File From Url
|
|
994
|
+
|
|
995
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
996
|
+
|
|
997
|
+
```ruby
|
|
998
|
+
result = carbon.files.upload_from_url(
|
|
999
|
+
url: "string_example",
|
|
1000
|
+
file_name: "string_example",
|
|
1001
|
+
chunk_size: 1,
|
|
1002
|
+
chunk_overlap: 1,
|
|
1003
|
+
skip_embedding_generation: false,
|
|
1004
|
+
set_page_as_boundary: false,
|
|
1005
|
+
embedding_model: "OPENAI",
|
|
1006
|
+
generate_sparse_vectors: false,
|
|
1007
|
+
use_textract: false,
|
|
1008
|
+
prepend_filename_to_chunks: false,
|
|
1009
|
+
max_items_per_chunk: 1,
|
|
1010
|
+
)
|
|
1011
|
+
p result
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1015
|
+
|
|
1016
|
+
##### url: `String`<a id="url-string"></a>
|
|
1017
|
+
##### file_name: `String`<a id="file_name-string"></a>
|
|
1018
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1019
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1020
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1021
|
+
##### set_page_as_boundary: `Boolean`<a id="set_page_as_boundary-boolean"></a>
|
|
1022
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
1023
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1024
|
+
##### use_textract: `Boolean`<a id="use_textract-boolean"></a>
|
|
1025
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1026
|
+
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
|
1027
|
+
#### π Return<a id="π-return"></a>
|
|
1028
|
+
|
|
1029
|
+
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
|
1030
|
+
|
|
1031
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1032
|
+
|
|
1033
|
+
`/upload_file_from_url` `POST`
|
|
1034
|
+
|
|
1035
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1036
|
+
|
|
1037
|
+
---
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
### `carbon.files.upload_text`<a id="carbonfilesupload_text"></a>
|
|
1041
|
+
|
|
1042
|
+
Carbon supports multiple models for use in generating embeddings for files. For images, we support Vertex AI's
|
|
1043
|
+
multimodal model; for text, we support OpenAI's `text-embedding-ada-002` and Cohere's embed-multilingual-v3.0.
|
|
1044
|
+
The model can be specified via the `embedding_model` parameter (in the POST body for `/embeddings`, and a query
|
|
1045
|
+
parameter in `/uploadfile`). If no model is supplied, the `text-embedding-ada-002` is used by default. When performing
|
|
1046
|
+
embedding queries, embeddings from files that used the specified model will be considered in the query.
|
|
1047
|
+
For example, if files A and B have embeddings generated with `OPENAI`, and files C and D have embeddings generated with
|
|
1048
|
+
`COHERE_MULTILINGUAL_V3`, then by default, queries will only consider files A and B. If `COHERE_MULTILINGUAL_V3` is
|
|
1049
|
+
specified as the `embedding_model` in `/embeddings`, then only files C and D will be considered. Make sure that
|
|
1050
|
+
the set of all files you want considered for a query have embeddings generated via the same model. For now, **do not**
|
|
1051
|
+
set `VERTEX_MULTIMODAL` as an `embedding_model`. This model is used automatically by Carbon when it detects an image file.
|
|
1052
|
+
|
|
1053
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1054
|
+
|
|
1055
|
+
```ruby
|
|
1056
|
+
result = carbon.files.upload_text(
|
|
1057
|
+
contents: "string_example",
|
|
1058
|
+
name: "string_example",
|
|
1059
|
+
chunk_size: 1,
|
|
1060
|
+
chunk_overlap: 1,
|
|
1061
|
+
skip_embedding_generation: false,
|
|
1062
|
+
overwrite_file_id: 1,
|
|
1063
|
+
embedding_model: "OPENAI",
|
|
1064
|
+
generate_sparse_vectors: false,
|
|
1065
|
+
)
|
|
1066
|
+
p result
|
|
1067
|
+
```
|
|
1068
|
+
|
|
1069
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1070
|
+
|
|
1071
|
+
##### contents: `String`<a id="contents-string"></a>
|
|
1072
|
+
##### name: `String`<a id="name-string"></a>
|
|
1073
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1074
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1075
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1076
|
+
##### overwrite_file_id: `Integer`<a id="overwrite_file_id-integer"></a>
|
|
1077
|
+
##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
|
|
1078
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1079
|
+
#### π Return<a id="π-return"></a>
|
|
1080
|
+
|
|
1081
|
+
[UserFile](./lib/carbon_ruby_sdk/models/user_file.rb)
|
|
1082
|
+
|
|
1083
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1084
|
+
|
|
1085
|
+
`/upload_text` `POST`
|
|
1086
|
+
|
|
1087
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1088
|
+
|
|
1089
|
+
---
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
### `carbon.health.check`<a id="carbonhealthcheck"></a>
|
|
1093
|
+
|
|
1094
|
+
Health
|
|
1095
|
+
|
|
1096
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1097
|
+
|
|
1098
|
+
```ruby
|
|
1099
|
+
result = carbon.health.check
|
|
1100
|
+
p result
|
|
1101
|
+
```
|
|
1102
|
+
|
|
1103
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1104
|
+
|
|
1105
|
+
`/health` `GET`
|
|
1106
|
+
|
|
1107
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1108
|
+
|
|
1109
|
+
---
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
### `carbon.integrations.connect_freshdesk`<a id="carbonintegrationsconnect_freshdesk"></a>
|
|
1113
|
+
|
|
1114
|
+
Refer this article to obtain an API key https://support.freshdesk.com/en/support/solutions/articles/215517.
|
|
1115
|
+
Make sure that your API key has the permission to read solutions from your account and you are on a <b>paid</b> plan.
|
|
1116
|
+
Once you have an API key, you can make a request to this endpoint along with your freshdesk domain. This will
|
|
1117
|
+
trigger an automatic sync of the articles in your "solutions" tab. Additional parameters below can be used to associate
|
|
1118
|
+
data with the synced articles or modify the sync behavior.
|
|
1119
|
+
|
|
1120
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1121
|
+
|
|
1122
|
+
```ruby
|
|
1123
|
+
result = carbon.integrations.connect_freshdesk(
|
|
1124
|
+
domain: "string_example",
|
|
1125
|
+
api_key: "string_example",
|
|
1126
|
+
tags: {},
|
|
1127
|
+
chunk_size: 1500,
|
|
1128
|
+
chunk_overlap: 20,
|
|
1129
|
+
skip_embedding_generation: false,
|
|
1130
|
+
embedding_model: "OPENAI",
|
|
1131
|
+
generate_sparse_vectors: false,
|
|
1132
|
+
prepend_filename_to_chunks: false,
|
|
1133
|
+
)
|
|
1134
|
+
p result
|
|
1135
|
+
```
|
|
1136
|
+
|
|
1137
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1138
|
+
|
|
1139
|
+
##### domain: `String`<a id="domain-string"></a>
|
|
1140
|
+
##### api_key: `String`<a id="api_key-string"></a>
|
|
1141
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1142
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1143
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1144
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1145
|
+
##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
|
|
1146
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1147
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1148
|
+
#### π Return<a id="π-return"></a>
|
|
1149
|
+
|
|
1150
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1151
|
+
|
|
1152
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1153
|
+
|
|
1154
|
+
`/integrations/freshdesk` `POST`
|
|
1155
|
+
|
|
1156
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1157
|
+
|
|
1158
|
+
---
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
### `carbon.integrations.connect_gitbook`<a id="carbonintegrationsconnect_gitbook"></a>
|
|
1162
|
+
|
|
1163
|
+
You will need an access token to connect your Gitbook account. Note that the permissions will be defined by the user
|
|
1164
|
+
generating access token so make sure you have the permission to access spaces you will be syncing.
|
|
1165
|
+
Refer this article for more details https://developer.gitbook.com/gitbook-api/authentication. Additionally, you
|
|
1166
|
+
need to specify the name of organization you will be syncing data from.
|
|
1167
|
+
|
|
1168
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1169
|
+
|
|
1170
|
+
```ruby
|
|
1171
|
+
result = carbon.integrations.connect_gitbook(
|
|
1172
|
+
organization: "string_example",
|
|
1173
|
+
access_token: "string_example",
|
|
1174
|
+
)
|
|
1175
|
+
p result
|
|
1176
|
+
```
|
|
1177
|
+
|
|
1178
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1179
|
+
|
|
1180
|
+
##### organization: `String`<a id="organization-string"></a>
|
|
1181
|
+
##### access_token: `String`<a id="access_token-string"></a>
|
|
1182
|
+
#### π Return<a id="π-return"></a>
|
|
1183
|
+
|
|
1184
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1185
|
+
|
|
1186
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1187
|
+
|
|
1188
|
+
`/integrations/gitbook` `POST`
|
|
1189
|
+
|
|
1190
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1191
|
+
|
|
1192
|
+
---
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
### `carbon.integrations.create_aws_iam_user`<a id="carbonintegrationscreate_aws_iam_user"></a>
|
|
1196
|
+
|
|
1197
|
+
Create a new IAM user with permissions to:
|
|
1198
|
+
<ol>
|
|
1199
|
+
<li>List all buckets.</li>
|
|
1200
|
+
<li>Read from the specific buckets and objects to sync with Carbon. Ensure any future buckets or objects carry
|
|
1201
|
+
the same permissions.</li>
|
|
1202
|
+
</ol>
|
|
1203
|
+
Once created, generate an access key for this user and share the credentials with us. We recommend testing this key beforehand.
|
|
1204
|
+
|
|
1205
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1206
|
+
|
|
1207
|
+
```ruby
|
|
1208
|
+
result = carbon.integrations.create_aws_iam_user(
|
|
1209
|
+
access_key: "string_example",
|
|
1210
|
+
access_key_secret: "string_example",
|
|
1211
|
+
)
|
|
1212
|
+
p result
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1216
|
+
|
|
1217
|
+
##### access_key: `String`<a id="access_key-string"></a>
|
|
1218
|
+
##### access_key_secret: `String`<a id="access_key_secret-string"></a>
|
|
1219
|
+
#### π Return<a id="π-return"></a>
|
|
1220
|
+
|
|
1221
|
+
[OrganizationUserDataSourceAPI](./lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb)
|
|
1222
|
+
|
|
1223
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1224
|
+
|
|
1225
|
+
`/integrations/s3` `POST`
|
|
1226
|
+
|
|
1227
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1228
|
+
|
|
1229
|
+
---
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
### `carbon.integrations.get_oauth_url`<a id="carbonintegrationsget_oauth_url"></a>
|
|
1233
|
+
|
|
1234
|
+
Get Oauth Url
|
|
1235
|
+
|
|
1236
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1237
|
+
|
|
1238
|
+
```ruby
|
|
1239
|
+
result = carbon.integrations.get_oauth_url(
|
|
1240
|
+
service: "GOOGLE_DRIVE",
|
|
1241
|
+
tags: None,
|
|
1242
|
+
scope: "string_example",
|
|
1243
|
+
chunk_size: 1500,
|
|
1244
|
+
chunk_overlap: 20,
|
|
1245
|
+
skip_embedding_generation: false,
|
|
1246
|
+
embedding_model: "OPENAI",
|
|
1247
|
+
zendesk_subdomain: "string_example",
|
|
1248
|
+
microsoft_tenant: "string_example",
|
|
1249
|
+
sharepoint_site_name: "string_example",
|
|
1250
|
+
confluence_subdomain: "string_example",
|
|
1251
|
+
generate_sparse_vectors: false,
|
|
1252
|
+
prepend_filename_to_chunks: false,
|
|
1253
|
+
max_items_per_chunk: 1,
|
|
1254
|
+
)
|
|
1255
|
+
p result
|
|
1256
|
+
```
|
|
1257
|
+
|
|
1258
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1259
|
+
|
|
1260
|
+
##### service: [`DataSourceType`](./lib/carbon_ruby_sdk/models/data_source_type.rb)<a id="service-datasourcetypelibcarbon_ruby_sdkmodelsdata_source_typerb"></a>
|
|
1261
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1262
|
+
##### scope: `String`<a id="scope-string"></a>
|
|
1263
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1264
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1265
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1266
|
+
##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
|
|
1267
|
+
##### zendesk_subdomain: `String`<a id="zendesk_subdomain-string"></a>
|
|
1268
|
+
##### microsoft_tenant: `String`<a id="microsoft_tenant-string"></a>
|
|
1269
|
+
##### sharepoint_site_name: `String`<a id="sharepoint_site_name-string"></a>
|
|
1270
|
+
##### confluence_subdomain: `String`<a id="confluence_subdomain-string"></a>
|
|
1271
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1272
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1273
|
+
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
|
1274
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1275
|
+
|
|
1276
|
+
`/integrations/oauth_url` `POST`
|
|
1277
|
+
|
|
1278
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1279
|
+
|
|
1280
|
+
---
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
### `carbon.integrations.list_confluence_pages`<a id="carbonintegrationslist_confluence_pages"></a>
|
|
1284
|
+
|
|
1285
|
+
To begin listing a user's Confluence pages, at least a `data_source_id` of a connected
|
|
1286
|
+
Confluence account must be specified. This base request returns a list of root pages for
|
|
1287
|
+
every space the user has access to in a Confluence instance. To traverse further down
|
|
1288
|
+
the user's page directory, additional requests to this endpoint can be made with the same
|
|
1289
|
+
`data_source_id` and with `parent_id` set to the id of page from a previous request. For
|
|
1290
|
+
convenience, the `has_children` property in each directory item in the response list will
|
|
1291
|
+
flag which pages will return non-empty lists of pages when set as the `parent_id`.
|
|
1292
|
+
|
|
1293
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1294
|
+
|
|
1295
|
+
```ruby
|
|
1296
|
+
result = carbon.integrations.list_confluence_pages(
|
|
1297
|
+
data_source_id: 1,
|
|
1298
|
+
parent_id: "string_example",
|
|
1299
|
+
)
|
|
1300
|
+
p result
|
|
1301
|
+
```
|
|
1302
|
+
|
|
1303
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1304
|
+
|
|
1305
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
1306
|
+
##### parent_id: `String`<a id="parent_id-string"></a>
|
|
1307
|
+
#### π Return<a id="π-return"></a>
|
|
1308
|
+
|
|
1309
|
+
[ListResponse](./lib/carbon_ruby_sdk/models/list_response.rb)
|
|
1310
|
+
|
|
1311
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1312
|
+
|
|
1313
|
+
`/integrations/confluence/list` `POST`
|
|
1314
|
+
|
|
1315
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1316
|
+
|
|
1317
|
+
---
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
### `carbon.integrations.list_data_source_items`<a id="carbonintegrationslist_data_source_items"></a>
|
|
1321
|
+
|
|
1322
|
+
List Data Source Items
|
|
1323
|
+
|
|
1324
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1325
|
+
|
|
1326
|
+
```ruby
|
|
1327
|
+
result = carbon.integrations.list_data_source_items(
|
|
1328
|
+
data_source_id: 1,
|
|
1329
|
+
parent_id: "string_example",
|
|
1330
|
+
pagination: {
|
|
1331
|
+
"limit" => 10,
|
|
1332
|
+
"offset" => 0,
|
|
1333
|
+
},
|
|
1334
|
+
)
|
|
1335
|
+
p result
|
|
1336
|
+
```
|
|
1337
|
+
|
|
1338
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1339
|
+
|
|
1340
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
1341
|
+
##### parent_id: `String`<a id="parent_id-string"></a>
|
|
1342
|
+
##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
|
|
1343
|
+
#### π Return<a id="π-return"></a>
|
|
1344
|
+
|
|
1345
|
+
[ListDataSourceItemsResponse](./lib/carbon_ruby_sdk/models/list_data_source_items_response.rb)
|
|
1346
|
+
|
|
1347
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1348
|
+
|
|
1349
|
+
`/integrations/items/list` `POST`
|
|
1350
|
+
|
|
1351
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1352
|
+
|
|
1353
|
+
---
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
### `carbon.integrations.list_folders`<a id="carbonintegrationslist_folders"></a>
|
|
1357
|
+
|
|
1358
|
+
After connecting your Outlook account, you can use this endpoint to list all of your folders on outlook. This includes
|
|
1359
|
+
both system folders like "inbox" and user created folders.
|
|
1360
|
+
|
|
1361
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1362
|
+
|
|
1363
|
+
```ruby
|
|
1364
|
+
result = carbon.integrations.list_folders
|
|
1365
|
+
p result
|
|
1366
|
+
```
|
|
1367
|
+
|
|
1368
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1369
|
+
|
|
1370
|
+
`/integrations/outlook/user_folders` `GET`
|
|
1371
|
+
|
|
1372
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1373
|
+
|
|
1374
|
+
---
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
### `carbon.integrations.list_gitbook_spaces`<a id="carbonintegrationslist_gitbook_spaces"></a>
|
|
1378
|
+
|
|
1379
|
+
After connecting your Gitbook account, you can use this endpoint to list all of your spaces under current organization.
|
|
1380
|
+
|
|
1381
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1382
|
+
|
|
1383
|
+
```ruby
|
|
1384
|
+
result = carbon.integrations.list_gitbook_spaces(
|
|
1385
|
+
data_source_id: 1,
|
|
1386
|
+
)
|
|
1387
|
+
p result
|
|
1388
|
+
```
|
|
1389
|
+
|
|
1390
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1391
|
+
|
|
1392
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
1393
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1394
|
+
|
|
1395
|
+
`/integrations/gitbook/spaces` `GET`
|
|
1396
|
+
|
|
1397
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1398
|
+
|
|
1399
|
+
---
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
### `carbon.integrations.list_labels`<a id="carbonintegrationslist_labels"></a>
|
|
1403
|
+
|
|
1404
|
+
After connecting your Gmail account, you can use this endpoint to list all of your labels. User created labels
|
|
1405
|
+
will have the type "user" and Gmail's default labels will have the type "system"
|
|
1406
|
+
|
|
1407
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1408
|
+
|
|
1409
|
+
```ruby
|
|
1410
|
+
result = carbon.integrations.list_labels
|
|
1411
|
+
p result
|
|
1412
|
+
```
|
|
1413
|
+
|
|
1414
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1415
|
+
|
|
1416
|
+
`/integrations/gmail/user_labels` `GET`
|
|
1417
|
+
|
|
1418
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1419
|
+
|
|
1420
|
+
---
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
### `carbon.integrations.sync_confluence`<a id="carbonintegrationssync_confluence"></a>
|
|
1424
|
+
|
|
1425
|
+
After listing pages in a user's Confluence account, the set of selected page `ids` and the
|
|
1426
|
+
connected account's `data_source_id` can be passed into this endpoint to sync them into
|
|
1427
|
+
Carbon. Additional parameters listed below can be used to associate data to the selected
|
|
1428
|
+
pages or alter the behavior of the sync.
|
|
1429
|
+
|
|
1430
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1431
|
+
|
|
1432
|
+
```ruby
|
|
1433
|
+
result = carbon.integrations.sync_confluence(
|
|
1434
|
+
data_source_id: 1,
|
|
1435
|
+
ids: [
|
|
1436
|
+
"string_example"
|
|
1437
|
+
],
|
|
1438
|
+
tags: {},
|
|
1439
|
+
chunk_size: 1500,
|
|
1440
|
+
chunk_overlap: 20,
|
|
1441
|
+
skip_embedding_generation: false,
|
|
1442
|
+
embedding_model: "OPENAI",
|
|
1443
|
+
generate_sparse_vectors: false,
|
|
1444
|
+
prepend_filename_to_chunks: false,
|
|
1445
|
+
max_items_per_chunk: 1,
|
|
1446
|
+
)
|
|
1447
|
+
p result
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1451
|
+
|
|
1452
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
1453
|
+
##### ids: Array<`String`><a id="ids-array"></a>
|
|
1454
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1455
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1456
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1457
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1458
|
+
##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
|
|
1459
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1460
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1461
|
+
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
|
1462
|
+
#### π Return<a id="π-return"></a>
|
|
1463
|
+
|
|
1464
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1465
|
+
|
|
1466
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1467
|
+
|
|
1468
|
+
`/integrations/confluence/sync` `POST`
|
|
1469
|
+
|
|
1470
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1471
|
+
|
|
1472
|
+
---
|
|
1473
|
+
|
|
1474
|
+
|
|
1475
|
+
### `carbon.integrations.sync_data_source_items`<a id="carbonintegrationssync_data_source_items"></a>
|
|
1476
|
+
|
|
1477
|
+
Sync Data Source Items
|
|
1478
|
+
|
|
1479
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1480
|
+
|
|
1481
|
+
```ruby
|
|
1482
|
+
result = carbon.integrations.sync_data_source_items(
|
|
1483
|
+
data_source_id: 1,
|
|
1484
|
+
)
|
|
1485
|
+
p result
|
|
1486
|
+
```
|
|
1487
|
+
|
|
1488
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1489
|
+
|
|
1490
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
1491
|
+
#### π Return<a id="π-return"></a>
|
|
1492
|
+
|
|
1493
|
+
[OrganizationUserDataSourceAPI](./lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb)
|
|
1494
|
+
|
|
1495
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1496
|
+
|
|
1497
|
+
`/integrations/items/sync` `POST`
|
|
1498
|
+
|
|
1499
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1500
|
+
|
|
1501
|
+
---
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
### `carbon.integrations.sync_files`<a id="carbonintegrationssync_files"></a>
|
|
1505
|
+
|
|
1506
|
+
Sync Files
|
|
1507
|
+
|
|
1508
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1509
|
+
|
|
1510
|
+
```ruby
|
|
1511
|
+
result = carbon.integrations.sync_files(
|
|
1512
|
+
data_source_id: 1,
|
|
1513
|
+
ids: [
|
|
1514
|
+
"string_example"
|
|
1515
|
+
],
|
|
1516
|
+
tags: {},
|
|
1517
|
+
chunk_size: 1500,
|
|
1518
|
+
chunk_overlap: 20,
|
|
1519
|
+
skip_embedding_generation: false,
|
|
1520
|
+
embedding_model: "OPENAI",
|
|
1521
|
+
generate_sparse_vectors: false,
|
|
1522
|
+
prepend_filename_to_chunks: false,
|
|
1523
|
+
max_items_per_chunk: 1,
|
|
1524
|
+
)
|
|
1525
|
+
p result
|
|
1526
|
+
```
|
|
1527
|
+
|
|
1528
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1529
|
+
|
|
1530
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
1531
|
+
##### ids: Array<`String`><a id="ids-array"></a>
|
|
1532
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1533
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1534
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1535
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1536
|
+
##### embedding_model: [`EmbeddingGeneratorsNullable`](./lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb)<a id="embedding_model-embeddinggeneratorsnullablelibcarbon_ruby_sdkmodelsembedding_generators_nullablerb"></a>
|
|
1537
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1538
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1539
|
+
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
|
1540
|
+
#### π Return<a id="π-return"></a>
|
|
1541
|
+
|
|
1542
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1543
|
+
|
|
1544
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1545
|
+
|
|
1546
|
+
`/integrations/files/sync` `POST`
|
|
1547
|
+
|
|
1548
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1549
|
+
|
|
1550
|
+
---
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
### `carbon.integrations.sync_gitbook`<a id="carbonintegrationssync_gitbook"></a>
|
|
1554
|
+
|
|
1555
|
+
You can sync upto 20 Gitbook spaces at a time using this endpoint. Additional parameters below can be used to associate
|
|
1556
|
+
data with the synced pages or modify the sync behavior.
|
|
1557
|
+
|
|
1558
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1559
|
+
|
|
1560
|
+
```ruby
|
|
1561
|
+
result = carbon.integrations.sync_gitbook(
|
|
1562
|
+
space_ids: [
|
|
1563
|
+
"string_example"
|
|
1564
|
+
],
|
|
1565
|
+
data_source_id: 1,
|
|
1566
|
+
tags: {},
|
|
1567
|
+
chunk_size: 1500,
|
|
1568
|
+
chunk_overlap: 20,
|
|
1569
|
+
skip_embedding_generation: false,
|
|
1570
|
+
embedding_model: "OPENAI",
|
|
1571
|
+
generate_sparse_vectors: false,
|
|
1572
|
+
prepend_filename_to_chunks: false,
|
|
1573
|
+
)
|
|
1574
|
+
p result
|
|
1575
|
+
```
|
|
1576
|
+
|
|
1577
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1578
|
+
|
|
1579
|
+
##### space_ids: Array<`String`><a id="space_ids-array"></a>
|
|
1580
|
+
##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
|
|
1581
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1582
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1583
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1584
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1585
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
1586
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1587
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1588
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1589
|
+
|
|
1590
|
+
`/integrations/gitbook/sync` `POST`
|
|
1591
|
+
|
|
1592
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1593
|
+
|
|
1594
|
+
---
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
### `carbon.integrations.sync_gmail`<a id="carbonintegrationssync_gmail"></a>
|
|
1598
|
+
|
|
1599
|
+
Once you have successfully connected your gmail account, you can choose which emails to sync with us
|
|
1600
|
+
using the filters parameter. Filters is a JSON object with key value pairs. It also supports AND and OR operations.
|
|
1601
|
+
For now, we support a limited set of keys listed below.
|
|
1602
|
+
|
|
1603
|
+
<b>label</b>: Inbuilt Gmail labels, for example "Important" or a custom label you created.
|
|
1604
|
+
<b>after</b> or <b>before</b>: A date in YYYY/mm/dd format (example 2023/12/31). Gets emails after/before a certain date.
|
|
1605
|
+
You can also use them in combination to get emails from a certain period.
|
|
1606
|
+
<b>is</b>: Can have the following values - starred, important, snoozed, and unread
|
|
1607
|
+
|
|
1608
|
+
Using keys or values outside of the specified values can lead to unexpected behaviour.
|
|
1609
|
+
|
|
1610
|
+
An example of a basic query with filters can be
|
|
1611
|
+
```json
|
|
1612
|
+
{
|
|
1613
|
+
"filters": {
|
|
1614
|
+
"key": "label",
|
|
1615
|
+
"value": "Test"
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
```
|
|
1619
|
+
Which will list all emails that have the label "Test".
|
|
1620
|
+
|
|
1621
|
+
You can use AND and OR operation in the following way:
|
|
1622
|
+
```json
|
|
1623
|
+
{
|
|
1624
|
+
"filters": {
|
|
1625
|
+
"AND": [
|
|
1626
|
+
{
|
|
1627
|
+
"key": "after",
|
|
1628
|
+
"value": "2024/01/07"
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
"OR": [
|
|
1632
|
+
{
|
|
1633
|
+
"key": "label",
|
|
1634
|
+
"value": "Personal"
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
"key": "is",
|
|
1638
|
+
"value": "starred"
|
|
1639
|
+
}
|
|
1640
|
+
]
|
|
1641
|
+
}
|
|
1642
|
+
]
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
```
|
|
1646
|
+
This will return emails after 7th of Jan that are either starred or have the label "Personal".
|
|
1647
|
+
Note that this is the highest level of nesting we support, i.e. you can't add more AND/OR filters within the OR filter
|
|
1648
|
+
in the above example.
|
|
1649
|
+
|
|
1650
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1651
|
+
|
|
1652
|
+
```ruby
|
|
1653
|
+
result = carbon.integrations.sync_gmail(
|
|
1654
|
+
filters: {},
|
|
1655
|
+
tags: {},
|
|
1656
|
+
chunk_size: 1500,
|
|
1657
|
+
chunk_overlap: 20,
|
|
1658
|
+
skip_embedding_generation: false,
|
|
1659
|
+
embedding_model: "OPENAI",
|
|
1660
|
+
generate_sparse_vectors: false,
|
|
1661
|
+
prepend_filename_to_chunks: false,
|
|
1662
|
+
)
|
|
1663
|
+
p result
|
|
1664
|
+
```
|
|
1665
|
+
|
|
1666
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1667
|
+
|
|
1668
|
+
##### filters: `Object`<a id="filters-object"></a>
|
|
1669
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1670
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1671
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1672
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1673
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
1674
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1675
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1676
|
+
#### π Return<a id="π-return"></a>
|
|
1677
|
+
|
|
1678
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1679
|
+
|
|
1680
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1681
|
+
|
|
1682
|
+
`/integrations/gmail/sync` `POST`
|
|
1683
|
+
|
|
1684
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1685
|
+
|
|
1686
|
+
---
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
### `carbon.integrations.sync_outlook`<a id="carbonintegrationssync_outlook"></a>
|
|
1690
|
+
|
|
1691
|
+
Once you have successfully connected your Outlook account, you can choose which emails to sync with us
|
|
1692
|
+
using the filters and folder parameter. "folder" should be the folder you want to sync from Outlook. By default
|
|
1693
|
+
we get messages from your inbox folder.
|
|
1694
|
+
Filters is a JSON object with key value pairs. It also supports AND and OR operations.
|
|
1695
|
+
For now, we support a limited set of keys listed below.
|
|
1696
|
+
|
|
1697
|
+
<b>category</b>: Custom categories that you created in Outlook.
|
|
1698
|
+
<b>after</b> or <b>before</b>: A date in YYYY/mm/dd format (example 2023/12/31). Gets emails after/before a certain date. You can also use them in combination to get emails from a certain period.
|
|
1699
|
+
<b>is</b>: Can have the following values: flagged
|
|
1700
|
+
|
|
1701
|
+
An example of a basic query with filters can be
|
|
1702
|
+
```json
|
|
1703
|
+
{
|
|
1704
|
+
"filters": {
|
|
1705
|
+
"key": "category",
|
|
1706
|
+
"value": "Test"
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
```
|
|
1710
|
+
Which will list all emails that have the category "Test".
|
|
1711
|
+
|
|
1712
|
+
Specifying a custom folder in the same query
|
|
1713
|
+
```json
|
|
1714
|
+
{
|
|
1715
|
+
"folder": "Folder Name",
|
|
1716
|
+
"filters": {
|
|
1717
|
+
"key": "category",
|
|
1718
|
+
"value": "Test"
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
```
|
|
1722
|
+
|
|
1723
|
+
You can use AND and OR operation in the following way:
|
|
1724
|
+
```json
|
|
1725
|
+
{
|
|
1726
|
+
"filters": {
|
|
1727
|
+
"AND": [
|
|
1728
|
+
{
|
|
1729
|
+
"key": "after",
|
|
1730
|
+
"value": "2024/01/07"
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
"OR": [
|
|
1734
|
+
{
|
|
1735
|
+
"key": "category",
|
|
1736
|
+
"value": "Personal"
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
"key": "category",
|
|
1740
|
+
"value": "Test"
|
|
1741
|
+
},
|
|
1742
|
+
]
|
|
1743
|
+
}
|
|
1744
|
+
]
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
```
|
|
1748
|
+
This will return emails after 7th of Jan that have either Personal or Test as category.
|
|
1749
|
+
Note that this is the highest level of nesting we support, i.e. you can't add more AND/OR filters within the OR filter
|
|
1750
|
+
in the above example.
|
|
1751
|
+
|
|
1752
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1753
|
+
|
|
1754
|
+
```ruby
|
|
1755
|
+
result = carbon.integrations.sync_outlook(
|
|
1756
|
+
filters: {},
|
|
1757
|
+
tags: {},
|
|
1758
|
+
folder: "Inbox",
|
|
1759
|
+
chunk_size: 1500,
|
|
1760
|
+
chunk_overlap: 20,
|
|
1761
|
+
skip_embedding_generation: false,
|
|
1762
|
+
embedding_model: "OPENAI",
|
|
1763
|
+
generate_sparse_vectors: false,
|
|
1764
|
+
prepend_filename_to_chunks: false,
|
|
1765
|
+
)
|
|
1766
|
+
p result
|
|
1767
|
+
```
|
|
1768
|
+
|
|
1769
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1770
|
+
|
|
1771
|
+
##### filters: `Object`<a id="filters-object"></a>
|
|
1772
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1773
|
+
##### folder: `String`<a id="folder-string"></a>
|
|
1774
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1775
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1776
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1777
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
1778
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1779
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1780
|
+
#### π Return<a id="π-return"></a>
|
|
1781
|
+
|
|
1782
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1783
|
+
|
|
1784
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1785
|
+
|
|
1786
|
+
`/integrations/outlook/sync` `POST`
|
|
1787
|
+
|
|
1788
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1789
|
+
|
|
1790
|
+
---
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
### `carbon.integrations.sync_rss_feed`<a id="carbonintegrationssync_rss_feed"></a>
|
|
1794
|
+
|
|
1795
|
+
Rss Feed
|
|
1796
|
+
|
|
1797
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1798
|
+
|
|
1799
|
+
```ruby
|
|
1800
|
+
result = carbon.integrations.sync_rss_feed(
|
|
1801
|
+
url: "string_example",
|
|
1802
|
+
tags: {},
|
|
1803
|
+
chunk_size: 1500,
|
|
1804
|
+
chunk_overlap: 20,
|
|
1805
|
+
skip_embedding_generation: false,
|
|
1806
|
+
embedding_model: "OPENAI",
|
|
1807
|
+
generate_sparse_vectors: false,
|
|
1808
|
+
prepend_filename_to_chunks: false,
|
|
1809
|
+
)
|
|
1810
|
+
p result
|
|
1811
|
+
```
|
|
1812
|
+
|
|
1813
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1814
|
+
|
|
1815
|
+
##### url: `String`<a id="url-string"></a>
|
|
1816
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1817
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1818
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1819
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1820
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
1821
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1822
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1823
|
+
#### π Return<a id="π-return"></a>
|
|
1824
|
+
|
|
1825
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1826
|
+
|
|
1827
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1828
|
+
|
|
1829
|
+
`/integrations/rss_feed` `POST`
|
|
1830
|
+
|
|
1831
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1832
|
+
|
|
1833
|
+
---
|
|
1834
|
+
|
|
1835
|
+
|
|
1836
|
+
### `carbon.integrations.sync_s3_files`<a id="carbonintegrationssync_s3_files"></a>
|
|
1837
|
+
|
|
1838
|
+
After optionally loading the items via /integrations/items/sync and integrations/items/list, use the bucket name
|
|
1839
|
+
and object key as the ID in this endpoint to sync them into Carbon. Additional parameters below can associate
|
|
1840
|
+
data with the selected items or modify the sync behavior
|
|
1841
|
+
|
|
1842
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1843
|
+
|
|
1844
|
+
```ruby
|
|
1845
|
+
result = carbon.integrations.sync_s3_files(
|
|
1846
|
+
ids: [
|
|
1847
|
+
{
|
|
1848
|
+
}
|
|
1849
|
+
],
|
|
1850
|
+
tags: {},
|
|
1851
|
+
chunk_size: 1500,
|
|
1852
|
+
chunk_overlap: 20,
|
|
1853
|
+
skip_embedding_generation: false,
|
|
1854
|
+
embedding_model: "OPENAI",
|
|
1855
|
+
generate_sparse_vectors: false,
|
|
1856
|
+
prepend_filename_to_chunks: false,
|
|
1857
|
+
max_items_per_chunk: 1,
|
|
1858
|
+
)
|
|
1859
|
+
p result
|
|
1860
|
+
```
|
|
1861
|
+
|
|
1862
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1863
|
+
|
|
1864
|
+
##### ids: Array<[`S3GetFileInput`](./lib/carbon_ruby_sdk/models/s3_get_file_input.rb)><a id="ids-array"></a>
|
|
1865
|
+
##### tags: `Object`<a id="tags-object"></a>
|
|
1866
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
1867
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
1868
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
1869
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
1870
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
1871
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
1872
|
+
##### max_items_per_chunk: `Integer`<a id="max_items_per_chunk-integer"></a>
|
|
1873
|
+
#### π Return<a id="π-return"></a>
|
|
1874
|
+
|
|
1875
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1876
|
+
|
|
1877
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1878
|
+
|
|
1879
|
+
`/integrations/s3/files` `POST`
|
|
1880
|
+
|
|
1881
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1882
|
+
|
|
1883
|
+
---
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
### `carbon.organizations.get`<a id="carbonorganizationsget"></a>
|
|
1887
|
+
|
|
1888
|
+
Get Organization
|
|
1889
|
+
|
|
1890
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1891
|
+
|
|
1892
|
+
```ruby
|
|
1893
|
+
result = carbon.organizations.get
|
|
1894
|
+
p result
|
|
1895
|
+
```
|
|
1896
|
+
|
|
1897
|
+
#### π Return<a id="π-return"></a>
|
|
1898
|
+
|
|
1899
|
+
[OrganizationResponse](./lib/carbon_ruby_sdk/models/organization_response.rb)
|
|
1900
|
+
|
|
1901
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1902
|
+
|
|
1903
|
+
`/organization` `GET`
|
|
1904
|
+
|
|
1905
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1906
|
+
|
|
1907
|
+
---
|
|
1908
|
+
|
|
1909
|
+
|
|
1910
|
+
### `carbon.users.get`<a id="carbonusersget"></a>
|
|
1911
|
+
|
|
1912
|
+
User Endpoint
|
|
1913
|
+
|
|
1914
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1915
|
+
|
|
1916
|
+
```ruby
|
|
1917
|
+
result = carbon.users.get(
|
|
1918
|
+
customer_id: "string_example",
|
|
1919
|
+
)
|
|
1920
|
+
p result
|
|
1921
|
+
```
|
|
1922
|
+
|
|
1923
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1924
|
+
|
|
1925
|
+
##### customer_id: `String`<a id="customer_id-string"></a>
|
|
1926
|
+
#### π Return<a id="π-return"></a>
|
|
1927
|
+
|
|
1928
|
+
[UserResponse](./lib/carbon_ruby_sdk/models/user_response.rb)
|
|
1929
|
+
|
|
1930
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1931
|
+
|
|
1932
|
+
`/user` `POST`
|
|
1933
|
+
|
|
1934
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1935
|
+
|
|
1936
|
+
---
|
|
1937
|
+
|
|
1938
|
+
|
|
1939
|
+
### `carbon.users.toggle_user_features`<a id="carbonuserstoggle_user_features"></a>
|
|
1940
|
+
|
|
1941
|
+
Toggle User Features
|
|
1942
|
+
|
|
1943
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1944
|
+
|
|
1945
|
+
```ruby
|
|
1946
|
+
result = carbon.users.toggle_user_features(
|
|
1947
|
+
configuration_key_name: "string_example",
|
|
1948
|
+
value: {},
|
|
1949
|
+
)
|
|
1950
|
+
p result
|
|
1951
|
+
```
|
|
1952
|
+
|
|
1953
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1954
|
+
|
|
1955
|
+
##### configuration_key_name: `String`<a id="configuration_key_name-string"></a>
|
|
1956
|
+
##### value: `Object`<a id="value-object"></a>
|
|
1957
|
+
#### π Return<a id="π-return"></a>
|
|
1958
|
+
|
|
1959
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
1960
|
+
|
|
1961
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1962
|
+
|
|
1963
|
+
`/modify_user_configuration` `POST`
|
|
1964
|
+
|
|
1965
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
1966
|
+
|
|
1967
|
+
---
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
### `carbon.utilities.fetch_urls`<a id="carbonutilitiesfetch_urls"></a>
|
|
1971
|
+
|
|
1972
|
+
Extracts all URLs from a webpage.
|
|
1973
|
+
|
|
1974
|
+
Args:
|
|
1975
|
+
url (str): URL of the webpage
|
|
1976
|
+
|
|
1977
|
+
Returns:
|
|
1978
|
+
FetchURLsResponse: A response object with a list of URLs extracted from the webpage and the webpage content.
|
|
1979
|
+
|
|
1980
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
1981
|
+
|
|
1982
|
+
```ruby
|
|
1983
|
+
result = carbon.utilities.fetch_urls(
|
|
1984
|
+
url: "url_example",
|
|
1985
|
+
)
|
|
1986
|
+
p result
|
|
1987
|
+
```
|
|
1988
|
+
|
|
1989
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
1990
|
+
|
|
1991
|
+
##### url: `String`<a id="url-string"></a>
|
|
1992
|
+
#### π Return<a id="π-return"></a>
|
|
1993
|
+
|
|
1994
|
+
[FetchURLsResponse](./lib/carbon_ruby_sdk/models/fetch_urls_response.rb)
|
|
1995
|
+
|
|
1996
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
1997
|
+
|
|
1998
|
+
`/fetch_urls` `GET`
|
|
1999
|
+
|
|
2000
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2001
|
+
|
|
2002
|
+
---
|
|
2003
|
+
|
|
2004
|
+
|
|
2005
|
+
### `carbon.utilities.fetch_youtube_transcripts`<a id="carbonutilitiesfetch_youtube_transcripts"></a>
|
|
2006
|
+
|
|
2007
|
+
Fetches english transcripts from YouTube videos.
|
|
2008
|
+
|
|
2009
|
+
Args:
|
|
2010
|
+
id (str): The ID of the YouTube video.
|
|
2011
|
+
raw (bool): Whether to return the raw transcript or not. Defaults to False.
|
|
2012
|
+
|
|
2013
|
+
Returns:
|
|
2014
|
+
dict: A dictionary with the transcript of the YouTube video.
|
|
2015
|
+
|
|
2016
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2017
|
+
|
|
2018
|
+
```ruby
|
|
2019
|
+
result = carbon.utilities.fetch_youtube_transcripts(
|
|
2020
|
+
id: "id_example",
|
|
2021
|
+
raw: false,
|
|
2022
|
+
)
|
|
2023
|
+
p result
|
|
2024
|
+
```
|
|
2025
|
+
|
|
2026
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
2027
|
+
|
|
2028
|
+
##### id: `String`<a id="id-string"></a>
|
|
2029
|
+
##### raw: `Boolean`<a id="raw-boolean"></a>
|
|
2030
|
+
#### π Return<a id="π-return"></a>
|
|
2031
|
+
|
|
2032
|
+
[YoutubeTranscriptResponse](./lib/carbon_ruby_sdk/models/youtube_transcript_response.rb)
|
|
2033
|
+
|
|
2034
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2035
|
+
|
|
2036
|
+
`/fetch_youtube_transcript` `GET`
|
|
2037
|
+
|
|
2038
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2039
|
+
|
|
2040
|
+
---
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
### `carbon.utilities.process_sitemap`<a id="carbonutilitiesprocess_sitemap"></a>
|
|
2044
|
+
|
|
2045
|
+
Retrieves all URLs from a sitemap, which can subsequently be utilized with our `web_scrape` endpoint.
|
|
2046
|
+
|
|
2047
|
+
<!--Args:
|
|
2048
|
+
url (str): URL of the sitemap
|
|
2049
|
+
|
|
2050
|
+
Returns:
|
|
2051
|
+
dict: A dictionary with a list of URLs extracted from the sitemap.-->
|
|
2052
|
+
|
|
2053
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2054
|
+
|
|
2055
|
+
```ruby
|
|
2056
|
+
result = carbon.utilities.process_sitemap(
|
|
2057
|
+
url: "url_example",
|
|
2058
|
+
)
|
|
2059
|
+
p result
|
|
2060
|
+
```
|
|
2061
|
+
|
|
2062
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
2063
|
+
|
|
2064
|
+
##### url: `String`<a id="url-string"></a>
|
|
2065
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2066
|
+
|
|
2067
|
+
`/process_sitemap` `GET`
|
|
2068
|
+
|
|
2069
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2070
|
+
|
|
2071
|
+
---
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
### `carbon.utilities.scrape_sitemap`<a id="carbonutilitiesscrape_sitemap"></a>
|
|
2075
|
+
|
|
2076
|
+
Extracts all URLs from a sitemap and performs a web scrape on each of them.
|
|
2077
|
+
|
|
2078
|
+
Args:
|
|
2079
|
+
sitemap_url (str): URL of the sitemap
|
|
2080
|
+
|
|
2081
|
+
Returns:
|
|
2082
|
+
dict: A response object with the status of the scraping job message.-->
|
|
2083
|
+
|
|
2084
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2085
|
+
|
|
2086
|
+
```ruby
|
|
2087
|
+
result = carbon.utilities.scrape_sitemap(
|
|
2088
|
+
url: "string_example",
|
|
2089
|
+
tags: {
|
|
2090
|
+
"key": "string_example",
|
|
2091
|
+
},
|
|
2092
|
+
max_pages_to_scrape: 1,
|
|
2093
|
+
chunk_size: 1500,
|
|
2094
|
+
chunk_overlap: 20,
|
|
2095
|
+
skip_embedding_generation: false,
|
|
2096
|
+
enable_auto_sync: false,
|
|
2097
|
+
generate_sparse_vectors: false,
|
|
2098
|
+
prepend_filename_to_chunks: false,
|
|
2099
|
+
html_tags_to_skip: [],
|
|
2100
|
+
css_classes_to_skip: [],
|
|
2101
|
+
css_selectors_to_skip: [],
|
|
2102
|
+
embedding_model: "OPENAI",
|
|
2103
|
+
)
|
|
2104
|
+
p result
|
|
2105
|
+
```
|
|
2106
|
+
|
|
2107
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
2108
|
+
|
|
2109
|
+
##### url: `String`<a id="url-string"></a>
|
|
2110
|
+
##### tags: Hash<string, [`Tags1`](./lib/carbon_ruby_sdk/models/tags1.rb)><a id="tags-hash"></a>
|
|
2111
|
+
##### max_pages_to_scrape: `Integer`<a id="max_pages_to_scrape-integer"></a>
|
|
2112
|
+
##### chunk_size: `Integer`<a id="chunk_size-integer"></a>
|
|
2113
|
+
##### chunk_overlap: `Integer`<a id="chunk_overlap-integer"></a>
|
|
2114
|
+
##### skip_embedding_generation: `Boolean`<a id="skip_embedding_generation-boolean"></a>
|
|
2115
|
+
##### enable_auto_sync: `Boolean`<a id="enable_auto_sync-boolean"></a>
|
|
2116
|
+
##### generate_sparse_vectors: `Boolean`<a id="generate_sparse_vectors-boolean"></a>
|
|
2117
|
+
##### prepend_filename_to_chunks: `Boolean`<a id="prepend_filename_to_chunks-boolean"></a>
|
|
2118
|
+
##### html_tags_to_skip: Array<`String`><a id="html_tags_to_skip-array"></a>
|
|
2119
|
+
##### css_classes_to_skip: Array<`String`><a id="css_classes_to_skip-array"></a>
|
|
2120
|
+
##### css_selectors_to_skip: Array<`String`><a id="css_selectors_to_skip-array"></a>
|
|
2121
|
+
##### embedding_model: [`EmbeddingGenerators`](./lib/carbon_ruby_sdk/models/embedding_generators.rb)<a id="embedding_model-embeddinggeneratorslibcarbon_ruby_sdkmodelsembedding_generatorsrb"></a>
|
|
2122
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2123
|
+
|
|
2124
|
+
`/scrape_sitemap` `POST`
|
|
2125
|
+
|
|
2126
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2127
|
+
|
|
2128
|
+
---
|
|
2129
|
+
|
|
2130
|
+
|
|
2131
|
+
### `carbon.utilities.scrape_web`<a id="carbonutilitiesscrape_web"></a>
|
|
2132
|
+
|
|
2133
|
+
Conduct a web scrape on a given webpage URL. Our web scraper is fully compatible with JavaScript and supports recursion depth, enabling you to efficiently extract all content from the target website.
|
|
2134
|
+
|
|
2135
|
+
<!--Args:
|
|
2136
|
+
scraping_requests (List[WebscrapeRequest]): A list of WebscrapeRequest objects.
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
Returns:
|
|
2140
|
+
dict: A response object with the status of the scraping job message.-->
|
|
2141
|
+
|
|
2142
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2143
|
+
|
|
2144
|
+
```ruby
|
|
2145
|
+
result = carbon.utilities.scrape_web(
|
|
2146
|
+
body: [
|
|
2147
|
+
{
|
|
2148
|
+
"url" => "url_example",
|
|
2149
|
+
"recursion_depth" => 3,
|
|
2150
|
+
"max_pages_to_scrape" => 100,
|
|
2151
|
+
"chunk_size" => 1500,
|
|
2152
|
+
"chunk_overlap" => 20,
|
|
2153
|
+
"skip_embedding_generation" => false,
|
|
2154
|
+
"enable_auto_sync" => false,
|
|
2155
|
+
"generate_sparse_vectors" => false,
|
|
2156
|
+
"prepend_filename_to_chunks" => false,
|
|
2157
|
+
"html_tags_to_skip" => [],
|
|
2158
|
+
"css_classes_to_skip" => [],
|
|
2159
|
+
"css_selectors_to_skip" => [],
|
|
2160
|
+
"embedding_model" => "OPENAI",
|
|
2161
|
+
}
|
|
2162
|
+
],
|
|
2163
|
+
)
|
|
2164
|
+
p result
|
|
2165
|
+
```
|
|
2166
|
+
|
|
2167
|
+
#### βοΈ body<a id="βοΈ-body"></a>
|
|
2168
|
+
|
|
2169
|
+
Array<[`WebscrapeRequest`](./lib/carbon_ruby_sdk/models/webscrape_request.rb)>
|
|
2170
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2171
|
+
|
|
2172
|
+
`/web_scrape` `POST`
|
|
2173
|
+
|
|
2174
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2175
|
+
|
|
2176
|
+
---
|
|
2177
|
+
|
|
2178
|
+
|
|
2179
|
+
### `carbon.utilities.search_urls`<a id="carbonutilitiessearch_urls"></a>
|
|
2180
|
+
|
|
2181
|
+
Perform a web search and obtain a list of relevant URLs.
|
|
2182
|
+
|
|
2183
|
+
As an illustration, when you perform a search for βcontent related to MRNA,β you will receive a list of links such as the following:
|
|
2184
|
+
|
|
2185
|
+
- https://tomrenz.substack.com/p/mrna-and-why-it-matters
|
|
2186
|
+
|
|
2187
|
+
- https://www.statnews.com/2020/11/10/the-story-of-mrna-how-a-once-dismissed-idea-became-a-leading-technology-in-the-covid-vaccine-race/
|
|
2188
|
+
|
|
2189
|
+
- https://www.statnews.com/2022/11/16/covid-19-vaccines-were-a-success-but-mrna-still-has-a-delivery-problem/
|
|
2190
|
+
|
|
2191
|
+
- https://joomi.substack.com/p/were-still-being-misled-about-how
|
|
2192
|
+
|
|
2193
|
+
Subsequently, you can submit these links to the web_scrape endpoint in order to retrieve the content of the respective web pages.
|
|
2194
|
+
|
|
2195
|
+
Args:
|
|
2196
|
+
query (str): Query to search for
|
|
2197
|
+
|
|
2198
|
+
Returns:
|
|
2199
|
+
FetchURLsResponse: A response object with a list of URLs for a given search query.
|
|
2200
|
+
|
|
2201
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2202
|
+
|
|
2203
|
+
```ruby
|
|
2204
|
+
result = carbon.utilities.search_urls(
|
|
2205
|
+
query: "query_example",
|
|
2206
|
+
)
|
|
2207
|
+
p result
|
|
2208
|
+
```
|
|
2209
|
+
|
|
2210
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
2211
|
+
|
|
2212
|
+
##### query: `String`<a id="query-string"></a>
|
|
2213
|
+
#### π Return<a id="π-return"></a>
|
|
2214
|
+
|
|
2215
|
+
[FetchURLsResponse](./lib/carbon_ruby_sdk/models/fetch_urls_response.rb)
|
|
2216
|
+
|
|
2217
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2218
|
+
|
|
2219
|
+
`/search_urls` `GET`
|
|
2220
|
+
|
|
2221
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2222
|
+
|
|
2223
|
+
---
|
|
2224
|
+
|
|
2225
|
+
|
|
2226
|
+
### `carbon.webhooks.add_url`<a id="carbonwebhooksadd_url"></a>
|
|
2227
|
+
|
|
2228
|
+
Add Webhook Url
|
|
2229
|
+
|
|
2230
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2231
|
+
|
|
2232
|
+
```ruby
|
|
2233
|
+
result = carbon.webhooks.add_url(
|
|
2234
|
+
url: "string_example",
|
|
2235
|
+
)
|
|
2236
|
+
p result
|
|
2237
|
+
```
|
|
2238
|
+
|
|
2239
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
2240
|
+
|
|
2241
|
+
##### url: `String`<a id="url-string"></a>
|
|
2242
|
+
#### π Return<a id="π-return"></a>
|
|
2243
|
+
|
|
2244
|
+
[Webhook](./lib/carbon_ruby_sdk/models/webhook.rb)
|
|
2245
|
+
|
|
2246
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2247
|
+
|
|
2248
|
+
`/add_webhook` `POST`
|
|
2249
|
+
|
|
2250
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2251
|
+
|
|
2252
|
+
---
|
|
2253
|
+
|
|
2254
|
+
|
|
2255
|
+
### `carbon.webhooks.delete_url`<a id="carbonwebhooksdelete_url"></a>
|
|
2256
|
+
|
|
2257
|
+
Delete Webhook Url
|
|
2258
|
+
|
|
2259
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2260
|
+
|
|
2261
|
+
```ruby
|
|
2262
|
+
result = carbon.webhooks.delete_url(
|
|
2263
|
+
webhook_id: 1,
|
|
2264
|
+
)
|
|
2265
|
+
p result
|
|
2266
|
+
```
|
|
2267
|
+
|
|
2268
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
2269
|
+
|
|
2270
|
+
##### webhook_id: `Integer`<a id="webhook_id-integer"></a>
|
|
2271
|
+
#### π Return<a id="π-return"></a>
|
|
2272
|
+
|
|
2273
|
+
[GenericSuccessResponse](./lib/carbon_ruby_sdk/models/generic_success_response.rb)
|
|
2274
|
+
|
|
2275
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2276
|
+
|
|
2277
|
+
`/delete_webhook/{webhook_id}` `DELETE`
|
|
2278
|
+
|
|
2279
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2280
|
+
|
|
2281
|
+
---
|
|
2282
|
+
|
|
2283
|
+
|
|
2284
|
+
### `carbon.webhooks.urls`<a id="carbonwebhooksurls"></a>
|
|
2285
|
+
|
|
2286
|
+
Webhook Urls
|
|
2287
|
+
|
|
2288
|
+
#### π οΈ Usage<a id="π οΈ-usage"></a>
|
|
2289
|
+
|
|
2290
|
+
```ruby
|
|
2291
|
+
result = carbon.webhooks.urls(
|
|
2292
|
+
pagination: {
|
|
2293
|
+
"limit" => 10,
|
|
2294
|
+
"offset" => 0,
|
|
2295
|
+
},
|
|
2296
|
+
order_by: "created_at",
|
|
2297
|
+
order_dir: "desc",
|
|
2298
|
+
filters: {
|
|
2299
|
+
"ids" => [],
|
|
2300
|
+
},
|
|
2301
|
+
)
|
|
2302
|
+
p result
|
|
2303
|
+
```
|
|
2304
|
+
|
|
2305
|
+
#### βοΈ Parameters<a id="βοΈ-parameters"></a>
|
|
2306
|
+
|
|
2307
|
+
##### pagination: [`Pagination`](./lib/carbon_ruby_sdk/models/pagination.rb)<a id="pagination-paginationlibcarbon_ruby_sdkmodelspaginationrb"></a>
|
|
2308
|
+
##### order_by: [`WebhookOrderByColumns`](./lib/carbon_ruby_sdk/models/webhook_order_by_columns.rb)<a id="order_by-webhookorderbycolumnslibcarbon_ruby_sdkmodelswebhook_order_by_columnsrb"></a>
|
|
2309
|
+
##### order_dir: [`OrderDir`](./lib/carbon_ruby_sdk/models/order_dir.rb)<a id="order_dir-orderdirlibcarbon_ruby_sdkmodelsorder_dirrb"></a>
|
|
2310
|
+
##### filters: [`WebhookFilters`](./lib/carbon_ruby_sdk/models/webhook_filters.rb)<a id="filters-webhookfilterslibcarbon_ruby_sdkmodelswebhook_filtersrb"></a>
|
|
2311
|
+
#### π Return<a id="π-return"></a>
|
|
2312
|
+
|
|
2313
|
+
[WebhookQueryResponse](./lib/carbon_ruby_sdk/models/webhook_query_response.rb)
|
|
2314
|
+
|
|
2315
|
+
#### π Endpoint<a id="π-endpoint"></a>
|
|
2316
|
+
|
|
2317
|
+
`/webhooks` `POST`
|
|
2318
|
+
|
|
2319
|
+
[π **Back to Table of Contents**](#table-of-contents)
|
|
2320
|
+
|
|
2321
|
+
---
|
|
2322
|
+
|
|
2323
|
+
|
|
2324
|
+
## Author<a id="author"></a>
|
|
2325
|
+
This TypeScript package is automatically generated by [Konfig](https://konfigthis.com)
|