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.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -30
  3. data/docs/ApiKeyRespBody.md +32 -0
  4. data/docs/AutocompleteData.md +42 -0
  5. data/docs/AutocompleteReqPayload.md +50 -0
  6. data/docs/BoostPhrase.md +20 -0
  7. data/docs/ChunkApi.md +140 -66
  8. data/docs/ChunkData.md +2 -0
  9. data/docs/ChunkFilter.md +3 -3
  10. data/docs/ChunkGroup.md +1 -1
  11. data/docs/ChunkGroupApi.md +35 -33
  12. data/docs/ChunkMetadata.md +5 -3
  13. data/docs/ChunkMetadataStringTagSet.md +46 -0
  14. data/docs/ChunkMetadataTypes.md +51 -0
  15. data/docs/ChunkMetadataWithScore.md +0 -2
  16. data/docs/ChunkReqPayload.md +50 -0
  17. data/docs/ClientDatasetConfiguration.md +0 -2
  18. data/docs/ConditionType.md +49 -0
  19. data/docs/ContentChunkMetadata.md +32 -0
  20. data/docs/CreateChunkGroupReqPayload.md +28 -0
  21. data/docs/CreateChunkReqPayloadEnum.md +49 -0
  22. data/docs/CreateDatasetRequest.md +2 -2
  23. data/docs/CreateMessageData.md +2 -2
  24. data/docs/CreateMessageReqPayload.md +42 -0
  25. data/docs/CreateTopicReqPayload.md +22 -0
  26. data/docs/Dataset.md +2 -0
  27. data/docs/DatasetApi.md +236 -12
  28. data/docs/DateRange.md +24 -0
  29. data/docs/EditMessageReqPayload.md +44 -0
  30. data/docs/FieldCondition.md +2 -0
  31. data/docs/File.md +1 -1
  32. data/docs/FileApi.md +7 -7
  33. data/docs/GenerateChunksRequest.md +2 -0
  34. data/docs/GetDatasetsPagination.md +20 -0
  35. data/docs/GroupScoreSlimChunks.md +4 -0
  36. data/docs/HasIDCondition.md +20 -0
  37. data/docs/InvitationApi.md +1 -1
  38. data/docs/MatchCondition.md +3 -1
  39. data/docs/MessageApi.md +42 -42
  40. data/docs/Organization.md +2 -0
  41. data/docs/OrganizationApi.md +24 -25
  42. data/docs/RangeCondition.md +1 -3
  43. data/docs/RecommendChunksRequest.md +1 -1
  44. data/docs/RecommendGroupChunksRequest.md +1 -1
  45. data/docs/RegenerateMessageReqPayload.md +40 -0
  46. data/docs/RemoveChunkFromGroupReqPayload.md +18 -0
  47. data/docs/ScoreChunkDTO.md +3 -1
  48. data/docs/SearchChunkData.md +12 -6
  49. data/docs/SearchChunksReqPayload.md +54 -0
  50. data/docs/SearchOverGroupsData.md +12 -4
  51. data/docs/SearchWithinGroupData.md +16 -6
  52. data/docs/SetUserApiKeyRequest.md +4 -0
  53. data/docs/SlimChunkMetadata.md +4 -0
  54. data/docs/SuggestedQueriesReqPayload.md +18 -0
  55. data/docs/TopicApi.md +16 -16
  56. data/docs/UpdateChunkData.md +2 -0
  57. data/docs/UpdateChunkReqPayload.md +46 -0
  58. data/docs/UpdateDatasetRequest.md +2 -0
  59. data/docs/UpdateGroupByTrackingIDReqPayload.md +26 -0
  60. data/docs/UpdateTopicReqPayload.md +20 -0
  61. data/docs/UpdateUserOrgRoleData.md +1 -1
  62. data/docs/UploadFileReqPayload.md +40 -0
  63. data/docs/UserApi.md +7 -8
  64. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  65. data/lib/trieve_ruby_client/api/chunk_api.rb +158 -83
  66. data/lib/trieve_ruby_client/api/chunk_group_api.rb +58 -51
  67. data/lib/trieve_ruby_client/api/dataset_api.rb +224 -15
  68. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  69. data/lib/trieve_ruby_client/api/file_api.rb +12 -12
  70. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  71. data/lib/trieve_ruby_client/api/invitation_api.rb +3 -3
  72. data/lib/trieve_ruby_client/api/message_api.rb +50 -50
  73. data/lib/trieve_ruby_client/api/organization_api.rb +27 -27
  74. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  75. data/lib/trieve_ruby_client/api/topic_api.rb +27 -27
  76. data/lib/trieve_ruby_client/api/user_api.rb +8 -8
  77. data/lib/trieve_ruby_client/api_client.rb +1 -1
  78. data/lib/trieve_ruby_client/api_error.rb +1 -1
  79. data/lib/trieve_ruby_client/configuration.rb +1 -1
  80. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
  81. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  82. data/lib/trieve_ruby_client/models/api_key_resp_body.rb +325 -0
  83. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  84. data/lib/trieve_ruby_client/models/autocomplete_data.rb +378 -0
  85. data/lib/trieve_ruby_client/models/autocomplete_req_payload.rb +467 -0
  86. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  87. data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
  88. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  89. data/lib/trieve_ruby_client/models/boost_phrase.rb +240 -0
  90. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  91. data/lib/trieve_ruby_client/models/chunk_data.rb +15 -2
  92. data/lib/trieve_ruby_client/models/chunk_filter.rb +4 -4
  93. data/lib/trieve_ruby_client/models/chunk_group.rb +5 -3
  94. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  95. data/lib/trieve_ruby_client/models/chunk_metadata.rb +28 -20
  96. data/lib/trieve_ruby_client/models/chunk_metadata_string_tag_set.rb +387 -0
  97. data/lib/trieve_ruby_client/models/chunk_metadata_types.rb +106 -0
  98. data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +2 -18
  99. data/lib/trieve_ruby_client/models/chunk_req_payload.rb +400 -0
  100. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +2 -18
  101. data/lib/trieve_ruby_client/models/condition_type.rb +105 -0
  102. data/lib/trieve_ruby_client/models/content_chunk_metadata.rb +299 -0
  103. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  104. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
  105. data/lib/trieve_ruby_client/models/create_chunk_group_req_payload.rb +273 -0
  106. data/lib/trieve_ruby_client/models/create_chunk_req_payload_enum.rb +105 -0
  107. data/lib/trieve_ruby_client/models/create_dataset_request.rb +3 -3
  108. data/lib/trieve_ruby_client/models/create_message_data.rb +13 -13
  109. data/lib/trieve_ruby_client/models/create_message_req_payload.rb +378 -0
  110. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  111. data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
  112. data/lib/trieve_ruby_client/models/create_topic_req_payload.rb +244 -0
  113. data/lib/trieve_ruby_client/models/dataset.rb +18 -2
  114. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  115. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  116. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  117. data/lib/trieve_ruby_client/models/date_range.rb +245 -0
  118. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  119. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  120. data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
  121. data/lib/trieve_ruby_client/models/edit_message_req_payload.rb +395 -0
  122. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  123. data/lib/trieve_ruby_client/models/event.rb +1 -1
  124. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  125. data/lib/trieve_ruby_client/models/field_condition.rb +12 -2
  126. data/lib/trieve_ruby_client/models/file.rb +5 -3
  127. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  128. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +13 -2
  129. data/lib/trieve_ruby_client/models/geo_info.rb +1 -1
  130. data/lib/trieve_ruby_client/models/geo_types.rb +1 -1
  131. data/lib/trieve_ruby_client/models/get_chunks_data.rb +1 -1
  132. data/lib/trieve_ruby_client/models/get_datasets_pagination.rb +225 -0
  133. data/lib/trieve_ruby_client/models/get_events_data.rb +1 -1
  134. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  135. data/lib/trieve_ruby_client/models/get_tracking_chunks_data.rb +1 -1
  136. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  137. data/lib/trieve_ruby_client/models/group_score_chunk.rb +1 -1
  138. data/lib/trieve_ruby_client/models/group_score_slim_chunks.rb +22 -2
  139. data/lib/trieve_ruby_client/models/has_id_condition.rb +229 -0
  140. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  141. data/lib/trieve_ruby_client/models/location_bounding_box.rb +1 -1
  142. data/lib/trieve_ruby_client/models/location_polygon.rb +1 -1
  143. data/lib/trieve_ruby_client/models/location_radius.rb +1 -1
  144. data/lib/trieve_ruby_client/models/match_condition.rb +2 -1
  145. data/lib/trieve_ruby_client/models/message.rb +1 -1
  146. data/lib/trieve_ruby_client/models/organization.rb +18 -2
  147. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  148. data/lib/trieve_ruby_client/models/range.rb +1 -1
  149. data/lib/trieve_ruby_client/models/range_condition.rb +2 -3
  150. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +2 -2
  151. data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +2 -2
  152. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
  153. data/lib/trieve_ruby_client/models/regenerate_message_req_payload.rb +361 -0
  154. data/lib/trieve_ruby_client/models/remove_chunk_from_group_req_payload.rb +222 -0
  155. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  156. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +15 -3
  157. data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
  158. data/lib/trieve_ruby_client/models/search_chunk_data.rb +49 -14
  159. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  160. data/lib/trieve_ruby_client/models/search_chunks_req_payload.rb +504 -0
  161. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +95 -6
  162. data/lib/trieve_ruby_client/models/search_over_groups_results.rb +1 -1
  163. data/lib/trieve_ruby_client/models/search_over_groups_slim_results.rb +1 -1
  164. data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +1 -1
  165. data/lib/trieve_ruby_client/models/search_within_group_data.rb +119 -17
  166. data/lib/trieve_ruby_client/models/search_within_group_results.rb +1 -1
  167. data/lib/trieve_ruby_client/models/search_within_group_slim_results.rb +1 -1
  168. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +28 -2
  169. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  170. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  171. data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +24 -2
  172. data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +1 -1
  173. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  174. data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
  175. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  176. data/lib/trieve_ruby_client/models/suggested_queries_req_payload.rb +222 -0
  177. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  178. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  179. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  180. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
  181. data/lib/trieve_ruby_client/models/update_chunk_data.rb +15 -2
  182. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  183. data/lib/trieve_ruby_client/models/update_chunk_req_payload.rb +376 -0
  184. data/lib/trieve_ruby_client/models/update_dataset_request.rb +13 -2
  185. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  186. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_req_payload.rb +268 -0
  187. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  188. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  189. data/lib/trieve_ruby_client/models/update_topic_req_payload.rb +239 -0
  190. data/lib/trieve_ruby_client/models/update_user_org_role_data.rb +2 -2
  191. data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
  192. data/lib/trieve_ruby_client/models/upload_file_req_payload.rb +368 -0
  193. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  194. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  195. data/lib/trieve_ruby_client/version.rb +2 -2
  196. data/lib/trieve_ruby_client.rb +25 -20
  197. data/openapi-generator.yaml +1 -1
  198. data/openapi.json +1 -7784
  199. data/spec/models/api_key_resp_body_spec.rb +78 -0
  200. data/spec/models/autocomplete_data_spec.rb +108 -0
  201. data/spec/models/autocomplete_req_payload_spec.rb +132 -0
  202. data/spec/models/boost_phrase_spec.rb +42 -0
  203. data/spec/models/chunk_metadata_string_tag_set_spec.rb +120 -0
  204. data/spec/models/chunk_metadata_types_spec.rb +32 -0
  205. data/spec/models/chunk_req_payload_spec.rb +132 -0
  206. data/spec/models/condition_type_spec.rb +32 -0
  207. data/spec/models/content_chunk_metadata_spec.rb +72 -0
  208. data/spec/models/create_chunk_group_req_payload_spec.rb +66 -0
  209. data/spec/models/create_chunk_req_payload_enum_spec.rb +32 -0
  210. data/spec/models/create_message_req_payload_spec.rb +108 -0
  211. data/spec/models/create_topic_req_payload_spec.rb +48 -0
  212. data/spec/models/date_range_spec.rb +54 -0
  213. data/spec/models/edit_message_req_payload_spec.rb +114 -0
  214. data/spec/models/get_datasets_pagination_spec.rb +42 -0
  215. data/spec/models/has_id_condition_spec.rb +42 -0
  216. data/spec/models/regenerate_message_req_payload_spec.rb +102 -0
  217. data/spec/models/remove_chunk_from_group_req_payload_spec.rb +36 -0
  218. data/spec/models/search_chunks_req_payload_spec.rb +144 -0
  219. data/spec/models/suggested_queries_req_payload_spec.rb +36 -0
  220. data/spec/models/update_chunk_req_payload_spec.rb +120 -0
  221. data/spec/models/update_group_by_tracking_id_req_payload_spec.rb +60 -0
  222. data/spec/models/update_topic_req_payload_spec.rb +42 -0
  223. data/spec/models/upload_file_req_payload_spec.rb +102 -0
  224. data/spec/spec_helper.rb +1 -1
  225. data/trieve_ruby_client-0.8.0.gem +0 -0
  226. data/trieve_ruby_client-0.8.2.gem +0 -0
  227. data/trieve_ruby_client-0.8.5.gem +0 -0
  228. data/trieve_ruby_client.gemspec +1 -1
  229. metadata +105 -2
@@ -0,0 +1,222 @@
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 RemoveChunkFromGroupReqPayload
18
+ # Id of the chunk to remove from the group.
19
+ attr_accessor :chunk_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'chunk_id' => :'chunk_id'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'chunk_id' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::RemoveChunkFromGroupReqPayload` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::RemoveChunkFromGroupReqPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'chunk_id')
62
+ self.chunk_id = attributes[:'chunk_id']
63
+ else
64
+ self.chunk_id = nil
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
72
+ invalid_properties = Array.new
73
+ if @chunk_id.nil?
74
+ invalid_properties.push('invalid value for "chunk_id", chunk_id cannot be nil.')
75
+ end
76
+
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ return false if @chunk_id.nil?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ chunk_id == o.chunk_id
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [chunk_id].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def self._deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = TrieveRubyClient.const_get(type)
170
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ 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.8.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
@@ -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.8.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
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module TrieveRubyClient
17
17
  class ScoreChunkDTO
18
+ attr_accessor :highlights
19
+
18
20
  attr_accessor :metadata
19
21
 
20
22
  attr_accessor :score
@@ -22,6 +24,7 @@ module TrieveRubyClient
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
23
25
  def self.attribute_map
24
26
  {
27
+ :'highlights' => :'highlights',
25
28
  :'metadata' => :'metadata',
26
29
  :'score' => :'score'
27
30
  }
@@ -35,7 +38,8 @@ module TrieveRubyClient
35
38
  # Attribute type mapping.
36
39
  def self.openapi_types
37
40
  {
38
- :'metadata' => :'Array<ChunkMetadata>',
41
+ :'highlights' => :'Array<String>',
42
+ :'metadata' => :'Array<ChunkMetadataTypes>',
39
43
  :'score' => :'Float'
40
44
  }
41
45
  end
@@ -43,6 +47,7 @@ module TrieveRubyClient
43
47
  # List of attributes with nullable: true
44
48
  def self.openapi_nullable
45
49
  Set.new([
50
+ :'highlights',
46
51
  ])
47
52
  end
48
53
 
@@ -61,6 +66,12 @@ module TrieveRubyClient
61
66
  h[k.to_sym] = v
62
67
  }
63
68
 
69
+ if attributes.key?(:'highlights')
70
+ if (value = attributes[:'highlights']).is_a?(Array)
71
+ self.highlights = value
72
+ end
73
+ end
74
+
64
75
  if attributes.key?(:'metadata')
65
76
  if (value = attributes[:'metadata']).is_a?(Array)
66
77
  self.metadata = value
@@ -106,6 +117,7 @@ module TrieveRubyClient
106
117
  def ==(o)
107
118
  return true if self.equal?(o)
108
119
  self.class == o.class &&
120
+ highlights == o.highlights &&
109
121
  metadata == o.metadata &&
110
122
  score == o.score
111
123
  end
@@ -119,7 +131,7 @@ module TrieveRubyClient
119
131
  # Calculates hash code according to all attributes.
120
132
  # @return [Integer] Hash code
121
133
  def hash
122
- [metadata, score].hash
134
+ [highlights, metadata, score].hash
123
135
  end
124
136
 
125
137
  # 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.8.0
6
+ The version of the OpenAPI document: 0.8.2
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.8.5
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -15,23 +15,26 @@ require 'time'
15
15
 
16
16
  module TrieveRubyClient
17
17
  class SearchChunkData
18
- # Set date_bias to true to bias search results towards more recent chunks. This will work best in hybrid search mode.
19
- attr_accessor :date_bias
18
+ # Set content_only to true to only returning the chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typically 10-50ms). Default is false.
19
+ attr_accessor :content_only
20
20
 
21
21
  attr_accessor :filters
22
22
 
23
23
  # Set get_collisions to true to get the collisions for each chunk. This will only apply if environment variable COLLISIONS_ENABLED is set to true.
24
24
  attr_accessor :get_collisions
25
25
 
26
- # Get total page count for the query accounting for the applied filters. Defaults to true, but can be set to false to reduce latency in edge cases performance.
26
+ # Get total page count for the query accounting for the applied filters. Defaults to false, but can be set to true when the latency penalty is acceptable (typically 50-200ms).
27
27
  attr_accessor :get_total_pages
28
28
 
29
29
  # Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"].
30
30
  attr_accessor :highlight_delimiters
31
31
 
32
- # Set highlight_results to true to highlight the results. If not specified, this defaults to true.
32
+ # Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>` tags to the chunk_html of the chunks to highlight matching sub-sentences.
33
33
  attr_accessor :highlight_results
34
34
 
35
+ # Set highlight_threshold to a lower or higher value to adjust the sensitivity of the highlights applied to the chunk html. If not specified, this defaults to 0.8. The range is 0.0 to 1.0.
36
+ attr_accessor :highlight_threshold
37
+
35
38
  # Page of chunks to fetch. Page is 1-indexed.
36
39
  attr_accessor :page
37
40
 
@@ -41,33 +44,42 @@ module TrieveRubyClient
41
44
  # Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set.
42
45
  attr_accessor :query
43
46
 
47
+ # Recency Bias lets you determine how much of an effect the recency of chunks will have on the search results. If not specified, this defaults to 0.0. We recommend setting this to 1.0 for a gentle reranking of the results, >3.0 for a strong reranking of the results.
48
+ attr_accessor :recency_bias
49
+
44
50
  # Set score_threshold to a float to filter out chunks with a score below the threshold.
45
51
  attr_accessor :score_threshold
46
52
 
47
- # 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.
53
+ # Can be either \"semantic\", \"fulltext\", or \"hybrid\". If specified as \"hybrid\", it 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
54
  attr_accessor :search_type
49
55
 
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.
56
+ # 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 (typically 10-50ms). Default is false.
51
57
  attr_accessor :slim_chunks
52
58
 
59
+ # Tag weights is a JSON object which can be used to boost the ranking of chunks with certain tags. This is useful for when you want to be able to bias towards chunks with a certain tag on the fly. The keys are the tag names and the values are the weights.
60
+ attr_accessor :tag_weights
61
+
53
62
  # 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.
54
63
  attr_accessor :use_weights
55
64
 
56
65
  # Attribute mapping from ruby-style variable name to JSON key.
57
66
  def self.attribute_map
58
67
  {
59
- :'date_bias' => :'date_bias',
68
+ :'content_only' => :'content_only',
60
69
  :'filters' => :'filters',
61
70
  :'get_collisions' => :'get_collisions',
62
71
  :'get_total_pages' => :'get_total_pages',
63
72
  :'highlight_delimiters' => :'highlight_delimiters',
64
73
  :'highlight_results' => :'highlight_results',
74
+ :'highlight_threshold' => :'highlight_threshold',
65
75
  :'page' => :'page',
66
76
  :'page_size' => :'page_size',
67
77
  :'query' => :'query',
78
+ :'recency_bias' => :'recency_bias',
68
79
  :'score_threshold' => :'score_threshold',
69
80
  :'search_type' => :'search_type',
70
81
  :'slim_chunks' => :'slim_chunks',
82
+ :'tag_weights' => :'tag_weights',
71
83
  :'use_weights' => :'use_weights'
72
84
  }
73
85
  end
@@ -80,18 +92,21 @@ module TrieveRubyClient
80
92
  # Attribute type mapping.
81
93
  def self.openapi_types
82
94
  {
83
- :'date_bias' => :'Boolean',
95
+ :'content_only' => :'Boolean',
84
96
  :'filters' => :'ChunkFilter',
85
97
  :'get_collisions' => :'Boolean',
86
98
  :'get_total_pages' => :'Boolean',
87
99
  :'highlight_delimiters' => :'Array<String>',
88
100
  :'highlight_results' => :'Boolean',
101
+ :'highlight_threshold' => :'Float',
89
102
  :'page' => :'Integer',
90
103
  :'page_size' => :'Integer',
91
104
  :'query' => :'String',
105
+ :'recency_bias' => :'Float',
92
106
  :'score_threshold' => :'Float',
93
107
  :'search_type' => :'String',
94
108
  :'slim_chunks' => :'Boolean',
109
+ :'tag_weights' => :'Hash<String, Float>',
95
110
  :'use_weights' => :'Boolean'
96
111
  }
97
112
  end
@@ -99,16 +114,19 @@ module TrieveRubyClient
99
114
  # List of attributes with nullable: true
100
115
  def self.openapi_nullable
101
116
  Set.new([
102
- :'date_bias',
117
+ :'content_only',
103
118
  :'filters',
104
119
  :'get_collisions',
105
120
  :'get_total_pages',
106
121
  :'highlight_delimiters',
107
122
  :'highlight_results',
123
+ :'highlight_threshold',
108
124
  :'page',
109
125
  :'page_size',
126
+ :'recency_bias',
110
127
  :'score_threshold',
111
128
  :'slim_chunks',
129
+ :'tag_weights',
112
130
  :'use_weights'
113
131
  ])
114
132
  end
@@ -128,8 +146,8 @@ module TrieveRubyClient
128
146
  h[k.to_sym] = v
129
147
  }
130
148
 
131
- if attributes.key?(:'date_bias')
132
- self.date_bias = attributes[:'date_bias']
149
+ if attributes.key?(:'content_only')
150
+ self.content_only = attributes[:'content_only']
133
151
  end
134
152
 
135
153
  if attributes.key?(:'filters')
@@ -154,6 +172,10 @@ module TrieveRubyClient
154
172
  self.highlight_results = attributes[:'highlight_results']
155
173
  end
156
174
 
175
+ if attributes.key?(:'highlight_threshold')
176
+ self.highlight_threshold = attributes[:'highlight_threshold']
177
+ end
178
+
157
179
  if attributes.key?(:'page')
158
180
  self.page = attributes[:'page']
159
181
  end
@@ -168,6 +190,10 @@ module TrieveRubyClient
168
190
  self.query = nil
169
191
  end
170
192
 
193
+ if attributes.key?(:'recency_bias')
194
+ self.recency_bias = attributes[:'recency_bias']
195
+ end
196
+
171
197
  if attributes.key?(:'score_threshold')
172
198
  self.score_threshold = attributes[:'score_threshold']
173
199
  end
@@ -182,6 +208,12 @@ module TrieveRubyClient
182
208
  self.slim_chunks = attributes[:'slim_chunks']
183
209
  end
184
210
 
211
+ if attributes.key?(:'tag_weights')
212
+ if (value = attributes[:'tag_weights']).is_a?(Hash)
213
+ self.tag_weights = value
214
+ end
215
+ end
216
+
185
217
  if attributes.key?(:'use_weights')
186
218
  self.use_weights = attributes[:'use_weights']
187
219
  end
@@ -247,18 +279,21 @@ module TrieveRubyClient
247
279
  def ==(o)
248
280
  return true if self.equal?(o)
249
281
  self.class == o.class &&
250
- date_bias == o.date_bias &&
282
+ content_only == o.content_only &&
251
283
  filters == o.filters &&
252
284
  get_collisions == o.get_collisions &&
253
285
  get_total_pages == o.get_total_pages &&
254
286
  highlight_delimiters == o.highlight_delimiters &&
255
287
  highlight_results == o.highlight_results &&
288
+ highlight_threshold == o.highlight_threshold &&
256
289
  page == o.page &&
257
290
  page_size == o.page_size &&
258
291
  query == o.query &&
292
+ recency_bias == o.recency_bias &&
259
293
  score_threshold == o.score_threshold &&
260
294
  search_type == o.search_type &&
261
295
  slim_chunks == o.slim_chunks &&
296
+ tag_weights == o.tag_weights &&
262
297
  use_weights == o.use_weights
263
298
  end
264
299
 
@@ -271,7 +306,7 @@ module TrieveRubyClient
271
306
  # Calculates hash code according to all attributes.
272
307
  # @return [Integer] Hash code
273
308
  def hash
274
- [date_bias, filters, get_collisions, get_total_pages, highlight_delimiters, highlight_results, page, page_size, query, score_threshold, search_type, slim_chunks, use_weights].hash
309
+ [content_only, filters, get_collisions, get_total_pages, highlight_delimiters, highlight_results, highlight_threshold, page, page_size, query, recency_bias, score_threshold, search_type, slim_chunks, tag_weights, use_weights].hash
275
310
  end
276
311
 
277
312
  # 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.8.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