trieve_ruby_client 0.5.7 → 0.6.0
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.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/docs/AddChunkToGroupData.md +4 -2
- data/docs/AuthApi.md +12 -6
- data/docs/ChunkGroup.md +4 -0
- data/docs/ChunkGroupApi.md +13 -13
- data/docs/CreateChunkGroupData.md +4 -0
- data/docs/DatasetApi.md +6 -6
- data/docs/EventsApi.md +1 -1
- data/docs/FileApi.md +2 -2
- data/docs/RecommendChunksRequest.md +3 -1
- data/docs/RecommendGroupChunksRequest.md +34 -0
- data/docs/SearchChunkData.md +1 -3
- data/docs/SearchOverGroupsData.md +3 -5
- data/docs/SearchWithinGroupData.md +1 -3
- data/docs/UpdateChunkGroupData.md +4 -0
- data/docs/UpdateGroupByTrackingIDData.md +4 -0
- data/lib/trieve_ruby_client/api/auth_api.rb +13 -11
- data/lib/trieve_ruby_client/api/chunk_api.rb +1 -1
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +18 -18
- data/lib/trieve_ruby_client/api/dataset_api.rb +10 -10
- data/lib/trieve_ruby_client/api/events_api.rb +3 -3
- data/lib/trieve_ruby_client/api/file_api.rb +5 -5
- data/lib/trieve_ruby_client/api/health_api.rb +1 -1
- data/lib/trieve_ruby_client/api/invitation_api.rb +1 -1
- data/lib/trieve_ruby_client/api/message_api.rb +1 -1
- data/lib/trieve_ruby_client/api/organization_api.rb +1 -1
- data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
- data/lib/trieve_ruby_client/api/topic_api.rb +1 -1
- data/lib/trieve_ruby_client/api/user_api.rb +1 -1
- data/lib/trieve_ruby_client/api_client.rb +1 -1
- data/lib/trieve_ruby_client/api_error.rb +1 -1
- data/lib/trieve_ruby_client/configuration.rb +1 -1
- data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +17 -12
- data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
- data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
- data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
- data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
- data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_filter.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_group.rb +22 -2
- data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_metadata.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_metadata_with_file_data.rb +1 -1
- data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +1 -1
- data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +26 -2
- data/lib/trieve_ruby_client/models/create_dataset_request.rb +1 -1
- data/lib/trieve_ruby_client/models/create_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
- data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
- data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
- data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/event.rb +1 -1
- data/lib/trieve_ruby_client/models/event_return.rb +1 -1
- data/lib/trieve_ruby_client/models/field_condition.rb +1 -1
- data/lib/trieve_ruby_client/models/file.rb +1 -1
- data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/generate_chunks_request.rb +1 -1
- data/lib/trieve_ruby_client/models/get_events_data.rb +1 -1
- data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
- data/lib/trieve_ruby_client/models/group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/group_score_chunk_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/group_slim_chunks_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
- data/lib/trieve_ruby_client/models/match_condition.rb +1 -1
- data/lib/trieve_ruby_client/models/message.rb +1 -1
- data/lib/trieve_ruby_client/models/organization.rb +1 -1
- data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
- data/lib/trieve_ruby_client/models/range.rb +1 -1
- data/lib/trieve_ruby_client/models/range_condition.rb +1 -1
- data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +17 -6
- data/lib/trieve_ruby_client/models/recommend_chunks_response_types.rb +1 -1
- data/lib/trieve_ruby_client/models/recommend_group_chunk_response_types.rb +1 -1
- data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +341 -0
- data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
- data/lib/trieve_ruby_client/models/score_chunk_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_data.rb +3 -14
- data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_response_types.rb +1 -1
- data/lib/trieve_ruby_client/models/search_group_slim_chunks_result.rb +1 -1
- data/lib/trieve_ruby_client/models/search_groups_result.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_data.rb +5 -15
- data/lib/trieve_ruby_client/models/search_over_groups_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_response_types.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_slim_chunks_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_within_group_data.rb +3 -14
- data/lib/trieve_ruby_client/models/search_within_group_response_types.rb +1 -1
- data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +1 -1
- data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
- data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
- data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +1 -1
- data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
- data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
- data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
- data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
- data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
- data/lib/trieve_ruby_client/models/topic.rb +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +26 -2
- data/lib/trieve_ruby_client/models/update_dataset_request.rb +1 -1
- data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +26 -2
- data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_user_data.rb +1 -1
- data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
- data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
- data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
- data/lib/trieve_ruby_client/version.rb +2 -2
- data/lib/trieve_ruby_client.rb +2 -2
- data/openapi-generator.yaml +1 -1
- data/openapi.json +176 -177
- data/spec/models/recommend_group_chunks_request_spec.rb +84 -0
- data/spec/spec_helper.rb +1 -1
- data/trieve_ruby_client-0.5.7.gem +0 -0
- data/trieve_ruby_client.gemspec +1 -1
- metadata +7 -2
@@ -0,0 +1,341 @@
|
|
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.0
|
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 RecommendGroupChunksRequest
|
18
|
+
attr_accessor :filters
|
19
|
+
|
20
|
+
# The number of chunks to fetch for each group. This is the number of chunks which will be returned in the response for each group. The default is 3. If this is set to a large number, we recommend setting slim_chunks to true to avoid returning the content and chunk_html of the chunks so as to reduce latency due to content download and serialization.
|
21
|
+
attr_accessor :group_size
|
22
|
+
|
23
|
+
# The number of groups to return. This is the number of groups which will be returned in the response. The default is 10.
|
24
|
+
attr_accessor :limit
|
25
|
+
|
26
|
+
# The ids of the groups to be used as negative examples for the recommendation. The groups in this array will be used to filter out similar groups.
|
27
|
+
attr_accessor :negative_group_ids
|
28
|
+
|
29
|
+
# The ids of the groups to be used as negative examples for the recommendation. The groups in this array will be used to filter out similar groups.
|
30
|
+
attr_accessor :negative_group_tracking_ids
|
31
|
+
|
32
|
+
# The ids of the groups to be used as positive examples for the recommendation. The groups in this array will be used to find similar groups.
|
33
|
+
attr_accessor :positive_group_ids
|
34
|
+
|
35
|
+
# The ids of the groups to be used as positive examples for the recommendation. The groups in this array will be used to find similar groups.
|
36
|
+
attr_accessor :positive_group_tracking_ids
|
37
|
+
|
38
|
+
# Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement. Default is false.
|
39
|
+
attr_accessor :slim_chunks
|
40
|
+
|
41
|
+
# Strategy to use for recommendations, either \"average_vector\" or \"best_score\". The default is \"average_vector\". The \"average_vector\" strategy will construct a single average vector from the positive and negative samples then use it to perform a pseudo-search. The \"best_score\" strategy is more advanced and navigates the HNSW with a heuristic of picking edges where the point is closer to the positive samples than it is the negatives.
|
42
|
+
attr_accessor :strategy
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'filters' => :'filters',
|
48
|
+
:'group_size' => :'group_size',
|
49
|
+
:'limit' => :'limit',
|
50
|
+
:'negative_group_ids' => :'negative_group_ids',
|
51
|
+
:'negative_group_tracking_ids' => :'negative_group_tracking_ids',
|
52
|
+
:'positive_group_ids' => :'positive_group_ids',
|
53
|
+
:'positive_group_tracking_ids' => :'positive_group_tracking_ids',
|
54
|
+
:'slim_chunks' => :'slim_chunks',
|
55
|
+
:'strategy' => :'strategy'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Returns all the JSON keys this model knows about
|
60
|
+
def self.acceptable_attributes
|
61
|
+
attribute_map.values
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute type mapping.
|
65
|
+
def self.openapi_types
|
66
|
+
{
|
67
|
+
:'filters' => :'ChunkFilter',
|
68
|
+
:'group_size' => :'Integer',
|
69
|
+
:'limit' => :'Integer',
|
70
|
+
:'negative_group_ids' => :'Array<String>',
|
71
|
+
:'negative_group_tracking_ids' => :'Array<String>',
|
72
|
+
:'positive_group_ids' => :'Array<String>',
|
73
|
+
:'positive_group_tracking_ids' => :'Array<String>',
|
74
|
+
:'slim_chunks' => :'Boolean',
|
75
|
+
:'strategy' => :'String'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# List of attributes with nullable: true
|
80
|
+
def self.openapi_nullable
|
81
|
+
Set.new([
|
82
|
+
:'filters',
|
83
|
+
:'group_size',
|
84
|
+
:'limit',
|
85
|
+
:'negative_group_ids',
|
86
|
+
:'negative_group_tracking_ids',
|
87
|
+
:'positive_group_ids',
|
88
|
+
:'positive_group_tracking_ids',
|
89
|
+
:'slim_chunks',
|
90
|
+
:'strategy'
|
91
|
+
])
|
92
|
+
end
|
93
|
+
|
94
|
+
# Initializes the object
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
def initialize(attributes = {})
|
97
|
+
if (!attributes.is_a?(Hash))
|
98
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::RecommendGroupChunksRequest` initialize method"
|
99
|
+
end
|
100
|
+
|
101
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
102
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
103
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::RecommendGroupChunksRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
105
|
+
end
|
106
|
+
h[k.to_sym] = v
|
107
|
+
}
|
108
|
+
|
109
|
+
if attributes.key?(:'filters')
|
110
|
+
self.filters = attributes[:'filters']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'group_size')
|
114
|
+
self.group_size = attributes[:'group_size']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'limit')
|
118
|
+
self.limit = attributes[:'limit']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'negative_group_ids')
|
122
|
+
if (value = attributes[:'negative_group_ids']).is_a?(Array)
|
123
|
+
self.negative_group_ids = value
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'negative_group_tracking_ids')
|
128
|
+
if (value = attributes[:'negative_group_tracking_ids']).is_a?(Array)
|
129
|
+
self.negative_group_tracking_ids = value
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'positive_group_ids')
|
134
|
+
if (value = attributes[:'positive_group_ids']).is_a?(Array)
|
135
|
+
self.positive_group_ids = value
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'positive_group_tracking_ids')
|
140
|
+
if (value = attributes[:'positive_group_tracking_ids']).is_a?(Array)
|
141
|
+
self.positive_group_tracking_ids = value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'slim_chunks')
|
146
|
+
self.slim_chunks = attributes[:'slim_chunks']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.key?(:'strategy')
|
150
|
+
self.strategy = attributes[:'strategy']
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
155
|
+
# @return Array for valid properties with the reasons
|
156
|
+
def list_invalid_properties
|
157
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
158
|
+
invalid_properties = Array.new
|
159
|
+
if !@group_size.nil? && @group_size < 0
|
160
|
+
invalid_properties.push('invalid value for "group_size", must be greater than or equal to 0.')
|
161
|
+
end
|
162
|
+
|
163
|
+
if !@limit.nil? && @limit < 0
|
164
|
+
invalid_properties.push('invalid value for "limit", must be greater than or equal to 0.')
|
165
|
+
end
|
166
|
+
|
167
|
+
invalid_properties
|
168
|
+
end
|
169
|
+
|
170
|
+
# Check to see if the all the properties in the model are valid
|
171
|
+
# @return true if the model is valid
|
172
|
+
def valid?
|
173
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
174
|
+
return false if !@group_size.nil? && @group_size < 0
|
175
|
+
return false if !@limit.nil? && @limit < 0
|
176
|
+
true
|
177
|
+
end
|
178
|
+
|
179
|
+
# Custom attribute writer method with validation
|
180
|
+
# @param [Object] group_size Value to be assigned
|
181
|
+
def group_size=(group_size)
|
182
|
+
if !group_size.nil? && group_size < 0
|
183
|
+
fail ArgumentError, 'invalid value for "group_size", must be greater than or equal to 0.'
|
184
|
+
end
|
185
|
+
|
186
|
+
@group_size = group_size
|
187
|
+
end
|
188
|
+
|
189
|
+
# Custom attribute writer method with validation
|
190
|
+
# @param [Object] limit Value to be assigned
|
191
|
+
def limit=(limit)
|
192
|
+
if !limit.nil? && limit < 0
|
193
|
+
fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 0.'
|
194
|
+
end
|
195
|
+
|
196
|
+
@limit = limit
|
197
|
+
end
|
198
|
+
|
199
|
+
# Checks equality by comparing each attribute.
|
200
|
+
# @param [Object] Object to be compared
|
201
|
+
def ==(o)
|
202
|
+
return true if self.equal?(o)
|
203
|
+
self.class == o.class &&
|
204
|
+
filters == o.filters &&
|
205
|
+
group_size == o.group_size &&
|
206
|
+
limit == o.limit &&
|
207
|
+
negative_group_ids == o.negative_group_ids &&
|
208
|
+
negative_group_tracking_ids == o.negative_group_tracking_ids &&
|
209
|
+
positive_group_ids == o.positive_group_ids &&
|
210
|
+
positive_group_tracking_ids == o.positive_group_tracking_ids &&
|
211
|
+
slim_chunks == o.slim_chunks &&
|
212
|
+
strategy == o.strategy
|
213
|
+
end
|
214
|
+
|
215
|
+
# @see the `==` method
|
216
|
+
# @param [Object] Object to be compared
|
217
|
+
def eql?(o)
|
218
|
+
self == o
|
219
|
+
end
|
220
|
+
|
221
|
+
# Calculates hash code according to all attributes.
|
222
|
+
# @return [Integer] Hash code
|
223
|
+
def hash
|
224
|
+
[filters, group_size, limit, negative_group_ids, negative_group_tracking_ids, positive_group_ids, positive_group_tracking_ids, slim_chunks, strategy].hash
|
225
|
+
end
|
226
|
+
|
227
|
+
# Builds the object from hash
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
229
|
+
# @return [Object] Returns the model itself
|
230
|
+
def self.build_from_hash(attributes)
|
231
|
+
return nil unless attributes.is_a?(Hash)
|
232
|
+
attributes = attributes.transform_keys(&:to_sym)
|
233
|
+
transformed_hash = {}
|
234
|
+
openapi_types.each_pair do |key, type|
|
235
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
236
|
+
transformed_hash["#{key}"] = nil
|
237
|
+
elsif type =~ /\AArray<(.*)>/i
|
238
|
+
# check to ensure the input is an array given that the attribute
|
239
|
+
# is documented as an array but the input is not
|
240
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
241
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
242
|
+
end
|
243
|
+
elsif !attributes[attribute_map[key]].nil?
|
244
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
245
|
+
end
|
246
|
+
end
|
247
|
+
new(transformed_hash)
|
248
|
+
end
|
249
|
+
|
250
|
+
# Deserializes the data based on type
|
251
|
+
# @param string type Data type
|
252
|
+
# @param string value Value to be deserialized
|
253
|
+
# @return [Object] Deserialized data
|
254
|
+
def self._deserialize(type, value)
|
255
|
+
case type.to_sym
|
256
|
+
when :Time
|
257
|
+
Time.parse(value)
|
258
|
+
when :Date
|
259
|
+
Date.parse(value)
|
260
|
+
when :String
|
261
|
+
value.to_s
|
262
|
+
when :Integer
|
263
|
+
value.to_i
|
264
|
+
when :Float
|
265
|
+
value.to_f
|
266
|
+
when :Boolean
|
267
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
268
|
+
true
|
269
|
+
else
|
270
|
+
false
|
271
|
+
end
|
272
|
+
when :Object
|
273
|
+
# generic object (usually a Hash), return directly
|
274
|
+
value
|
275
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
276
|
+
inner_type = Regexp.last_match[:inner_type]
|
277
|
+
value.map { |v| _deserialize(inner_type, v) }
|
278
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
279
|
+
k_type = Regexp.last_match[:k_type]
|
280
|
+
v_type = Regexp.last_match[:v_type]
|
281
|
+
{}.tap do |hash|
|
282
|
+
value.each do |k, v|
|
283
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
284
|
+
end
|
285
|
+
end
|
286
|
+
else # model
|
287
|
+
# models (e.g. Pet) or oneOf
|
288
|
+
klass = TrieveRubyClient.const_get(type)
|
289
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
# Returns the string representation of the object
|
294
|
+
# @return [String] String presentation of the object
|
295
|
+
def to_s
|
296
|
+
to_hash.to_s
|
297
|
+
end
|
298
|
+
|
299
|
+
# to_body is an alias to to_hash (backward compatibility)
|
300
|
+
# @return [Hash] Returns the object in the form of hash
|
301
|
+
def to_body
|
302
|
+
to_hash
|
303
|
+
end
|
304
|
+
|
305
|
+
# Returns the object in the form of hash
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
307
|
+
def to_hash
|
308
|
+
hash = {}
|
309
|
+
self.class.attribute_map.each_pair do |attr, param|
|
310
|
+
value = self.send(attr)
|
311
|
+
if value.nil?
|
312
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
313
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
314
|
+
end
|
315
|
+
|
316
|
+
hash[param] = _to_hash(value)
|
317
|
+
end
|
318
|
+
hash
|
319
|
+
end
|
320
|
+
|
321
|
+
# Outputs non-array value in the form of hash
|
322
|
+
# For object, use to_hash. Otherwise, just return the value
|
323
|
+
# @param [Object] value Any valid value
|
324
|
+
# @return [Hash] Returns the value in the form of hash
|
325
|
+
def _to_hash(value)
|
326
|
+
if value.is_a?(Array)
|
327
|
+
value.compact.map { |v| _to_hash(v) }
|
328
|
+
elsif value.is_a?(Hash)
|
329
|
+
{}.tap do |hash|
|
330
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
331
|
+
end
|
332
|
+
elsif value.respond_to? :to_hash
|
333
|
+
value.to_hash
|
334
|
+
else
|
335
|
+
value
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
end
|
340
|
+
|
341
|
+
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -29,7 +29,7 @@ module TrieveRubyClient
|
|
29
29
|
# Set highlight_results to true to highlight the results. If not specified, this defaults to true.
|
30
30
|
attr_accessor :highlight_results
|
31
31
|
|
32
|
-
# Page of chunks to fetch.
|
32
|
+
# Page of chunks to fetch. Page is 1-indexed.
|
33
33
|
attr_accessor :page
|
34
34
|
|
35
35
|
# Page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time.
|
@@ -38,9 +38,6 @@ module TrieveRubyClient
|
|
38
38
|
# Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set.
|
39
39
|
attr_accessor :query
|
40
40
|
|
41
|
-
# Turn on quote words and negated words to search for exact phrases and exclude words from the search results. Default is false.
|
42
|
-
attr_accessor :quote_negated_words
|
43
|
-
|
44
41
|
# Set score_threshold to a float to filter out chunks with a score below the threshold.
|
45
42
|
attr_accessor :score_threshold
|
46
43
|
|
@@ -64,7 +61,6 @@ module TrieveRubyClient
|
|
64
61
|
:'page' => :'page',
|
65
62
|
:'page_size' => :'page_size',
|
66
63
|
:'query' => :'query',
|
67
|
-
:'quote_negated_words' => :'quote_negated_words',
|
68
64
|
:'score_threshold' => :'score_threshold',
|
69
65
|
:'search_type' => :'search_type',
|
70
66
|
:'slim_chunks' => :'slim_chunks',
|
@@ -88,7 +84,6 @@ module TrieveRubyClient
|
|
88
84
|
:'page' => :'Integer',
|
89
85
|
:'page_size' => :'Integer',
|
90
86
|
:'query' => :'String',
|
91
|
-
:'quote_negated_words' => :'Boolean',
|
92
87
|
:'score_threshold' => :'Float',
|
93
88
|
:'search_type' => :'String',
|
94
89
|
:'slim_chunks' => :'Boolean',
|
@@ -106,7 +101,6 @@ module TrieveRubyClient
|
|
106
101
|
:'highlight_results',
|
107
102
|
:'page',
|
108
103
|
:'page_size',
|
109
|
-
:'quote_negated_words',
|
110
104
|
:'score_threshold',
|
111
105
|
:'slim_chunks',
|
112
106
|
:'use_weights'
|
@@ -164,10 +158,6 @@ module TrieveRubyClient
|
|
164
158
|
self.query = nil
|
165
159
|
end
|
166
160
|
|
167
|
-
if attributes.key?(:'quote_negated_words')
|
168
|
-
self.quote_negated_words = attributes[:'quote_negated_words']
|
169
|
-
end
|
170
|
-
|
171
161
|
if attributes.key?(:'score_threshold')
|
172
162
|
self.score_threshold = attributes[:'score_threshold']
|
173
163
|
end
|
@@ -255,7 +245,6 @@ module TrieveRubyClient
|
|
255
245
|
page == o.page &&
|
256
246
|
page_size == o.page_size &&
|
257
247
|
query == o.query &&
|
258
|
-
quote_negated_words == o.quote_negated_words &&
|
259
248
|
score_threshold == o.score_threshold &&
|
260
249
|
search_type == o.search_type &&
|
261
250
|
slim_chunks == o.slim_chunks &&
|
@@ -271,7 +260,7 @@ module TrieveRubyClient
|
|
271
260
|
# Calculates hash code according to all attributes.
|
272
261
|
# @return [Integer] Hash code
|
273
262
|
def hash
|
274
|
-
[date_bias, filters, get_collisions, highlight_delimiters, highlight_results, page, page_size, query,
|
263
|
+
[date_bias, filters, get_collisions, highlight_delimiters, highlight_results, page, page_size, query, score_threshold, search_type, slim_chunks, use_weights].hash
|
275
264
|
end
|
276
265
|
|
277
266
|
# Builds the object from hash
|
@@ -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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -20,6 +20,7 @@ module TrieveRubyClient
|
|
20
20
|
# Set get_collisions to true to get the collisions for each chunk. This will only apply if environment variable COLLISIONS_ENABLED is set to true.
|
21
21
|
attr_accessor :get_collisions
|
22
22
|
|
23
|
+
# Group_size is the number of chunks to fetch for each group. The default is 3. If a group has less than group_size chunks, all chunks will be returned. If this is set to a large number, we recommend setting slim_chunks to true to avoid returning the content and chunk_html of the chunks so as to lower the amount of time required for content download and serialization.
|
23
24
|
attr_accessor :group_size
|
24
25
|
|
25
26
|
# Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"].
|
@@ -28,18 +29,15 @@ module TrieveRubyClient
|
|
28
29
|
# Set highlight_results to true to highlight the results. If not specified, this defaults to true.
|
29
30
|
attr_accessor :highlight_results
|
30
31
|
|
31
|
-
# Page of
|
32
|
+
# Page of group results to fetch. Page is 1-indexed.
|
32
33
|
attr_accessor :page
|
33
34
|
|
34
|
-
# Page size is the number of
|
35
|
+
# Page size is the number of group results to fetch. The default is 10.
|
35
36
|
attr_accessor :page_size
|
36
37
|
|
37
38
|
# Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set.
|
38
39
|
attr_accessor :query
|
39
40
|
|
40
|
-
# Turn on quote words and negated words to search for exact phrases and exclude words from the search results. Default is false.
|
41
|
-
attr_accessor :quote_negated_words
|
42
|
-
|
43
41
|
# Set score_threshold to a float to filter out chunks with a score below the threshold.
|
44
42
|
attr_accessor :score_threshold
|
45
43
|
|
@@ -60,7 +58,6 @@ module TrieveRubyClient
|
|
60
58
|
:'page' => :'page',
|
61
59
|
:'page_size' => :'page_size',
|
62
60
|
:'query' => :'query',
|
63
|
-
:'quote_negated_words' => :'quote_negated_words',
|
64
61
|
:'score_threshold' => :'score_threshold',
|
65
62
|
:'search_type' => :'search_type',
|
66
63
|
:'slim_chunks' => :'slim_chunks'
|
@@ -83,7 +80,6 @@ module TrieveRubyClient
|
|
83
80
|
:'page' => :'Integer',
|
84
81
|
:'page_size' => :'Integer',
|
85
82
|
:'query' => :'String',
|
86
|
-
:'quote_negated_words' => :'Boolean',
|
87
83
|
:'score_threshold' => :'Float',
|
88
84
|
:'search_type' => :'String',
|
89
85
|
:'slim_chunks' => :'Boolean'
|
@@ -100,7 +96,6 @@ module TrieveRubyClient
|
|
100
96
|
:'highlight_results',
|
101
97
|
:'page',
|
102
98
|
:'page_size',
|
103
|
-
:'quote_negated_words',
|
104
99
|
:'score_threshold',
|
105
100
|
:'slim_chunks'
|
106
101
|
])
|
@@ -157,10 +152,6 @@ module TrieveRubyClient
|
|
157
152
|
self.query = nil
|
158
153
|
end
|
159
154
|
|
160
|
-
if attributes.key?(:'quote_negated_words')
|
161
|
-
self.quote_negated_words = attributes[:'quote_negated_words']
|
162
|
-
end
|
163
|
-
|
164
155
|
if attributes.key?(:'score_threshold')
|
165
156
|
self.score_threshold = attributes[:'score_threshold']
|
166
157
|
end
|
@@ -259,7 +250,6 @@ module TrieveRubyClient
|
|
259
250
|
page == o.page &&
|
260
251
|
page_size == o.page_size &&
|
261
252
|
query == o.query &&
|
262
|
-
quote_negated_words == o.quote_negated_words &&
|
263
253
|
score_threshold == o.score_threshold &&
|
264
254
|
search_type == o.search_type &&
|
265
255
|
slim_chunks == o.slim_chunks
|
@@ -274,7 +264,7 @@ module TrieveRubyClient
|
|
274
264
|
# Calculates hash code according to all attributes.
|
275
265
|
# @return [Integer] Hash code
|
276
266
|
def hash
|
277
|
-
[filters, get_collisions, group_size, highlight_delimiters, highlight_results, page, page_size, query,
|
267
|
+
[filters, get_collisions, group_size, highlight_delimiters, highlight_results, page, page_size, query, score_threshold, search_type, slim_chunks].hash
|
278
268
|
end
|
279
269
|
|
280
270
|
# Builds the object from hash
|
@@ -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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
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
|
+
The version of the OpenAPI document: 0.6.0
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|