carbon_ruby_sdk 0.2.16 → 0.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -19
- data/README.md +21 -7
- data/lib/carbon_ruby_sdk/api/files_api.rb +15 -4
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +8 -8
- data/lib/carbon_ruby_sdk/models/file_sync_config.rb +11 -1
- data/lib/carbon_ruby_sdk/models/file_sync_config_nullable.rb +11 -1
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +2 -2
- data/lib/carbon_ruby_sdk/models/object_type.rb +42 -0
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload.rb +276 -0
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload_object.rb +235 -0
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload_object_additional_information.rb +101 -0
- data/lib/carbon_ruby_sdk/models/sent_webhook_payload_object_object_id.rb +103 -0
- data/lib/carbon_ruby_sdk/models/sent_webhook_request_body.rb +215 -0
- 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/transcription_service.rb +36 -0
- data/lib/carbon_ruby_sdk/models/transcription_service_nullable.rb +36 -0
- data/lib/carbon_ruby_sdk/models/upload_file_from_url_input.rb +11 -1
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +8 -0
- data/spec/api/files_api_spec.rb +1 -0
- data/spec/models/file_sync_config_nullable_spec.rb +6 -0
- data/spec/models/file_sync_config_spec.rb +6 -0
- data/spec/models/object_type_spec.rb +22 -0
- data/spec/models/sent_webhook_payload_object_additional_information_spec.rb +25 -0
- data/spec/models/sent_webhook_payload_object_object_id_spec.rb +25 -0
- data/spec/models/sent_webhook_payload_object_spec.rb +40 -0
- data/spec/models/sent_webhook_payload_spec.rb +50 -0
- data/spec/models/sent_webhook_request_body_spec.rb +28 -0
- data/spec/models/transcription_service_nullable_spec.rb +22 -0
- data/spec/models/transcription_service_spec.rb +22 -0
- data/spec/models/upload_file_from_url_input_spec.rb +6 -0
- metadata +27 -3
@@ -0,0 +1,103 @@
|
|
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
|
+
module SentWebhookPayloadObjectObjectId
|
14
|
+
class << self
|
15
|
+
# List of class defined in oneOf (OpenAPI v3)
|
16
|
+
def openapi_one_of
|
17
|
+
[
|
18
|
+
:'Array<Integer>',
|
19
|
+
:'Array<String>',
|
20
|
+
:'Integer',
|
21
|
+
:'String'
|
22
|
+
]
|
23
|
+
end
|
24
|
+
|
25
|
+
# Builds the object
|
26
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
27
|
+
# @return [Object] Returns the model or the data itself
|
28
|
+
def build(data)
|
29
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
30
|
+
# Note:
|
31
|
+
# - We do not attempt to check whether exactly one item matches.
|
32
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
33
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
34
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
35
|
+
# - TODO: logging when debugging is set.
|
36
|
+
openapi_one_of.each do |klass|
|
37
|
+
begin
|
38
|
+
next if klass == :AnyType # "nullable: true"
|
39
|
+
typed_data = find_and_cast_into_type(klass, data)
|
40
|
+
return typed_data if typed_data
|
41
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
SchemaMismatchError = Class.new(StandardError)
|
51
|
+
|
52
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
53
|
+
def find_and_cast_into_type(klass, data)
|
54
|
+
return if data.nil?
|
55
|
+
|
56
|
+
case klass.to_s
|
57
|
+
when 'Boolean'
|
58
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
59
|
+
when 'Float'
|
60
|
+
return data if data.instance_of?(Float)
|
61
|
+
when 'Integer'
|
62
|
+
return data if data.instance_of?(Integer)
|
63
|
+
when 'Time'
|
64
|
+
return Time.parse(data)
|
65
|
+
when 'Date'
|
66
|
+
return Date.parse(data)
|
67
|
+
when 'String'
|
68
|
+
return data if data.instance_of?(String)
|
69
|
+
when 'Object' # "type: object"
|
70
|
+
return data if data.instance_of?(Hash)
|
71
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
72
|
+
if data.instance_of?(Array)
|
73
|
+
sub_type = Regexp.last_match[:sub_type]
|
74
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
75
|
+
end
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
80
|
+
end
|
81
|
+
else # model
|
82
|
+
const = Carbon.const_get(klass)
|
83
|
+
if const
|
84
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
85
|
+
model = const.build(data)
|
86
|
+
return model if model
|
87
|
+
else
|
88
|
+
# raise if data contains keys that are not known to the model
|
89
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
90
|
+
model = const.build_from_hash(data)
|
91
|
+
return model if model && model.valid?
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
raise # if no match by now, raise
|
97
|
+
rescue
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
@@ -0,0 +1,215 @@
|
|
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 SentWebhookRequestBody
|
14
|
+
attr_accessor :payload
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:'payload' => :'payload'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns all the JSON keys this model knows about
|
24
|
+
def self.acceptable_attributes
|
25
|
+
attribute_map.values
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'payload' => :'String'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
if (!attributes.is_a?(Hash))
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::SentWebhookRequestBody` initialize method"
|
46
|
+
end
|
47
|
+
|
48
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::SentWebhookRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
|
+
end
|
53
|
+
h[k.to_sym] = v
|
54
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:'payload')
|
57
|
+
self.payload = attributes[:'payload']
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properties with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
payload == o.payload
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Integer] Hash code
|
90
|
+
def hash
|
91
|
+
[payload].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def self.build_from_hash(attributes)
|
98
|
+
new.build_from_hash(attributes)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def build_from_hash(attributes)
|
105
|
+
return nil unless attributes.is_a?(Hash)
|
106
|
+
attributes = attributes.transform_keys(&:to_sym)
|
107
|
+
self.class.openapi_types.each_pair do |key, type|
|
108
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
109
|
+
self.send("#{key}=", nil)
|
110
|
+
elsif type =~ /\AArray<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the attribute
|
112
|
+
# is documented as an array but the input is not
|
113
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
115
|
+
end
|
116
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
self
|
122
|
+
end
|
123
|
+
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
128
|
+
def _deserialize(type, value)
|
129
|
+
case type.to_sym
|
130
|
+
when :Time
|
131
|
+
Time.parse(value)
|
132
|
+
when :Date
|
133
|
+
Date.parse(value)
|
134
|
+
when :String
|
135
|
+
value.to_s
|
136
|
+
when :Integer
|
137
|
+
value.to_i
|
138
|
+
when :Float
|
139
|
+
value.to_f
|
140
|
+
when :Boolean
|
141
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
142
|
+
true
|
143
|
+
else
|
144
|
+
false
|
145
|
+
end
|
146
|
+
when :Object
|
147
|
+
# generic object (usually a Hash), return directly
|
148
|
+
value
|
149
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
150
|
+
inner_type = Regexp.last_match[:inner_type]
|
151
|
+
value.map { |v| _deserialize(inner_type, v) }
|
152
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
153
|
+
k_type = Regexp.last_match[:k_type]
|
154
|
+
v_type = Regexp.last_match[:v_type]
|
155
|
+
{}.tap do |hash|
|
156
|
+
value.each do |k, v|
|
157
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
else # model
|
161
|
+
# models (e.g. Pet) or oneOf
|
162
|
+
klass = Carbon.const_get(type)
|
163
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
if value.nil?
|
186
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
188
|
+
end
|
189
|
+
|
190
|
+
hash[param] = _to_hash(value)
|
191
|
+
end
|
192
|
+
hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Outputs non-array value in the form of hash
|
196
|
+
# For object, use to_hash. Otherwise, just return the value
|
197
|
+
# @param [Object] value Any valid value
|
198
|
+
# @return [Hash] Returns the value in the form of hash
|
199
|
+
def _to_hash(value)
|
200
|
+
if value.is_a?(Array)
|
201
|
+
value.compact.map { |v| _to_hash(v) }
|
202
|
+
elsif value.is_a?(Hash)
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
205
|
+
end
|
206
|
+
elsif value.respond_to? :to_hash
|
207
|
+
value.to_hash
|
208
|
+
else
|
209
|
+
value
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
|
215
|
+
end
|
@@ -187,7 +187,7 @@ module Carbon
|
|
187
187
|
if attributes.key?(:'request_id')
|
188
188
|
self.request_id = attributes[:'request_id']
|
189
189
|
else
|
190
|
-
self.request_id = '
|
190
|
+
self.request_id = '0a2f743b-fe89-4193-86c3-87ca6d2ffc43'
|
191
191
|
end
|
192
192
|
|
193
193
|
if attributes.key?(:'use_ocr')
|
@@ -182,7 +182,7 @@ module Carbon
|
|
182
182
|
if attributes.key?(:'request_id')
|
183
183
|
self.request_id = attributes[:'request_id']
|
184
184
|
else
|
185
|
-
self.request_id = '
|
185
|
+
self.request_id = 'bdd2d0b8-c211-49bd-b70a-4889ae5fab99'
|
186
186
|
end
|
187
187
|
|
188
188
|
if attributes.key?(:'enable_file_picker')
|
@@ -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 TranscriptionService
|
14
|
+
ASSEMBLYAI = "assemblyai".freeze
|
15
|
+
DEEPGRAM = "deepgram".freeze
|
16
|
+
|
17
|
+
def self.all_vars
|
18
|
+
@all_vars ||= [ASSEMBLYAI, DEEPGRAM].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 TranscriptionService.all_vars.include?(value)
|
33
|
+
raise "Invalid ENUM value #{value} for class #TranscriptionService"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
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 TranscriptionServiceNullable
|
14
|
+
ASSEMBLYAI = "assemblyai".freeze
|
15
|
+
DEEPGRAM = "deepgram".freeze
|
16
|
+
|
17
|
+
def self.all_vars
|
18
|
+
@all_vars ||= [ASSEMBLYAI, DEEPGRAM].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 TranscriptionServiceNullable.all_vars.include?(value)
|
33
|
+
raise "Invalid ENUM value #{value} for class #TranscriptionServiceNullable"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -38,6 +38,8 @@ module Carbon
|
|
38
38
|
|
39
39
|
attr_accessor :detect_audio_language
|
40
40
|
|
41
|
+
attr_accessor :transcription_service
|
42
|
+
|
41
43
|
attr_accessor :media_type
|
42
44
|
|
43
45
|
attr_accessor :split_rows
|
@@ -58,6 +60,7 @@ module Carbon
|
|
58
60
|
:'max_items_per_chunk' => :'max_items_per_chunk',
|
59
61
|
:'parse_pdf_tables_with_ocr' => :'parse_pdf_tables_with_ocr',
|
60
62
|
:'detect_audio_language' => :'detect_audio_language',
|
63
|
+
:'transcription_service' => :'transcription_service',
|
61
64
|
:'media_type' => :'media_type',
|
62
65
|
:'split_rows' => :'split_rows'
|
63
66
|
}
|
@@ -84,6 +87,7 @@ module Carbon
|
|
84
87
|
:'max_items_per_chunk' => :'Integer',
|
85
88
|
:'parse_pdf_tables_with_ocr' => :'Boolean',
|
86
89
|
:'detect_audio_language' => :'Boolean',
|
90
|
+
:'transcription_service' => :'TranscriptionServiceNullable',
|
87
91
|
:'media_type' => :'FileContentTypesNullable',
|
88
92
|
:'split_rows' => :'Boolean'
|
89
93
|
}
|
@@ -96,6 +100,7 @@ module Carbon
|
|
96
100
|
:'chunk_size',
|
97
101
|
:'chunk_overlap',
|
98
102
|
:'max_items_per_chunk',
|
103
|
+
:'transcription_service',
|
99
104
|
:'media_type',
|
100
105
|
])
|
101
106
|
end
|
@@ -183,6 +188,10 @@ module Carbon
|
|
183
188
|
self.detect_audio_language = false
|
184
189
|
end
|
185
190
|
|
191
|
+
if attributes.key?(:'transcription_service')
|
192
|
+
self.transcription_service = attributes[:'transcription_service']
|
193
|
+
end
|
194
|
+
|
186
195
|
if attributes.key?(:'media_type')
|
187
196
|
self.media_type = attributes[:'media_type']
|
188
197
|
end
|
@@ -230,6 +239,7 @@ module Carbon
|
|
230
239
|
max_items_per_chunk == o.max_items_per_chunk &&
|
231
240
|
parse_pdf_tables_with_ocr == o.parse_pdf_tables_with_ocr &&
|
232
241
|
detect_audio_language == o.detect_audio_language &&
|
242
|
+
transcription_service == o.transcription_service &&
|
233
243
|
media_type == o.media_type &&
|
234
244
|
split_rows == o.split_rows
|
235
245
|
end
|
@@ -243,7 +253,7 @@ module Carbon
|
|
243
253
|
# Calculates hash code according to all attributes.
|
244
254
|
# @return [Integer] Hash code
|
245
255
|
def hash
|
246
|
-
[url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk, parse_pdf_tables_with_ocr, detect_audio_language, media_type, split_rows].hash
|
256
|
+
[url, file_name, chunk_size, chunk_overlap, skip_embedding_generation, set_page_as_boundary, embedding_model, generate_sparse_vectors, use_textract, prepend_filename_to_chunks, max_items_per_chunk, parse_pdf_tables_with_ocr, detect_audio_language, transcription_service, media_type, split_rows].hash
|
247
257
|
end
|
248
258
|
|
249
259
|
# Builds the object from hash
|
data/lib/carbon_ruby_sdk.rb
CHANGED
@@ -92,6 +92,7 @@ require 'carbon_ruby_sdk/models/modify_user_configuration_input'
|
|
92
92
|
require 'carbon_ruby_sdk/models/notion_authentication'
|
93
93
|
require 'carbon_ruby_sdk/models/o_auth_authentication'
|
94
94
|
require 'carbon_ruby_sdk/models/o_auth_url_request'
|
95
|
+
require 'carbon_ruby_sdk/models/object_type'
|
95
96
|
require 'carbon_ruby_sdk/models/order_dir'
|
96
97
|
require 'carbon_ruby_sdk/models/order_dir_v2'
|
97
98
|
require 'carbon_ruby_sdk/models/organization_response'
|
@@ -122,6 +123,11 @@ require 'carbon_ruby_sdk/models/s3_authentication'
|
|
122
123
|
require 'carbon_ruby_sdk/models/s3_file_sync_input'
|
123
124
|
require 'carbon_ruby_sdk/models/s3_get_file_input'
|
124
125
|
require 'carbon_ruby_sdk/models/salesforce_authentication'
|
126
|
+
require 'carbon_ruby_sdk/models/sent_webhook_payload'
|
127
|
+
require 'carbon_ruby_sdk/models/sent_webhook_payload_object'
|
128
|
+
require 'carbon_ruby_sdk/models/sent_webhook_payload_object_additional_information'
|
129
|
+
require 'carbon_ruby_sdk/models/sent_webhook_payload_object_object_id'
|
130
|
+
require 'carbon_ruby_sdk/models/sent_webhook_request_body'
|
125
131
|
require 'carbon_ruby_sdk/models/sharepoint_authentication'
|
126
132
|
require 'carbon_ruby_sdk/models/simple_o_auth_data_sources'
|
127
133
|
require 'carbon_ruby_sdk/models/single_chunks_and_embeddings_upload_input'
|
@@ -137,6 +143,8 @@ require 'carbon_ruby_sdk/models/tags'
|
|
137
143
|
require 'carbon_ruby_sdk/models/tags1'
|
138
144
|
require 'carbon_ruby_sdk/models/text_embedding_generators'
|
139
145
|
require 'carbon_ruby_sdk/models/token_response'
|
146
|
+
require 'carbon_ruby_sdk/models/transcription_service'
|
147
|
+
require 'carbon_ruby_sdk/models/transcription_service_nullable'
|
140
148
|
require 'carbon_ruby_sdk/models/update_organization_input'
|
141
149
|
require 'carbon_ruby_sdk/models/update_users_input'
|
142
150
|
require 'carbon_ruby_sdk/models/upload_file_from_url_input'
|
data/spec/api/files_api_spec.rb
CHANGED
@@ -158,6 +158,7 @@ describe 'FilesApi' do
|
|
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 [TranscriptionServiceNullable] :transcription_service The transcription service to use for audio files. If no service is specified, 'deepgram' will be used.
|
161
162
|
# @option opts [FileContentTypesNullable] :media_type The media type of the file. If not provided, it will be inferred from the file extension.
|
162
163
|
# @option opts [Boolean] :split_rows Whether to split tabular rows into chunks. Currently only valid for CSV, TSV, and XLSX files.
|
163
164
|
# @return [UserFile]
|
@@ -37,6 +37,12 @@ describe Carbon::FileSyncConfigNullable do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe 'test attribute "transcription_service"' 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
|
+
|
40
46
|
describe 'test attribute "split_rows"' do
|
41
47
|
it 'should work' do
|
42
48
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -37,6 +37,12 @@ describe Carbon::FileSyncConfig do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe 'test attribute "transcription_service"' 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
|
+
|
40
46
|
describe 'test attribute "split_rows"' do
|
41
47
|
it 'should work' do
|
42
48
|
# 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::ObjectType
|
14
|
+
describe Carbon::ObjectType do
|
15
|
+
let(:instance) { Carbon::ObjectType.new }
|
16
|
+
|
17
|
+
describe 'test an instance of ObjectType' do
|
18
|
+
it 'should create an instance of ObjectType' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::ObjectType)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
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::SentWebhookPayloadObjectAdditionalInformation
|
14
|
+
describe Carbon::SentWebhookPayloadObjectAdditionalInformation do
|
15
|
+
describe '.openapi_one_of' do
|
16
|
+
it 'lists the items referenced in the oneOf array' do
|
17
|
+
expect(described_class.openapi_one_of).to_not be_empty
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '.build' do
|
22
|
+
it 'returns the correct model' do
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
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::SentWebhookPayloadObjectObjectId
|
14
|
+
describe Carbon::SentWebhookPayloadObjectObjectId do
|
15
|
+
describe '.openapi_one_of' do
|
16
|
+
it 'lists the items referenced in the oneOf array' do
|
17
|
+
expect(described_class.openapi_one_of).to_not be_empty
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '.build' do
|
22
|
+
it 'returns the correct model' do
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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::SentWebhookPayloadObject
|
14
|
+
describe Carbon::SentWebhookPayloadObject do
|
15
|
+
let(:instance) { Carbon::SentWebhookPayloadObject.new }
|
16
|
+
|
17
|
+
describe 'test an instance of SentWebhookPayloadObject' do
|
18
|
+
it 'should create an instance of SentWebhookPayloadObject' do
|
19
|
+
expect(instance).to be_instance_of(Carbon::SentWebhookPayloadObject)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
describe 'test attribute "object_type"' 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 "object_id"' 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
|
+
describe 'test attribute "additional_information"' do
|
35
|
+
it 'should work' do
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|