trieve_ruby_client 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -19
  3. data/docs/BookmarkData.md +1 -1
  4. data/docs/ChunkApi.md +8 -8
  5. data/docs/ChunkGroupApi.md +14 -14
  6. data/docs/ChunkMetadataWithScore.md +44 -0
  7. data/docs/CreateChunkGroupData.md +1 -1
  8. data/docs/GetEventsData.md +1 -1
  9. data/docs/GroupScoreChunk.md +22 -0
  10. data/docs/GroupScoreSlimChunks.md +20 -0
  11. data/docs/ScoreChunkDTO.md +1 -1
  12. data/docs/SearchOverGroupsResults.md +20 -0
  13. data/docs/SearchOverGroupsSlimResults.md +20 -0
  14. data/docs/SearchWithinGroupResults.md +22 -0
  15. data/docs/SearchWithinGroupSlimResults.md +22 -0
  16. data/docs/SlimChunkMetadataWithScore.md +38 -0
  17. data/docs/UserApi.md +2 -2
  18. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  19. data/lib/trieve_ruby_client/api/chunk_api.rb +7 -7
  20. data/lib/trieve_ruby_client/api/chunk_group_api.rb +10 -10
  21. data/lib/trieve_ruby_client/api/dataset_api.rb +1 -1
  22. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  23. data/lib/trieve_ruby_client/api/file_api.rb +1 -1
  24. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  25. data/lib/trieve_ruby_client/api/invitation_api.rb +1 -1
  26. data/lib/trieve_ruby_client/api/message_api.rb +1 -1
  27. data/lib/trieve_ruby_client/api/organization_api.rb +1 -1
  28. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  29. data/lib/trieve_ruby_client/api/topic_api.rb +1 -1
  30. data/lib/trieve_ruby_client/api/user_api.rb +3 -3
  31. data/lib/trieve_ruby_client/api_client.rb +1 -1
  32. data/lib/trieve_ruby_client/api_error.rb +1 -1
  33. data/lib/trieve_ruby_client/configuration.rb +1 -1
  34. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
  35. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  36. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  37. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  38. data/lib/trieve_ruby_client/models/bookmark_data.rb +2 -2
  39. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  40. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  41. data/lib/trieve_ruby_client/models/chunk_data.rb +1 -1
  42. data/lib/trieve_ruby_client/models/chunk_filter.rb +1 -1
  43. data/lib/trieve_ruby_client/models/chunk_group.rb +1 -1
  44. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  45. data/lib/trieve_ruby_client/models/chunk_metadata.rb +1 -1
  46. data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +387 -0
  47. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +1 -1
  48. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  49. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +2 -8
  50. data/lib/trieve_ruby_client/models/create_dataset_request.rb +1 -1
  51. data/lib/trieve_ruby_client/models/create_message_data.rb +1 -1
  52. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  53. data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
  54. data/lib/trieve_ruby_client/models/dataset.rb +1 -1
  55. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  56. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  57. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  58. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  59. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  60. data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
  61. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  62. data/lib/trieve_ruby_client/models/event.rb +1 -1
  63. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  64. data/lib/trieve_ruby_client/models/field_condition.rb +1 -1
  65. data/lib/trieve_ruby_client/models/file.rb +1 -1
  66. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  67. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +1 -1
  68. data/lib/trieve_ruby_client/models/get_events_data.rb +2 -2
  69. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  70. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  71. data/lib/trieve_ruby_client/models/group_score_chunk.rb +249 -0
  72. data/lib/trieve_ruby_client/models/group_score_slim_chunks.rb +239 -0
  73. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  74. data/lib/trieve_ruby_client/models/match_condition.rb +1 -1
  75. data/lib/trieve_ruby_client/models/message.rb +1 -1
  76. data/lib/trieve_ruby_client/models/organization.rb +1 -1
  77. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  78. data/lib/trieve_ruby_client/models/range.rb +1 -1
  79. data/lib/trieve_ruby_client/models/range_condition.rb +1 -1
  80. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +1 -1
  81. data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +1 -1
  82. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
  83. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  84. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +2 -2
  85. data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
  86. data/lib/trieve_ruby_client/models/search_chunk_data.rb +1 -1
  87. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  88. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +1 -1
  89. data/lib/trieve_ruby_client/models/search_over_groups_results.rb +239 -0
  90. data/lib/trieve_ruby_client/models/search_over_groups_slim_results.rb +239 -0
  91. data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +1 -1
  92. data/lib/trieve_ruby_client/models/search_within_group_data.rb +1 -1
  93. data/lib/trieve_ruby_client/models/search_within_group_results.rb +255 -0
  94. data/lib/trieve_ruby_client/models/search_within_group_slim_results.rb +255 -0
  95. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +1 -1
  96. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  97. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  98. data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +1 -1
  99. data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +345 -0
  100. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  101. data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
  102. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  103. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  104. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  105. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  106. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
  107. data/lib/trieve_ruby_client/models/update_chunk_data.rb +1 -1
  108. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  109. data/lib/trieve_ruby_client/models/update_dataset_request.rb +1 -1
  110. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  111. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  112. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  113. data/lib/trieve_ruby_client/models/update_user_data.rb +1 -1
  114. data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
  115. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  116. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  117. data/lib/trieve_ruby_client/version.rb +2 -2
  118. data/lib/trieve_ruby_client.rb +9 -13
  119. data/openapi-generator.yaml +1 -1
  120. data/openapi.json +253 -191
  121. data/spec/models/chunk_metadata_with_score_spec.rb +114 -0
  122. data/spec/models/group_score_chunk_spec.rb +48 -0
  123. data/spec/models/group_score_slim_chunks_spec.rb +42 -0
  124. data/spec/models/search_over_groups_results_spec.rb +42 -0
  125. data/spec/models/search_over_groups_slim_results_spec.rb +42 -0
  126. data/spec/models/search_within_group_results_spec.rb +48 -0
  127. data/spec/models/search_within_group_slim_results_spec.rb +48 -0
  128. data/spec/models/slim_chunk_metadata_with_score_spec.rb +96 -0
  129. data/spec/spec_helper.rb +1 -1
  130. data/trieve_ruby_client-0.6.0.gem +0 -0
  131. data/trieve_ruby_client.gemspec +1 -1
  132. metadata +35 -2
@@ -0,0 +1,249 @@
1
+ =begin
2
+ #Trieve API
3
+
4
+ #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
+
6
+ The version of the OpenAPI document: 0.6.2
7
+ Contact: developers@trieve.ai
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrieveRubyClient
17
+ class GroupScoreChunk
18
+ attr_accessor :group_id
19
+
20
+ attr_accessor :group_tracking_id
21
+
22
+ attr_accessor :metadata
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'group_id' => :'group_id',
28
+ :'group_tracking_id' => :'group_tracking_id',
29
+ :'metadata' => :'metadata'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'group_id' => :'String',
42
+ :'group_tracking_id' => :'String',
43
+ :'metadata' => :'Array<ScoreChunkDTO>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'group_tracking_id',
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::GroupScoreChunk` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::GroupScoreChunk`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'group_id')
70
+ self.group_id = attributes[:'group_id']
71
+ else
72
+ self.group_id = nil
73
+ end
74
+
75
+ if attributes.key?(:'group_tracking_id')
76
+ self.group_tracking_id = attributes[:'group_tracking_id']
77
+ end
78
+
79
+ if attributes.key?(:'metadata')
80
+ if (value = attributes[:'metadata']).is_a?(Array)
81
+ self.metadata = value
82
+ end
83
+ else
84
+ self.metadata = nil
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
+ invalid_properties = Array.new
93
+ if @group_id.nil?
94
+ invalid_properties.push('invalid value for "group_id", group_id cannot be nil.')
95
+ end
96
+
97
+ if @metadata.nil?
98
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ return false if @group_id.nil?
109
+ return false if @metadata.nil?
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ group_id == o.group_id &&
119
+ group_tracking_id == o.group_tracking_id &&
120
+ metadata == o.metadata
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [group_id, group_tracking_id, metadata].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def self._deserialize(type, value)
163
+ case type.to_sym
164
+ when :Time
165
+ Time.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :Boolean
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ # models (e.g. Pet) or oneOf
196
+ klass = TrieveRubyClient.const_get(type)
197
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+
247
+ end
248
+
249
+ end
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #Trieve API
3
+
4
+ #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
+
6
+ The version of the OpenAPI document: 0.6.2
7
+ Contact: developers@trieve.ai
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrieveRubyClient
17
+ class GroupScoreSlimChunks
18
+ attr_accessor :group_id
19
+
20
+ attr_accessor :metadata
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'group_id' => :'group_id',
26
+ :'metadata' => :'metadata'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'group_id' => :'String',
39
+ :'metadata' => :'Array<ScoreSlimChunks>'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::GroupScoreSlimChunks` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::GroupScoreSlimChunks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'group_id')
65
+ self.group_id = attributes[:'group_id']
66
+ else
67
+ self.group_id = nil
68
+ end
69
+
70
+ if attributes.key?(:'metadata')
71
+ if (value = attributes[:'metadata']).is_a?(Array)
72
+ self.metadata = value
73
+ end
74
+ else
75
+ self.metadata = nil
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ if @group_id.nil?
85
+ invalid_properties.push('invalid value for "group_id", group_id cannot be nil.')
86
+ end
87
+
88
+ if @metadata.nil?
89
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @group_id.nil?
100
+ return false if @metadata.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ group_id == o.group_id &&
110
+ metadata == o.metadata
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [group_id, metadata].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def self._deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = TrieveRubyClient.const_get(type)
187
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -35,7 +35,7 @@ module TrieveRubyClient
35
35
  # Attribute type mapping.
36
36
  def self.openapi_types
37
37
  {
38
- :'metadata' => :'Array<ChunkMetadataWithFileData>',
38
+ :'metadata' => :'Array<ChunkMetadata>',
39
39
  :'score' => :'Float'
40
40
  }
41
41
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.6.0
6
+ The version of the OpenAPI document: 0.6.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0