trieve_ruby_client 0.3.4

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 (272) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +240 -0
  5. data/Rakefile +10 -0
  6. data/docs/AddChunkToGroupData.md +18 -0
  7. data/docs/ApiKeyDTO.md +28 -0
  8. data/docs/AuthApi.md +274 -0
  9. data/docs/BookmarkData.md +22 -0
  10. data/docs/BookmarkGroupResult.md +20 -0
  11. data/docs/ChatMessageProxy.md +20 -0
  12. data/docs/ChunkApi.md +955 -0
  13. data/docs/ChunkFilter.md +22 -0
  14. data/docs/ChunkGroup.md +30 -0
  15. data/docs/ChunkGroupAndFile.md +32 -0
  16. data/docs/ChunkGroupApi.md +1262 -0
  17. data/docs/ChunkMetadata.md +42 -0
  18. data/docs/ChunkMetadataWithFileData.md +44 -0
  19. data/docs/ClientDatasetConfiguration.md +38 -0
  20. data/docs/CreateChunkData.md +42 -0
  21. data/docs/CreateChunkGroupData.md +22 -0
  22. data/docs/CreateDatasetRequest.md +24 -0
  23. data/docs/CreateMessageData.md +28 -0
  24. data/docs/CreateOrganizationData.md +18 -0
  25. data/docs/CreateTopicData.md +22 -0
  26. data/docs/Dataset.md +30 -0
  27. data/docs/DatasetAndUsage.md +20 -0
  28. data/docs/DatasetApi.md +480 -0
  29. data/docs/DatasetDTO.md +28 -0
  30. data/docs/DatasetUsageCount.md +22 -0
  31. data/docs/DeleteDatasetRequest.md +18 -0
  32. data/docs/DeleteTopicData.md +18 -0
  33. data/docs/DeleteUserApiKeyRequest.md +18 -0
  34. data/docs/EditMessageData.md +30 -0
  35. data/docs/ErrorResponseBody.md +18 -0
  36. data/docs/Event.md +28 -0
  37. data/docs/EventReturn.md +20 -0
  38. data/docs/EventsApi.md +86 -0
  39. data/docs/FieldCondition.md +22 -0
  40. data/docs/File.md +36 -0
  41. data/docs/FileApi.md +326 -0
  42. data/docs/FileDTO.md +32 -0
  43. data/docs/GenerateChunksRequest.md +26 -0
  44. data/docs/GetGroupsForChunksData.md +18 -0
  45. data/docs/GroupData.md +20 -0
  46. data/docs/GroupScoreChunkDTO.md +20 -0
  47. data/docs/HealthApi.md +66 -0
  48. data/docs/InvitationApi.md +85 -0
  49. data/docs/InvitationData.md +26 -0
  50. data/docs/MatchCondition.md +49 -0
  51. data/docs/Message.md +38 -0
  52. data/docs/MessageApi.md +322 -0
  53. data/docs/Organization.md +26 -0
  54. data/docs/OrganizationApi.md +479 -0
  55. data/docs/OrganizationUsageCount.md +28 -0
  56. data/docs/Range.md +24 -0
  57. data/docs/ReccomendGroupChunksRequest.md +30 -0
  58. data/docs/RecommendChunksRequest.md +28 -0
  59. data/docs/RegenerateMessageData.md +26 -0
  60. data/docs/ReturnQueuedChunk.md +20 -0
  61. data/docs/ScoreChunkDTO.md +20 -0
  62. data/docs/SearchChunkData.md +38 -0
  63. data/docs/SearchChunkQueryResponseBody.md +20 -0
  64. data/docs/SearchGroupsResult.md +22 -0
  65. data/docs/SearchOverGroupsData.md +36 -0
  66. data/docs/SearchOverGroupsResponseBody.md +20 -0
  67. data/docs/SearchWithinGroupData.md +40 -0
  68. data/docs/SetUserApiKeyRequest.md +20 -0
  69. data/docs/SetUserApiKeyResponse.md +18 -0
  70. data/docs/SlimGroup.md +24 -0
  71. data/docs/SlimUser.md +32 -0
  72. data/docs/StripeApi.md +285 -0
  73. data/docs/StripePlan.md +38 -0
  74. data/docs/StripeSubscription.md +30 -0
  75. data/docs/SuggestedQueriesRequest.md +18 -0
  76. data/docs/SuggestedQueriesResponse.md +18 -0
  77. data/docs/Topic.md +30 -0
  78. data/docs/TopicApi.md +321 -0
  79. data/docs/UpdateChunkByTrackingIdData.md +32 -0
  80. data/docs/UpdateChunkData.md +34 -0
  81. data/docs/UpdateChunkGroupData.md +24 -0
  82. data/docs/UpdateDatasetRequest.md +24 -0
  83. data/docs/UpdateGroupByTrackingIDData.md +22 -0
  84. data/docs/UpdateOrganizationData.md +20 -0
  85. data/docs/UpdateTopicData.md +20 -0
  86. data/docs/UpdateUserData.md +30 -0
  87. data/docs/UploadFileData.md +34 -0
  88. data/docs/UploadFileResult.md +18 -0
  89. data/docs/UserApi.md +238 -0
  90. data/docs/UserOrganization.md +28 -0
  91. data/git_push.sh +57 -0
  92. data/lib/trieve_ruby_client/api/auth_api.rb +262 -0
  93. data/lib/trieve_ruby_client/api/chunk_api.rb +906 -0
  94. data/lib/trieve_ruby_client/api/chunk_group_api.rb +1230 -0
  95. data/lib/trieve_ruby_client/api/dataset_api.rb +458 -0
  96. data/lib/trieve_ruby_client/api/events_api.rb +92 -0
  97. data/lib/trieve_ruby_client/api/file_api.rb +324 -0
  98. data/lib/trieve_ruby_client/api/health_api.rb +75 -0
  99. data/lib/trieve_ruby_client/api/invitation_api.rb +97 -0
  100. data/lib/trieve_ruby_client/api/message_api.rb +317 -0
  101. data/lib/trieve_ruby_client/api/organization_api.rb +445 -0
  102. data/lib/trieve_ruby_client/api/stripe_api.rb +278 -0
  103. data/lib/trieve_ruby_client/api/topic_api.rb +317 -0
  104. data/lib/trieve_ruby_client/api/user_api.rb +226 -0
  105. data/lib/trieve_ruby_client/api_client.rb +394 -0
  106. data/lib/trieve_ruby_client/api_error.rb +58 -0
  107. data/lib/trieve_ruby_client/configuration.rb +305 -0
  108. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +222 -0
  109. data/lib/trieve_ruby_client/models/api_key_dto.rb +301 -0
  110. data/lib/trieve_ruby_client/models/bookmark_data.rb +255 -0
  111. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +239 -0
  112. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +237 -0
  113. data/lib/trieve_ruby_client/models/chunk_filter.rb +244 -0
  114. data/lib/trieve_ruby_client/models/chunk_group.rb +311 -0
  115. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +321 -0
  116. data/lib/trieve_ruby_client/models/chunk_metadata.rb +371 -0
  117. data/lib/trieve_ruby_client/models/chunk_metadata_with_file_data.rb +381 -0
  118. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +336 -0
  119. data/lib/trieve_ruby_client/models/create_chunk_data.rb +356 -0
  120. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +250 -0
  121. data/lib/trieve_ruby_client/models/create_dataset_request.rb +265 -0
  122. data/lib/trieve_ruby_client/models/create_message_data.rb +285 -0
  123. data/lib/trieve_ruby_client/models/create_organization_data.rb +222 -0
  124. data/lib/trieve_ruby_client/models/create_topic_data.rb +238 -0
  125. data/lib/trieve_ruby_client/models/dataset.rb +309 -0
  126. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +237 -0
  127. data/lib/trieve_ruby_client/models/dataset_dto.rb +297 -0
  128. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +253 -0
  129. data/lib/trieve_ruby_client/models/delete_dataset_request.rb +222 -0
  130. data/lib/trieve_ruby_client/models/delete_topic_data.rb +222 -0
  131. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +222 -0
  132. data/lib/trieve_ruby_client/models/edit_message_data.rb +302 -0
  133. data/lib/trieve_ruby_client/models/error_response_body.rb +221 -0
  134. data/lib/trieve_ruby_client/models/event.rb +297 -0
  135. data/lib/trieve_ruby_client/models/event_return.rb +239 -0
  136. data/lib/trieve_ruby_client/models/field_condition.rb +245 -0
  137. data/lib/trieve_ruby_client/models/file.rb +341 -0
  138. data/lib/trieve_ruby_client/models/file_dto.rb +321 -0
  139. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +276 -0
  140. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +223 -0
  141. data/lib/trieve_ruby_client/models/group_data.rb +239 -0
  142. data/lib/trieve_ruby_client/models/group_score_chunk_dto.rb +239 -0
  143. data/lib/trieve_ruby_client/models/invitation_data.rb +290 -0
  144. data/lib/trieve_ruby_client/models/match_condition.rb +105 -0
  145. data/lib/trieve_ruby_client/models/message.rb +369 -0
  146. data/lib/trieve_ruby_client/models/organization.rb +279 -0
  147. data/lib/trieve_ruby_client/models/organization_usage_count.rb +301 -0
  148. data/lib/trieve_ruby_client/models/range.rb +245 -0
  149. data/lib/trieve_ruby_client/models/reccomend_group_chunks_request.rb +319 -0
  150. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +293 -0
  151. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +268 -0
  152. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +237 -0
  153. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +239 -0
  154. data/lib/trieve_ruby_client/models/search_chunk_data.rb +369 -0
  155. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +239 -0
  156. data/lib/trieve_ruby_client/models/search_groups_result.rb +255 -0
  157. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +372 -0
  158. data/lib/trieve_ruby_client/models/search_over_groups_response_body.rb +239 -0
  159. data/lib/trieve_ruby_client/models/search_within_group_data.rb +380 -0
  160. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +239 -0
  161. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +222 -0
  162. data/lib/trieve_ruby_client/models/slim_group.rb +269 -0
  163. data/lib/trieve_ruby_client/models/slim_user.rb +319 -0
  164. data/lib/trieve_ruby_client/models/stripe_plan.rb +381 -0
  165. data/lib/trieve_ruby_client/models/stripe_subscription.rb +311 -0
  166. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +222 -0
  167. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +223 -0
  168. data/lib/trieve_ruby_client/models/topic.rb +317 -0
  169. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +303 -0
  170. data/lib/trieve_ruby_client/models/update_chunk_data.rb +308 -0
  171. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +249 -0
  172. data/lib/trieve_ruby_client/models/update_dataset_request.rb +255 -0
  173. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +244 -0
  174. data/lib/trieve_ruby_client/models/update_organization_data.rb +233 -0
  175. data/lib/trieve_ruby_client/models/update_topic_data.rb +239 -0
  176. data/lib/trieve_ruby_client/models/update_user_data.rb +288 -0
  177. data/lib/trieve_ruby_client/models/upload_file_data.rb +324 -0
  178. data/lib/trieve_ruby_client/models/upload_file_result.rb +221 -0
  179. data/lib/trieve_ruby_client/models/user_organization.rb +301 -0
  180. data/lib/trieve_ruby_client/version.rb +15 -0
  181. data/lib/trieve_ruby_client.rb +124 -0
  182. data/openapi-generator.yaml +9 -0
  183. data/openapi.json +6530 -0
  184. data/openapitools.json +7 -0
  185. data/spec/api/auth_api_spec.rb +82 -0
  186. data/spec/api/chunk_api_spec.rb +191 -0
  187. data/spec/api/chunk_group_api_spec.rb +242 -0
  188. data/spec/api/dataset_api_spec.rb +113 -0
  189. data/spec/api/events_api_spec.rb +48 -0
  190. data/spec/api/file_api_spec.rb +89 -0
  191. data/spec/api/health_api_spec.rb +44 -0
  192. data/spec/api/invitation_api_spec.rb +48 -0
  193. data/spec/api/message_api_spec.rb +87 -0
  194. data/spec/api/organization_api_spec.rb +112 -0
  195. data/spec/api/stripe_api_spec.rb +78 -0
  196. data/spec/api/topic_api_spec.rb +87 -0
  197. data/spec/api/user_api_spec.rb +71 -0
  198. data/spec/models/add_chunk_to_group_data_spec.rb +36 -0
  199. data/spec/models/api_key_dto_spec.rb +66 -0
  200. data/spec/models/bookmark_data_spec.rb +48 -0
  201. data/spec/models/bookmark_group_result_spec.rb +42 -0
  202. data/spec/models/chat_message_proxy_spec.rb +42 -0
  203. data/spec/models/chunk_filter_spec.rb +48 -0
  204. data/spec/models/chunk_group_and_file_spec.rb +78 -0
  205. data/spec/models/chunk_group_spec.rb +72 -0
  206. data/spec/models/chunk_metadata_spec.rb +108 -0
  207. data/spec/models/chunk_metadata_with_file_data_spec.rb +114 -0
  208. data/spec/models/client_dataset_configuration_spec.rb +96 -0
  209. data/spec/models/create_chunk_data_spec.rb +108 -0
  210. data/spec/models/create_chunk_group_data_spec.rb +48 -0
  211. data/spec/models/create_dataset_request_spec.rb +54 -0
  212. data/spec/models/create_message_data_spec.rb +66 -0
  213. data/spec/models/create_organization_data_spec.rb +36 -0
  214. data/spec/models/create_topic_data_spec.rb +48 -0
  215. data/spec/models/dataset_and_usage_spec.rb +42 -0
  216. data/spec/models/dataset_dto_spec.rb +66 -0
  217. data/spec/models/dataset_spec.rb +72 -0
  218. data/spec/models/dataset_usage_count_spec.rb +48 -0
  219. data/spec/models/delete_dataset_request_spec.rb +36 -0
  220. data/spec/models/delete_topic_data_spec.rb +36 -0
  221. data/spec/models/delete_user_api_key_request_spec.rb +36 -0
  222. data/spec/models/edit_message_data_spec.rb +72 -0
  223. data/spec/models/error_response_body_spec.rb +36 -0
  224. data/spec/models/event_return_spec.rb +42 -0
  225. data/spec/models/event_spec.rb +66 -0
  226. data/spec/models/field_condition_spec.rb +48 -0
  227. data/spec/models/file_dto_spec.rb +78 -0
  228. data/spec/models/file_spec.rb +90 -0
  229. data/spec/models/generate_chunks_request_spec.rb +60 -0
  230. data/spec/models/get_groups_for_chunks_data_spec.rb +36 -0
  231. data/spec/models/group_data_spec.rb +42 -0
  232. data/spec/models/group_score_chunk_dto_spec.rb +42 -0
  233. data/spec/models/invitation_data_spec.rb +60 -0
  234. data/spec/models/match_condition_spec.rb +32 -0
  235. data/spec/models/message_spec.rb +96 -0
  236. data/spec/models/organization_spec.rb +60 -0
  237. data/spec/models/organization_usage_count_spec.rb +66 -0
  238. data/spec/models/range_spec.rb +54 -0
  239. data/spec/models/reccomend_group_chunks_request_spec.rb +72 -0
  240. data/spec/models/recommend_chunks_request_spec.rb +66 -0
  241. data/spec/models/regenerate_message_data_spec.rb +60 -0
  242. data/spec/models/return_queued_chunk_spec.rb +42 -0
  243. data/spec/models/score_chunk_dto_spec.rb +42 -0
  244. data/spec/models/search_chunk_data_spec.rb +96 -0
  245. data/spec/models/search_chunk_query_response_body_spec.rb +42 -0
  246. data/spec/models/search_groups_result_spec.rb +48 -0
  247. data/spec/models/search_over_groups_data_spec.rb +90 -0
  248. data/spec/models/search_over_groups_response_body_spec.rb +42 -0
  249. data/spec/models/search_within_group_data_spec.rb +102 -0
  250. data/spec/models/set_user_api_key_request_spec.rb +42 -0
  251. data/spec/models/set_user_api_key_response_spec.rb +36 -0
  252. data/spec/models/slim_group_spec.rb +54 -0
  253. data/spec/models/slim_user_spec.rb +78 -0
  254. data/spec/models/stripe_plan_spec.rb +96 -0
  255. data/spec/models/stripe_subscription_spec.rb +72 -0
  256. data/spec/models/suggested_queries_request_spec.rb +36 -0
  257. data/spec/models/suggested_queries_response_spec.rb +36 -0
  258. data/spec/models/topic_spec.rb +72 -0
  259. data/spec/models/update_chunk_by_tracking_id_data_spec.rb +66 -0
  260. data/spec/models/update_chunk_data_spec.rb +72 -0
  261. data/spec/models/update_chunk_group_data_spec.rb +48 -0
  262. data/spec/models/update_dataset_request_spec.rb +54 -0
  263. data/spec/models/update_group_by_tracking_id_data_spec.rb +48 -0
  264. data/spec/models/update_organization_data_spec.rb +42 -0
  265. data/spec/models/update_topic_data_spec.rb +42 -0
  266. data/spec/models/update_user_data_spec.rb +72 -0
  267. data/spec/models/upload_file_data_spec.rb +84 -0
  268. data/spec/models/upload_file_result_spec.rb +36 -0
  269. data/spec/models/user_organization_spec.rb +66 -0
  270. data/spec/spec_helper.rb +111 -0
  271. data/trieve_ruby_client.gemspec +39 -0
  272. metadata +439 -0
@@ -0,0 +1,381 @@
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.3.4
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 ChunkMetadataWithFileData
18
+ attr_accessor :chunk_html
19
+
20
+ attr_accessor :content
21
+
22
+ attr_accessor :created_at
23
+
24
+ attr_accessor :file_id
25
+
26
+ attr_accessor :file_name
27
+
28
+ attr_accessor :id
29
+
30
+ attr_accessor :link
31
+
32
+ attr_accessor :metadata
33
+
34
+ attr_accessor :qdrant_point_id
35
+
36
+ attr_accessor :tag_set
37
+
38
+ attr_accessor :time_stamp
39
+
40
+ attr_accessor :tracking_id
41
+
42
+ attr_accessor :updated_at
43
+
44
+ attr_accessor :weight
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'chunk_html' => :'chunk_html',
50
+ :'content' => :'content',
51
+ :'created_at' => :'created_at',
52
+ :'file_id' => :'file_id',
53
+ :'file_name' => :'file_name',
54
+ :'id' => :'id',
55
+ :'link' => :'link',
56
+ :'metadata' => :'metadata',
57
+ :'qdrant_point_id' => :'qdrant_point_id',
58
+ :'tag_set' => :'tag_set',
59
+ :'time_stamp' => :'time_stamp',
60
+ :'tracking_id' => :'tracking_id',
61
+ :'updated_at' => :'updated_at',
62
+ :'weight' => :'weight'
63
+ }
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'chunk_html' => :'String',
75
+ :'content' => :'String',
76
+ :'created_at' => :'Time',
77
+ :'file_id' => :'String',
78
+ :'file_name' => :'String',
79
+ :'id' => :'String',
80
+ :'link' => :'String',
81
+ :'metadata' => :'Object',
82
+ :'qdrant_point_id' => :'String',
83
+ :'tag_set' => :'String',
84
+ :'time_stamp' => :'Time',
85
+ :'tracking_id' => :'String',
86
+ :'updated_at' => :'Time',
87
+ :'weight' => :'Float'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ :'chunk_html',
95
+ :'file_id',
96
+ :'file_name',
97
+ :'link',
98
+ :'metadata',
99
+ :'tag_set',
100
+ :'time_stamp',
101
+ :'tracking_id',
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ if (!attributes.is_a?(Hash))
109
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::ChunkMetadataWithFileData` initialize method"
110
+ end
111
+
112
+ # check to see if the attribute exists and convert string to symbol for hash key
113
+ attributes = attributes.each_with_object({}) { |(k, v), h|
114
+ if (!self.class.attribute_map.key?(k.to_sym))
115
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::ChunkMetadataWithFileData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
116
+ end
117
+ h[k.to_sym] = v
118
+ }
119
+
120
+ if attributes.key?(:'chunk_html')
121
+ self.chunk_html = attributes[:'chunk_html']
122
+ end
123
+
124
+ if attributes.key?(:'content')
125
+ self.content = attributes[:'content']
126
+ else
127
+ self.content = nil
128
+ end
129
+
130
+ if attributes.key?(:'created_at')
131
+ self.created_at = attributes[:'created_at']
132
+ else
133
+ self.created_at = nil
134
+ end
135
+
136
+ if attributes.key?(:'file_id')
137
+ self.file_id = attributes[:'file_id']
138
+ end
139
+
140
+ if attributes.key?(:'file_name')
141
+ self.file_name = attributes[:'file_name']
142
+ end
143
+
144
+ if attributes.key?(:'id')
145
+ self.id = attributes[:'id']
146
+ else
147
+ self.id = nil
148
+ end
149
+
150
+ if attributes.key?(:'link')
151
+ self.link = attributes[:'link']
152
+ end
153
+
154
+ if attributes.key?(:'metadata')
155
+ self.metadata = attributes[:'metadata']
156
+ end
157
+
158
+ if attributes.key?(:'qdrant_point_id')
159
+ self.qdrant_point_id = attributes[:'qdrant_point_id']
160
+ else
161
+ self.qdrant_point_id = nil
162
+ end
163
+
164
+ if attributes.key?(:'tag_set')
165
+ self.tag_set = attributes[:'tag_set']
166
+ end
167
+
168
+ if attributes.key?(:'time_stamp')
169
+ self.time_stamp = attributes[:'time_stamp']
170
+ end
171
+
172
+ if attributes.key?(:'tracking_id')
173
+ self.tracking_id = attributes[:'tracking_id']
174
+ end
175
+
176
+ if attributes.key?(:'updated_at')
177
+ self.updated_at = attributes[:'updated_at']
178
+ else
179
+ self.updated_at = nil
180
+ end
181
+
182
+ if attributes.key?(:'weight')
183
+ self.weight = attributes[:'weight']
184
+ else
185
+ self.weight = nil
186
+ end
187
+ end
188
+
189
+ # Show invalid properties with the reasons. Usually used together with valid?
190
+ # @return Array for valid properties with the reasons
191
+ def list_invalid_properties
192
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
193
+ invalid_properties = Array.new
194
+ if @content.nil?
195
+ invalid_properties.push('invalid value for "content", content cannot be nil.')
196
+ end
197
+
198
+ if @created_at.nil?
199
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
200
+ end
201
+
202
+ if @id.nil?
203
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
204
+ end
205
+
206
+ if @qdrant_point_id.nil?
207
+ invalid_properties.push('invalid value for "qdrant_point_id", qdrant_point_id cannot be nil.')
208
+ end
209
+
210
+ if @updated_at.nil?
211
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
212
+ end
213
+
214
+ if @weight.nil?
215
+ invalid_properties.push('invalid value for "weight", weight cannot be nil.')
216
+ end
217
+
218
+ invalid_properties
219
+ end
220
+
221
+ # Check to see if the all the properties in the model are valid
222
+ # @return true if the model is valid
223
+ def valid?
224
+ warn '[DEPRECATED] the `valid?` method is obsolete'
225
+ return false if @content.nil?
226
+ return false if @created_at.nil?
227
+ return false if @id.nil?
228
+ return false if @qdrant_point_id.nil?
229
+ return false if @updated_at.nil?
230
+ return false if @weight.nil?
231
+ true
232
+ end
233
+
234
+ # Checks equality by comparing each attribute.
235
+ # @param [Object] Object to be compared
236
+ def ==(o)
237
+ return true if self.equal?(o)
238
+ self.class == o.class &&
239
+ chunk_html == o.chunk_html &&
240
+ content == o.content &&
241
+ created_at == o.created_at &&
242
+ file_id == o.file_id &&
243
+ file_name == o.file_name &&
244
+ id == o.id &&
245
+ link == o.link &&
246
+ metadata == o.metadata &&
247
+ qdrant_point_id == o.qdrant_point_id &&
248
+ tag_set == o.tag_set &&
249
+ time_stamp == o.time_stamp &&
250
+ tracking_id == o.tracking_id &&
251
+ updated_at == o.updated_at &&
252
+ weight == o.weight
253
+ end
254
+
255
+ # @see the `==` method
256
+ # @param [Object] Object to be compared
257
+ def eql?(o)
258
+ self == o
259
+ end
260
+
261
+ # Calculates hash code according to all attributes.
262
+ # @return [Integer] Hash code
263
+ def hash
264
+ [chunk_html, content, created_at, file_id, file_name, id, link, metadata, qdrant_point_id, tag_set, time_stamp, tracking_id, updated_at, weight].hash
265
+ end
266
+
267
+ # Builds the object from hash
268
+ # @param [Hash] attributes Model attributes in the form of hash
269
+ # @return [Object] Returns the model itself
270
+ def self.build_from_hash(attributes)
271
+ return nil unless attributes.is_a?(Hash)
272
+ attributes = attributes.transform_keys(&:to_sym)
273
+ transformed_hash = {}
274
+ openapi_types.each_pair do |key, type|
275
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
276
+ transformed_hash["#{key}"] = nil
277
+ elsif type =~ /\AArray<(.*)>/i
278
+ # check to ensure the input is an array given that the attribute
279
+ # is documented as an array but the input is not
280
+ if attributes[attribute_map[key]].is_a?(Array)
281
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
282
+ end
283
+ elsif !attributes[attribute_map[key]].nil?
284
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
285
+ end
286
+ end
287
+ new(transformed_hash)
288
+ end
289
+
290
+ # Deserializes the data based on type
291
+ # @param string type Data type
292
+ # @param string value Value to be deserialized
293
+ # @return [Object] Deserialized data
294
+ def self._deserialize(type, value)
295
+ case type.to_sym
296
+ when :Time
297
+ Time.parse(value)
298
+ when :Date
299
+ Date.parse(value)
300
+ when :String
301
+ value.to_s
302
+ when :Integer
303
+ value.to_i
304
+ when :Float
305
+ value.to_f
306
+ when :Boolean
307
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
308
+ true
309
+ else
310
+ false
311
+ end
312
+ when :Object
313
+ # generic object (usually a Hash), return directly
314
+ value
315
+ when /\AArray<(?<inner_type>.+)>\z/
316
+ inner_type = Regexp.last_match[:inner_type]
317
+ value.map { |v| _deserialize(inner_type, v) }
318
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
319
+ k_type = Regexp.last_match[:k_type]
320
+ v_type = Regexp.last_match[:v_type]
321
+ {}.tap do |hash|
322
+ value.each do |k, v|
323
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
324
+ end
325
+ end
326
+ else # model
327
+ # models (e.g. Pet) or oneOf
328
+ klass = TrieveRubyClient.const_get(type)
329
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
330
+ end
331
+ end
332
+
333
+ # Returns the string representation of the object
334
+ # @return [String] String presentation of the object
335
+ def to_s
336
+ to_hash.to_s
337
+ end
338
+
339
+ # to_body is an alias to to_hash (backward compatibility)
340
+ # @return [Hash] Returns the object in the form of hash
341
+ def to_body
342
+ to_hash
343
+ end
344
+
345
+ # Returns the object in the form of hash
346
+ # @return [Hash] Returns the object in the form of hash
347
+ def to_hash
348
+ hash = {}
349
+ self.class.attribute_map.each_pair do |attr, param|
350
+ value = self.send(attr)
351
+ if value.nil?
352
+ is_nullable = self.class.openapi_nullable.include?(attr)
353
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
354
+ end
355
+
356
+ hash[param] = _to_hash(value)
357
+ end
358
+ hash
359
+ end
360
+
361
+ # Outputs non-array value in the form of hash
362
+ # For object, use to_hash. Otherwise, just return the value
363
+ # @param [Object] value Any valid value
364
+ # @return [Hash] Returns the value in the form of hash
365
+ def _to_hash(value)
366
+ if value.is_a?(Array)
367
+ value.compact.map { |v| _to_hash(v) }
368
+ elsif value.is_a?(Hash)
369
+ {}.tap do |hash|
370
+ value.each { |k, v| hash[k] = _to_hash(v) }
371
+ end
372
+ elsif value.respond_to? :to_hash
373
+ value.to_hash
374
+ else
375
+ value
376
+ end
377
+ end
378
+
379
+ end
380
+
381
+ end
@@ -0,0 +1,336 @@
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.3.4
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 ClientDatasetConfiguration
18
+ attr_accessor :create_chunk_feature
19
+
20
+ attr_accessor :date_range_value
21
+
22
+ attr_accessor :document_upload_feature
23
+
24
+ attr_accessor :file_name_key
25
+
26
+ attr_accessor :filter_items
27
+
28
+ attr_accessor :frontmatter_vals
29
+
30
+ attr_accessor :image_range_end_key
31
+
32
+ attr_accessor :image_range_start_key
33
+
34
+ attr_accessor :lines_before_show_more
35
+
36
+ attr_accessor :search_queries
37
+
38
+ attr_accessor :suggested_queries
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'create_chunk_feature' => :'CREATE_CHUNK_FEATURE',
44
+ :'date_range_value' => :'DATE_RANGE_VALUE',
45
+ :'document_upload_feature' => :'DOCUMENT_UPLOAD_FEATURE',
46
+ :'file_name_key' => :'FILE_NAME_KEY',
47
+ :'filter_items' => :'FILTER_ITEMS',
48
+ :'frontmatter_vals' => :'FRONTMATTER_VALS',
49
+ :'image_range_end_key' => :'IMAGE_RANGE_END_KEY',
50
+ :'image_range_start_key' => :'IMAGE_RANGE_START_KEY',
51
+ :'lines_before_show_more' => :'LINES_BEFORE_SHOW_MORE',
52
+ :'search_queries' => :'SEARCH_QUERIES',
53
+ :'suggested_queries' => :'SUGGESTED_QUERIES'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'create_chunk_feature' => :'Boolean',
66
+ :'date_range_value' => :'String',
67
+ :'document_upload_feature' => :'Boolean',
68
+ :'file_name_key' => :'String',
69
+ :'filter_items' => :'Object',
70
+ :'frontmatter_vals' => :'String',
71
+ :'image_range_end_key' => :'String',
72
+ :'image_range_start_key' => :'String',
73
+ :'lines_before_show_more' => :'Integer',
74
+ :'search_queries' => :'String',
75
+ :'suggested_queries' => :'String'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ :'create_chunk_feature',
83
+ :'date_range_value',
84
+ :'document_upload_feature',
85
+ :'filter_items',
86
+ :'frontmatter_vals',
87
+ :'image_range_end_key',
88
+ :'image_range_start_key',
89
+ :'lines_before_show_more',
90
+ :'search_queries',
91
+ :'suggested_queries'
92
+ ])
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ if (!attributes.is_a?(Hash))
99
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::ClientDatasetConfiguration` initialize method"
100
+ end
101
+
102
+ # check to see if the attribute exists and convert string to symbol for hash key
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!self.class.attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::ClientDatasetConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'create_chunk_feature')
111
+ self.create_chunk_feature = attributes[:'create_chunk_feature']
112
+ end
113
+
114
+ if attributes.key?(:'date_range_value')
115
+ self.date_range_value = attributes[:'date_range_value']
116
+ end
117
+
118
+ if attributes.key?(:'document_upload_feature')
119
+ self.document_upload_feature = attributes[:'document_upload_feature']
120
+ end
121
+
122
+ if attributes.key?(:'file_name_key')
123
+ self.file_name_key = attributes[:'file_name_key']
124
+ else
125
+ self.file_name_key = nil
126
+ end
127
+
128
+ if attributes.key?(:'filter_items')
129
+ self.filter_items = attributes[:'filter_items']
130
+ end
131
+
132
+ if attributes.key?(:'frontmatter_vals')
133
+ self.frontmatter_vals = attributes[:'frontmatter_vals']
134
+ end
135
+
136
+ if attributes.key?(:'image_range_end_key')
137
+ self.image_range_end_key = attributes[:'image_range_end_key']
138
+ end
139
+
140
+ if attributes.key?(:'image_range_start_key')
141
+ self.image_range_start_key = attributes[:'image_range_start_key']
142
+ end
143
+
144
+ if attributes.key?(:'lines_before_show_more')
145
+ self.lines_before_show_more = attributes[:'lines_before_show_more']
146
+ end
147
+
148
+ if attributes.key?(:'search_queries')
149
+ self.search_queries = attributes[:'search_queries']
150
+ end
151
+
152
+ if attributes.key?(:'suggested_queries')
153
+ self.suggested_queries = attributes[:'suggested_queries']
154
+ end
155
+ end
156
+
157
+ # Show invalid properties with the reasons. Usually used together with valid?
158
+ # @return Array for valid properties with the reasons
159
+ def list_invalid_properties
160
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
161
+ invalid_properties = Array.new
162
+ if @file_name_key.nil?
163
+ invalid_properties.push('invalid value for "file_name_key", file_name_key cannot be nil.')
164
+ end
165
+
166
+ if !@lines_before_show_more.nil? && @lines_before_show_more < 0
167
+ invalid_properties.push('invalid value for "lines_before_show_more", must be greater than or equal to 0.')
168
+ end
169
+
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ warn '[DEPRECATED] the `valid?` method is obsolete'
177
+ return false if @file_name_key.nil?
178
+ return false if !@lines_before_show_more.nil? && @lines_before_show_more < 0
179
+ true
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] lines_before_show_more Value to be assigned
184
+ def lines_before_show_more=(lines_before_show_more)
185
+ if !lines_before_show_more.nil? && lines_before_show_more < 0
186
+ fail ArgumentError, 'invalid value for "lines_before_show_more", must be greater than or equal to 0.'
187
+ end
188
+
189
+ @lines_before_show_more = lines_before_show_more
190
+ end
191
+
192
+ # Checks equality by comparing each attribute.
193
+ # @param [Object] Object to be compared
194
+ def ==(o)
195
+ return true if self.equal?(o)
196
+ self.class == o.class &&
197
+ create_chunk_feature == o.create_chunk_feature &&
198
+ date_range_value == o.date_range_value &&
199
+ document_upload_feature == o.document_upload_feature &&
200
+ file_name_key == o.file_name_key &&
201
+ filter_items == o.filter_items &&
202
+ frontmatter_vals == o.frontmatter_vals &&
203
+ image_range_end_key == o.image_range_end_key &&
204
+ image_range_start_key == o.image_range_start_key &&
205
+ lines_before_show_more == o.lines_before_show_more &&
206
+ search_queries == o.search_queries &&
207
+ suggested_queries == o.suggested_queries
208
+ end
209
+
210
+ # @see the `==` method
211
+ # @param [Object] Object to be compared
212
+ def eql?(o)
213
+ self == o
214
+ end
215
+
216
+ # Calculates hash code according to all attributes.
217
+ # @return [Integer] Hash code
218
+ def hash
219
+ [create_chunk_feature, date_range_value, document_upload_feature, file_name_key, filter_items, frontmatter_vals, image_range_end_key, image_range_start_key, lines_before_show_more, search_queries, suggested_queries].hash
220
+ end
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def self.build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+ attributes = attributes.transform_keys(&:to_sym)
228
+ transformed_hash = {}
229
+ openapi_types.each_pair do |key, type|
230
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
231
+ transformed_hash["#{key}"] = nil
232
+ elsif type =~ /\AArray<(.*)>/i
233
+ # check to ensure the input is an array given that the attribute
234
+ # is documented as an array but the input is not
235
+ if attributes[attribute_map[key]].is_a?(Array)
236
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
237
+ end
238
+ elsif !attributes[attribute_map[key]].nil?
239
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
240
+ end
241
+ end
242
+ new(transformed_hash)
243
+ end
244
+
245
+ # Deserializes the data based on type
246
+ # @param string type Data type
247
+ # @param string value Value to be deserialized
248
+ # @return [Object] Deserialized data
249
+ def self._deserialize(type, value)
250
+ case type.to_sym
251
+ when :Time
252
+ Time.parse(value)
253
+ when :Date
254
+ Date.parse(value)
255
+ when :String
256
+ value.to_s
257
+ when :Integer
258
+ value.to_i
259
+ when :Float
260
+ value.to_f
261
+ when :Boolean
262
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
263
+ true
264
+ else
265
+ false
266
+ end
267
+ when :Object
268
+ # generic object (usually a Hash), return directly
269
+ value
270
+ when /\AArray<(?<inner_type>.+)>\z/
271
+ inner_type = Regexp.last_match[:inner_type]
272
+ value.map { |v| _deserialize(inner_type, v) }
273
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
274
+ k_type = Regexp.last_match[:k_type]
275
+ v_type = Regexp.last_match[:v_type]
276
+ {}.tap do |hash|
277
+ value.each do |k, v|
278
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
279
+ end
280
+ end
281
+ else # model
282
+ # models (e.g. Pet) or oneOf
283
+ klass = TrieveRubyClient.const_get(type)
284
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
285
+ end
286
+ end
287
+
288
+ # Returns the string representation of the object
289
+ # @return [String] String presentation of the object
290
+ def to_s
291
+ to_hash.to_s
292
+ end
293
+
294
+ # to_body is an alias to to_hash (backward compatibility)
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_body
297
+ to_hash
298
+ end
299
+
300
+ # Returns the object in the form of hash
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_hash
303
+ hash = {}
304
+ self.class.attribute_map.each_pair do |attr, param|
305
+ value = self.send(attr)
306
+ if value.nil?
307
+ is_nullable = self.class.openapi_nullable.include?(attr)
308
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
309
+ end
310
+
311
+ hash[param] = _to_hash(value)
312
+ end
313
+ hash
314
+ end
315
+
316
+ # Outputs non-array value in the form of hash
317
+ # For object, use to_hash. Otherwise, just return the value
318
+ # @param [Object] value Any valid value
319
+ # @return [Hash] Returns the value in the form of hash
320
+ def _to_hash(value)
321
+ if value.is_a?(Array)
322
+ value.compact.map { |v| _to_hash(v) }
323
+ elsif value.is_a?(Hash)
324
+ {}.tap do |hash|
325
+ value.each { |k, v| hash[k] = _to_hash(v) }
326
+ end
327
+ elsif value.respond_to? :to_hash
328
+ value.to_hash
329
+ else
330
+ value
331
+ end
332
+ end
333
+
334
+ end
335
+
336
+ end