carbon_ruby_sdk 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,316 @@
|
|
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 FreshDeskConnectRequest
|
14
|
+
attr_accessor :tags
|
15
|
+
|
16
|
+
attr_accessor :domain
|
17
|
+
|
18
|
+
attr_accessor :api_key
|
19
|
+
|
20
|
+
attr_accessor :chunk_size
|
21
|
+
|
22
|
+
attr_accessor :chunk_overlap
|
23
|
+
|
24
|
+
attr_accessor :skip_embedding_generation
|
25
|
+
|
26
|
+
attr_accessor :embedding_model
|
27
|
+
|
28
|
+
attr_accessor :generate_sparse_vectors
|
29
|
+
|
30
|
+
attr_accessor :prepend_filename_to_chunks
|
31
|
+
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:'tags' => :'tags',
|
36
|
+
:'domain' => :'domain',
|
37
|
+
:'api_key' => :'api_key',
|
38
|
+
:'chunk_size' => :'chunk_size',
|
39
|
+
:'chunk_overlap' => :'chunk_overlap',
|
40
|
+
:'skip_embedding_generation' => :'skip_embedding_generation',
|
41
|
+
:'embedding_model' => :'embedding_model',
|
42
|
+
:'generate_sparse_vectors' => :'generate_sparse_vectors',
|
43
|
+
:'prepend_filename_to_chunks' => :'prepend_filename_to_chunks'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Returns all the JSON keys this model knows about
|
48
|
+
def self.acceptable_attributes
|
49
|
+
attribute_map.values
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute type mapping.
|
53
|
+
def self.openapi_types
|
54
|
+
{
|
55
|
+
:'tags' => :'Object',
|
56
|
+
:'domain' => :'String',
|
57
|
+
:'api_key' => :'String',
|
58
|
+
:'chunk_size' => :'Integer',
|
59
|
+
:'chunk_overlap' => :'Integer',
|
60
|
+
:'skip_embedding_generation' => :'Boolean',
|
61
|
+
:'embedding_model' => :'EmbeddingGeneratorsNullable',
|
62
|
+
:'generate_sparse_vectors' => :'Boolean',
|
63
|
+
:'prepend_filename_to_chunks' => :'Boolean'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# List of attributes with nullable: true
|
68
|
+
def self.openapi_nullable
|
69
|
+
Set.new([
|
70
|
+
:'tags',
|
71
|
+
:'chunk_size',
|
72
|
+
:'chunk_overlap',
|
73
|
+
:'skip_embedding_generation',
|
74
|
+
:'embedding_model',
|
75
|
+
:'generate_sparse_vectors',
|
76
|
+
:'prepend_filename_to_chunks'
|
77
|
+
])
|
78
|
+
end
|
79
|
+
|
80
|
+
# Initializes the object
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
def initialize(attributes = {})
|
83
|
+
if (!attributes.is_a?(Hash))
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::FreshDeskConnectRequest` initialize method"
|
85
|
+
end
|
86
|
+
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
89
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::FreshDeskConnectRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
91
|
+
end
|
92
|
+
h[k.to_sym] = v
|
93
|
+
}
|
94
|
+
|
95
|
+
if attributes.key?(:'tags')
|
96
|
+
self.tags = attributes[:'tags']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'domain')
|
100
|
+
self.domain = attributes[:'domain']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'api_key')
|
104
|
+
self.api_key = attributes[:'api_key']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'chunk_size')
|
108
|
+
self.chunk_size = attributes[:'chunk_size']
|
109
|
+
else
|
110
|
+
self.chunk_size = 1500
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'chunk_overlap')
|
114
|
+
self.chunk_overlap = attributes[:'chunk_overlap']
|
115
|
+
else
|
116
|
+
self.chunk_overlap = 20
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'skip_embedding_generation')
|
120
|
+
self.skip_embedding_generation = attributes[:'skip_embedding_generation']
|
121
|
+
else
|
122
|
+
self.skip_embedding_generation = false
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'embedding_model')
|
126
|
+
self.embedding_model = attributes[:'embedding_model']
|
127
|
+
else
|
128
|
+
self.embedding_model = 'OPENAI'
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'generate_sparse_vectors')
|
132
|
+
self.generate_sparse_vectors = attributes[:'generate_sparse_vectors']
|
133
|
+
else
|
134
|
+
self.generate_sparse_vectors = false
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'prepend_filename_to_chunks')
|
138
|
+
self.prepend_filename_to_chunks = attributes[:'prepend_filename_to_chunks']
|
139
|
+
else
|
140
|
+
self.prepend_filename_to_chunks = false
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
145
|
+
# @return Array for valid properties with the reasons
|
146
|
+
def list_invalid_properties
|
147
|
+
invalid_properties = Array.new
|
148
|
+
if @domain.nil?
|
149
|
+
invalid_properties.push('invalid value for "domain", domain cannot be nil.')
|
150
|
+
end
|
151
|
+
|
152
|
+
if @api_key.nil?
|
153
|
+
invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
|
154
|
+
end
|
155
|
+
|
156
|
+
invalid_properties
|
157
|
+
end
|
158
|
+
|
159
|
+
# Check to see if the all the properties in the model are valid
|
160
|
+
# @return true if the model is valid
|
161
|
+
def valid?
|
162
|
+
return false if @domain.nil?
|
163
|
+
return false if @api_key.nil?
|
164
|
+
true
|
165
|
+
end
|
166
|
+
|
167
|
+
# Checks equality by comparing each attribute.
|
168
|
+
# @param [Object] Object to be compared
|
169
|
+
def ==(o)
|
170
|
+
return true if self.equal?(o)
|
171
|
+
self.class == o.class &&
|
172
|
+
tags == o.tags &&
|
173
|
+
domain == o.domain &&
|
174
|
+
api_key == o.api_key &&
|
175
|
+
chunk_size == o.chunk_size &&
|
176
|
+
chunk_overlap == o.chunk_overlap &&
|
177
|
+
skip_embedding_generation == o.skip_embedding_generation &&
|
178
|
+
embedding_model == o.embedding_model &&
|
179
|
+
generate_sparse_vectors == o.generate_sparse_vectors &&
|
180
|
+
prepend_filename_to_chunks == o.prepend_filename_to_chunks
|
181
|
+
end
|
182
|
+
|
183
|
+
# @see the `==` method
|
184
|
+
# @param [Object] Object to be compared
|
185
|
+
def eql?(o)
|
186
|
+
self == o
|
187
|
+
end
|
188
|
+
|
189
|
+
# Calculates hash code according to all attributes.
|
190
|
+
# @return [Integer] Hash code
|
191
|
+
def hash
|
192
|
+
[tags, domain, api_key, chunk_size, chunk_overlap, skip_embedding_generation, embedding_model, generate_sparse_vectors, prepend_filename_to_chunks].hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Builds the object from hash
|
196
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
197
|
+
# @return [Object] Returns the model itself
|
198
|
+
def self.build_from_hash(attributes)
|
199
|
+
new.build_from_hash(attributes)
|
200
|
+
end
|
201
|
+
|
202
|
+
# Builds the object from hash
|
203
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
204
|
+
# @return [Object] Returns the model itself
|
205
|
+
def build_from_hash(attributes)
|
206
|
+
return nil unless attributes.is_a?(Hash)
|
207
|
+
attributes = attributes.transform_keys(&:to_sym)
|
208
|
+
self.class.openapi_types.each_pair do |key, type|
|
209
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
210
|
+
self.send("#{key}=", nil)
|
211
|
+
elsif type =~ /\AArray<(.*)>/i
|
212
|
+
# check to ensure the input is an array given that the attribute
|
213
|
+
# is documented as an array but the input is not
|
214
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
215
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
216
|
+
end
|
217
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
218
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
self
|
223
|
+
end
|
224
|
+
|
225
|
+
# Deserializes the data based on type
|
226
|
+
# @param string type Data type
|
227
|
+
# @param string value Value to be deserialized
|
228
|
+
# @return [Object] Deserialized data
|
229
|
+
def _deserialize(type, value)
|
230
|
+
case type.to_sym
|
231
|
+
when :Time
|
232
|
+
Time.parse(value)
|
233
|
+
when :Date
|
234
|
+
Date.parse(value)
|
235
|
+
when :String
|
236
|
+
value.to_s
|
237
|
+
when :Integer
|
238
|
+
value.to_i
|
239
|
+
when :Float
|
240
|
+
value.to_f
|
241
|
+
when :Boolean
|
242
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
243
|
+
true
|
244
|
+
else
|
245
|
+
false
|
246
|
+
end
|
247
|
+
when :Object
|
248
|
+
# generic object (usually a Hash), return directly
|
249
|
+
value
|
250
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
251
|
+
inner_type = Regexp.last_match[:inner_type]
|
252
|
+
value.map { |v| _deserialize(inner_type, v) }
|
253
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
254
|
+
k_type = Regexp.last_match[:k_type]
|
255
|
+
v_type = Regexp.last_match[:v_type]
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each do |k, v|
|
258
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
else # model
|
262
|
+
# models (e.g. Pet) or oneOf
|
263
|
+
klass = Carbon.const_get(type)
|
264
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
# Returns the string representation of the object
|
269
|
+
# @return [String] String presentation of the object
|
270
|
+
def to_s
|
271
|
+
to_hash.to_s
|
272
|
+
end
|
273
|
+
|
274
|
+
# to_body is an alias to to_hash (backward compatibility)
|
275
|
+
# @return [Hash] Returns the object in the form of hash
|
276
|
+
def to_body
|
277
|
+
to_hash
|
278
|
+
end
|
279
|
+
|
280
|
+
# Returns the object in the form of hash
|
281
|
+
# @return [Hash] Returns the object in the form of hash
|
282
|
+
def to_hash
|
283
|
+
hash = {}
|
284
|
+
self.class.attribute_map.each_pair do |attr, param|
|
285
|
+
value = self.send(attr)
|
286
|
+
if value.nil?
|
287
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
288
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
289
|
+
end
|
290
|
+
|
291
|
+
hash[param] = _to_hash(value)
|
292
|
+
end
|
293
|
+
hash
|
294
|
+
end
|
295
|
+
|
296
|
+
# Outputs non-array value in the form of hash
|
297
|
+
# For object, use to_hash. Otherwise, just return the value
|
298
|
+
# @param [Object] value Any valid value
|
299
|
+
# @return [Hash] Returns the value in the form of hash
|
300
|
+
def _to_hash(value)
|
301
|
+
if value.is_a?(Array)
|
302
|
+
value.compact.map { |v| _to_hash(v) }
|
303
|
+
elsif value.is_a?(Hash)
|
304
|
+
{}.tap do |hash|
|
305
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
306
|
+
end
|
307
|
+
elsif value.respond_to? :to_hash
|
308
|
+
value.to_hash
|
309
|
+
else
|
310
|
+
value
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
end
|
315
|
+
|
316
|
+
end
|
@@ -0,0 +1,220 @@
|
|
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 GenericSuccessResponse
|
14
|
+
attr_accessor :success
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:'success' => :'success'
|
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
|
+
:'success' => :'Boolean'
|
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::GenericSuccessResponse` 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::GenericSuccessResponse`. 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?(:'success')
|
57
|
+
self.success = attributes[:'success']
|
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
|
+
if @success.nil?
|
66
|
+
invalid_properties.push('invalid value for "success", success cannot be nil.')
|
67
|
+
end
|
68
|
+
|
69
|
+
invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
return false if @success.nil?
|
76
|
+
true
|
77
|
+
end
|
78
|
+
|
79
|
+
# Checks equality by comparing each attribute.
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def ==(o)
|
82
|
+
return true if self.equal?(o)
|
83
|
+
self.class == o.class &&
|
84
|
+
success == o.success
|
85
|
+
end
|
86
|
+
|
87
|
+
# @see the `==` method
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def eql?(o)
|
90
|
+
self == o
|
91
|
+
end
|
92
|
+
|
93
|
+
# Calculates hash code according to all attributes.
|
94
|
+
# @return [Integer] Hash code
|
95
|
+
def hash
|
96
|
+
[success].hash
|
97
|
+
end
|
98
|
+
|
99
|
+
# Builds the object from hash
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
# @return [Object] Returns the model itself
|
102
|
+
def self.build_from_hash(attributes)
|
103
|
+
new.build_from_hash(attributes)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
attributes = attributes.transform_keys(&:to_sym)
|
112
|
+
self.class.openapi_types.each_pair do |key, type|
|
113
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
114
|
+
self.send("#{key}=", nil)
|
115
|
+
elsif type =~ /\AArray<(.*)>/i
|
116
|
+
# check to ensure the input is an array given that the attribute
|
117
|
+
# is documented as an array but the input is not
|
118
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
119
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
120
|
+
end
|
121
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
122
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Deserializes the data based on type
|
130
|
+
# @param string type Data type
|
131
|
+
# @param string value Value to be deserialized
|
132
|
+
# @return [Object] Deserialized data
|
133
|
+
def _deserialize(type, value)
|
134
|
+
case type.to_sym
|
135
|
+
when :Time
|
136
|
+
Time.parse(value)
|
137
|
+
when :Date
|
138
|
+
Date.parse(value)
|
139
|
+
when :String
|
140
|
+
value.to_s
|
141
|
+
when :Integer
|
142
|
+
value.to_i
|
143
|
+
when :Float
|
144
|
+
value.to_f
|
145
|
+
when :Boolean
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
147
|
+
true
|
148
|
+
else
|
149
|
+
false
|
150
|
+
end
|
151
|
+
when :Object
|
152
|
+
# generic object (usually a Hash), return directly
|
153
|
+
value
|
154
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
155
|
+
inner_type = Regexp.last_match[:inner_type]
|
156
|
+
value.map { |v| _deserialize(inner_type, v) }
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
158
|
+
k_type = Regexp.last_match[:k_type]
|
159
|
+
v_type = Regexp.last_match[:v_type]
|
160
|
+
{}.tap do |hash|
|
161
|
+
value.each do |k, v|
|
162
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
else # model
|
166
|
+
# models (e.g. Pet) or oneOf
|
167
|
+
klass = Carbon.const_get(type)
|
168
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the string representation of the object
|
173
|
+
# @return [String] String presentation of the object
|
174
|
+
def to_s
|
175
|
+
to_hash.to_s
|
176
|
+
end
|
177
|
+
|
178
|
+
# to_body is an alias to to_hash (backward compatibility)
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_body
|
181
|
+
to_hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the object in the form of hash
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_hash
|
187
|
+
hash = {}
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
189
|
+
value = self.send(attr)
|
190
|
+
if value.nil?
|
191
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
192
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
193
|
+
end
|
194
|
+
|
195
|
+
hash[param] = _to_hash(value)
|
196
|
+
end
|
197
|
+
hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Outputs non-array value in the form of hash
|
201
|
+
# For object, use to_hash. Otherwise, just return the value
|
202
|
+
# @param [Object] value Any valid value
|
203
|
+
# @return [Hash] Returns the value in the form of hash
|
204
|
+
def _to_hash(value)
|
205
|
+
if value.is_a?(Array)
|
206
|
+
value.compact.map { |v| _to_hash(v) }
|
207
|
+
elsif value.is_a?(Hash)
|
208
|
+
{}.tap do |hash|
|
209
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
210
|
+
end
|
211
|
+
elsif value.respond_to? :to_hash
|
212
|
+
value.to_hash
|
213
|
+
else
|
214
|
+
value
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|