carbon_ruby_sdk 0.1.34 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +42 -9
- data/lib/carbon_ruby_sdk/api/files_api.rb +13 -6
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +8 -8
- data/lib/carbon_ruby_sdk/api/organizations_api.rb +83 -0
- data/lib/carbon_ruby_sdk/models/data_source_type.rb +9 -3
- data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +9 -3
- data/lib/carbon_ruby_sdk/models/embedding_model.rb +227 -0
- data/lib/carbon_ruby_sdk/models/file_content_types.rb +3 -1
- data/lib/carbon_ruby_sdk/models/file_content_types_nullable.rb +3 -1
- data/lib/carbon_ruby_sdk/models/file_formats.rb +9 -3
- data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +9 -3
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +2 -2
- data/lib/carbon_ruby_sdk/models/organization_response.rb +39 -1
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +1 -1
- data/lib/carbon_ruby_sdk/models/sync_options.rb +1 -1
- data/lib/carbon_ruby_sdk/models/user_response.rb +85 -1
- data/lib/carbon_ruby_sdk/models/webhook.rb +25 -1
- data/lib/carbon_ruby_sdk/models/webhook_no_key.rb +25 -1
- data/lib/carbon_ruby_sdk/models/webhook_status.rb +36 -0
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +2 -0
- data/spec/api/files_api_spec.rb +2 -1
- data/spec/api/organizations_api_spec.rb +11 -0
- data/spec/models/embedding_model_spec.rb +22 -0
- data/spec/models/organization_response_spec.rb +18 -0
- data/spec/models/user_response_spec.rb +36 -0
- data/spec/models/webhook_no_key_spec.rb +12 -0
- data/spec/models/webhook_spec.rb +12 -0
- data/spec/models/webhook_status_spec.rb +22 -0
- metadata +8 -2
@@ -17,6 +17,10 @@ module Carbon
|
|
17
17
|
|
18
18
|
attr_accessor :url
|
19
19
|
|
20
|
+
attr_accessor :status
|
21
|
+
|
22
|
+
attr_accessor :status_reason
|
23
|
+
|
20
24
|
attr_accessor :created_at
|
21
25
|
|
22
26
|
attr_accessor :updated_at
|
@@ -27,6 +31,8 @@ module Carbon
|
|
27
31
|
:'id' => :'id',
|
28
32
|
:'organization_id' => :'organization_id',
|
29
33
|
:'url' => :'url',
|
34
|
+
:'status' => :'status',
|
35
|
+
:'status_reason' => :'status_reason',
|
30
36
|
:'created_at' => :'created_at',
|
31
37
|
:'updated_at' => :'updated_at'
|
32
38
|
}
|
@@ -43,6 +49,8 @@ module Carbon
|
|
43
49
|
:'id' => :'Integer',
|
44
50
|
:'organization_id' => :'Integer',
|
45
51
|
:'url' => :'String',
|
52
|
+
:'status' => :'WebhookStatus',
|
53
|
+
:'status_reason' => :'String',
|
46
54
|
:'created_at' => :'Time',
|
47
55
|
:'updated_at' => :'Time'
|
48
56
|
}
|
@@ -51,6 +59,7 @@ module Carbon
|
|
51
59
|
# List of attributes with nullable: true
|
52
60
|
def self.openapi_nullable
|
53
61
|
Set.new([
|
62
|
+
:'status_reason',
|
54
63
|
])
|
55
64
|
end
|
56
65
|
|
@@ -81,6 +90,14 @@ module Carbon
|
|
81
90
|
self.url = attributes[:'url']
|
82
91
|
end
|
83
92
|
|
93
|
+
if attributes.key?(:'status')
|
94
|
+
self.status = attributes[:'status']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'status_reason')
|
98
|
+
self.status_reason = attributes[:'status_reason']
|
99
|
+
end
|
100
|
+
|
84
101
|
if attributes.key?(:'created_at')
|
85
102
|
self.created_at = attributes[:'created_at']
|
86
103
|
end
|
@@ -106,6 +123,10 @@ module Carbon
|
|
106
123
|
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
107
124
|
end
|
108
125
|
|
126
|
+
if @status.nil?
|
127
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
128
|
+
end
|
129
|
+
|
109
130
|
if @created_at.nil?
|
110
131
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
111
132
|
end
|
@@ -123,6 +144,7 @@ module Carbon
|
|
123
144
|
return false if @id.nil?
|
124
145
|
return false if @organization_id.nil?
|
125
146
|
return false if @url.nil?
|
147
|
+
return false if @status.nil?
|
126
148
|
return false if @created_at.nil?
|
127
149
|
return false if @updated_at.nil?
|
128
150
|
true
|
@@ -136,6 +158,8 @@ module Carbon
|
|
136
158
|
id == o.id &&
|
137
159
|
organization_id == o.organization_id &&
|
138
160
|
url == o.url &&
|
161
|
+
status == o.status &&
|
162
|
+
status_reason == o.status_reason &&
|
139
163
|
created_at == o.created_at &&
|
140
164
|
updated_at == o.updated_at
|
141
165
|
end
|
@@ -149,7 +173,7 @@ module Carbon
|
|
149
173
|
# Calculates hash code according to all attributes.
|
150
174
|
# @return [Integer] Hash code
|
151
175
|
def hash
|
152
|
-
[id, organization_id, url, created_at, updated_at].hash
|
176
|
+
[id, organization_id, url, status, status_reason, created_at, updated_at].hash
|
153
177
|
end
|
154
178
|
|
155
179
|
# Builds the object from hash
|
@@ -0,0 +1,36 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Carbon
|
13
|
+
class WebhookStatus
|
14
|
+
ACTIVE = "ACTIVE".freeze
|
15
|
+
FLAGGED = "FLAGGED".freeze
|
16
|
+
|
17
|
+
def self.all_vars
|
18
|
+
@all_vars ||= [ACTIVE, FLAGGED].freeze
|
19
|
+
end
|
20
|
+
|
21
|
+
# Builds the enum from string
|
22
|
+
# @param [String] The enum value in the form of the string
|
23
|
+
# @return [String] The enum value
|
24
|
+
def self.build_from_hash(value)
|
25
|
+
new.build_from_hash(value)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Builds the enum from string
|
29
|
+
# @param [String] The enum value in the form of the string
|
30
|
+
# @return [String] The enum value
|
31
|
+
def build_from_hash(value)
|
32
|
+
return value if WebhookStatus.all_vars.include?(value)
|
33
|
+
raise "Invalid ENUM value #{value} for class #WebhookStatus"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/carbon_ruby_sdk.rb
CHANGED
@@ -40,6 +40,7 @@ require 'carbon_ruby_sdk/models/document_response_list'
|
|
40
40
|
require 'carbon_ruby_sdk/models/embedding_and_chunk'
|
41
41
|
require 'carbon_ruby_sdk/models/embedding_generators'
|
42
42
|
require 'carbon_ruby_sdk/models/embedding_generators_nullable'
|
43
|
+
require 'carbon_ruby_sdk/models/embedding_model'
|
43
44
|
require 'carbon_ruby_sdk/models/embedding_properties'
|
44
45
|
require 'carbon_ruby_sdk/models/embeddings_and_chunks_filters'
|
45
46
|
require 'carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns'
|
@@ -141,6 +142,7 @@ require 'carbon_ruby_sdk/models/webhook_no_key'
|
|
141
142
|
require 'carbon_ruby_sdk/models/webhook_order_by_columns'
|
142
143
|
require 'carbon_ruby_sdk/models/webhook_query_input'
|
143
144
|
require 'carbon_ruby_sdk/models/webhook_query_response'
|
145
|
+
require 'carbon_ruby_sdk/models/webhook_status'
|
144
146
|
require 'carbon_ruby_sdk/models/webscrape_request'
|
145
147
|
require 'carbon_ruby_sdk/models/white_labeling_response'
|
146
148
|
require 'carbon_ruby_sdk/models/youtube_transcript_response'
|
data/spec/api/files_api_spec.rb
CHANGED
@@ -151,13 +151,14 @@ describe 'FilesApi' do
|
|
151
151
|
# @option opts [Integer] :chunk_overlap Chunk overlap in tiktoken tokens to be used when processing file.
|
152
152
|
# @option opts [Boolean] :skip_embedding_generation Flag to control whether or not embeddings should be generated and stored when processing file.
|
153
153
|
# @option opts [Boolean] :set_page_as_boundary Flag to control whether or not to set the a page's worth of content as the maximum amount of content that can appear in a chunk. Only valid for PDFs. See description route description for more information.
|
154
|
-
# @option opts [
|
154
|
+
# @option opts [EmbeddingModel] :embedding_model Embedding model that will be used to embed file chunks.
|
155
155
|
# @option opts [Boolean] :use_ocr Whether or not to use OCR when processing files. Only valid for PDFs. Useful for documents with tables, images, and/or scanned text.
|
156
156
|
# @option opts [Boolean] :generate_sparse_vectors Whether or not to generate sparse vectors for the file. This is *required* for the file to be a candidate for hybrid search.
|
157
157
|
# @option opts [Boolean] :prepend_filename_to_chunks Whether or not to prepend the file's name to chunks.
|
158
158
|
# @option opts [Integer] :max_items_per_chunk Number of objects per chunk. For csv, tsv, xlsx, and json files only.
|
159
159
|
# @option opts [Boolean] :parse_pdf_tables_with_ocr Whether to use rich table parsing when `use_ocr` is enabled.
|
160
160
|
# @option opts [Boolean] :detect_audio_language Whether to automatically detect the language of the uploaded audio file.
|
161
|
+
# @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
|
161
162
|
# @return [UserFile]
|
162
163
|
describe 'upload test' do
|
163
164
|
it 'should work' do
|
@@ -47,4 +47,15 @@ describe 'OrganizationsApi' do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
# unit tests for update_stats
|
51
|
+
# Update Organization Statistics
|
52
|
+
# Use this endpoint to reaggregate the statistics for an organization, for example aggregate_file_size. The reaggregation process is asyncronous so a webhook will be sent with the event type being FILE_STATISTICS_AGGREGATED to notify when the process is complee. After this aggregation is complete, the updated statistics can be retrieved using the /organization endpoint. The response of /organization willalso contain a timestamp of the last time the statistics were reaggregated.
|
53
|
+
# @param [Hash] opts the optional parameters
|
54
|
+
# @return [GenericSuccessResponse]
|
55
|
+
describe 'update_stats test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
50
61
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'spec_helper'
|
10
|
+
require 'json'
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
# Unit tests for Carbon::EmbeddingModel
|
14
|
+
describe Carbon::EmbeddingModel do
|
15
|
+
let(:instance) { Carbon::EmbeddingModel.new }
|
16
|
+
|
17
|
+
describe 'test an instance of EmbeddingModel' do
|
18
|
+
it 'should create an instance of EmbeddingModel' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::EmbeddingModel)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -79,6 +79,24 @@ describe Carbon::OrganizationResponse do
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
describe 'test attribute "aggregate_num_files_by_source"' do
|
83
|
+
it 'should work' do
|
84
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
describe 'test attribute "aggregate_num_files_by_file_format"' do
|
89
|
+
it 'should work' do
|
90
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe 'test attribute "file_statistics_aggregated_at"' do
|
95
|
+
it 'should work' do
|
96
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
82
100
|
describe 'test attribute "period_ends_at"' do
|
83
101
|
it 'should work' do
|
84
102
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -73,6 +73,42 @@ describe Carbon::UserResponse do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
describe 'test attribute "aggregate_file_size"' do
|
77
|
+
it 'should work' do
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe 'test attribute "aggregate_num_characters"' do
|
83
|
+
it 'should work' do
|
84
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
describe 'test attribute "aggregate_num_tokens"' do
|
89
|
+
it 'should work' do
|
90
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe 'test attribute "aggregate_num_embeddings"' do
|
95
|
+
it 'should work' do
|
96
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe 'test attribute "aggregate_num_files_by_source"' do
|
101
|
+
it 'should work' do
|
102
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe 'test attribute "aggregate_num_files_by_file_format"' do
|
107
|
+
it 'should work' do
|
108
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
76
112
|
describe 'test attribute "unique_file_tags"' do
|
77
113
|
it 'should work' do
|
78
114
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -37,6 +37,18 @@ describe Carbon::WebhookNoKey do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe 'test attribute "status"' do
|
41
|
+
it 'should work' do
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe 'test attribute "status_reason"' do
|
47
|
+
it 'should work' do
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
40
52
|
describe 'test attribute "created_at"' do
|
41
53
|
it 'should work' do
|
42
54
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
data/spec/models/webhook_spec.rb
CHANGED
@@ -43,6 +43,18 @@ describe Carbon::Webhook do
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
describe 'test attribute "status"' do
|
47
|
+
it 'should work' do
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe 'test attribute "status_reason"' do
|
53
|
+
it 'should work' do
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
46
58
|
describe 'test attribute "created_at"' do
|
47
59
|
it 'should work' do
|
48
60
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -0,0 +1,22 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'spec_helper'
|
10
|
+
require 'json'
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
# Unit tests for Carbon::WebhookStatus
|
14
|
+
describe Carbon::WebhookStatus do
|
15
|
+
let(:instance) { Carbon::WebhookStatus.new }
|
16
|
+
|
17
|
+
describe 'test an instance of WebhookStatus' do
|
18
|
+
it 'should create an instance of WebhookStatus' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::WebhookStatus)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carbon_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konfig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/carbon_ruby_sdk/models/embedding_and_chunk.rb
|
124
124
|
- lib/carbon_ruby_sdk/models/embedding_generators.rb
|
125
125
|
- lib/carbon_ruby_sdk/models/embedding_generators_nullable.rb
|
126
|
+
- lib/carbon_ruby_sdk/models/embedding_model.rb
|
126
127
|
- lib/carbon_ruby_sdk/models/embedding_properties.rb
|
127
128
|
- lib/carbon_ruby_sdk/models/embeddings_and_chunks_filters.rb
|
128
129
|
- lib/carbon_ruby_sdk/models/embeddings_and_chunks_order_by_columns.rb
|
@@ -224,6 +225,7 @@ files:
|
|
224
225
|
- lib/carbon_ruby_sdk/models/webhook_order_by_columns.rb
|
225
226
|
- lib/carbon_ruby_sdk/models/webhook_query_input.rb
|
226
227
|
- lib/carbon_ruby_sdk/models/webhook_query_response.rb
|
228
|
+
- lib/carbon_ruby_sdk/models/webhook_status.rb
|
227
229
|
- lib/carbon_ruby_sdk/models/webscrape_request.rb
|
228
230
|
- lib/carbon_ruby_sdk/models/white_labeling_response.rb
|
229
231
|
- lib/carbon_ruby_sdk/models/youtube_transcript_response.rb
|
@@ -268,6 +270,7 @@ files:
|
|
268
270
|
- spec/models/embedding_and_chunk_spec.rb
|
269
271
|
- spec/models/embedding_generators_nullable_spec.rb
|
270
272
|
- spec/models/embedding_generators_spec.rb
|
273
|
+
- spec/models/embedding_model_spec.rb
|
271
274
|
- spec/models/embedding_properties_spec.rb
|
272
275
|
- spec/models/embeddings_and_chunks_filters_spec.rb
|
273
276
|
- spec/models/embeddings_and_chunks_order_by_columns_spec.rb
|
@@ -369,6 +372,7 @@ files:
|
|
369
372
|
- spec/models/webhook_query_input_spec.rb
|
370
373
|
- spec/models/webhook_query_response_spec.rb
|
371
374
|
- spec/models/webhook_spec.rb
|
375
|
+
- spec/models/webhook_status_spec.rb
|
372
376
|
- spec/models/webscrape_request_spec.rb
|
373
377
|
- spec/models/white_labeling_response_spec.rb
|
374
378
|
- spec/models/youtube_transcript_response_spec.rb
|
@@ -419,6 +423,7 @@ test_files:
|
|
419
423
|
- spec/models/sitemap_scrape_request_spec.rb
|
420
424
|
- spec/models/organization_user_files_to_sync_order_by_types_spec.rb
|
421
425
|
- spec/models/order_dir_spec.rb
|
426
|
+
- spec/models/webhook_status_spec.rb
|
422
427
|
- spec/models/external_source_item_spec.rb
|
423
428
|
- spec/models/organization_user_data_source_query_input_spec.rb
|
424
429
|
- spec/models/organization_user_data_source_filters_spec.rb
|
@@ -437,6 +442,7 @@ test_files:
|
|
437
442
|
- spec/models/update_organization_input_spec.rb
|
438
443
|
- spec/models/user_request_content_spec.rb
|
439
444
|
- spec/models/gmail_sync_input_spec.rb
|
445
|
+
- spec/models/embedding_model_spec.rb
|
440
446
|
- spec/models/delete_files_query_input_spec.rb
|
441
447
|
- spec/models/webhook_query_input_spec.rb
|
442
448
|
- spec/models/text_embedding_generators_spec.rb
|