trieve_ruby_client 0.8.0 → 0.10.7
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 +39 -30
- data/docs/ApiKeyRespBody.md +32 -0
- data/docs/AutocompleteData.md +42 -0
- data/docs/AutocompleteReqPayload.md +50 -0
- data/docs/BoostPhrase.md +20 -0
- data/docs/ChunkApi.md +140 -66
- data/docs/ChunkData.md +2 -0
- data/docs/ChunkFilter.md +3 -3
- data/docs/ChunkGroup.md +1 -1
- data/docs/ChunkGroupApi.md +35 -33
- data/docs/ChunkMetadata.md +5 -3
- data/docs/ChunkMetadataStringTagSet.md +46 -0
- data/docs/ChunkMetadataTypes.md +51 -0
- data/docs/ChunkMetadataWithScore.md +0 -2
- data/docs/ChunkReqPayload.md +50 -0
- data/docs/ClientDatasetConfiguration.md +0 -2
- data/docs/ConditionType.md +49 -0
- data/docs/ContentChunkMetadata.md +32 -0
- data/docs/CreateChunkGroupReqPayload.md +28 -0
- data/docs/CreateChunkReqPayloadEnum.md +49 -0
- data/docs/CreateDatasetRequest.md +2 -2
- data/docs/CreateMessageData.md +2 -2
- data/docs/CreateMessageReqPayload.md +42 -0
- data/docs/CreateTopicReqPayload.md +22 -0
- data/docs/Dataset.md +2 -0
- data/docs/DatasetApi.md +236 -12
- data/docs/DateRange.md +24 -0
- data/docs/EditMessageReqPayload.md +44 -0
- data/docs/FieldCondition.md +2 -0
- data/docs/File.md +1 -1
- data/docs/FileApi.md +7 -7
- data/docs/GenerateChunksRequest.md +2 -0
- data/docs/GetDatasetsPagination.md +20 -0
- data/docs/GroupScoreSlimChunks.md +4 -0
- data/docs/HasIDCondition.md +20 -0
- data/docs/InvitationApi.md +1 -1
- data/docs/MatchCondition.md +3 -1
- data/docs/MessageApi.md +42 -42
- data/docs/Organization.md +2 -0
- data/docs/OrganizationApi.md +24 -25
- data/docs/RangeCondition.md +1 -3
- data/docs/RecommendChunksRequest.md +1 -1
- data/docs/RecommendGroupChunksRequest.md +1 -1
- data/docs/RegenerateMessageReqPayload.md +40 -0
- data/docs/RemoveChunkFromGroupReqPayload.md +18 -0
- data/docs/ScoreChunkDTO.md +3 -1
- data/docs/SearchChunkData.md +12 -6
- data/docs/SearchChunksReqPayload.md +54 -0
- data/docs/SearchOverGroupsData.md +12 -4
- data/docs/SearchWithinGroupData.md +16 -6
- data/docs/SetUserApiKeyRequest.md +4 -0
- data/docs/SlimChunkMetadata.md +4 -0
- data/docs/SuggestedQueriesReqPayload.md +18 -0
- data/docs/TopicApi.md +16 -16
- data/docs/UpdateChunkData.md +2 -0
- data/docs/UpdateChunkReqPayload.md +46 -0
- data/docs/UpdateDatasetRequest.md +2 -0
- data/docs/UpdateGroupByTrackingIDReqPayload.md +26 -0
- data/docs/UpdateTopicReqPayload.md +20 -0
- data/docs/UpdateUserOrgRoleData.md +1 -1
- data/docs/UploadFileReqPayload.md +40 -0
- data/docs/UserApi.md +7 -8
- data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
- data/lib/trieve_ruby_client/api/chunk_api.rb +158 -83
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +58 -51
- data/lib/trieve_ruby_client/api/dataset_api.rb +224 -15
- data/lib/trieve_ruby_client/api/events_api.rb +1 -1
- data/lib/trieve_ruby_client/api/file_api.rb +12 -12
- data/lib/trieve_ruby_client/api/health_api.rb +1 -1
- data/lib/trieve_ruby_client/api/invitation_api.rb +3 -3
- data/lib/trieve_ruby_client/api/message_api.rb +50 -50
- data/lib/trieve_ruby_client/api/organization_api.rb +27 -27
- data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
- data/lib/trieve_ruby_client/api/topic_api.rb +27 -27
- data/lib/trieve_ruby_client/api/user_api.rb +8 -8
- 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 +1 -1
- data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/api_key_resp_body.rb +325 -0
- data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
- data/lib/trieve_ruby_client/models/autocomplete_data.rb +378 -0
- data/lib/trieve_ruby_client/models/autocomplete_req_payload.rb +467 -0
- 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/boost_phrase.rb +240 -0
- data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_data.rb +15 -2
- data/lib/trieve_ruby_client/models/chunk_filter.rb +4 -4
- data/lib/trieve_ruby_client/models/chunk_group.rb +5 -3
- data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
- data/lib/trieve_ruby_client/models/chunk_metadata.rb +28 -20
- data/lib/trieve_ruby_client/models/chunk_metadata_string_tag_set.rb +387 -0
- data/lib/trieve_ruby_client/models/chunk_metadata_types.rb +106 -0
- data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +2 -18
- data/lib/trieve_ruby_client/models/chunk_req_payload.rb +400 -0
- data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +2 -18
- data/lib/trieve_ruby_client/models/condition_type.rb +105 -0
- data/lib/trieve_ruby_client/models/content_chunk_metadata.rb +299 -0
- data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
- data/lib/trieve_ruby_client/models/create_chunk_group_req_payload.rb +273 -0
- data/lib/trieve_ruby_client/models/create_chunk_req_payload_enum.rb +105 -0
- data/lib/trieve_ruby_client/models/create_dataset_request.rb +3 -3
- data/lib/trieve_ruby_client/models/create_message_data.rb +13 -13
- data/lib/trieve_ruby_client/models/create_message_req_payload.rb +378 -0
- 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/create_topic_req_payload.rb +244 -0
- data/lib/trieve_ruby_client/models/dataset.rb +18 -2
- 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/date_range.rb +245 -0
- 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/edit_message_req_payload.rb +395 -0
- 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 +12 -2
- data/lib/trieve_ruby_client/models/file.rb +5 -3
- data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
- data/lib/trieve_ruby_client/models/generate_chunks_request.rb +13 -2
- data/lib/trieve_ruby_client/models/geo_info.rb +1 -1
- data/lib/trieve_ruby_client/models/geo_types.rb +1 -1
- data/lib/trieve_ruby_client/models/get_chunks_data.rb +1 -1
- data/lib/trieve_ruby_client/models/get_datasets_pagination.rb +225 -0
- 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/get_tracking_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.rb +1 -1
- data/lib/trieve_ruby_client/models/group_score_slim_chunks.rb +22 -2
- data/lib/trieve_ruby_client/models/has_id_condition.rb +229 -0
- data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
- data/lib/trieve_ruby_client/models/location_bounding_box.rb +1 -1
- data/lib/trieve_ruby_client/models/location_polygon.rb +1 -1
- data/lib/trieve_ruby_client/models/location_radius.rb +1 -1
- data/lib/trieve_ruby_client/models/match_condition.rb +2 -1
- data/lib/trieve_ruby_client/models/message.rb +1 -1
- data/lib/trieve_ruby_client/models/organization.rb +18 -2
- 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 +2 -3
- data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +2 -2
- data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +2 -2
- data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
- data/lib/trieve_ruby_client/models/regenerate_message_req_payload.rb +361 -0
- data/lib/trieve_ruby_client/models/remove_chunk_from_group_req_payload.rb +222 -0
- data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
- data/lib/trieve_ruby_client/models/score_chunk_dto.rb +15 -3
- data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunk_data.rb +49 -14
- data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
- data/lib/trieve_ruby_client/models/search_chunks_req_payload.rb +504 -0
- data/lib/trieve_ruby_client/models/search_over_groups_data.rb +95 -6
- data/lib/trieve_ruby_client/models/search_over_groups_results.rb +1 -1
- data/lib/trieve_ruby_client/models/search_over_groups_slim_results.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 +119 -17
- data/lib/trieve_ruby_client/models/search_within_group_results.rb +1 -1
- data/lib/trieve_ruby_client/models/search_within_group_slim_results.rb +1 -1
- data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +28 -2
- 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 +24 -2
- data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.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_req_payload.rb +222 -0
- 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 +1 -1
- data/lib/trieve_ruby_client/models/update_chunk_req_payload.rb +376 -0
- data/lib/trieve_ruby_client/models/update_dataset_request.rb +13 -2
- data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
- data/lib/trieve_ruby_client/models/update_group_by_tracking_id_req_payload.rb +268 -0
- 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_topic_req_payload.rb +239 -0
- data/lib/trieve_ruby_client/models/update_user_org_role_data.rb +2 -2
- data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
- data/lib/trieve_ruby_client/models/upload_file_req_payload.rb +368 -0
- 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 +25 -20
- data/openapi-generator.yaml +1 -1
- data/openapi.json +1 -7784
- data/spec/models/api_key_resp_body_spec.rb +78 -0
- data/spec/models/autocomplete_data_spec.rb +108 -0
- data/spec/models/autocomplete_req_payload_spec.rb +132 -0
- data/spec/models/boost_phrase_spec.rb +42 -0
- data/spec/models/chunk_metadata_string_tag_set_spec.rb +120 -0
- data/spec/models/chunk_metadata_types_spec.rb +32 -0
- data/spec/models/chunk_req_payload_spec.rb +132 -0
- data/spec/models/condition_type_spec.rb +32 -0
- data/spec/models/content_chunk_metadata_spec.rb +72 -0
- data/spec/models/create_chunk_group_req_payload_spec.rb +66 -0
- data/spec/models/create_chunk_req_payload_enum_spec.rb +32 -0
- data/spec/models/create_message_req_payload_spec.rb +108 -0
- data/spec/models/create_topic_req_payload_spec.rb +48 -0
- data/spec/models/date_range_spec.rb +54 -0
- data/spec/models/edit_message_req_payload_spec.rb +114 -0
- data/spec/models/get_datasets_pagination_spec.rb +42 -0
- data/spec/models/has_id_condition_spec.rb +42 -0
- data/spec/models/regenerate_message_req_payload_spec.rb +102 -0
- data/spec/models/remove_chunk_from_group_req_payload_spec.rb +36 -0
- data/spec/models/search_chunks_req_payload_spec.rb +144 -0
- data/spec/models/suggested_queries_req_payload_spec.rb +36 -0
- data/spec/models/update_chunk_req_payload_spec.rb +120 -0
- data/spec/models/update_group_by_tracking_id_req_payload_spec.rb +60 -0
- data/spec/models/update_topic_req_payload_spec.rb +42 -0
- data/spec/models/upload_file_req_payload_spec.rb +102 -0
- data/spec/spec_helper.rb +1 -1
- data/trieve_ruby_client-0.8.0.gem +0 -0
- data/trieve_ruby_client-0.8.2.gem +0 -0
- data/trieve_ruby_client-0.8.5.gem +0 -0
- data/trieve_ruby_client.gemspec +1 -1
- metadata +105 -2
@@ -0,0 +1,387 @@
|
|
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.10.7
|
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 ChunkMetadataStringTagSet
|
18
|
+
attr_accessor :chunk_html
|
19
|
+
|
20
|
+
attr_accessor :created_at
|
21
|
+
|
22
|
+
attr_accessor :dataset_id
|
23
|
+
|
24
|
+
attr_accessor :id
|
25
|
+
|
26
|
+
attr_accessor :image_urls
|
27
|
+
|
28
|
+
attr_accessor :link
|
29
|
+
|
30
|
+
attr_accessor :location
|
31
|
+
|
32
|
+
attr_accessor :metadata
|
33
|
+
|
34
|
+
attr_accessor :num_value
|
35
|
+
|
36
|
+
attr_accessor :qdrant_point_id
|
37
|
+
|
38
|
+
attr_accessor :tag_set
|
39
|
+
|
40
|
+
attr_accessor :time_stamp
|
41
|
+
|
42
|
+
attr_accessor :tracking_id
|
43
|
+
|
44
|
+
attr_accessor :updated_at
|
45
|
+
|
46
|
+
attr_accessor :weight
|
47
|
+
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
49
|
+
def self.attribute_map
|
50
|
+
{
|
51
|
+
:'chunk_html' => :'chunk_html',
|
52
|
+
:'created_at' => :'created_at',
|
53
|
+
:'dataset_id' => :'dataset_id',
|
54
|
+
:'id' => :'id',
|
55
|
+
:'image_urls' => :'image_urls',
|
56
|
+
:'link' => :'link',
|
57
|
+
:'location' => :'location',
|
58
|
+
:'metadata' => :'metadata',
|
59
|
+
:'num_value' => :'num_value',
|
60
|
+
:'qdrant_point_id' => :'qdrant_point_id',
|
61
|
+
:'tag_set' => :'tag_set',
|
62
|
+
:'time_stamp' => :'time_stamp',
|
63
|
+
:'tracking_id' => :'tracking_id',
|
64
|
+
:'updated_at' => :'updated_at',
|
65
|
+
:'weight' => :'weight'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns all the JSON keys this model knows about
|
70
|
+
def self.acceptable_attributes
|
71
|
+
attribute_map.values
|
72
|
+
end
|
73
|
+
|
74
|
+
# Attribute type mapping.
|
75
|
+
def self.openapi_types
|
76
|
+
{
|
77
|
+
:'chunk_html' => :'String',
|
78
|
+
:'created_at' => :'Time',
|
79
|
+
:'dataset_id' => :'String',
|
80
|
+
:'id' => :'String',
|
81
|
+
:'image_urls' => :'Array<String>',
|
82
|
+
:'link' => :'String',
|
83
|
+
:'location' => :'GeoInfo',
|
84
|
+
:'metadata' => :'Object',
|
85
|
+
:'num_value' => :'Float',
|
86
|
+
:'qdrant_point_id' => :'String',
|
87
|
+
:'tag_set' => :'String',
|
88
|
+
:'time_stamp' => :'Time',
|
89
|
+
:'tracking_id' => :'String',
|
90
|
+
:'updated_at' => :'Time',
|
91
|
+
:'weight' => :'Float'
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
# List of attributes with nullable: true
|
96
|
+
def self.openapi_nullable
|
97
|
+
Set.new([
|
98
|
+
:'chunk_html',
|
99
|
+
:'image_urls',
|
100
|
+
:'link',
|
101
|
+
:'location',
|
102
|
+
:'metadata',
|
103
|
+
:'num_value',
|
104
|
+
:'qdrant_point_id',
|
105
|
+
:'tag_set',
|
106
|
+
:'time_stamp',
|
107
|
+
:'tracking_id',
|
108
|
+
])
|
109
|
+
end
|
110
|
+
|
111
|
+
# Initializes the object
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
def initialize(attributes = {})
|
114
|
+
if (!attributes.is_a?(Hash))
|
115
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::ChunkMetadataStringTagSet` initialize method"
|
116
|
+
end
|
117
|
+
|
118
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
120
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
121
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::ChunkMetadataStringTagSet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
122
|
+
end
|
123
|
+
h[k.to_sym] = v
|
124
|
+
}
|
125
|
+
|
126
|
+
if attributes.key?(:'chunk_html')
|
127
|
+
self.chunk_html = attributes[:'chunk_html']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'created_at')
|
131
|
+
self.created_at = attributes[:'created_at']
|
132
|
+
else
|
133
|
+
self.created_at = nil
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'dataset_id')
|
137
|
+
self.dataset_id = attributes[:'dataset_id']
|
138
|
+
else
|
139
|
+
self.dataset_id = nil
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'id')
|
143
|
+
self.id = attributes[:'id']
|
144
|
+
else
|
145
|
+
self.id = nil
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'image_urls')
|
149
|
+
if (value = attributes[:'image_urls']).is_a?(Array)
|
150
|
+
self.image_urls = value
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'link')
|
155
|
+
self.link = attributes[:'link']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.key?(:'location')
|
159
|
+
self.location = attributes[:'location']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'metadata')
|
163
|
+
self.metadata = attributes[:'metadata']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'num_value')
|
167
|
+
self.num_value = attributes[:'num_value']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.key?(:'qdrant_point_id')
|
171
|
+
self.qdrant_point_id = attributes[:'qdrant_point_id']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.key?(:'tag_set')
|
175
|
+
self.tag_set = attributes[:'tag_set']
|
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?(:'updated_at')
|
187
|
+
self.updated_at = attributes[:'updated_at']
|
188
|
+
else
|
189
|
+
self.updated_at = nil
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'weight')
|
193
|
+
self.weight = attributes[:'weight']
|
194
|
+
else
|
195
|
+
self.weight = nil
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
200
|
+
# @return Array for valid properties with the reasons
|
201
|
+
def list_invalid_properties
|
202
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
203
|
+
invalid_properties = Array.new
|
204
|
+
if @created_at.nil?
|
205
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
206
|
+
end
|
207
|
+
|
208
|
+
if @dataset_id.nil?
|
209
|
+
invalid_properties.push('invalid value for "dataset_id", dataset_id cannot be nil.')
|
210
|
+
end
|
211
|
+
|
212
|
+
if @id.nil?
|
213
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
214
|
+
end
|
215
|
+
|
216
|
+
if @updated_at.nil?
|
217
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
218
|
+
end
|
219
|
+
|
220
|
+
if @weight.nil?
|
221
|
+
invalid_properties.push('invalid value for "weight", weight cannot be nil.')
|
222
|
+
end
|
223
|
+
|
224
|
+
invalid_properties
|
225
|
+
end
|
226
|
+
|
227
|
+
# Check to see if the all the properties in the model are valid
|
228
|
+
# @return true if the model is valid
|
229
|
+
def valid?
|
230
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
231
|
+
return false if @created_at.nil?
|
232
|
+
return false if @dataset_id.nil?
|
233
|
+
return false if @id.nil?
|
234
|
+
return false if @updated_at.nil?
|
235
|
+
return false if @weight.nil?
|
236
|
+
true
|
237
|
+
end
|
238
|
+
|
239
|
+
# Checks equality by comparing each attribute.
|
240
|
+
# @param [Object] Object to be compared
|
241
|
+
def ==(o)
|
242
|
+
return true if self.equal?(o)
|
243
|
+
self.class == o.class &&
|
244
|
+
chunk_html == o.chunk_html &&
|
245
|
+
created_at == o.created_at &&
|
246
|
+
dataset_id == o.dataset_id &&
|
247
|
+
id == o.id &&
|
248
|
+
image_urls == o.image_urls &&
|
249
|
+
link == o.link &&
|
250
|
+
location == o.location &&
|
251
|
+
metadata == o.metadata &&
|
252
|
+
num_value == o.num_value &&
|
253
|
+
qdrant_point_id == o.qdrant_point_id &&
|
254
|
+
tag_set == o.tag_set &&
|
255
|
+
time_stamp == o.time_stamp &&
|
256
|
+
tracking_id == o.tracking_id &&
|
257
|
+
updated_at == o.updated_at &&
|
258
|
+
weight == o.weight
|
259
|
+
end
|
260
|
+
|
261
|
+
# @see the `==` method
|
262
|
+
# @param [Object] Object to be compared
|
263
|
+
def eql?(o)
|
264
|
+
self == o
|
265
|
+
end
|
266
|
+
|
267
|
+
# Calculates hash code according to all attributes.
|
268
|
+
# @return [Integer] Hash code
|
269
|
+
def hash
|
270
|
+
[chunk_html, created_at, dataset_id, id, image_urls, link, location, metadata, num_value, qdrant_point_id, tag_set, time_stamp, tracking_id, updated_at, weight].hash
|
271
|
+
end
|
272
|
+
|
273
|
+
# Builds the object from hash
|
274
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
275
|
+
# @return [Object] Returns the model itself
|
276
|
+
def self.build_from_hash(attributes)
|
277
|
+
return nil unless attributes.is_a?(Hash)
|
278
|
+
attributes = attributes.transform_keys(&:to_sym)
|
279
|
+
transformed_hash = {}
|
280
|
+
openapi_types.each_pair do |key, type|
|
281
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
282
|
+
transformed_hash["#{key}"] = nil
|
283
|
+
elsif type =~ /\AArray<(.*)>/i
|
284
|
+
# check to ensure the input is an array given that the attribute
|
285
|
+
# is documented as an array but the input is not
|
286
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
287
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
288
|
+
end
|
289
|
+
elsif !attributes[attribute_map[key]].nil?
|
290
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
291
|
+
end
|
292
|
+
end
|
293
|
+
new(transformed_hash)
|
294
|
+
end
|
295
|
+
|
296
|
+
# Deserializes the data based on type
|
297
|
+
# @param string type Data type
|
298
|
+
# @param string value Value to be deserialized
|
299
|
+
# @return [Object] Deserialized data
|
300
|
+
def self._deserialize(type, value)
|
301
|
+
case type.to_sym
|
302
|
+
when :Time
|
303
|
+
Time.parse(value)
|
304
|
+
when :Date
|
305
|
+
Date.parse(value)
|
306
|
+
when :String
|
307
|
+
value.to_s
|
308
|
+
when :Integer
|
309
|
+
value.to_i
|
310
|
+
when :Float
|
311
|
+
value.to_f
|
312
|
+
when :Boolean
|
313
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
314
|
+
true
|
315
|
+
else
|
316
|
+
false
|
317
|
+
end
|
318
|
+
when :Object
|
319
|
+
# generic object (usually a Hash), return directly
|
320
|
+
value
|
321
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
322
|
+
inner_type = Regexp.last_match[:inner_type]
|
323
|
+
value.map { |v| _deserialize(inner_type, v) }
|
324
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
325
|
+
k_type = Regexp.last_match[:k_type]
|
326
|
+
v_type = Regexp.last_match[:v_type]
|
327
|
+
{}.tap do |hash|
|
328
|
+
value.each do |k, v|
|
329
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
330
|
+
end
|
331
|
+
end
|
332
|
+
else # model
|
333
|
+
# models (e.g. Pet) or oneOf
|
334
|
+
klass = TrieveRubyClient.const_get(type)
|
335
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
# Returns the string representation of the object
|
340
|
+
# @return [String] String presentation of the object
|
341
|
+
def to_s
|
342
|
+
to_hash.to_s
|
343
|
+
end
|
344
|
+
|
345
|
+
# to_body is an alias to to_hash (backward compatibility)
|
346
|
+
# @return [Hash] Returns the object in the form of hash
|
347
|
+
def to_body
|
348
|
+
to_hash
|
349
|
+
end
|
350
|
+
|
351
|
+
# Returns the object in the form of hash
|
352
|
+
# @return [Hash] Returns the object in the form of hash
|
353
|
+
def to_hash
|
354
|
+
hash = {}
|
355
|
+
self.class.attribute_map.each_pair do |attr, param|
|
356
|
+
value = self.send(attr)
|
357
|
+
if value.nil?
|
358
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
359
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
360
|
+
end
|
361
|
+
|
362
|
+
hash[param] = _to_hash(value)
|
363
|
+
end
|
364
|
+
hash
|
365
|
+
end
|
366
|
+
|
367
|
+
# Outputs non-array value in the form of hash
|
368
|
+
# For object, use to_hash. Otherwise, just return the value
|
369
|
+
# @param [Object] value Any valid value
|
370
|
+
# @return [Hash] Returns the value in the form of hash
|
371
|
+
def _to_hash(value)
|
372
|
+
if value.is_a?(Array)
|
373
|
+
value.compact.map { |v| _to_hash(v) }
|
374
|
+
elsif value.is_a?(Hash)
|
375
|
+
{}.tap do |hash|
|
376
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
377
|
+
end
|
378
|
+
elsif value.respond_to? :to_hash
|
379
|
+
value.to_hash
|
380
|
+
else
|
381
|
+
value
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
end
|
386
|
+
|
387
|
+
end
|
@@ -0,0 +1,106 @@
|
|
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.10.7
|
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 ChunkMetadataTypes
|
18
|
+
class << self
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
20
|
+
def openapi_one_of
|
21
|
+
[
|
22
|
+
:'ChunkMetadataStringTagSet',
|
23
|
+
:'ContentChunkMetadata',
|
24
|
+
:'SlimChunkMetadata'
|
25
|
+
]
|
26
|
+
end
|
27
|
+
|
28
|
+
# Builds the object
|
29
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
30
|
+
# @return [Object] Returns the model or the data itself
|
31
|
+
def build(data)
|
32
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
33
|
+
# Note:
|
34
|
+
# - We do not attempt to check whether exactly one item matches.
|
35
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
36
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
37
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
38
|
+
# - TODO: logging when debugging is set.
|
39
|
+
openapi_one_of.each do |klass|
|
40
|
+
begin
|
41
|
+
next if klass == :AnyType # "nullable: true"
|
42
|
+
typed_data = find_and_cast_into_type(klass, data)
|
43
|
+
return typed_data if typed_data
|
44
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
SchemaMismatchError = Class.new(StandardError)
|
54
|
+
|
55
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
56
|
+
def find_and_cast_into_type(klass, data)
|
57
|
+
return if data.nil?
|
58
|
+
|
59
|
+
case klass.to_s
|
60
|
+
when 'Boolean'
|
61
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
62
|
+
when 'Float'
|
63
|
+
return data if data.instance_of?(Float)
|
64
|
+
when 'Integer'
|
65
|
+
return data if data.instance_of?(Integer)
|
66
|
+
when 'Time'
|
67
|
+
return Time.parse(data)
|
68
|
+
when 'Date'
|
69
|
+
return Date.parse(data)
|
70
|
+
when 'String'
|
71
|
+
return data if data.instance_of?(String)
|
72
|
+
when 'Object' # "type: object"
|
73
|
+
return data if data.instance_of?(Hash)
|
74
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
75
|
+
if data.instance_of?(Array)
|
76
|
+
sub_type = Regexp.last_match[:sub_type]
|
77
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
78
|
+
end
|
79
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
80
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
81
|
+
sub_type = Regexp.last_match[:sub_type]
|
82
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
83
|
+
end
|
84
|
+
else # model
|
85
|
+
const = TrieveRubyClient.const_get(klass)
|
86
|
+
if const
|
87
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
88
|
+
model = const.build(data)
|
89
|
+
return model if model
|
90
|
+
else
|
91
|
+
# raise if data contains keys that are not known to the model
|
92
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
93
|
+
model = const.build_from_hash(data)
|
94
|
+
return model if model
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
raise # if no match by now, raise
|
100
|
+
rescue
|
101
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
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.10.7
|
7
7
|
Contact: developers@trieve.ai
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
Generator version: 7.4.0
|
@@ -17,8 +17,6 @@ module TrieveRubyClient
|
|
17
17
|
class ChunkMetadataWithScore
|
18
18
|
attr_accessor :chunk_html
|
19
19
|
|
20
|
-
attr_accessor :content
|
21
|
-
|
22
20
|
attr_accessor :created_at
|
23
21
|
|
24
22
|
attr_accessor :dataset_id
|
@@ -47,7 +45,6 @@ module TrieveRubyClient
|
|
47
45
|
def self.attribute_map
|
48
46
|
{
|
49
47
|
:'chunk_html' => :'chunk_html',
|
50
|
-
:'content' => :'content',
|
51
48
|
:'created_at' => :'created_at',
|
52
49
|
:'dataset_id' => :'dataset_id',
|
53
50
|
:'id' => :'id',
|
@@ -72,7 +69,6 @@ module TrieveRubyClient
|
|
72
69
|
def self.openapi_types
|
73
70
|
{
|
74
71
|
:'chunk_html' => :'String',
|
75
|
-
:'content' => :'String',
|
76
72
|
:'created_at' => :'Time',
|
77
73
|
:'dataset_id' => :'String',
|
78
74
|
:'id' => :'String',
|
@@ -120,12 +116,6 @@ module TrieveRubyClient
|
|
120
116
|
self.chunk_html = attributes[:'chunk_html']
|
121
117
|
end
|
122
118
|
|
123
|
-
if attributes.key?(:'content')
|
124
|
-
self.content = attributes[:'content']
|
125
|
-
else
|
126
|
-
self.content = nil
|
127
|
-
end
|
128
|
-
|
129
119
|
if attributes.key?(:'created_at')
|
130
120
|
self.created_at = attributes[:'created_at']
|
131
121
|
else
|
@@ -192,10 +182,6 @@ module TrieveRubyClient
|
|
192
182
|
def list_invalid_properties
|
193
183
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
194
184
|
invalid_properties = Array.new
|
195
|
-
if @content.nil?
|
196
|
-
invalid_properties.push('invalid value for "content", content cannot be nil.')
|
197
|
-
end
|
198
|
-
|
199
185
|
if @created_at.nil?
|
200
186
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
201
187
|
end
|
@@ -227,7 +213,6 @@ module TrieveRubyClient
|
|
227
213
|
# @return true if the model is valid
|
228
214
|
def valid?
|
229
215
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
230
|
-
return false if @content.nil?
|
231
216
|
return false if @created_at.nil?
|
232
217
|
return false if @dataset_id.nil?
|
233
218
|
return false if @id.nil?
|
@@ -243,7 +228,6 @@ module TrieveRubyClient
|
|
243
228
|
return true if self.equal?(o)
|
244
229
|
self.class == o.class &&
|
245
230
|
chunk_html == o.chunk_html &&
|
246
|
-
content == o.content &&
|
247
231
|
created_at == o.created_at &&
|
248
232
|
dataset_id == o.dataset_id &&
|
249
233
|
id == o.id &&
|
@@ -267,7 +251,7 @@ module TrieveRubyClient
|
|
267
251
|
# Calculates hash code according to all attributes.
|
268
252
|
# @return [Integer] Hash code
|
269
253
|
def hash
|
270
|
-
[chunk_html,
|
254
|
+
[chunk_html, created_at, dataset_id, id, link, metadata, qdrant_point_id, score, tag_set, time_stamp, tracking_id, updated_at, weight].hash
|
271
255
|
end
|
272
256
|
|
273
257
|
# Builds the object from hash
|