trieve_ruby_client 0.3.5 → 0.4.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 +78 -74
- data/docs/AuthApi.md +28 -34
- data/docs/AuthQuery.md +22 -0
- data/docs/BatchQueuedChunkResponse.md +20 -0
- data/docs/ChunkApi.md +69 -143
- data/docs/ChunkData.md +42 -0
- data/docs/ChunkGroupApi.md +169 -85
- data/docs/CreateChunkData.md +41 -34
- data/docs/DatasetApi.md +31 -31
- data/docs/EventsApi.md +13 -13
- data/docs/FileApi.md +21 -21
- data/docs/GetEventsData.md +22 -0
- data/docs/HealthApi.md +6 -4
- data/docs/InvitationApi.md +6 -6
- data/docs/MessageApi.md +21 -21
- data/docs/OrganizationApi.md +31 -31
- data/docs/ReturnQueuedChunk.md +39 -10
- data/docs/SingleQueuedChunkResponse.md +20 -0
- data/docs/StripeApi.md +21 -13
- data/docs/TopicApi.md +21 -21
- data/docs/UserApi.md +16 -16
- data/lib/trieve_ruby_client/api/auth_api.rb +27 -34
- data/lib/trieve_ruby_client/api/chunk_api.rb +57 -132
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +149 -61
- data/lib/trieve_ruby_client/api/dataset_api.rb +25 -25
- data/lib/trieve_ruby_client/api/events_api.rb +21 -16
- data/lib/trieve_ruby_client/api/file_api.rb +17 -17
- data/lib/trieve_ruby_client/api/health_api.rb +5 -1
- data/lib/trieve_ruby_client/api/invitation_api.rb +5 -5
- data/lib/trieve_ruby_client/api/message_api.rb +17 -17
- data/lib/trieve_ruby_client/api/organization_api.rb +25 -25
- data/lib/trieve_ruby_client/api/stripe_api.rb +17 -1
- data/lib/trieve_ruby_client/api/topic_api.rb +17 -17
- data/lib/trieve_ruby_client/api/user_api.rb +13 -13
- 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 +8 -4
- data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/auth_query.rb +238 -0
- data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +240 -0
- 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 +356 -0
- data/lib/trieve_ruby_client/models/chunk_filter.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_group.rb +1 -1
- 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 +79 -330
- data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
- 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_dataset_request.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 +240 -0
- 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/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/reccomend_group_chunks_request.rb +1 -1
- data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +1 -1
- data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/return_queued_chunk.rb +75 -207
- data/lib/trieve_ruby_client/models/score_chunk_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_query_response_body.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 +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_within_group_data.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 +238 -0
- 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 +1 -1
- 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 +1 -1
- 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 +6 -2
- data/openapi-generator.yaml +1 -1
- data/openapi.json +1233 -824
- data/spec/models/auth_query_spec.rb +48 -0
- data/spec/models/batch_queued_chunk_response_spec.rb +42 -0
- data/spec/models/chunk_data_spec.rb +108 -0
- data/spec/models/get_events_data_spec.rb +48 -0
- data/spec/models/single_queued_chunk_response_spec.rb +42 -0
- data/spec/spec_helper.rb +1 -1
- data/trieve_ruby_client-0.3.5.gem +0 -0
- data/trieve_ruby_client.gemspec +1 -1
- metadata +23 -4
- data/trieve_ruby_client-0.3.4.gem +0 -0
- data/trieve_ruby_client-0.3.41.gem +0 -0
@@ -0,0 +1,240 @@
|
|
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.4.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 BatchQueuedChunkResponse
|
18
|
+
attr_accessor :chunk_metadata
|
19
|
+
|
20
|
+
# The current position the last access item is in the queue
|
21
|
+
attr_accessor :pos_in_queue
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'chunk_metadata' => :'chunk_metadata',
|
27
|
+
:'pos_in_queue' => :'pos_in_queue'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'chunk_metadata' => :'Array<ChunkMetadata>',
|
40
|
+
:'pos_in_queue' => :'Integer'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::BatchQueuedChunkResponse` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::BatchQueuedChunkResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'chunk_metadata')
|
66
|
+
if (value = attributes[:'chunk_metadata']).is_a?(Array)
|
67
|
+
self.chunk_metadata = value
|
68
|
+
end
|
69
|
+
else
|
70
|
+
self.chunk_metadata = nil
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'pos_in_queue')
|
74
|
+
self.pos_in_queue = attributes[:'pos_in_queue']
|
75
|
+
else
|
76
|
+
self.pos_in_queue = nil
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
84
|
+
invalid_properties = Array.new
|
85
|
+
if @chunk_metadata.nil?
|
86
|
+
invalid_properties.push('invalid value for "chunk_metadata", chunk_metadata cannot be nil.')
|
87
|
+
end
|
88
|
+
|
89
|
+
if @pos_in_queue.nil?
|
90
|
+
invalid_properties.push('invalid value for "pos_in_queue", pos_in_queue cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
100
|
+
return false if @chunk_metadata.nil?
|
101
|
+
return false if @pos_in_queue.nil?
|
102
|
+
true
|
103
|
+
end
|
104
|
+
|
105
|
+
# Checks equality by comparing each attribute.
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def ==(o)
|
108
|
+
return true if self.equal?(o)
|
109
|
+
self.class == o.class &&
|
110
|
+
chunk_metadata == o.chunk_metadata &&
|
111
|
+
pos_in_queue == o.pos_in_queue
|
112
|
+
end
|
113
|
+
|
114
|
+
# @see the `==` method
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def eql?(o)
|
117
|
+
self == o
|
118
|
+
end
|
119
|
+
|
120
|
+
# Calculates hash code according to all attributes.
|
121
|
+
# @return [Integer] Hash code
|
122
|
+
def hash
|
123
|
+
[chunk_metadata, pos_in_queue].hash
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def self.build_from_hash(attributes)
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
132
|
+
transformed_hash = {}
|
133
|
+
openapi_types.each_pair do |key, type|
|
134
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
135
|
+
transformed_hash["#{key}"] = nil
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
137
|
+
# check to ensure the input is an array given that the attribute
|
138
|
+
# is documented as an array but the input is not
|
139
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
140
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
141
|
+
end
|
142
|
+
elsif !attributes[attribute_map[key]].nil?
|
143
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
144
|
+
end
|
145
|
+
end
|
146
|
+
new(transformed_hash)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def self._deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :Time
|
156
|
+
Time.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :Boolean
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
# models (e.g. Pet) or oneOf
|
187
|
+
klass = TrieveRubyClient.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the string representation of the object
|
193
|
+
# @return [String] String presentation of the object
|
194
|
+
def to_s
|
195
|
+
to_hash.to_s
|
196
|
+
end
|
197
|
+
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_body
|
201
|
+
to_hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the object in the form of hash
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_hash
|
207
|
+
hash = {}
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
209
|
+
value = self.send(attr)
|
210
|
+
if value.nil?
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
213
|
+
end
|
214
|
+
|
215
|
+
hash[param] = _to_hash(value)
|
216
|
+
end
|
217
|
+
hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Outputs non-array value in the form of hash
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
222
|
+
# @param [Object] value Any valid value
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
224
|
+
def _to_hash(value)
|
225
|
+
if value.is_a?(Array)
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
227
|
+
elsif value.is_a?(Hash)
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
230
|
+
end
|
231
|
+
elsif value.respond_to? :to_hash
|
232
|
+
value.to_hash
|
233
|
+
else
|
234
|
+
value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
|
240
|
+
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.4.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.4.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.4.0
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -0,0 +1,356 @@
|
|
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.4.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 ChunkData
|
18
|
+
# HTML content of the chunk. This can also be plaintext. The innerText of the HTML will be used to create the embedding vector. The point of using HTML is for convienience, as some users have applications where users submit HTML content.
|
19
|
+
attr_accessor :chunk_html
|
20
|
+
|
21
|
+
# Chunk_vector is a vector of floats which can be used instead of generating a new embedding. This is useful for when you are using a pre-embedded dataset. If this is not provided, the innerText of the chunk_html will be used to create the embedding.
|
22
|
+
attr_accessor :chunk_vector
|
23
|
+
|
24
|
+
# File_uuid is the uuid of the file that the chunk is associated with. This is used to associate chunks with files. This is useful for when you want to delete a file and all of its associated chunks.
|
25
|
+
attr_accessor :file_id
|
26
|
+
|
27
|
+
# Group ids are the ids of the groups that the chunk should be placed into. This is useful for when you want to create a chunk and add it to a group or multiple groups in one request. Necessary because this route queues the chunk for ingestion and the chunk may not exist yet immediately after response.
|
28
|
+
attr_accessor :group_ids
|
29
|
+
|
30
|
+
# Group tracking_ids are the tracking_ids of the groups that the chunk should be placed into. This is useful for when you want to create a chunk and add it to a group or multiple groups in one request. Necessary because this route queues the chunk for ingestion and the chunk may not exist yet immediately after response.
|
31
|
+
attr_accessor :group_tracking_ids
|
32
|
+
|
33
|
+
# Link to the chunk. This can also be any string. Frequently, this is a link to the source of the chunk. The link value will not affect the embedding creation.
|
34
|
+
attr_accessor :link
|
35
|
+
|
36
|
+
# Metadata is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata.
|
37
|
+
attr_accessor :metadata
|
38
|
+
|
39
|
+
# Split avg is a boolean which tells the server to split the text in the chunk_html into smaller chunks and average their resulting vectors. This is useful for when you want to create a chunk from a large piece of text and want to split it into smaller chunks to create a more fuzzy average dense vector. The sparse vector will be generated normally with no averaging. By default this is false.
|
40
|
+
attr_accessor :split_avg
|
41
|
+
|
42
|
+
# Tag set is a list of tags. This can be used to filter chunks by tag. Unlike with metadata filtering, HNSW indices will exist for each tag such that there is not a performance hit for filtering on them.
|
43
|
+
attr_accessor :tag_set
|
44
|
+
|
45
|
+
# Time_stamp should be an ISO 8601 combined date and time without timezone. It is used for time window filtering and recency-biasing search results.
|
46
|
+
attr_accessor :time_stamp
|
47
|
+
|
48
|
+
# Tracking_id is a string which can be used to identify a chunk. This is useful for when you are coordinating with an external system and want to use the tracking_id to identify the chunk.
|
49
|
+
attr_accessor :tracking_id
|
50
|
+
|
51
|
+
# Upsert when a chunk with the same tracking_id exists. By default this is false, and the request will fail if a chunk with the same tracking_id exists. If this is true, the chunk will be updated if a chunk with the same tracking_id exists.
|
52
|
+
attr_accessor :upsert_by_tracking_id
|
53
|
+
|
54
|
+
# Weight is a float which can be used to bias search results. This is useful for when you want to bias search results for a chunk. The magnitude only matters relative to other chunks in the chunk's dataset dataset.
|
55
|
+
attr_accessor :weight
|
56
|
+
|
57
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
58
|
+
def self.attribute_map
|
59
|
+
{
|
60
|
+
:'chunk_html' => :'chunk_html',
|
61
|
+
:'chunk_vector' => :'chunk_vector',
|
62
|
+
:'file_id' => :'file_id',
|
63
|
+
:'group_ids' => :'group_ids',
|
64
|
+
:'group_tracking_ids' => :'group_tracking_ids',
|
65
|
+
:'link' => :'link',
|
66
|
+
:'metadata' => :'metadata',
|
67
|
+
:'split_avg' => :'split_avg',
|
68
|
+
:'tag_set' => :'tag_set',
|
69
|
+
:'time_stamp' => :'time_stamp',
|
70
|
+
:'tracking_id' => :'tracking_id',
|
71
|
+
:'upsert_by_tracking_id' => :'upsert_by_tracking_id',
|
72
|
+
:'weight' => :'weight'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns all the JSON keys this model knows about
|
77
|
+
def self.acceptable_attributes
|
78
|
+
attribute_map.values
|
79
|
+
end
|
80
|
+
|
81
|
+
# Attribute type mapping.
|
82
|
+
def self.openapi_types
|
83
|
+
{
|
84
|
+
:'chunk_html' => :'String',
|
85
|
+
:'chunk_vector' => :'Array<Float>',
|
86
|
+
:'file_id' => :'String',
|
87
|
+
:'group_ids' => :'Array<String>',
|
88
|
+
:'group_tracking_ids' => :'Array<String>',
|
89
|
+
:'link' => :'String',
|
90
|
+
:'metadata' => :'Object',
|
91
|
+
:'split_avg' => :'Boolean',
|
92
|
+
:'tag_set' => :'Array<String>',
|
93
|
+
:'time_stamp' => :'String',
|
94
|
+
:'tracking_id' => :'String',
|
95
|
+
:'upsert_by_tracking_id' => :'Boolean',
|
96
|
+
:'weight' => :'Float'
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
# List of attributes with nullable: true
|
101
|
+
def self.openapi_nullable
|
102
|
+
Set.new([
|
103
|
+
:'chunk_html',
|
104
|
+
:'chunk_vector',
|
105
|
+
:'file_id',
|
106
|
+
:'group_ids',
|
107
|
+
:'group_tracking_ids',
|
108
|
+
:'link',
|
109
|
+
:'metadata',
|
110
|
+
:'split_avg',
|
111
|
+
:'tag_set',
|
112
|
+
:'time_stamp',
|
113
|
+
:'tracking_id',
|
114
|
+
:'upsert_by_tracking_id',
|
115
|
+
:'weight'
|
116
|
+
])
|
117
|
+
end
|
118
|
+
|
119
|
+
# Initializes the object
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
+
def initialize(attributes = {})
|
122
|
+
if (!attributes.is_a?(Hash))
|
123
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::ChunkData` initialize method"
|
124
|
+
end
|
125
|
+
|
126
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
127
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
128
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
129
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::ChunkData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
130
|
+
end
|
131
|
+
h[k.to_sym] = v
|
132
|
+
}
|
133
|
+
|
134
|
+
if attributes.key?(:'chunk_html')
|
135
|
+
self.chunk_html = attributes[:'chunk_html']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'chunk_vector')
|
139
|
+
if (value = attributes[:'chunk_vector']).is_a?(Array)
|
140
|
+
self.chunk_vector = value
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'file_id')
|
145
|
+
self.file_id = attributes[:'file_id']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'group_ids')
|
149
|
+
if (value = attributes[:'group_ids']).is_a?(Array)
|
150
|
+
self.group_ids = value
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'group_tracking_ids')
|
155
|
+
if (value = attributes[:'group_tracking_ids']).is_a?(Array)
|
156
|
+
self.group_tracking_ids = value
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'link')
|
161
|
+
self.link = attributes[:'link']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'metadata')
|
165
|
+
self.metadata = attributes[:'metadata']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'split_avg')
|
169
|
+
self.split_avg = attributes[:'split_avg']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'tag_set')
|
173
|
+
if (value = attributes[:'tag_set']).is_a?(Array)
|
174
|
+
self.tag_set = value
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.key?(:'time_stamp')
|
179
|
+
self.time_stamp = attributes[:'time_stamp']
|
180
|
+
end
|
181
|
+
|
182
|
+
if attributes.key?(:'tracking_id')
|
183
|
+
self.tracking_id = attributes[:'tracking_id']
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.key?(:'upsert_by_tracking_id')
|
187
|
+
self.upsert_by_tracking_id = attributes[:'upsert_by_tracking_id']
|
188
|
+
end
|
189
|
+
|
190
|
+
if attributes.key?(:'weight')
|
191
|
+
self.weight = attributes[:'weight']
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
196
|
+
# @return Array for valid properties with the reasons
|
197
|
+
def list_invalid_properties
|
198
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
199
|
+
invalid_properties = Array.new
|
200
|
+
invalid_properties
|
201
|
+
end
|
202
|
+
|
203
|
+
# Check to see if the all the properties in the model are valid
|
204
|
+
# @return true if the model is valid
|
205
|
+
def valid?
|
206
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
207
|
+
true
|
208
|
+
end
|
209
|
+
|
210
|
+
# Checks equality by comparing each attribute.
|
211
|
+
# @param [Object] Object to be compared
|
212
|
+
def ==(o)
|
213
|
+
return true if self.equal?(o)
|
214
|
+
self.class == o.class &&
|
215
|
+
chunk_html == o.chunk_html &&
|
216
|
+
chunk_vector == o.chunk_vector &&
|
217
|
+
file_id == o.file_id &&
|
218
|
+
group_ids == o.group_ids &&
|
219
|
+
group_tracking_ids == o.group_tracking_ids &&
|
220
|
+
link == o.link &&
|
221
|
+
metadata == o.metadata &&
|
222
|
+
split_avg == o.split_avg &&
|
223
|
+
tag_set == o.tag_set &&
|
224
|
+
time_stamp == o.time_stamp &&
|
225
|
+
tracking_id == o.tracking_id &&
|
226
|
+
upsert_by_tracking_id == o.upsert_by_tracking_id &&
|
227
|
+
weight == o.weight
|
228
|
+
end
|
229
|
+
|
230
|
+
# @see the `==` method
|
231
|
+
# @param [Object] Object to be compared
|
232
|
+
def eql?(o)
|
233
|
+
self == o
|
234
|
+
end
|
235
|
+
|
236
|
+
# Calculates hash code according to all attributes.
|
237
|
+
# @return [Integer] Hash code
|
238
|
+
def hash
|
239
|
+
[chunk_html, chunk_vector, file_id, group_ids, group_tracking_ids, link, metadata, split_avg, tag_set, time_stamp, tracking_id, upsert_by_tracking_id, weight].hash
|
240
|
+
end
|
241
|
+
|
242
|
+
# Builds the object from hash
|
243
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
244
|
+
# @return [Object] Returns the model itself
|
245
|
+
def self.build_from_hash(attributes)
|
246
|
+
return nil unless attributes.is_a?(Hash)
|
247
|
+
attributes = attributes.transform_keys(&:to_sym)
|
248
|
+
transformed_hash = {}
|
249
|
+
openapi_types.each_pair do |key, type|
|
250
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
251
|
+
transformed_hash["#{key}"] = nil
|
252
|
+
elsif type =~ /\AArray<(.*)>/i
|
253
|
+
# check to ensure the input is an array given that the attribute
|
254
|
+
# is documented as an array but the input is not
|
255
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
256
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
257
|
+
end
|
258
|
+
elsif !attributes[attribute_map[key]].nil?
|
259
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
260
|
+
end
|
261
|
+
end
|
262
|
+
new(transformed_hash)
|
263
|
+
end
|
264
|
+
|
265
|
+
# Deserializes the data based on type
|
266
|
+
# @param string type Data type
|
267
|
+
# @param string value Value to be deserialized
|
268
|
+
# @return [Object] Deserialized data
|
269
|
+
def self._deserialize(type, value)
|
270
|
+
case type.to_sym
|
271
|
+
when :Time
|
272
|
+
Time.parse(value)
|
273
|
+
when :Date
|
274
|
+
Date.parse(value)
|
275
|
+
when :String
|
276
|
+
value.to_s
|
277
|
+
when :Integer
|
278
|
+
value.to_i
|
279
|
+
when :Float
|
280
|
+
value.to_f
|
281
|
+
when :Boolean
|
282
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
283
|
+
true
|
284
|
+
else
|
285
|
+
false
|
286
|
+
end
|
287
|
+
when :Object
|
288
|
+
# generic object (usually a Hash), return directly
|
289
|
+
value
|
290
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
291
|
+
inner_type = Regexp.last_match[:inner_type]
|
292
|
+
value.map { |v| _deserialize(inner_type, v) }
|
293
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
294
|
+
k_type = Regexp.last_match[:k_type]
|
295
|
+
v_type = Regexp.last_match[:v_type]
|
296
|
+
{}.tap do |hash|
|
297
|
+
value.each do |k, v|
|
298
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
299
|
+
end
|
300
|
+
end
|
301
|
+
else # model
|
302
|
+
# models (e.g. Pet) or oneOf
|
303
|
+
klass = TrieveRubyClient.const_get(type)
|
304
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
# Returns the string representation of the object
|
309
|
+
# @return [String] String presentation of the object
|
310
|
+
def to_s
|
311
|
+
to_hash.to_s
|
312
|
+
end
|
313
|
+
|
314
|
+
# to_body is an alias to to_hash (backward compatibility)
|
315
|
+
# @return [Hash] Returns the object in the form of hash
|
316
|
+
def to_body
|
317
|
+
to_hash
|
318
|
+
end
|
319
|
+
|
320
|
+
# Returns the object in the form of hash
|
321
|
+
# @return [Hash] Returns the object in the form of hash
|
322
|
+
def to_hash
|
323
|
+
hash = {}
|
324
|
+
self.class.attribute_map.each_pair do |attr, param|
|
325
|
+
value = self.send(attr)
|
326
|
+
if value.nil?
|
327
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
328
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
329
|
+
end
|
330
|
+
|
331
|
+
hash[param] = _to_hash(value)
|
332
|
+
end
|
333
|
+
hash
|
334
|
+
end
|
335
|
+
|
336
|
+
# Outputs non-array value in the form of hash
|
337
|
+
# For object, use to_hash. Otherwise, just return the value
|
338
|
+
# @param [Object] value Any valid value
|
339
|
+
# @return [Hash] Returns the value in the form of hash
|
340
|
+
def _to_hash(value)
|
341
|
+
if value.is_a?(Array)
|
342
|
+
value.compact.map { |v| _to_hash(v) }
|
343
|
+
elsif value.is_a?(Hash)
|
344
|
+
{}.tap do |hash|
|
345
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
346
|
+
end
|
347
|
+
elsif value.respond_to? :to_hash
|
348
|
+
value.to_hash
|
349
|
+
else
|
350
|
+
value
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
end
|
355
|
+
|
356
|
+
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.4.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.4.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.4.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.4.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.4.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.4.0
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|