trieve_ruby_client 0.4.0 → 0.5.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 (255) hide show
  1. checksums.yaml +4 -4
  2. data/GENERATE_COMMAND.txt +1 -0
  3. data/README.md +29 -18
  4. data/docs/AddChunkToGroupData.md +1 -1
  5. data/docs/AuthApi.md +1 -1
  6. data/docs/ChunkApi.md +34 -38
  7. data/docs/ChunkGroupApi.md +51 -48
  8. data/docs/DatasetApi.md +9 -9
  9. data/docs/EventsApi.md +1 -1
  10. data/docs/FileApi.md +1 -1
  11. data/docs/GetEventsData.md +1 -1
  12. data/docs/GroupScoreChunkDTO.md +2 -0
  13. data/docs/GroupSlimChunksDTO.md +20 -0
  14. data/docs/HealthApi.md +1 -1
  15. data/docs/InvitationApi.md +1 -1
  16. data/docs/MessageApi.md +1 -1
  17. data/docs/OrganizationApi.md +1 -1
  18. data/docs/Range.md +4 -4
  19. data/docs/RangeCondition.md +49 -0
  20. data/docs/ReccomendGroupChunksRequest.md +3 -1
  21. data/docs/RecommendChunksRequest.md +3 -1
  22. data/docs/RecommendChunksResponseTypes.md +49 -0
  23. data/docs/RecommendGroupChunkResponseTypes.md +49 -0
  24. data/docs/ScoreSlimChunks.md +20 -0
  25. data/docs/SearchChunkData.md +4 -0
  26. data/docs/SearchChunkResponseTypes.md +49 -0
  27. data/docs/SearchGroupSlimChunksResult.md +22 -0
  28. data/docs/SearchOverGroupsData.md +5 -1
  29. data/docs/SearchOverGroupsResponseTypes.md +49 -0
  30. data/docs/SearchOverGroupsSlimChunksResponseBody.md +20 -0
  31. data/docs/SearchSlimChunkQueryResponseBody.md +20 -0
  32. data/docs/SearchWithinGroupData.md +4 -0
  33. data/docs/SearchWithinGroupResponseTypes.md +49 -0
  34. data/docs/SlimChunkMetadata.md +36 -0
  35. data/docs/SlimUser.md +1 -7
  36. data/docs/StripeApi.md +1 -1
  37. data/docs/TopicApi.md +9 -9
  38. data/docs/UpdateChunkData.md +2 -0
  39. data/docs/UpdateUserData.md +1 -7
  40. data/docs/UserApi.md +9 -9
  41. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  42. data/lib/trieve_ruby_client/api/chunk_api.rb +34 -38
  43. data/lib/trieve_ruby_client/api/chunk_group_api.rb +56 -59
  44. data/lib/trieve_ruby_client/api/dataset_api.rb +11 -16
  45. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  46. data/lib/trieve_ruby_client/api/file_api.rb +1 -1
  47. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  48. data/lib/trieve_ruby_client/api/invitation_api.rb +1 -1
  49. data/lib/trieve_ruby_client/api/message_api.rb +1 -1
  50. data/lib/trieve_ruby_client/api/organization_api.rb +1 -1
  51. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  52. data/lib/trieve_ruby_client/api/topic_api.rb +11 -16
  53. data/lib/trieve_ruby_client/api/user_api.rb +11 -16
  54. data/lib/trieve_ruby_client/api_client.rb +1 -1
  55. data/lib/trieve_ruby_client/api_error.rb +1 -1
  56. data/lib/trieve_ruby_client/configuration.rb +7 -7
  57. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +2 -2
  58. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  59. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  60. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  61. data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
  62. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  63. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  64. data/lib/trieve_ruby_client/models/chunk_data.rb +1 -1
  65. data/lib/trieve_ruby_client/models/chunk_filter.rb +1 -1
  66. data/lib/trieve_ruby_client/models/chunk_group.rb +1 -1
  67. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  68. data/lib/trieve_ruby_client/models/chunk_metadata.rb +1 -1
  69. data/lib/trieve_ruby_client/models/chunk_metadata_with_file_data.rb +1 -1
  70. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +1 -1
  71. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  72. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
  73. data/lib/trieve_ruby_client/models/create_dataset_request.rb +1 -1
  74. data/lib/trieve_ruby_client/models/create_message_data.rb +1 -1
  75. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  76. data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
  77. data/lib/trieve_ruby_client/models/dataset.rb +1 -1
  78. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  79. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  80. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  81. data/lib/trieve_ruby_client/models/delete_dataset_request.rb +1 -1
  82. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  83. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  84. data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
  85. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  86. data/lib/trieve_ruby_client/models/event.rb +1 -1
  87. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  88. data/lib/trieve_ruby_client/models/field_condition.rb +1 -1
  89. data/lib/trieve_ruby_client/models/file.rb +1 -1
  90. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  91. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +1 -1
  92. data/lib/trieve_ruby_client/models/get_events_data.rb +2 -2
  93. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  94. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  95. data/lib/trieve_ruby_client/models/group_score_chunk_dto.rb +12 -2
  96. data/lib/trieve_ruby_client/models/group_slim_chunks_dto.rb +239 -0
  97. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  98. data/lib/trieve_ruby_client/models/match_condition.rb +1 -1
  99. data/lib/trieve_ruby_client/models/message.rb +1 -1
  100. data/lib/trieve_ruby_client/models/organization.rb +1 -1
  101. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  102. data/lib/trieve_ruby_client/models/range.rb +5 -5
  103. data/lib/trieve_ruby_client/models/range_condition.rb +105 -0
  104. data/lib/trieve_ruby_client/models/reccomend_group_chunks_request.rb +17 -6
  105. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +17 -6
  106. data/lib/trieve_ruby_client/models/recommend_chunks_response_types.rb +105 -0
  107. data/lib/trieve_ruby_client/models/recommend_group_chunk_response_types.rb +105 -0
  108. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
  109. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  110. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +1 -1
  111. data/lib/trieve_ruby_client/models/score_slim_chunks.rb +239 -0
  112. data/lib/trieve_ruby_client/models/search_chunk_data.rb +24 -2
  113. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  114. data/lib/trieve_ruby_client/models/search_chunk_response_types.rb +105 -0
  115. data/lib/trieve_ruby_client/models/search_group_slim_chunks_result.rb +255 -0
  116. data/lib/trieve_ruby_client/models/search_groups_result.rb +1 -1
  117. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +27 -5
  118. data/lib/trieve_ruby_client/models/search_over_groups_response_body.rb +1 -1
  119. data/lib/trieve_ruby_client/models/search_over_groups_response_types.rb +105 -0
  120. data/lib/trieve_ruby_client/models/search_over_groups_slim_chunks_response_body.rb +239 -0
  121. data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +239 -0
  122. data/lib/trieve_ruby_client/models/search_within_group_data.rb +24 -2
  123. data/lib/trieve_ruby_client/models/search_within_group_response_types.rb +105 -0
  124. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +1 -1
  125. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  126. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  127. data/lib/trieve_ruby_client/models/{stripe_subscription.rb → slim_chunk_metadata.rb} +75 -57
  128. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  129. data/lib/trieve_ruby_client/models/slim_user.rb +5 -41
  130. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  131. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  132. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  133. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  134. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
  135. data/lib/trieve_ruby_client/models/update_chunk_data.rb +15 -2
  136. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  137. data/lib/trieve_ruby_client/models/update_dataset_request.rb +1 -1
  138. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  139. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  140. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  141. data/lib/trieve_ruby_client/models/update_user_data.rb +6 -39
  142. data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
  143. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  144. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  145. data/lib/trieve_ruby_client/version.rb +2 -2
  146. data/lib/trieve_ruby_client.rb +13 -2
  147. data/openapi-generator.yaml +1 -1
  148. data/openapi.json +692 -335
  149. data/spec/api/auth_api_spec.rb +16 -18
  150. data/spec/api/chunk_api_spec.rb +30 -43
  151. data/spec/api/chunk_group_api_spec.rb +54 -33
  152. data/spec/api/dataset_api_spec.rb +19 -19
  153. data/spec/api/events_api_spec.rb +10 -10
  154. data/spec/api/file_api_spec.rb +15 -15
  155. data/spec/api/health_api_spec.rb +9 -7
  156. data/spec/api/invitation_api_spec.rb +9 -9
  157. data/spec/api/message_api_spec.rb +15 -15
  158. data/spec/api/organization_api_spec.rb +19 -19
  159. data/spec/api/stripe_api_spec.rb +15 -7
  160. data/spec/api/topic_api_spec.rb +15 -15
  161. data/spec/api/user_api_spec.rb +13 -13
  162. data/spec/models/add_chunk_to_group_data_spec.rb +8 -8
  163. data/spec/models/api_key_dto_spec.rb +8 -8
  164. data/spec/models/auth_query_spec.rb +1 -1
  165. data/spec/models/batch_queued_chunk_response_spec.rb +1 -1
  166. data/spec/models/bookmark_data_spec.rb +8 -8
  167. data/spec/models/bookmark_group_result_spec.rb +8 -8
  168. data/spec/models/chat_message_proxy_spec.rb +8 -8
  169. data/spec/models/chunk_data_spec.rb +1 -1
  170. data/spec/models/chunk_filter_spec.rb +8 -8
  171. data/spec/models/chunk_group_and_file_spec.rb +8 -8
  172. data/spec/models/chunk_group_spec.rb +8 -8
  173. data/spec/models/chunk_metadata_spec.rb +8 -8
  174. data/spec/models/chunk_metadata_with_file_data_spec.rb +8 -8
  175. data/spec/models/client_dataset_configuration_spec.rb +8 -8
  176. data/spec/models/create_chunk_data_spec.rb +11 -87
  177. data/spec/models/create_chunk_group_data_spec.rb +8 -8
  178. data/spec/models/create_dataset_request_spec.rb +8 -8
  179. data/spec/models/create_message_data_spec.rb +8 -8
  180. data/spec/models/create_organization_data_spec.rb +8 -8
  181. data/spec/models/create_topic_data_spec.rb +8 -8
  182. data/spec/models/dataset_and_usage_spec.rb +8 -8
  183. data/spec/models/dataset_dto_spec.rb +8 -8
  184. data/spec/models/dataset_spec.rb +8 -8
  185. data/spec/models/dataset_usage_count_spec.rb +8 -8
  186. data/spec/models/delete_dataset_request_spec.rb +8 -8
  187. data/spec/models/delete_topic_data_spec.rb +8 -8
  188. data/spec/models/delete_user_api_key_request_spec.rb +8 -8
  189. data/spec/models/edit_message_data_spec.rb +8 -8
  190. data/spec/models/error_response_body_spec.rb +8 -8
  191. data/spec/models/event_return_spec.rb +8 -8
  192. data/spec/models/event_spec.rb +8 -8
  193. data/spec/models/field_condition_spec.rb +8 -8
  194. data/spec/models/file_dto_spec.rb +8 -8
  195. data/spec/models/file_spec.rb +8 -8
  196. data/spec/models/generate_chunks_request_spec.rb +8 -8
  197. data/spec/models/get_events_data_spec.rb +1 -1
  198. data/spec/models/get_groups_for_chunks_data_spec.rb +8 -8
  199. data/spec/models/group_data_spec.rb +8 -8
  200. data/spec/models/group_score_chunk_dto_spec.rb +8 -8
  201. data/spec/models/group_slim_chunks_dto_spec.rb +42 -0
  202. data/spec/models/invitation_data_spec.rb +8 -8
  203. data/spec/models/match_condition_spec.rb +6 -6
  204. data/spec/models/message_spec.rb +8 -8
  205. data/spec/models/organization_spec.rb +8 -8
  206. data/spec/models/organization_usage_count_spec.rb +8 -8
  207. data/spec/models/range_condition_spec.rb +32 -0
  208. data/spec/models/range_spec.rb +8 -8
  209. data/spec/models/reccomend_group_chunks_request_spec.rb +8 -8
  210. data/spec/models/recommend_chunks_request_spec.rb +8 -8
  211. data/spec/models/recommend_chunks_response_types_spec.rb +32 -0
  212. data/spec/models/recommend_group_chunk_response_types_spec.rb +32 -0
  213. data/spec/models/regenerate_message_data_spec.rb +8 -8
  214. data/spec/models/return_queued_chunk_spec.rb +11 -21
  215. data/spec/models/score_chunk_dto_spec.rb +8 -8
  216. data/spec/models/score_slim_chunks_spec.rb +42 -0
  217. data/spec/models/search_chunk_data_spec.rb +8 -8
  218. data/spec/models/search_chunk_query_response_body_spec.rb +8 -8
  219. data/spec/models/search_chunk_response_types_spec.rb +32 -0
  220. data/spec/models/search_group_slim_chunks_result_spec.rb +48 -0
  221. data/spec/models/search_groups_result_spec.rb +8 -8
  222. data/spec/models/search_over_groups_data_spec.rb +8 -8
  223. data/spec/models/search_over_groups_response_body_spec.rb +8 -8
  224. data/spec/models/search_over_groups_response_types_spec.rb +32 -0
  225. data/spec/models/search_over_groups_slim_chunks_response_body_spec.rb +42 -0
  226. data/spec/models/search_slim_chunk_query_response_body_spec.rb +42 -0
  227. data/spec/models/search_within_group_data_spec.rb +8 -8
  228. data/spec/models/search_within_group_response_types_spec.rb +32 -0
  229. data/spec/models/set_user_api_key_request_spec.rb +8 -8
  230. data/spec/models/set_user_api_key_response_spec.rb +8 -8
  231. data/spec/models/single_queued_chunk_response_spec.rb +1 -1
  232. data/spec/models/{stripe_subscription_spec.rb → slim_chunk_metadata_spec.rb} +33 -15
  233. data/spec/models/slim_group_spec.rb +8 -8
  234. data/spec/models/slim_user_spec.rb +8 -8
  235. data/spec/models/stripe_plan_spec.rb +8 -8
  236. data/spec/models/suggested_queries_request_spec.rb +8 -8
  237. data/spec/models/suggested_queries_response_spec.rb +8 -8
  238. data/spec/models/topic_spec.rb +8 -8
  239. data/spec/models/update_chunk_by_tracking_id_data_spec.rb +20 -8
  240. data/spec/models/update_chunk_data_spec.rb +20 -8
  241. data/spec/models/update_chunk_group_data_spec.rb +14 -8
  242. data/spec/models/update_dataset_request_spec.rb +8 -8
  243. data/spec/models/update_group_by_tracking_id_data_spec.rb +8 -8
  244. data/spec/models/update_organization_data_spec.rb +8 -8
  245. data/spec/models/update_topic_data_spec.rb +8 -8
  246. data/spec/models/update_user_data_spec.rb +8 -8
  247. data/spec/models/upload_file_data_spec.rb +8 -8
  248. data/spec/models/upload_file_result_spec.rb +8 -8
  249. data/spec/models/user_organization_spec.rb +8 -8
  250. data/spec/spec_helper.rb +1 -1
  251. data/trieve_ruby_client-0.5.0.gem +0 -0
  252. data/trieve_ruby_client.gemspec +1 -1
  253. metadata +52 -7
  254. data/docs/StripeSubscription.md +0 -30
  255. data/trieve_ruby_client-0.3.5.gem +0 -0
@@ -0,0 +1,255 @@
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.5.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 SearchGroupSlimChunksResult
18
+ attr_accessor :bookmarks
19
+
20
+ attr_accessor :group
21
+
22
+ attr_accessor :total_pages
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'bookmarks' => :'bookmarks',
28
+ :'group' => :'group',
29
+ :'total_pages' => :'total_pages'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'bookmarks' => :'Array<ScoreSlimChunks>',
42
+ :'group' => :'ChunkGroup',
43
+ :'total_pages' => :'Integer'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::SearchGroupSlimChunksResult` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::SearchGroupSlimChunksResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'bookmarks')
69
+ if (value = attributes[:'bookmarks']).is_a?(Array)
70
+ self.bookmarks = value
71
+ end
72
+ else
73
+ self.bookmarks = nil
74
+ end
75
+
76
+ if attributes.key?(:'group')
77
+ self.group = attributes[:'group']
78
+ else
79
+ self.group = nil
80
+ end
81
+
82
+ if attributes.key?(:'total_pages')
83
+ self.total_pages = attributes[:'total_pages']
84
+ else
85
+ self.total_pages = nil
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ if @bookmarks.nil?
95
+ invalid_properties.push('invalid value for "bookmarks", bookmarks cannot be nil.')
96
+ end
97
+
98
+ if @group.nil?
99
+ invalid_properties.push('invalid value for "group", group cannot be nil.')
100
+ end
101
+
102
+ if @total_pages.nil?
103
+ invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if @bookmarks.nil?
114
+ return false if @group.nil?
115
+ return false if @total_pages.nil?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ bookmarks == o.bookmarks &&
125
+ group == o.group &&
126
+ total_pages == o.total_pages
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [bookmarks, group, total_pages].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def self._deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = TrieveRubyClient.const_get(type)
203
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ 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.4.0
6
+ The version of the OpenAPI document: 0.5.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.4.0
6
+ The version of the OpenAPI document: 0.5.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -37,12 +37,18 @@ module TrieveRubyClient
37
37
  # Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set.
38
38
  attr_accessor :query
39
39
 
40
+ # Turn on quote words and negated words to search for exact phrases and exclude words from the search results. Default is false.
41
+ attr_accessor :quote_negated_words
42
+
40
43
  # Set score_threshold to a float to filter out chunks with a score below the threshold.
41
44
  attr_accessor :score_threshold
42
45
 
43
46
  # 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.
44
47
  attr_accessor :search_type
45
48
 
49
+ # 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.
50
+ attr_accessor :slim_chunks
51
+
46
52
  # Attribute mapping from ruby-style variable name to JSON key.
47
53
  def self.attribute_map
48
54
  {
@@ -54,8 +60,10 @@ module TrieveRubyClient
54
60
  :'page' => :'page',
55
61
  :'page_size' => :'page_size',
56
62
  :'query' => :'query',
63
+ :'quote_negated_words' => :'quote_negated_words',
57
64
  :'score_threshold' => :'score_threshold',
58
- :'search_type' => :'search_type'
65
+ :'search_type' => :'search_type',
66
+ :'slim_chunks' => :'slim_chunks'
59
67
  }
60
68
  end
61
69
 
@@ -75,8 +83,10 @@ module TrieveRubyClient
75
83
  :'page' => :'Integer',
76
84
  :'page_size' => :'Integer',
77
85
  :'query' => :'String',
86
+ :'quote_negated_words' => :'Boolean',
78
87
  :'score_threshold' => :'Float',
79
- :'search_type' => :'String'
88
+ :'search_type' => :'String',
89
+ :'slim_chunks' => :'Boolean'
80
90
  }
81
91
  end
82
92
 
@@ -90,7 +100,9 @@ module TrieveRubyClient
90
100
  :'highlight_results',
91
101
  :'page',
92
102
  :'page_size',
103
+ :'quote_negated_words',
93
104
  :'score_threshold',
105
+ :'slim_chunks'
94
106
  ])
95
107
  end
96
108
 
@@ -145,6 +157,10 @@ module TrieveRubyClient
145
157
  self.query = nil
146
158
  end
147
159
 
160
+ if attributes.key?(:'quote_negated_words')
161
+ self.quote_negated_words = attributes[:'quote_negated_words']
162
+ end
163
+
148
164
  if attributes.key?(:'score_threshold')
149
165
  self.score_threshold = attributes[:'score_threshold']
150
166
  end
@@ -154,6 +170,10 @@ module TrieveRubyClient
154
170
  else
155
171
  self.search_type = nil
156
172
  end
173
+
174
+ if attributes.key?(:'slim_chunks')
175
+ self.slim_chunks = attributes[:'slim_chunks']
176
+ end
157
177
  end
158
178
 
159
179
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -239,8 +259,10 @@ module TrieveRubyClient
239
259
  page == o.page &&
240
260
  page_size == o.page_size &&
241
261
  query == o.query &&
262
+ quote_negated_words == o.quote_negated_words &&
242
263
  score_threshold == o.score_threshold &&
243
- search_type == o.search_type
264
+ search_type == o.search_type &&
265
+ slim_chunks == o.slim_chunks
244
266
  end
245
267
 
246
268
  # @see the `==` method
@@ -252,7 +274,7 @@ module TrieveRubyClient
252
274
  # Calculates hash code according to all attributes.
253
275
  # @return [Integer] Hash code
254
276
  def hash
255
- [filters, get_collisions, group_size, highlight_delimiters, highlight_results, page, page_size, query, score_threshold, search_type].hash
277
+ [filters, get_collisions, group_size, highlight_delimiters, highlight_results, page, page_size, query, quote_negated_words, score_threshold, search_type, slim_chunks].hash
256
278
  end
257
279
 
258
280
  # 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.4.0
6
+ The version of the OpenAPI document: 0.5.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -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.5.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 SearchOverGroupsResponseTypes
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'SearchOverGroupsResponseBody',
23
+ :'SearchOverGroupsSlimChunksResponseBody'
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