trieve_ruby_client 0.5.0 → 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/GENERATE_COMMAND.txt +1 -0
- data/README.md +22 -11
- data/docs/AddChunkToGroupData.md +4 -2
- data/docs/AuthApi.md +13 -7
- data/docs/ChunkApi.md +9 -9
- data/docs/ChunkGroup.md +4 -0
- data/docs/ChunkGroupApi.md +36 -27
- data/docs/CreateChunkGroupData.md +4 -0
- data/docs/DatasetApi.md +11 -11
- data/docs/EventsApi.md +2 -2
- data/docs/FileApi.md +3 -3
- data/docs/GroupScoreChunkDTO.md +2 -0
- data/docs/GroupSlimChunksDTO.md +20 -0
- data/docs/HealthApi.md +1 -1
- data/docs/InvitationApi.md +1 -1
- data/docs/MessageApi.md +1 -1
- data/docs/OrganizationApi.md +1 -1
- data/docs/Range.md +4 -4
- data/docs/RangeCondition.md +49 -0
- data/docs/ReccomendGroupChunksRequest.md +3 -1
- data/docs/RecommendChunksRequest.md +5 -1
- data/docs/RecommendChunksResponseTypes.md +49 -0
- data/docs/RecommendGroupChunkResponseTypes.md +49 -0
- data/docs/RecommendGroupChunksRequest.md +34 -0
- data/docs/ScoreSlimChunks.md +20 -0
- data/docs/SearchChunkData.md +3 -1
- data/docs/SearchChunkResponseTypes.md +49 -0
- data/docs/SearchGroupSlimChunksResult.md +22 -0
- data/docs/SearchOverGroupsData.md +6 -4
- data/docs/SearchOverGroupsResponseTypes.md +49 -0
- data/docs/SearchOverGroupsSlimChunksResponseBody.md +20 -0
- data/docs/SearchSlimChunkQueryResponseBody.md +20 -0
- data/docs/SearchWithinGroupData.md +3 -1
- data/docs/SearchWithinGroupResponseTypes.md +49 -0
- data/docs/SlimChunkMetadata.md +36 -0
- data/docs/SlimUser.md +1 -7
- data/docs/StripeApi.md +1 -1
- data/docs/TopicApi.md +9 -9
- data/docs/UpdateChunkData.md +2 -0
- data/docs/UpdateChunkGroupData.md +4 -0
- data/docs/UpdateGroupByTrackingIDData.md +4 -0
- data/docs/UpdateUserData.md +1 -7
- data/docs/UserApi.md +9 -9
- data/lib/trieve_ruby_client/api/auth_api.rb +13 -11
- data/lib/trieve_ruby_client/api/chunk_api.rb +7 -7
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +38 -31
- data/lib/trieve_ruby_client/api/dataset_api.rb +17 -22
- 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 +11 -16
- data/lib/trieve_ruby_client/api/user_api.rb +11 -16
- 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 +7 -7
- 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 +12 -2
- data/lib/trieve_ruby_client/models/group_slim_chunks_dto.rb +239 -0
- 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 +5 -5
- data/lib/trieve_ruby_client/models/range_condition.rb +105 -0
- data/lib/trieve_ruby_client/models/reccomend_group_chunks_request.rb +17 -6
- data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +28 -6
- data/lib/trieve_ruby_client/models/recommend_chunks_response_types.rb +105 -0
- data/lib/trieve_ruby_client/models/recommend_group_chunk_response_types.rb +105 -0
- 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 +239 -0
- data/lib/trieve_ruby_client/models/search_chunk_data.rb +14 -3
- 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 +105 -0
- data/lib/trieve_ruby_client/models/search_group_slim_chunks_result.rb +255 -0
- data/lib/trieve_ruby_client/models/search_groups_result.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_data.rb +19 -7
- 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 +105 -0
- data/lib/trieve_ruby_client/models/search_over_groups_slim_chunks_response_body.rb +239 -0
- data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +239 -0
- data/lib/trieve_ruby_client/models/search_within_group_data.rb +14 -3
- data/lib/trieve_ruby_client/models/search_within_group_response_types.rb +105 -0
- 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 +329 -0
- data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
- data/lib/trieve_ruby_client/models/slim_user.rb +5 -41
- 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 +15 -2
- 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 +6 -39
- 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 +14 -3
- data/openapi-generator.yaml +1 -1
- data/openapi.json +679 -261
- data/spec/models/group_slim_chunks_dto_spec.rb +42 -0
- data/spec/models/range_condition_spec.rb +32 -0
- data/spec/models/recommend_chunks_response_types_spec.rb +32 -0
- data/spec/models/recommend_group_chunk_response_types_spec.rb +32 -0
- data/spec/models/recommend_group_chunks_request_spec.rb +84 -0
- data/spec/models/score_slim_chunks_spec.rb +42 -0
- data/spec/models/search_chunk_response_types_spec.rb +32 -0
- data/spec/models/search_group_slim_chunks_result_spec.rb +48 -0
- data/spec/models/search_over_groups_response_types_spec.rb +32 -0
- data/spec/models/search_over_groups_slim_chunks_response_body_spec.rb +42 -0
- data/spec/models/search_slim_chunk_query_response_body_spec.rb +42 -0
- data/spec/models/search_within_group_response_types_spec.rb +32 -0
- data/spec/models/slim_chunk_metadata_spec.rb +90 -0
- data/spec/spec_helper.rb +1 -1
- data/trieve_ruby_client-0.5.0.gem +0 -0
- data/trieve_ruby_client-0.5.7.gem +0 -0
- data/trieve_ruby_client.gemspec +1 -1
- metadata +57 -4
- data/trieve_ruby_client-0.3.5.gem +0 -0
- data/trieve_ruby_client-0.4.0.gem +0 -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
|
@@ -32,7 +32,7 @@ module TrieveRubyClient
|
|
32
32
|
# Set highlight_results to true to highlight the results. If not specified, this defaults to true.
|
33
33
|
attr_accessor :highlight_results
|
34
34
|
|
35
|
-
# The page of chunks to fetch.
|
35
|
+
# The page of chunks to fetch. Page is 1-indexed.
|
36
36
|
attr_accessor :page
|
37
37
|
|
38
38
|
# The page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time.
|
@@ -47,6 +47,9 @@ module TrieveRubyClient
|
|
47
47
|
# Search_type can be either \"semantic\", \"fulltext\", or \"hybrid\". \"hybrid\" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using BAAI/bge-reranker-large. \"semantic\" will pull in one page (10 chunks) of the nearest cosine distant vectors. \"fulltext\" will pull in one page (10 chunks) of full-text results based on SPLADE.
|
48
48
|
attr_accessor :search_type
|
49
49
|
|
50
|
+
# 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.
|
51
|
+
attr_accessor :slim_chunks
|
52
|
+
|
50
53
|
# Set use_weights to true to use the weights of the chunks in the result set in order to sort them. If not specified, this defaults to true.
|
51
54
|
attr_accessor :use_weights
|
52
55
|
|
@@ -64,6 +67,7 @@ module TrieveRubyClient
|
|
64
67
|
:'query' => :'query',
|
65
68
|
:'score_threshold' => :'score_threshold',
|
66
69
|
:'search_type' => :'search_type',
|
70
|
+
:'slim_chunks' => :'slim_chunks',
|
67
71
|
:'use_weights' => :'use_weights'
|
68
72
|
}
|
69
73
|
end
|
@@ -87,6 +91,7 @@ module TrieveRubyClient
|
|
87
91
|
:'query' => :'String',
|
88
92
|
:'score_threshold' => :'Float',
|
89
93
|
:'search_type' => :'String',
|
94
|
+
:'slim_chunks' => :'Boolean',
|
90
95
|
:'use_weights' => :'Boolean'
|
91
96
|
}
|
92
97
|
end
|
@@ -103,6 +108,7 @@ module TrieveRubyClient
|
|
103
108
|
:'page',
|
104
109
|
:'page_size',
|
105
110
|
:'score_threshold',
|
111
|
+
:'slim_chunks',
|
106
112
|
:'use_weights'
|
107
113
|
])
|
108
114
|
end
|
@@ -172,6 +178,10 @@ module TrieveRubyClient
|
|
172
178
|
self.search_type = nil
|
173
179
|
end
|
174
180
|
|
181
|
+
if attributes.key?(:'slim_chunks')
|
182
|
+
self.slim_chunks = attributes[:'slim_chunks']
|
183
|
+
end
|
184
|
+
|
175
185
|
if attributes.key?(:'use_weights')
|
176
186
|
self.use_weights = attributes[:'use_weights']
|
177
187
|
end
|
@@ -248,6 +258,7 @@ module TrieveRubyClient
|
|
248
258
|
query == o.query &&
|
249
259
|
score_threshold == o.score_threshold &&
|
250
260
|
search_type == o.search_type &&
|
261
|
+
slim_chunks == o.slim_chunks &&
|
251
262
|
use_weights == o.use_weights
|
252
263
|
end
|
253
264
|
|
@@ -260,7 +271,7 @@ module TrieveRubyClient
|
|
260
271
|
# Calculates hash code according to all attributes.
|
261
272
|
# @return [Integer] Hash code
|
262
273
|
def hash
|
263
|
-
[date_bias, filters, group_id, group_tracking_id, highlight_delimiters, highlight_results, page, page_size, query, score_threshold, search_type, use_weights].hash
|
274
|
+
[date_bias, filters, group_id, group_tracking_id, highlight_delimiters, highlight_results, page, page_size, query, score_threshold, search_type, slim_chunks, use_weights].hash
|
264
275
|
end
|
265
276
|
|
266
277
|
# Builds the object from hash
|
@@ -0,0 +1,105 @@
|
|
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
|
+
module SearchWithinGroupResponseTypes
|
18
|
+
class << self
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
20
|
+
def openapi_one_of
|
21
|
+
[
|
22
|
+
:'SearchGroupSlimChunksResult',
|
23
|
+
:'SearchGroupsResult'
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Builds the object
|
28
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
29
|
+
# @return [Object] Returns the model or the data itself
|
30
|
+
def build(data)
|
31
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
32
|
+
# Note:
|
33
|
+
# - We do not attempt to check whether exactly one item matches.
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
36
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
37
|
+
# - TODO: logging when debugging is set.
|
38
|
+
openapi_one_of.each do |klass|
|
39
|
+
begin
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
41
|
+
typed_data = find_and_cast_into_type(klass, data)
|
42
|
+
return typed_data if typed_data
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
53
|
+
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
55
|
+
def find_and_cast_into_type(klass, data)
|
56
|
+
return if data.nil?
|
57
|
+
|
58
|
+
case klass.to_s
|
59
|
+
when 'Boolean'
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
61
|
+
when 'Float'
|
62
|
+
return data if data.instance_of?(Float)
|
63
|
+
when 'Integer'
|
64
|
+
return data if data.instance_of?(Integer)
|
65
|
+
when 'Time'
|
66
|
+
return Time.parse(data)
|
67
|
+
when 'Date'
|
68
|
+
return Date.parse(data)
|
69
|
+
when 'String'
|
70
|
+
return data if data.instance_of?(String)
|
71
|
+
when 'Object' # "type: object"
|
72
|
+
return data if data.instance_of?(Hash)
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
74
|
+
if data.instance_of?(Array)
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
77
|
+
end
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
82
|
+
end
|
83
|
+
else # model
|
84
|
+
const = TrieveRubyClient.const_get(klass)
|
85
|
+
if const
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
87
|
+
model = const.build(data)
|
88
|
+
return model if model
|
89
|
+
else
|
90
|
+
# raise if data contains keys that are not known to the model
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
92
|
+
model = const.build_from_hash(data)
|
93
|
+
return model if model
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
raise # if no match by now, raise
|
99
|
+
rescue
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
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
|
@@ -0,0 +1,329 @@
|
|
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 SlimChunkMetadata
|
18
|
+
attr_accessor :created_at
|
19
|
+
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
attr_accessor :link
|
23
|
+
|
24
|
+
attr_accessor :metadata
|
25
|
+
|
26
|
+
attr_accessor :qdrant_point_id
|
27
|
+
|
28
|
+
attr_accessor :tag_set
|
29
|
+
|
30
|
+
attr_accessor :time_stamp
|
31
|
+
|
32
|
+
attr_accessor :tracking_id
|
33
|
+
|
34
|
+
attr_accessor :updated_at
|
35
|
+
|
36
|
+
attr_accessor :weight
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'created_at' => :'created_at',
|
42
|
+
:'id' => :'id',
|
43
|
+
:'link' => :'link',
|
44
|
+
:'metadata' => :'metadata',
|
45
|
+
:'qdrant_point_id' => :'qdrant_point_id',
|
46
|
+
:'tag_set' => :'tag_set',
|
47
|
+
:'time_stamp' => :'time_stamp',
|
48
|
+
:'tracking_id' => :'tracking_id',
|
49
|
+
:'updated_at' => :'updated_at',
|
50
|
+
:'weight' => :'weight'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns all the JSON keys this model knows about
|
55
|
+
def self.acceptable_attributes
|
56
|
+
attribute_map.values
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute type mapping.
|
60
|
+
def self.openapi_types
|
61
|
+
{
|
62
|
+
:'created_at' => :'Time',
|
63
|
+
:'id' => :'String',
|
64
|
+
:'link' => :'String',
|
65
|
+
:'metadata' => :'Object',
|
66
|
+
:'qdrant_point_id' => :'String',
|
67
|
+
:'tag_set' => :'String',
|
68
|
+
:'time_stamp' => :'Time',
|
69
|
+
:'tracking_id' => :'String',
|
70
|
+
:'updated_at' => :'Time',
|
71
|
+
:'weight' => :'Float'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.openapi_nullable
|
77
|
+
Set.new([
|
78
|
+
:'link',
|
79
|
+
:'metadata',
|
80
|
+
:'qdrant_point_id',
|
81
|
+
:'tag_set',
|
82
|
+
:'time_stamp',
|
83
|
+
:'tracking_id',
|
84
|
+
])
|
85
|
+
end
|
86
|
+
|
87
|
+
# Initializes the object
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
def initialize(attributes = {})
|
90
|
+
if (!attributes.is_a?(Hash))
|
91
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::SlimChunkMetadata` initialize method"
|
92
|
+
end
|
93
|
+
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
96
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::SlimChunkMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
98
|
+
end
|
99
|
+
h[k.to_sym] = v
|
100
|
+
}
|
101
|
+
|
102
|
+
if attributes.key?(:'created_at')
|
103
|
+
self.created_at = attributes[:'created_at']
|
104
|
+
else
|
105
|
+
self.created_at = nil
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'id')
|
109
|
+
self.id = attributes[:'id']
|
110
|
+
else
|
111
|
+
self.id = nil
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'link')
|
115
|
+
self.link = attributes[:'link']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'metadata')
|
119
|
+
self.metadata = attributes[:'metadata']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'qdrant_point_id')
|
123
|
+
self.qdrant_point_id = attributes[:'qdrant_point_id']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'tag_set')
|
127
|
+
self.tag_set = attributes[:'tag_set']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'time_stamp')
|
131
|
+
self.time_stamp = attributes[:'time_stamp']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'tracking_id')
|
135
|
+
self.tracking_id = attributes[:'tracking_id']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'updated_at')
|
139
|
+
self.updated_at = attributes[:'updated_at']
|
140
|
+
else
|
141
|
+
self.updated_at = nil
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'weight')
|
145
|
+
self.weight = attributes[:'weight']
|
146
|
+
else
|
147
|
+
self.weight = nil
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
152
|
+
# @return Array for valid properties with the reasons
|
153
|
+
def list_invalid_properties
|
154
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
155
|
+
invalid_properties = Array.new
|
156
|
+
if @created_at.nil?
|
157
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
158
|
+
end
|
159
|
+
|
160
|
+
if @id.nil?
|
161
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
162
|
+
end
|
163
|
+
|
164
|
+
if @updated_at.nil?
|
165
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
166
|
+
end
|
167
|
+
|
168
|
+
if @weight.nil?
|
169
|
+
invalid_properties.push('invalid value for "weight", weight cannot be nil.')
|
170
|
+
end
|
171
|
+
|
172
|
+
invalid_properties
|
173
|
+
end
|
174
|
+
|
175
|
+
# Check to see if the all the properties in the model are valid
|
176
|
+
# @return true if the model is valid
|
177
|
+
def valid?
|
178
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
179
|
+
return false if @created_at.nil?
|
180
|
+
return false if @id.nil?
|
181
|
+
return false if @updated_at.nil?
|
182
|
+
return false if @weight.nil?
|
183
|
+
true
|
184
|
+
end
|
185
|
+
|
186
|
+
# Checks equality by comparing each attribute.
|
187
|
+
# @param [Object] Object to be compared
|
188
|
+
def ==(o)
|
189
|
+
return true if self.equal?(o)
|
190
|
+
self.class == o.class &&
|
191
|
+
created_at == o.created_at &&
|
192
|
+
id == o.id &&
|
193
|
+
link == o.link &&
|
194
|
+
metadata == o.metadata &&
|
195
|
+
qdrant_point_id == o.qdrant_point_id &&
|
196
|
+
tag_set == o.tag_set &&
|
197
|
+
time_stamp == o.time_stamp &&
|
198
|
+
tracking_id == o.tracking_id &&
|
199
|
+
updated_at == o.updated_at &&
|
200
|
+
weight == o.weight
|
201
|
+
end
|
202
|
+
|
203
|
+
# @see the `==` method
|
204
|
+
# @param [Object] Object to be compared
|
205
|
+
def eql?(o)
|
206
|
+
self == o
|
207
|
+
end
|
208
|
+
|
209
|
+
# Calculates hash code according to all attributes.
|
210
|
+
# @return [Integer] Hash code
|
211
|
+
def hash
|
212
|
+
[created_at, id, link, metadata, qdrant_point_id, tag_set, time_stamp, tracking_id, updated_at, weight].hash
|
213
|
+
end
|
214
|
+
|
215
|
+
# Builds the object from hash
|
216
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
217
|
+
# @return [Object] Returns the model itself
|
218
|
+
def self.build_from_hash(attributes)
|
219
|
+
return nil unless attributes.is_a?(Hash)
|
220
|
+
attributes = attributes.transform_keys(&:to_sym)
|
221
|
+
transformed_hash = {}
|
222
|
+
openapi_types.each_pair do |key, type|
|
223
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
224
|
+
transformed_hash["#{key}"] = nil
|
225
|
+
elsif type =~ /\AArray<(.*)>/i
|
226
|
+
# check to ensure the input is an array given that the attribute
|
227
|
+
# is documented as an array but the input is not
|
228
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
229
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
230
|
+
end
|
231
|
+
elsif !attributes[attribute_map[key]].nil?
|
232
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
233
|
+
end
|
234
|
+
end
|
235
|
+
new(transformed_hash)
|
236
|
+
end
|
237
|
+
|
238
|
+
# Deserializes the data based on type
|
239
|
+
# @param string type Data type
|
240
|
+
# @param string value Value to be deserialized
|
241
|
+
# @return [Object] Deserialized data
|
242
|
+
def self._deserialize(type, value)
|
243
|
+
case type.to_sym
|
244
|
+
when :Time
|
245
|
+
Time.parse(value)
|
246
|
+
when :Date
|
247
|
+
Date.parse(value)
|
248
|
+
when :String
|
249
|
+
value.to_s
|
250
|
+
when :Integer
|
251
|
+
value.to_i
|
252
|
+
when :Float
|
253
|
+
value.to_f
|
254
|
+
when :Boolean
|
255
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
256
|
+
true
|
257
|
+
else
|
258
|
+
false
|
259
|
+
end
|
260
|
+
when :Object
|
261
|
+
# generic object (usually a Hash), return directly
|
262
|
+
value
|
263
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
264
|
+
inner_type = Regexp.last_match[:inner_type]
|
265
|
+
value.map { |v| _deserialize(inner_type, v) }
|
266
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
267
|
+
k_type = Regexp.last_match[:k_type]
|
268
|
+
v_type = Regexp.last_match[:v_type]
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each do |k, v|
|
271
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
else # model
|
275
|
+
# models (e.g. Pet) or oneOf
|
276
|
+
klass = TrieveRubyClient.const_get(type)
|
277
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
# Returns the string representation of the object
|
282
|
+
# @return [String] String presentation of the object
|
283
|
+
def to_s
|
284
|
+
to_hash.to_s
|
285
|
+
end
|
286
|
+
|
287
|
+
# to_body is an alias to to_hash (backward compatibility)
|
288
|
+
# @return [Hash] Returns the object in the form of hash
|
289
|
+
def to_body
|
290
|
+
to_hash
|
291
|
+
end
|
292
|
+
|
293
|
+
# Returns the object in the form of hash
|
294
|
+
# @return [Hash] Returns the object in the form of hash
|
295
|
+
def to_hash
|
296
|
+
hash = {}
|
297
|
+
self.class.attribute_map.each_pair do |attr, param|
|
298
|
+
value = self.send(attr)
|
299
|
+
if value.nil?
|
300
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
301
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
302
|
+
end
|
303
|
+
|
304
|
+
hash[param] = _to_hash(value)
|
305
|
+
end
|
306
|
+
hash
|
307
|
+
end
|
308
|
+
|
309
|
+
# Outputs non-array value in the form of hash
|
310
|
+
# For object, use to_hash. Otherwise, just return the value
|
311
|
+
# @param [Object] value Any valid value
|
312
|
+
# @return [Hash] Returns the value in the form of hash
|
313
|
+
def _to_hash(value)
|
314
|
+
if value.is_a?(Array)
|
315
|
+
value.compact.map { |v| _to_hash(v) }
|
316
|
+
elsif value.is_a?(Hash)
|
317
|
+
{}.tap do |hash|
|
318
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
319
|
+
end
|
320
|
+
elsif value.respond_to? :to_hash
|
321
|
+
value.to_hash
|
322
|
+
else
|
323
|
+
value
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
end
|
328
|
+
|
329
|
+
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
|
@@ -25,12 +25,6 @@ module TrieveRubyClient
|
|
25
25
|
|
26
26
|
attr_accessor :user_orgs
|
27
27
|
|
28
|
-
attr_accessor :username
|
29
|
-
|
30
|
-
attr_accessor :visible_email
|
31
|
-
|
32
|
-
attr_accessor :website
|
33
|
-
|
34
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
35
29
|
def self.attribute_map
|
36
30
|
{
|
@@ -38,10 +32,7 @@ module TrieveRubyClient
|
|
38
32
|
:'id' => :'id',
|
39
33
|
:'name' => :'name',
|
40
34
|
:'orgs' => :'orgs',
|
41
|
-
:'user_orgs' => :'user_orgs'
|
42
|
-
:'username' => :'username',
|
43
|
-
:'visible_email' => :'visible_email',
|
44
|
-
:'website' => :'website'
|
35
|
+
:'user_orgs' => :'user_orgs'
|
45
36
|
}
|
46
37
|
end
|
47
38
|
|
@@ -57,10 +48,7 @@ module TrieveRubyClient
|
|
57
48
|
:'id' => :'String',
|
58
49
|
:'name' => :'String',
|
59
50
|
:'orgs' => :'Array<Organization>',
|
60
|
-
:'user_orgs' => :'Array<UserOrganization>'
|
61
|
-
:'username' => :'String',
|
62
|
-
:'visible_email' => :'Boolean',
|
63
|
-
:'website' => :'String'
|
51
|
+
:'user_orgs' => :'Array<UserOrganization>'
|
64
52
|
}
|
65
53
|
end
|
66
54
|
|
@@ -68,8 +56,6 @@ module TrieveRubyClient
|
|
68
56
|
def self.openapi_nullable
|
69
57
|
Set.new([
|
70
58
|
:'name',
|
71
|
-
:'username',
|
72
|
-
:'website'
|
73
59
|
])
|
74
60
|
end
|
75
61
|
|
@@ -119,20 +105,6 @@ module TrieveRubyClient
|
|
119
105
|
else
|
120
106
|
self.user_orgs = nil
|
121
107
|
end
|
122
|
-
|
123
|
-
if attributes.key?(:'username')
|
124
|
-
self.username = attributes[:'username']
|
125
|
-
end
|
126
|
-
|
127
|
-
if attributes.key?(:'visible_email')
|
128
|
-
self.visible_email = attributes[:'visible_email']
|
129
|
-
else
|
130
|
-
self.visible_email = nil
|
131
|
-
end
|
132
|
-
|
133
|
-
if attributes.key?(:'website')
|
134
|
-
self.website = attributes[:'website']
|
135
|
-
end
|
136
108
|
end
|
137
109
|
|
138
110
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -156,10 +128,6 @@ module TrieveRubyClient
|
|
156
128
|
invalid_properties.push('invalid value for "user_orgs", user_orgs cannot be nil.')
|
157
129
|
end
|
158
130
|
|
159
|
-
if @visible_email.nil?
|
160
|
-
invalid_properties.push('invalid value for "visible_email", visible_email cannot be nil.')
|
161
|
-
end
|
162
|
-
|
163
131
|
invalid_properties
|
164
132
|
end
|
165
133
|
|
@@ -171,7 +139,6 @@ module TrieveRubyClient
|
|
171
139
|
return false if @id.nil?
|
172
140
|
return false if @orgs.nil?
|
173
141
|
return false if @user_orgs.nil?
|
174
|
-
return false if @visible_email.nil?
|
175
142
|
true
|
176
143
|
end
|
177
144
|
|
@@ -184,10 +151,7 @@ module TrieveRubyClient
|
|
184
151
|
id == o.id &&
|
185
152
|
name == o.name &&
|
186
153
|
orgs == o.orgs &&
|
187
|
-
user_orgs == o.user_orgs
|
188
|
-
username == o.username &&
|
189
|
-
visible_email == o.visible_email &&
|
190
|
-
website == o.website
|
154
|
+
user_orgs == o.user_orgs
|
191
155
|
end
|
192
156
|
|
193
157
|
# @see the `==` method
|
@@ -199,7 +163,7 @@ module TrieveRubyClient
|
|
199
163
|
# Calculates hash code according to all attributes.
|
200
164
|
# @return [Integer] Hash code
|
201
165
|
def hash
|
202
|
-
[email, id, name, orgs, user_orgs
|
166
|
+
[email, id, name, orgs, user_orgs].hash
|
203
167
|
end
|
204
168
|
|
205
169
|
# 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
|