trieve_ruby_client 0.8.2 → 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 (219) 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 +3 -1
  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 -1
  13. data/docs/ChunkMetadataStringTagSet.md +46 -0
  14. data/docs/ChunkMetadataTypes.md +51 -0
  15. data/docs/ChunkReqPayload.md +50 -0
  16. data/docs/ClientDatasetConfiguration.md +0 -2
  17. data/docs/ConditionType.md +49 -0
  18. data/docs/ContentChunkMetadata.md +32 -0
  19. data/docs/CreateChunkGroupReqPayload.md +28 -0
  20. data/docs/CreateChunkReqPayloadEnum.md +49 -0
  21. data/docs/CreateDatasetRequest.md +2 -2
  22. data/docs/CreateMessageData.md +2 -2
  23. data/docs/CreateMessageReqPayload.md +42 -0
  24. data/docs/CreateTopicReqPayload.md +22 -0
  25. data/docs/Dataset.md +2 -0
  26. data/docs/DatasetApi.md +236 -12
  27. data/docs/DateRange.md +24 -0
  28. data/docs/EditMessageReqPayload.md +44 -0
  29. data/docs/FieldCondition.md +2 -0
  30. data/docs/File.md +1 -1
  31. data/docs/FileApi.md +7 -7
  32. data/docs/GenerateChunksRequest.md +2 -0
  33. data/docs/GetDatasetsPagination.md +20 -0
  34. data/docs/HasIDCondition.md +20 -0
  35. data/docs/InvitationApi.md +1 -1
  36. data/docs/MatchCondition.md +3 -1
  37. data/docs/MessageApi.md +42 -42
  38. data/docs/Organization.md +2 -0
  39. data/docs/OrganizationApi.md +24 -25
  40. data/docs/RangeCondition.md +1 -3
  41. data/docs/RegenerateMessageReqPayload.md +40 -0
  42. data/docs/RemoveChunkFromGroupReqPayload.md +18 -0
  43. data/docs/ScoreChunkDTO.md +3 -1
  44. data/docs/SearchChunkData.md +9 -3
  45. data/docs/SearchChunksReqPayload.md +54 -0
  46. data/docs/SearchOverGroupsData.md +10 -2
  47. data/docs/SearchWithinGroupData.md +12 -2
  48. data/docs/SetUserApiKeyRequest.md +4 -0
  49. data/docs/SlimChunkMetadata.md +4 -0
  50. data/docs/SuggestedQueriesReqPayload.md +18 -0
  51. data/docs/TopicApi.md +16 -16
  52. data/docs/UpdateChunkData.md +2 -0
  53. data/docs/UpdateChunkReqPayload.md +46 -0
  54. data/docs/UpdateDatasetRequest.md +2 -0
  55. data/docs/UpdateGroupByTrackingIDReqPayload.md +26 -0
  56. data/docs/UpdateTopicReqPayload.md +20 -0
  57. data/docs/UpdateUserOrgRoleData.md +1 -1
  58. data/docs/UploadFileReqPayload.md +40 -0
  59. data/docs/UserApi.md +7 -8
  60. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  61. data/lib/trieve_ruby_client/api/chunk_api.rb +158 -83
  62. data/lib/trieve_ruby_client/api/chunk_group_api.rb +58 -51
  63. data/lib/trieve_ruby_client/api/dataset_api.rb +224 -15
  64. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  65. data/lib/trieve_ruby_client/api/file_api.rb +12 -12
  66. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  67. data/lib/trieve_ruby_client/api/invitation_api.rb +3 -3
  68. data/lib/trieve_ruby_client/api/message_api.rb +50 -50
  69. data/lib/trieve_ruby_client/api/organization_api.rb +27 -27
  70. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  71. data/lib/trieve_ruby_client/api/topic_api.rb +27 -27
  72. data/lib/trieve_ruby_client/api/user_api.rb +8 -8
  73. data/lib/trieve_ruby_client/api_client.rb +1 -1
  74. data/lib/trieve_ruby_client/api_error.rb +1 -1
  75. data/lib/trieve_ruby_client/configuration.rb +1 -1
  76. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
  77. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  78. data/lib/trieve_ruby_client/models/api_key_resp_body.rb +325 -0
  79. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  80. data/lib/trieve_ruby_client/models/autocomplete_data.rb +378 -0
  81. data/lib/trieve_ruby_client/models/autocomplete_req_payload.rb +467 -0
  82. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  83. data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
  84. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  85. data/lib/trieve_ruby_client/models/boost_phrase.rb +240 -0
  86. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  87. data/lib/trieve_ruby_client/models/chunk_data.rb +16 -9
  88. data/lib/trieve_ruby_client/models/chunk_filter.rb +4 -4
  89. data/lib/trieve_ruby_client/models/chunk_group.rb +5 -3
  90. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  91. data/lib/trieve_ruby_client/models/chunk_metadata.rb +28 -4
  92. data/lib/trieve_ruby_client/models/chunk_metadata_string_tag_set.rb +387 -0
  93. data/lib/trieve_ruby_client/models/chunk_metadata_types.rb +106 -0
  94. data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +1 -1
  95. data/lib/trieve_ruby_client/models/chunk_req_payload.rb +400 -0
  96. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +2 -18
  97. data/lib/trieve_ruby_client/models/condition_type.rb +105 -0
  98. data/lib/trieve_ruby_client/models/content_chunk_metadata.rb +299 -0
  99. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  100. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
  101. data/lib/trieve_ruby_client/models/create_chunk_group_req_payload.rb +273 -0
  102. data/lib/trieve_ruby_client/models/create_chunk_req_payload_enum.rb +105 -0
  103. data/lib/trieve_ruby_client/models/create_dataset_request.rb +3 -3
  104. data/lib/trieve_ruby_client/models/create_message_data.rb +13 -13
  105. data/lib/trieve_ruby_client/models/create_message_req_payload.rb +378 -0
  106. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  107. data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
  108. data/lib/trieve_ruby_client/models/create_topic_req_payload.rb +244 -0
  109. data/lib/trieve_ruby_client/models/dataset.rb +18 -2
  110. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  111. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  112. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  113. data/lib/trieve_ruby_client/models/date_range.rb +245 -0
  114. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  115. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  116. data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
  117. data/lib/trieve_ruby_client/models/edit_message_req_payload.rb +395 -0
  118. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  119. data/lib/trieve_ruby_client/models/event.rb +1 -1
  120. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  121. data/lib/trieve_ruby_client/models/field_condition.rb +12 -2
  122. data/lib/trieve_ruby_client/models/file.rb +5 -3
  123. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  124. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +13 -2
  125. data/lib/trieve_ruby_client/models/geo_info.rb +1 -1
  126. data/lib/trieve_ruby_client/models/geo_types.rb +1 -1
  127. data/lib/trieve_ruby_client/models/get_chunks_data.rb +1 -1
  128. data/lib/trieve_ruby_client/models/get_datasets_pagination.rb +225 -0
  129. data/lib/trieve_ruby_client/models/get_events_data.rb +1 -1
  130. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  131. data/lib/trieve_ruby_client/models/get_tracking_chunks_data.rb +1 -1
  132. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  133. data/lib/trieve_ruby_client/models/group_score_chunk.rb +1 -1
  134. data/lib/trieve_ruby_client/models/has_id_condition.rb +229 -0
  135. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  136. data/lib/trieve_ruby_client/models/location_bounding_box.rb +1 -1
  137. data/lib/trieve_ruby_client/models/location_polygon.rb +1 -1
  138. data/lib/trieve_ruby_client/models/location_radius.rb +1 -1
  139. data/lib/trieve_ruby_client/models/match_condition.rb +2 -1
  140. data/lib/trieve_ruby_client/models/message.rb +1 -1
  141. data/lib/trieve_ruby_client/models/organization.rb +18 -2
  142. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  143. data/lib/trieve_ruby_client/models/range.rb +1 -1
  144. data/lib/trieve_ruby_client/models/range_condition.rb +2 -3
  145. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +1 -1
  146. data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +1 -1
  147. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
  148. data/lib/trieve_ruby_client/models/regenerate_message_req_payload.rb +361 -0
  149. data/lib/trieve_ruby_client/models/remove_chunk_from_group_req_payload.rb +222 -0
  150. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  151. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +15 -3
  152. data/lib/trieve_ruby_client/models/search_chunk_data.rb +40 -5
  153. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  154. data/lib/trieve_ruby_client/models/search_chunks_req_payload.rb +504 -0
  155. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +93 -4
  156. data/lib/trieve_ruby_client/models/search_over_groups_results.rb +1 -1
  157. data/lib/trieve_ruby_client/models/search_within_group_data.rb +106 -4
  158. data/lib/trieve_ruby_client/models/search_within_group_results.rb +1 -1
  159. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +28 -2
  160. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  161. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  162. data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +24 -2
  163. data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +1 -1
  164. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  165. data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
  166. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  167. data/lib/trieve_ruby_client/models/suggested_queries_req_payload.rb +222 -0
  168. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  169. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  170. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  171. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
  172. data/lib/trieve_ruby_client/models/update_chunk_data.rb +15 -2
  173. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  174. data/lib/trieve_ruby_client/models/update_chunk_req_payload.rb +376 -0
  175. data/lib/trieve_ruby_client/models/update_dataset_request.rb +13 -2
  176. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  177. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_req_payload.rb +268 -0
  178. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  179. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  180. data/lib/trieve_ruby_client/models/update_topic_req_payload.rb +239 -0
  181. data/lib/trieve_ruby_client/models/update_user_org_role_data.rb +2 -2
  182. data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
  183. data/lib/trieve_ruby_client/models/upload_file_req_payload.rb +368 -0
  184. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  185. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  186. data/lib/trieve_ruby_client/version.rb +2 -2
  187. data/lib/trieve_ruby_client.rb +25 -20
  188. data/openapi-generator.yaml +1 -1
  189. data/openapi.json +1 -7789
  190. data/spec/models/api_key_resp_body_spec.rb +78 -0
  191. data/spec/models/autocomplete_data_spec.rb +108 -0
  192. data/spec/models/autocomplete_req_payload_spec.rb +132 -0
  193. data/spec/models/boost_phrase_spec.rb +42 -0
  194. data/spec/models/chunk_metadata_string_tag_set_spec.rb +120 -0
  195. data/spec/models/chunk_metadata_types_spec.rb +32 -0
  196. data/spec/models/chunk_req_payload_spec.rb +132 -0
  197. data/spec/models/condition_type_spec.rb +32 -0
  198. data/spec/models/content_chunk_metadata_spec.rb +72 -0
  199. data/spec/models/create_chunk_group_req_payload_spec.rb +66 -0
  200. data/spec/models/create_chunk_req_payload_enum_spec.rb +32 -0
  201. data/spec/models/create_message_req_payload_spec.rb +108 -0
  202. data/spec/models/create_topic_req_payload_spec.rb +48 -0
  203. data/spec/models/date_range_spec.rb +54 -0
  204. data/spec/models/edit_message_req_payload_spec.rb +114 -0
  205. data/spec/models/get_datasets_pagination_spec.rb +42 -0
  206. data/spec/models/has_id_condition_spec.rb +42 -0
  207. data/spec/models/regenerate_message_req_payload_spec.rb +102 -0
  208. data/spec/models/remove_chunk_from_group_req_payload_spec.rb +36 -0
  209. data/spec/models/search_chunks_req_payload_spec.rb +144 -0
  210. data/spec/models/suggested_queries_req_payload_spec.rb +36 -0
  211. data/spec/models/update_chunk_req_payload_spec.rb +120 -0
  212. data/spec/models/update_group_by_tracking_id_req_payload_spec.rb +60 -0
  213. data/spec/models/update_topic_req_payload_spec.rb +42 -0
  214. data/spec/models/upload_file_req_payload_spec.rb +102 -0
  215. data/spec/spec_helper.rb +1 -1
  216. data/trieve_ruby_client-0.8.2.gem +0 -0
  217. data/trieve_ruby_client-0.8.5.gem +0 -0
  218. data/trieve_ruby_client.gemspec +1 -1
  219. metadata +104 -2
@@ -0,0 +1,467 @@
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 AutocompleteReqPayload
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
+
21
+ # If specified to true, this will extend the search results to include non-exact prefix matches of the same search_type such that a full page_size of results are returned. Default is false.
22
+ attr_accessor :extend_results
23
+
24
+ attr_accessor :filters
25
+
26
+ # Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to [\"?\", \",\", \".\", \"!\"]. These are the characters that will be used to split the chunk_html into splits for highlighting.
27
+ attr_accessor :highlight_delimiters
28
+
29
+ # Set highlight_max_length to control the maximum number of tokens (typically whitespace separated strings, but sometimes also word stems) which can be present within a single highlight. If not specified, this defaults to 8. This is useful to shorten large splits which may have low scores due to length compared to the query. Set to something very large like 100 to highlight entire splits.
30
+ attr_accessor :highlight_max_length
31
+
32
+ # Set highlight_max_num to control the maximum number of highlights per chunk. If not specified, this defaults to 3. It may be less than 3 if no snippets score above the highlight_threshold.
33
+ attr_accessor :highlight_max_num
34
+
35
+ # 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 splits and return the highlights on each scored chunk in the response.
36
+ attr_accessor :highlight_results
37
+
38
+ # 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.
39
+ attr_accessor :highlight_threshold
40
+
41
+ # Set highlight_window to a number to control the amount of words that are returned around the matched phrases. If not specified, this defaults to 0. This is useful for when you want to show more context around the matched words. When specified, window/2 whitespace separated words are added before and after each highlight in the response's highlights array. If an extended highlight overlaps with another highlight, the overlapping words are only included once.
42
+ attr_accessor :highlight_window
43
+
44
+ # Page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time.
45
+ attr_accessor :page_size
46
+
47
+ # 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.
48
+ attr_accessor :query
49
+
50
+ # 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.
51
+ attr_accessor :recency_bias
52
+
53
+ # Set score_threshold to a float to filter out chunks with a score below the threshold.
54
+ attr_accessor :score_threshold
55
+
56
+ # Can be either \"semantic\", or \"fulltext\". \"semantic\" will pull in one page_size of the nearest cosine distant vectors. \"fulltext\" will pull in one page_size of full-text results based on SPLADE.
57
+ attr_accessor :search_type
58
+
59
+ # 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.
60
+ attr_accessor :slim_chunks
61
+
62
+ # 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.
63
+ attr_accessor :tag_weights
64
+
65
+ # 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.
66
+ attr_accessor :use_weights
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'content_only' => :'content_only',
72
+ :'extend_results' => :'extend_results',
73
+ :'filters' => :'filters',
74
+ :'highlight_delimiters' => :'highlight_delimiters',
75
+ :'highlight_max_length' => :'highlight_max_length',
76
+ :'highlight_max_num' => :'highlight_max_num',
77
+ :'highlight_results' => :'highlight_results',
78
+ :'highlight_threshold' => :'highlight_threshold',
79
+ :'highlight_window' => :'highlight_window',
80
+ :'page_size' => :'page_size',
81
+ :'query' => :'query',
82
+ :'recency_bias' => :'recency_bias',
83
+ :'score_threshold' => :'score_threshold',
84
+ :'search_type' => :'search_type',
85
+ :'slim_chunks' => :'slim_chunks',
86
+ :'tag_weights' => :'tag_weights',
87
+ :'use_weights' => :'use_weights'
88
+ }
89
+ end
90
+
91
+ # Returns all the JSON keys this model knows about
92
+ def self.acceptable_attributes
93
+ attribute_map.values
94
+ end
95
+
96
+ # Attribute type mapping.
97
+ def self.openapi_types
98
+ {
99
+ :'content_only' => :'Boolean',
100
+ :'extend_results' => :'Boolean',
101
+ :'filters' => :'ChunkFilter',
102
+ :'highlight_delimiters' => :'Array<String>',
103
+ :'highlight_max_length' => :'Integer',
104
+ :'highlight_max_num' => :'Integer',
105
+ :'highlight_results' => :'Boolean',
106
+ :'highlight_threshold' => :'Float',
107
+ :'highlight_window' => :'Integer',
108
+ :'page_size' => :'Integer',
109
+ :'query' => :'String',
110
+ :'recency_bias' => :'Float',
111
+ :'score_threshold' => :'Float',
112
+ :'search_type' => :'String',
113
+ :'slim_chunks' => :'Boolean',
114
+ :'tag_weights' => :'Hash<String, Float>',
115
+ :'use_weights' => :'Boolean'
116
+ }
117
+ end
118
+
119
+ # List of attributes with nullable: true
120
+ def self.openapi_nullable
121
+ Set.new([
122
+ :'content_only',
123
+ :'extend_results',
124
+ :'filters',
125
+ :'highlight_delimiters',
126
+ :'highlight_max_length',
127
+ :'highlight_max_num',
128
+ :'highlight_results',
129
+ :'highlight_threshold',
130
+ :'highlight_window',
131
+ :'page_size',
132
+ :'recency_bias',
133
+ :'score_threshold',
134
+ :'slim_chunks',
135
+ :'tag_weights',
136
+ :'use_weights'
137
+ ])
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ if (!attributes.is_a?(Hash))
144
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::AutocompleteReqPayload` initialize method"
145
+ end
146
+
147
+ # check to see if the attribute exists and convert string to symbol for hash key
148
+ attributes = attributes.each_with_object({}) { |(k, v), h|
149
+ if (!self.class.attribute_map.key?(k.to_sym))
150
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::AutocompleteReqPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
151
+ end
152
+ h[k.to_sym] = v
153
+ }
154
+
155
+ if attributes.key?(:'content_only')
156
+ self.content_only = attributes[:'content_only']
157
+ end
158
+
159
+ if attributes.key?(:'extend_results')
160
+ self.extend_results = attributes[:'extend_results']
161
+ end
162
+
163
+ if attributes.key?(:'filters')
164
+ self.filters = attributes[:'filters']
165
+ end
166
+
167
+ if attributes.key?(:'highlight_delimiters')
168
+ if (value = attributes[:'highlight_delimiters']).is_a?(Array)
169
+ self.highlight_delimiters = value
170
+ end
171
+ end
172
+
173
+ if attributes.key?(:'highlight_max_length')
174
+ self.highlight_max_length = attributes[:'highlight_max_length']
175
+ end
176
+
177
+ if attributes.key?(:'highlight_max_num')
178
+ self.highlight_max_num = attributes[:'highlight_max_num']
179
+ end
180
+
181
+ if attributes.key?(:'highlight_results')
182
+ self.highlight_results = attributes[:'highlight_results']
183
+ end
184
+
185
+ if attributes.key?(:'highlight_threshold')
186
+ self.highlight_threshold = attributes[:'highlight_threshold']
187
+ end
188
+
189
+ if attributes.key?(:'highlight_window')
190
+ self.highlight_window = attributes[:'highlight_window']
191
+ end
192
+
193
+ if attributes.key?(:'page_size')
194
+ self.page_size = attributes[:'page_size']
195
+ end
196
+
197
+ if attributes.key?(:'query')
198
+ self.query = attributes[:'query']
199
+ else
200
+ self.query = nil
201
+ end
202
+
203
+ if attributes.key?(:'recency_bias')
204
+ self.recency_bias = attributes[:'recency_bias']
205
+ end
206
+
207
+ if attributes.key?(:'score_threshold')
208
+ self.score_threshold = attributes[:'score_threshold']
209
+ end
210
+
211
+ if attributes.key?(:'search_type')
212
+ self.search_type = attributes[:'search_type']
213
+ else
214
+ self.search_type = nil
215
+ end
216
+
217
+ if attributes.key?(:'slim_chunks')
218
+ self.slim_chunks = attributes[:'slim_chunks']
219
+ end
220
+
221
+ if attributes.key?(:'tag_weights')
222
+ if (value = attributes[:'tag_weights']).is_a?(Hash)
223
+ self.tag_weights = value
224
+ end
225
+ end
226
+
227
+ if attributes.key?(:'use_weights')
228
+ self.use_weights = attributes[:'use_weights']
229
+ end
230
+ end
231
+
232
+ # Show invalid properties with the reasons. Usually used together with valid?
233
+ # @return Array for valid properties with the reasons
234
+ def list_invalid_properties
235
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
236
+ invalid_properties = Array.new
237
+ if !@highlight_max_length.nil? && @highlight_max_length < 0
238
+ invalid_properties.push('invalid value for "highlight_max_length", must be greater than or equal to 0.')
239
+ end
240
+
241
+ if !@highlight_max_num.nil? && @highlight_max_num < 0
242
+ invalid_properties.push('invalid value for "highlight_max_num", must be greater than or equal to 0.')
243
+ end
244
+
245
+ if !@highlight_window.nil? && @highlight_window < 0
246
+ invalid_properties.push('invalid value for "highlight_window", must be greater than or equal to 0.')
247
+ end
248
+
249
+ if !@page_size.nil? && @page_size < 0
250
+ invalid_properties.push('invalid value for "page_size", must be greater than or equal to 0.')
251
+ end
252
+
253
+ if @query.nil?
254
+ invalid_properties.push('invalid value for "query", query cannot be nil.')
255
+ end
256
+
257
+ if @search_type.nil?
258
+ invalid_properties.push('invalid value for "search_type", search_type cannot be nil.')
259
+ end
260
+
261
+ invalid_properties
262
+ end
263
+
264
+ # Check to see if the all the properties in the model are valid
265
+ # @return true if the model is valid
266
+ def valid?
267
+ warn '[DEPRECATED] the `valid?` method is obsolete'
268
+ return false if !@highlight_max_length.nil? && @highlight_max_length < 0
269
+ return false if !@highlight_max_num.nil? && @highlight_max_num < 0
270
+ return false if !@highlight_window.nil? && @highlight_window < 0
271
+ return false if !@page_size.nil? && @page_size < 0
272
+ return false if @query.nil?
273
+ return false if @search_type.nil?
274
+ true
275
+ end
276
+
277
+ # Custom attribute writer method with validation
278
+ # @param [Object] highlight_max_length Value to be assigned
279
+ def highlight_max_length=(highlight_max_length)
280
+ if !highlight_max_length.nil? && highlight_max_length < 0
281
+ fail ArgumentError, 'invalid value for "highlight_max_length", must be greater than or equal to 0.'
282
+ end
283
+
284
+ @highlight_max_length = highlight_max_length
285
+ end
286
+
287
+ # Custom attribute writer method with validation
288
+ # @param [Object] highlight_max_num Value to be assigned
289
+ def highlight_max_num=(highlight_max_num)
290
+ if !highlight_max_num.nil? && highlight_max_num < 0
291
+ fail ArgumentError, 'invalid value for "highlight_max_num", must be greater than or equal to 0.'
292
+ end
293
+
294
+ @highlight_max_num = highlight_max_num
295
+ end
296
+
297
+ # Custom attribute writer method with validation
298
+ # @param [Object] highlight_window Value to be assigned
299
+ def highlight_window=(highlight_window)
300
+ if !highlight_window.nil? && highlight_window < 0
301
+ fail ArgumentError, 'invalid value for "highlight_window", must be greater than or equal to 0.'
302
+ end
303
+
304
+ @highlight_window = highlight_window
305
+ end
306
+
307
+ # Custom attribute writer method with validation
308
+ # @param [Object] page_size Value to be assigned
309
+ def page_size=(page_size)
310
+ if !page_size.nil? && page_size < 0
311
+ fail ArgumentError, 'invalid value for "page_size", must be greater than or equal to 0.'
312
+ end
313
+
314
+ @page_size = page_size
315
+ end
316
+
317
+ # Checks equality by comparing each attribute.
318
+ # @param [Object] Object to be compared
319
+ def ==(o)
320
+ return true if self.equal?(o)
321
+ self.class == o.class &&
322
+ content_only == o.content_only &&
323
+ extend_results == o.extend_results &&
324
+ filters == o.filters &&
325
+ highlight_delimiters == o.highlight_delimiters &&
326
+ highlight_max_length == o.highlight_max_length &&
327
+ highlight_max_num == o.highlight_max_num &&
328
+ highlight_results == o.highlight_results &&
329
+ highlight_threshold == o.highlight_threshold &&
330
+ highlight_window == o.highlight_window &&
331
+ page_size == o.page_size &&
332
+ query == o.query &&
333
+ recency_bias == o.recency_bias &&
334
+ score_threshold == o.score_threshold &&
335
+ search_type == o.search_type &&
336
+ slim_chunks == o.slim_chunks &&
337
+ tag_weights == o.tag_weights &&
338
+ use_weights == o.use_weights
339
+ end
340
+
341
+ # @see the `==` method
342
+ # @param [Object] Object to be compared
343
+ def eql?(o)
344
+ self == o
345
+ end
346
+
347
+ # Calculates hash code according to all attributes.
348
+ # @return [Integer] Hash code
349
+ def hash
350
+ [content_only, extend_results, filters, highlight_delimiters, highlight_max_length, highlight_max_num, highlight_results, highlight_threshold, highlight_window, page_size, query, recency_bias, score_threshold, search_type, slim_chunks, tag_weights, use_weights].hash
351
+ end
352
+
353
+ # Builds the object from hash
354
+ # @param [Hash] attributes Model attributes in the form of hash
355
+ # @return [Object] Returns the model itself
356
+ def self.build_from_hash(attributes)
357
+ return nil unless attributes.is_a?(Hash)
358
+ attributes = attributes.transform_keys(&:to_sym)
359
+ transformed_hash = {}
360
+ openapi_types.each_pair do |key, type|
361
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
362
+ transformed_hash["#{key}"] = nil
363
+ elsif type =~ /\AArray<(.*)>/i
364
+ # check to ensure the input is an array given that the attribute
365
+ # is documented as an array but the input is not
366
+ if attributes[attribute_map[key]].is_a?(Array)
367
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
368
+ end
369
+ elsif !attributes[attribute_map[key]].nil?
370
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
371
+ end
372
+ end
373
+ new(transformed_hash)
374
+ end
375
+
376
+ # Deserializes the data based on type
377
+ # @param string type Data type
378
+ # @param string value Value to be deserialized
379
+ # @return [Object] Deserialized data
380
+ def self._deserialize(type, value)
381
+ case type.to_sym
382
+ when :Time
383
+ Time.parse(value)
384
+ when :Date
385
+ Date.parse(value)
386
+ when :String
387
+ value.to_s
388
+ when :Integer
389
+ value.to_i
390
+ when :Float
391
+ value.to_f
392
+ when :Boolean
393
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
394
+ true
395
+ else
396
+ false
397
+ end
398
+ when :Object
399
+ # generic object (usually a Hash), return directly
400
+ value
401
+ when /\AArray<(?<inner_type>.+)>\z/
402
+ inner_type = Regexp.last_match[:inner_type]
403
+ value.map { |v| _deserialize(inner_type, v) }
404
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
405
+ k_type = Regexp.last_match[:k_type]
406
+ v_type = Regexp.last_match[:v_type]
407
+ {}.tap do |hash|
408
+ value.each do |k, v|
409
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
410
+ end
411
+ end
412
+ else # model
413
+ # models (e.g. Pet) or oneOf
414
+ klass = TrieveRubyClient.const_get(type)
415
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
416
+ end
417
+ end
418
+
419
+ # Returns the string representation of the object
420
+ # @return [String] String presentation of the object
421
+ def to_s
422
+ to_hash.to_s
423
+ end
424
+
425
+ # to_body is an alias to to_hash (backward compatibility)
426
+ # @return [Hash] Returns the object in the form of hash
427
+ def to_body
428
+ to_hash
429
+ end
430
+
431
+ # Returns the object in the form of hash
432
+ # @return [Hash] Returns the object in the form of hash
433
+ def to_hash
434
+ hash = {}
435
+ self.class.attribute_map.each_pair do |attr, param|
436
+ value = self.send(attr)
437
+ if value.nil?
438
+ is_nullable = self.class.openapi_nullable.include?(attr)
439
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
440
+ end
441
+
442
+ hash[param] = _to_hash(value)
443
+ end
444
+ hash
445
+ end
446
+
447
+ # Outputs non-array value in the form of hash
448
+ # For object, use to_hash. Otherwise, just return the value
449
+ # @param [Object] value Any valid value
450
+ # @return [Hash] Returns the value in the form of hash
451
+ def _to_hash(value)
452
+ if value.is_a?(Array)
453
+ value.compact.map { |v| _to_hash(v) }
454
+ elsif value.is_a?(Hash)
455
+ {}.tap do |hash|
456
+ value.each { |k, v| hash[k] = _to_hash(v) }
457
+ end
458
+ elsif value.respond_to? :to_hash
459
+ value.to_hash
460
+ else
461
+ value
462
+ end
463
+ end
464
+
465
+ end
466
+
467
+ 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.2
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.2
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.2
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