carbon_ruby_sdk 0.1.25 → 0.1.27
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 +31 -7
- data/lib/carbon_ruby_sdk/api/embeddings_api.rb +1 -1
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +24 -8
- data/lib/carbon_ruby_sdk/models/file_formats.rb +2 -1
- data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/helpdesk_file_sync_config.rb +228 -0
- data/lib/carbon_ruby_sdk/models/helpdesk_file_sync_config_nullable.rb +229 -0
- data/lib/carbon_ruby_sdk/models/helpdesk_file_types.rb +36 -0
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +28 -6
- data/lib/carbon_ruby_sdk/models/organization_user_files_to_sync_filters.rb +16 -5
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +18 -6
- data/lib/carbon_ruby_sdk/models/sync_options.rb +27 -5
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +3 -0
- data/spec/models/helpdesk_file_sync_config_nullable_spec.rb +34 -0
- data/spec/models/helpdesk_file_sync_config_spec.rb +34 -0
- data/spec/models/helpdesk_file_types_spec.rb +22 -0
- data/spec/models/o_auth_url_request_spec.rb +12 -0
- data/spec/models/organization_user_files_to_sync_filters_spec.rb +6 -0
- data/spec/models/sync_files_request_spec.rb +6 -0
- data/spec/models/sync_options_spec.rb +12 -0
- metadata +11 -2
@@ -0,0 +1,229 @@
|
|
1
|
+
=begin
|
2
|
+
#Carbon
|
3
|
+
|
4
|
+
#Connect external data to LLMs, no matter the source.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Carbon
|
13
|
+
# Used to configure file syncing for certain connectors when sync_files_on_connection is set to true
|
14
|
+
class HelpdeskFileSyncConfigNullable
|
15
|
+
attr_accessor :file_types
|
16
|
+
|
17
|
+
attr_accessor :sync_attachments
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'file_types' => :'file_types',
|
23
|
+
:'sync_attachments' => :'sync_attachments'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'file_types' => :'Array<HelpdeskFileTypes>',
|
36
|
+
:'sync_attachments' => :'Boolean'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::HelpdeskFileSyncConfigNullable` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::HelpdeskFileSyncConfigNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'file_types')
|
62
|
+
if (value = attributes[:'file_types']).is_a?(Array)
|
63
|
+
self.file_types = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.key?(:'sync_attachments')
|
68
|
+
self.sync_attachments = attributes[:'sync_attachments']
|
69
|
+
else
|
70
|
+
self.sync_attachments = false
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properties with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = Array.new
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class &&
|
92
|
+
file_types == o.file_types &&
|
93
|
+
sync_attachments == o.sync_attachments
|
94
|
+
end
|
95
|
+
|
96
|
+
# @see the `==` method
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def eql?(o)
|
99
|
+
self == o
|
100
|
+
end
|
101
|
+
|
102
|
+
# Calculates hash code according to all attributes.
|
103
|
+
# @return [Integer] Hash code
|
104
|
+
def hash
|
105
|
+
[file_types, sync_attachments].hash
|
106
|
+
end
|
107
|
+
|
108
|
+
# Builds the object from hash
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
# @return [Object] Returns the model itself
|
111
|
+
def self.build_from_hash(attributes)
|
112
|
+
new.build_from_hash(attributes)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
120
|
+
attributes = attributes.transform_keys(&:to_sym)
|
121
|
+
self.class.openapi_types.each_pair do |key, type|
|
122
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
123
|
+
self.send("#{key}=", nil)
|
124
|
+
elsif type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :Time
|
145
|
+
Time.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value.to_s
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :Boolean
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
# models (e.g. Pet) or oneOf
|
176
|
+
klass = Carbon.const_get(type)
|
177
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
if value.nil?
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
202
|
+
end
|
203
|
+
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
@@ -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 HelpdeskFileTypes
|
14
|
+
TICKET = "TICKET".freeze
|
15
|
+
ARTICLE = "ARTICLE".freeze
|
16
|
+
|
17
|
+
def self.all_vars
|
18
|
+
@all_vars ||= [TICKET, ARTICLE].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 HelpdeskFileTypes.all_vars.include?(value)
|
33
|
+
raise "Invalid ENUM value #{value} for class #HelpdeskFileTypes"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -61,12 +61,17 @@ module Carbon
|
|
61
61
|
|
62
62
|
attr_accessor :parse_pdf_tables_with_ocr
|
63
63
|
|
64
|
-
# Enable integration's file picker for sources that support it. Supported sources: BOX, SHAREPOINT,
|
64
|
+
# Enable integration's file picker for sources that support it. Supported sources: BOX, SHAREPOINT, GOOGLE_DRIVE, DROPBOX, ONEDRIVE
|
65
65
|
attr_accessor :enable_file_picker
|
66
66
|
|
67
67
|
# Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
68
68
|
attr_accessor :sync_source_items
|
69
69
|
|
70
|
+
# Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
|
71
|
+
attr_accessor :incremental_sync
|
72
|
+
|
73
|
+
attr_accessor :file_sync_config
|
74
|
+
|
70
75
|
# Attribute mapping from ruby-style variable name to JSON key.
|
71
76
|
def self.attribute_map
|
72
77
|
{
|
@@ -93,7 +98,9 @@ module Carbon
|
|
93
98
|
:'use_ocr' => :'use_ocr',
|
94
99
|
:'parse_pdf_tables_with_ocr' => :'parse_pdf_tables_with_ocr',
|
95
100
|
:'enable_file_picker' => :'enable_file_picker',
|
96
|
-
:'sync_source_items' => :'sync_source_items'
|
101
|
+
:'sync_source_items' => :'sync_source_items',
|
102
|
+
:'incremental_sync' => :'incremental_sync',
|
103
|
+
:'file_sync_config' => :'file_sync_config'
|
97
104
|
}
|
98
105
|
end
|
99
106
|
|
@@ -128,7 +135,9 @@ module Carbon
|
|
128
135
|
:'use_ocr' => :'Boolean',
|
129
136
|
:'parse_pdf_tables_with_ocr' => :'Boolean',
|
130
137
|
:'enable_file_picker' => :'Boolean',
|
131
|
-
:'sync_source_items' => :'Boolean'
|
138
|
+
:'sync_source_items' => :'Boolean',
|
139
|
+
:'incremental_sync' => :'Boolean',
|
140
|
+
:'file_sync_config' => :'HelpdeskFileSyncConfigNullable'
|
132
141
|
}
|
133
142
|
end
|
134
143
|
|
@@ -154,6 +163,7 @@ module Carbon
|
|
154
163
|
:'connecting_new_account',
|
155
164
|
:'use_ocr',
|
156
165
|
:'parse_pdf_tables_with_ocr',
|
166
|
+
:'file_sync_config'
|
157
167
|
])
|
158
168
|
end
|
159
169
|
|
@@ -269,7 +279,7 @@ module Carbon
|
|
269
279
|
if attributes.key?(:'request_id')
|
270
280
|
self.request_id = attributes[:'request_id']
|
271
281
|
else
|
272
|
-
self.request_id = '
|
282
|
+
self.request_id = '444e3f13-e490-4cc0-9cba-48957104083d'
|
273
283
|
end
|
274
284
|
|
275
285
|
if attributes.key?(:'use_ocr')
|
@@ -295,6 +305,16 @@ module Carbon
|
|
295
305
|
else
|
296
306
|
self.sync_source_items = true
|
297
307
|
end
|
308
|
+
|
309
|
+
if attributes.key?(:'incremental_sync')
|
310
|
+
self.incremental_sync = attributes[:'incremental_sync']
|
311
|
+
else
|
312
|
+
self.incremental_sync = false
|
313
|
+
end
|
314
|
+
|
315
|
+
if attributes.key?(:'file_sync_config')
|
316
|
+
self.file_sync_config = attributes[:'file_sync_config']
|
317
|
+
end
|
298
318
|
end
|
299
319
|
|
300
320
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -343,7 +363,9 @@ module Carbon
|
|
343
363
|
use_ocr == o.use_ocr &&
|
344
364
|
parse_pdf_tables_with_ocr == o.parse_pdf_tables_with_ocr &&
|
345
365
|
enable_file_picker == o.enable_file_picker &&
|
346
|
-
sync_source_items == o.sync_source_items
|
366
|
+
sync_source_items == o.sync_source_items &&
|
367
|
+
incremental_sync == o.incremental_sync &&
|
368
|
+
file_sync_config == o.file_sync_config
|
347
369
|
end
|
348
370
|
|
349
371
|
# @see the `==` method
|
@@ -355,7 +377,7 @@ module Carbon
|
|
355
377
|
# Calculates hash code according to all attributes.
|
356
378
|
# @return [Integer] Hash code
|
357
379
|
def hash
|
358
|
-
[tags, scope, service, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, zendesk_subdomain, microsoft_tenant, sharepoint_site_name, confluence_subdomain, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, salesforce_domain, sync_files_on_connection, set_page_as_boundary, data_source_id, connecting_new_account, request_id, use_ocr, parse_pdf_tables_with_ocr, enable_file_picker, sync_source_items].hash
|
380
|
+
[tags, scope, service, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, zendesk_subdomain, microsoft_tenant, sharepoint_site_name, confluence_subdomain, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, salesforce_domain, sync_files_on_connection, set_page_as_boundary, data_source_id, connecting_new_account, request_id, use_ocr, parse_pdf_tables_with_ocr, enable_file_picker, sync_source_items, incremental_sync, file_sync_config].hash
|
359
381
|
end
|
360
382
|
|
361
383
|
# Builds the object from hash
|
@@ -53,6 +53,9 @@ module Carbon
|
|
53
53
|
# The error message of the file. The query will return files with error messages that contain this string. To search for files with no error message, use an empty string.
|
54
54
|
attr_accessor :sync_error_message
|
55
55
|
|
56
|
+
# If true, the query will return containers in the response. Containers are files that group other files together and have no content themselves. Default behavior is to include containers.
|
57
|
+
attr_accessor :include_containers
|
58
|
+
|
56
59
|
# Attribute mapping from ruby-style variable name to JSON key.
|
57
60
|
def self.attribute_map
|
58
61
|
{
|
@@ -70,7 +73,8 @@ module Carbon
|
|
70
73
|
:'include_all_children' => :'include_all_children',
|
71
74
|
:'non_synced_only' => :'non_synced_only',
|
72
75
|
:'request_ids' => :'request_ids',
|
73
|
-
:'sync_error_message' => :'sync_error_message'
|
76
|
+
:'sync_error_message' => :'sync_error_message',
|
77
|
+
:'include_containers' => :'include_containers'
|
74
78
|
}
|
75
79
|
end
|
76
80
|
|
@@ -96,7 +100,8 @@ module Carbon
|
|
96
100
|
:'include_all_children' => :'Boolean',
|
97
101
|
:'non_synced_only' => :'Boolean',
|
98
102
|
:'request_ids' => :'Array<String>',
|
99
|
-
:'sync_error_message' => :'String'
|
103
|
+
:'sync_error_message' => :'String',
|
104
|
+
:'include_containers' => :'Boolean'
|
100
105
|
}
|
101
106
|
end
|
102
107
|
|
@@ -115,7 +120,8 @@ module Carbon
|
|
115
120
|
:'embedding_generators',
|
116
121
|
:'root_files_only',
|
117
122
|
:'request_ids',
|
118
|
-
:'sync_error_message'
|
123
|
+
:'sync_error_message',
|
124
|
+
:'include_containers'
|
119
125
|
])
|
120
126
|
end
|
121
127
|
|
@@ -213,6 +219,10 @@ module Carbon
|
|
213
219
|
if attributes.key?(:'sync_error_message')
|
214
220
|
self.sync_error_message = attributes[:'sync_error_message']
|
215
221
|
end
|
222
|
+
|
223
|
+
if attributes.key?(:'include_containers')
|
224
|
+
self.include_containers = attributes[:'include_containers']
|
225
|
+
end
|
216
226
|
end
|
217
227
|
|
218
228
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -262,7 +272,8 @@ module Carbon
|
|
262
272
|
include_all_children == o.include_all_children &&
|
263
273
|
non_synced_only == o.non_synced_only &&
|
264
274
|
request_ids == o.request_ids &&
|
265
|
-
sync_error_message == o.sync_error_message
|
275
|
+
sync_error_message == o.sync_error_message &&
|
276
|
+
include_containers == o.include_containers
|
266
277
|
end
|
267
278
|
|
268
279
|
# @see the `==` method
|
@@ -274,7 +285,7 @@ module Carbon
|
|
274
285
|
# Calculates hash code according to all attributes.
|
275
286
|
# @return [Integer] Hash code
|
276
287
|
def hash
|
277
|
-
[tags, source, name, tags_v2, ids, external_file_ids, sync_statuses, parent_file_ids, organization_user_data_source_id, embedding_generators, root_files_only, include_all_children, non_synced_only, request_ids, sync_error_message].hash
|
288
|
+
[tags, source, name, tags_v2, ids, external_file_ids, sync_statuses, parent_file_ids, organization_user_data_source_id, embedding_generators, root_files_only, include_all_children, non_synced_only, request_ids, sync_error_message, include_containers].hash
|
278
289
|
end
|
279
290
|
|
280
291
|
# Builds the object from hash
|
@@ -40,6 +40,9 @@ module Carbon
|
|
40
40
|
|
41
41
|
attr_accessor :parse_pdf_tables_with_ocr
|
42
42
|
|
43
|
+
# Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
|
44
|
+
attr_accessor :incremental_sync
|
45
|
+
|
43
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
44
47
|
def self.attribute_map
|
45
48
|
{
|
@@ -56,7 +59,8 @@ module Carbon
|
|
56
59
|
:'set_page_as_boundary' => :'set_page_as_boundary',
|
57
60
|
:'request_id' => :'request_id',
|
58
61
|
:'use_ocr' => :'use_ocr',
|
59
|
-
:'parse_pdf_tables_with_ocr' => :'parse_pdf_tables_with_ocr'
|
62
|
+
:'parse_pdf_tables_with_ocr' => :'parse_pdf_tables_with_ocr',
|
63
|
+
:'incremental_sync' => :'incremental_sync'
|
60
64
|
}
|
61
65
|
end
|
62
66
|
|
@@ -81,7 +85,8 @@ module Carbon
|
|
81
85
|
:'set_page_as_boundary' => :'Boolean',
|
82
86
|
:'request_id' => :'String',
|
83
87
|
:'use_ocr' => :'Boolean',
|
84
|
-
:'parse_pdf_tables_with_ocr' => :'Boolean'
|
88
|
+
:'parse_pdf_tables_with_ocr' => :'Boolean',
|
89
|
+
:'incremental_sync' => :'Boolean'
|
85
90
|
}
|
86
91
|
end
|
87
92
|
|
@@ -97,7 +102,7 @@ module Carbon
|
|
97
102
|
:'prepend_filename_to_chunks',
|
98
103
|
:'max_items_per_chunk',
|
99
104
|
:'use_ocr',
|
100
|
-
:'parse_pdf_tables_with_ocr'
|
105
|
+
:'parse_pdf_tables_with_ocr',
|
101
106
|
])
|
102
107
|
end
|
103
108
|
|
@@ -177,7 +182,7 @@ module Carbon
|
|
177
182
|
if attributes.key?(:'request_id')
|
178
183
|
self.request_id = attributes[:'request_id']
|
179
184
|
else
|
180
|
-
self.request_id = '
|
185
|
+
self.request_id = 'a5c6b913-12ce-4ae5-af61-694dd5c400fc'
|
181
186
|
end
|
182
187
|
|
183
188
|
if attributes.key?(:'use_ocr')
|
@@ -191,6 +196,12 @@ module Carbon
|
|
191
196
|
else
|
192
197
|
self.parse_pdf_tables_with_ocr = false
|
193
198
|
end
|
199
|
+
|
200
|
+
if attributes.key?(:'incremental_sync')
|
201
|
+
self.incremental_sync = attributes[:'incremental_sync']
|
202
|
+
else
|
203
|
+
self.incremental_sync = false
|
204
|
+
end
|
194
205
|
end
|
195
206
|
|
196
207
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -234,7 +245,8 @@ module Carbon
|
|
234
245
|
set_page_as_boundary == o.set_page_as_boundary &&
|
235
246
|
request_id == o.request_id &&
|
236
247
|
use_ocr == o.use_ocr &&
|
237
|
-
parse_pdf_tables_with_ocr == o.parse_pdf_tables_with_ocr
|
248
|
+
parse_pdf_tables_with_ocr == o.parse_pdf_tables_with_ocr &&
|
249
|
+
incremental_sync == o.incremental_sync
|
238
250
|
end
|
239
251
|
|
240
252
|
# @see the `==` method
|
@@ -246,7 +258,7 @@ module Carbon
|
|
246
258
|
# Calculates hash code according to all attributes.
|
247
259
|
# @return [Integer] Hash code
|
248
260
|
def hash
|
249
|
-
[tags, data_source_id, ids, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, set_page_as_boundary, request_id, use_ocr, parse_pdf_tables_with_ocr].hash
|
261
|
+
[tags, data_source_id, ids, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, set_page_as_boundary, request_id, use_ocr, parse_pdf_tables_with_ocr, incremental_sync].hash
|
250
262
|
end
|
251
263
|
|
252
264
|
# Builds the object from hash
|
@@ -40,6 +40,11 @@ module Carbon
|
|
40
40
|
# Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
41
41
|
attr_accessor :sync_source_items
|
42
42
|
|
43
|
+
# Only sync files if they have not already been synced or if the embedding properties have changed. This flag is currently supported by ONEDRIVE, GOOGLE_DRIVE, BOX, DROPBOX. It will be ignored for other data sources.
|
44
|
+
attr_accessor :incremental_sync
|
45
|
+
|
46
|
+
attr_accessor :file_sync_config
|
47
|
+
|
43
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
44
49
|
def self.attribute_map
|
45
50
|
{
|
@@ -55,7 +60,9 @@ module Carbon
|
|
55
60
|
:'set_page_as_boundary' => :'set_page_as_boundary',
|
56
61
|
:'request_id' => :'request_id',
|
57
62
|
:'enable_file_picker' => :'enable_file_picker',
|
58
|
-
:'sync_source_items' => :'sync_source_items'
|
63
|
+
:'sync_source_items' => :'sync_source_items',
|
64
|
+
:'incremental_sync' => :'incremental_sync',
|
65
|
+
:'file_sync_config' => :'file_sync_config'
|
59
66
|
}
|
60
67
|
end
|
61
68
|
|
@@ -79,7 +86,9 @@ module Carbon
|
|
79
86
|
:'set_page_as_boundary' => :'Boolean',
|
80
87
|
:'request_id' => :'String',
|
81
88
|
:'enable_file_picker' => :'Boolean',
|
82
|
-
:'sync_source_items' => :'Boolean'
|
89
|
+
:'sync_source_items' => :'Boolean',
|
90
|
+
:'incremental_sync' => :'Boolean',
|
91
|
+
:'file_sync_config' => :'HelpdeskFileSyncConfigNullable'
|
83
92
|
}
|
84
93
|
end
|
85
94
|
|
@@ -95,6 +104,7 @@ module Carbon
|
|
95
104
|
:'prepend_filename_to_chunks',
|
96
105
|
:'max_items_per_chunk',
|
97
106
|
:'sync_files_on_connection',
|
107
|
+
:'file_sync_config'
|
98
108
|
])
|
99
109
|
end
|
100
110
|
|
@@ -172,7 +182,7 @@ module Carbon
|
|
172
182
|
if attributes.key?(:'request_id')
|
173
183
|
self.request_id = attributes[:'request_id']
|
174
184
|
else
|
175
|
-
self.request_id = '
|
185
|
+
self.request_id = 'b9a72b38-115a-4dd6-bad9-00185ae2333b'
|
176
186
|
end
|
177
187
|
|
178
188
|
if attributes.key?(:'enable_file_picker')
|
@@ -186,6 +196,16 @@ module Carbon
|
|
186
196
|
else
|
187
197
|
self.sync_source_items = true
|
188
198
|
end
|
199
|
+
|
200
|
+
if attributes.key?(:'incremental_sync')
|
201
|
+
self.incremental_sync = attributes[:'incremental_sync']
|
202
|
+
else
|
203
|
+
self.incremental_sync = false
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.key?(:'file_sync_config')
|
207
|
+
self.file_sync_config = attributes[:'file_sync_config']
|
208
|
+
end
|
189
209
|
end
|
190
210
|
|
191
211
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -218,7 +238,9 @@ module Carbon
|
|
218
238
|
set_page_as_boundary == o.set_page_as_boundary &&
|
219
239
|
request_id == o.request_id &&
|
220
240
|
enable_file_picker == o.enable_file_picker &&
|
221
|
-
sync_source_items == o.sync_source_items
|
241
|
+
sync_source_items == o.sync_source_items &&
|
242
|
+
incremental_sync == o.incremental_sync &&
|
243
|
+
file_sync_config == o.file_sync_config
|
222
244
|
end
|
223
245
|
|
224
246
|
# @see the `==` method
|
@@ -230,7 +252,7 @@ module Carbon
|
|
230
252
|
# Calculates hash code according to all attributes.
|
231
253
|
# @return [Integer] Hash code
|
232
254
|
def hash
|
233
|
-
[tags, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, sync_files_on_connection, set_page_as_boundary, request_id, enable_file_picker, sync_source_items].hash
|
255
|
+
[tags, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks, max_items_per_chunk, sync_files_on_connection, set_page_as_boundary, request_id, enable_file_picker, sync_source_items, incremental_sync, file_sync_config].hash
|
234
256
|
end
|
235
257
|
|
236
258
|
# Builds the object from hash
|
data/lib/carbon_ruby_sdk.rb
CHANGED
@@ -67,6 +67,9 @@ require 'carbon_ruby_sdk/models/github_connect_request'
|
|
67
67
|
require 'carbon_ruby_sdk/models/github_fetch_repos_request'
|
68
68
|
require 'carbon_ruby_sdk/models/gmail_sync_input'
|
69
69
|
require 'carbon_ruby_sdk/models/http_validation_error'
|
70
|
+
require 'carbon_ruby_sdk/models/helpdesk_file_sync_config'
|
71
|
+
require 'carbon_ruby_sdk/models/helpdesk_file_sync_config_nullable'
|
72
|
+
require 'carbon_ruby_sdk/models/helpdesk_file_types'
|
70
73
|
require 'carbon_ruby_sdk/models/hybrid_search_tuning_params'
|
71
74
|
require 'carbon_ruby_sdk/models/hybrid_search_tuning_params_nullable'
|
72
75
|
require 'carbon_ruby_sdk/models/ids_property'
|
@@ -0,0 +1,34 @@
|
|
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::HelpdeskFileSyncConfigNullable
|
14
|
+
describe Carbon::HelpdeskFileSyncConfigNullable do
|
15
|
+
let(:instance) { Carbon::HelpdeskFileSyncConfigNullable.new }
|
16
|
+
|
17
|
+
describe 'test an instance of HelpdeskFileSyncConfigNullable' do
|
18
|
+
it 'should create an instance of HelpdeskFileSyncConfigNullable' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::HelpdeskFileSyncConfigNullable)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
describe 'test attribute "file_types"' do
|
23
|
+
it 'should work' do
|
24
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe 'test attribute "sync_attachments"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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::HelpdeskFileSyncConfig
|
14
|
+
describe Carbon::HelpdeskFileSyncConfig do
|
15
|
+
let(:instance) { Carbon::HelpdeskFileSyncConfig.new }
|
16
|
+
|
17
|
+
describe 'test an instance of HelpdeskFileSyncConfig' do
|
18
|
+
it 'should create an instance of HelpdeskFileSyncConfig' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::HelpdeskFileSyncConfig)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
describe 'test attribute "file_types"' do
|
23
|
+
it 'should work' do
|
24
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe 'test attribute "sync_attachments"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|