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,324 @@
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 'cgi'
14
+
15
+ module TrieveRubyClient
16
+ class FileApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # delete_file
23
+ # delete_file Delete a file from S3 attached to the server based on its id. This will disassociate chunks from the file, but will not delete the chunks. We plan to add support for deleting chunks in a release soon. Auth'ed user must be an admin or owner of the dataset's organization to upload a file.
24
+ # @param tr_dataset [String] The dataset id to use for the request
25
+ # @param file_id [String] The id of the file to delete
26
+ # @param delete_chunks [Boolean] Whether or not to delete the chunks associated with the file
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [nil]
29
+ def delete_file_handler(tr_dataset, file_id, delete_chunks, opts = {})
30
+ delete_file_handler_with_http_info(tr_dataset, file_id, delete_chunks, opts)
31
+ nil
32
+ end
33
+
34
+ # delete_file
35
+ # delete_file Delete a file from S3 attached to the server based on its id. This will disassociate chunks from the file, but will not delete the chunks. We plan to add support for deleting chunks in a release soon. Auth'ed user must be an admin or owner of the dataset's organization to upload a file.
36
+ # @param tr_dataset [String] The dataset id to use for the request
37
+ # @param file_id [String] The id of the file to delete
38
+ # @param delete_chunks [Boolean] Whether or not to delete the chunks associated with the file
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
41
+ def delete_file_handler_with_http_info(tr_dataset, file_id, delete_chunks, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: FileApi.delete_file_handler ...'
44
+ end
45
+ # verify the required parameter 'tr_dataset' is set
46
+ if @api_client.config.client_side_validation && tr_dataset.nil?
47
+ fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling FileApi.delete_file_handler"
48
+ end
49
+ # verify the required parameter 'file_id' is set
50
+ if @api_client.config.client_side_validation && file_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'file_id' when calling FileApi.delete_file_handler"
52
+ end
53
+ # verify the required parameter 'delete_chunks' is set
54
+ if @api_client.config.client_side_validation && delete_chunks.nil?
55
+ fail ArgumentError, "Missing the required parameter 'delete_chunks' when calling FileApi.delete_file_handler"
56
+ end
57
+ # resource path
58
+ local_var_path = '/api/file/{file_id}'.sub('{' + 'file_id' + '}', CGI.escape(file_id.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+ query_params[:'delete_chunks'] = delete_chunks
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68
+ header_params[:'TR-Dataset'] = tr_dataset
69
+
70
+ # form parameters
71
+ form_params = opts[:form_params] || {}
72
+
73
+ # http body (model)
74
+ post_body = opts[:debug_body]
75
+
76
+ # return_type
77
+ return_type = opts[:debug_return_type]
78
+
79
+ # auth_names
80
+ auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
81
+
82
+ new_options = opts.merge(
83
+ :operation => :"FileApi.delete_file_handler",
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => return_type
90
+ )
91
+
92
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug "API called: FileApi#delete_file_handler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
95
+ end
96
+ return data, status_code, headers
97
+ end
98
+
99
+ # get_dataset_files
100
+ # get_dataset_files Get all files which belong to a given dataset specified by the dataset_id parameter. 10 files are returned per page.
101
+ # @param tr_dataset [String] The dataset id to use for the request
102
+ # @param dataset_id [String] The id of the dataset to fetch files for.
103
+ # @param page [Integer] The page number of files you wish to fetch. Each page contains at most 10 files.
104
+ # @param [Hash] opts the optional parameters
105
+ # @return [Array<File>]
106
+ def get_dataset_files_handler(tr_dataset, dataset_id, page, opts = {})
107
+ data, _status_code, _headers = get_dataset_files_handler_with_http_info(tr_dataset, dataset_id, page, opts)
108
+ data
109
+ end
110
+
111
+ # get_dataset_files
112
+ # get_dataset_files Get all files which belong to a given dataset specified by the dataset_id parameter. 10 files are returned per page.
113
+ # @param tr_dataset [String] The dataset id to use for the request
114
+ # @param dataset_id [String] The id of the dataset to fetch files for.
115
+ # @param page [Integer] The page number of files you wish to fetch. Each page contains at most 10 files.
116
+ # @param [Hash] opts the optional parameters
117
+ # @return [Array<(Array<File>, Integer, Hash)>] Array<File> data, response status code and response headers
118
+ def get_dataset_files_handler_with_http_info(tr_dataset, dataset_id, page, opts = {})
119
+ if @api_client.config.debugging
120
+ @api_client.config.logger.debug 'Calling API: FileApi.get_dataset_files_handler ...'
121
+ end
122
+ # verify the required parameter 'tr_dataset' is set
123
+ if @api_client.config.client_side_validation && tr_dataset.nil?
124
+ fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling FileApi.get_dataset_files_handler"
125
+ end
126
+ # verify the required parameter 'dataset_id' is set
127
+ if @api_client.config.client_side_validation && dataset_id.nil?
128
+ fail ArgumentError, "Missing the required parameter 'dataset_id' when calling FileApi.get_dataset_files_handler"
129
+ end
130
+ # verify the required parameter 'page' is set
131
+ if @api_client.config.client_side_validation && page.nil?
132
+ fail ArgumentError, "Missing the required parameter 'page' when calling FileApi.get_dataset_files_handler"
133
+ end
134
+ if @api_client.config.client_side_validation && page < 0
135
+ fail ArgumentError, 'invalid value for "page" when calling FileApi.get_dataset_files_handler, must be greater than or equal to 0.'
136
+ end
137
+
138
+ # resource path
139
+ local_var_path = '/api/dataset/files/{dataset_id}/{page}'.sub('{' + 'dataset_id' + '}', CGI.escape(dataset_id.to_s)).sub('{' + 'page' + '}', CGI.escape(page.to_s))
140
+
141
+ # query parameters
142
+ query_params = opts[:query_params] || {}
143
+
144
+ # header parameters
145
+ header_params = opts[:header_params] || {}
146
+ # HTTP header 'Accept' (if needed)
147
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
148
+ header_params[:'TR-Dataset'] = tr_dataset
149
+
150
+ # form parameters
151
+ form_params = opts[:form_params] || {}
152
+
153
+ # http body (model)
154
+ post_body = opts[:debug_body]
155
+
156
+ # return_type
157
+ return_type = opts[:debug_return_type] || 'Array<File>'
158
+
159
+ # auth_names
160
+ auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
161
+
162
+ new_options = opts.merge(
163
+ :operation => :"FileApi.get_dataset_files_handler",
164
+ :header_params => header_params,
165
+ :query_params => query_params,
166
+ :form_params => form_params,
167
+ :body => post_body,
168
+ :auth_names => auth_names,
169
+ :return_type => return_type
170
+ )
171
+
172
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug "API called: FileApi#get_dataset_files_handler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
175
+ end
176
+ return data, status_code, headers
177
+ end
178
+
179
+ # get_file
180
+ # get_file Download a file from S3 attached to the server based on its id. We plan to add support for getting signed S3 URLs to download from S3 directly in a release soon.
181
+ # @param tr_dataset [String] The dataset id to use for the request
182
+ # @param file_id [String] The id of the file to fetch
183
+ # @param [Hash] opts the optional parameters
184
+ # @return [FileDTO]
185
+ def get_file_handler(tr_dataset, file_id, opts = {})
186
+ data, _status_code, _headers = get_file_handler_with_http_info(tr_dataset, file_id, opts)
187
+ data
188
+ end
189
+
190
+ # get_file
191
+ # get_file Download a file from S3 attached to the server based on its id. We plan to add support for getting signed S3 URLs to download from S3 directly in a release soon.
192
+ # @param tr_dataset [String] The dataset id to use for the request
193
+ # @param file_id [String] The id of the file to fetch
194
+ # @param [Hash] opts the optional parameters
195
+ # @return [Array<(FileDTO, Integer, Hash)>] FileDTO data, response status code and response headers
196
+ def get_file_handler_with_http_info(tr_dataset, file_id, opts = {})
197
+ if @api_client.config.debugging
198
+ @api_client.config.logger.debug 'Calling API: FileApi.get_file_handler ...'
199
+ end
200
+ # verify the required parameter 'tr_dataset' is set
201
+ if @api_client.config.client_side_validation && tr_dataset.nil?
202
+ fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling FileApi.get_file_handler"
203
+ end
204
+ # verify the required parameter 'file_id' is set
205
+ if @api_client.config.client_side_validation && file_id.nil?
206
+ fail ArgumentError, "Missing the required parameter 'file_id' when calling FileApi.get_file_handler"
207
+ end
208
+ # resource path
209
+ local_var_path = '/api/file/{file_id}'.sub('{' + 'file_id' + '}', CGI.escape(file_id.to_s))
210
+
211
+ # query parameters
212
+ query_params = opts[:query_params] || {}
213
+
214
+ # header parameters
215
+ header_params = opts[:header_params] || {}
216
+ # HTTP header 'Accept' (if needed)
217
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
218
+ header_params[:'TR-Dataset'] = tr_dataset
219
+
220
+ # form parameters
221
+ form_params = opts[:form_params] || {}
222
+
223
+ # http body (model)
224
+ post_body = opts[:debug_body]
225
+
226
+ # return_type
227
+ return_type = opts[:debug_return_type] || 'FileDTO'
228
+
229
+ # auth_names
230
+ auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
231
+
232
+ new_options = opts.merge(
233
+ :operation => :"FileApi.get_file_handler",
234
+ :header_params => header_params,
235
+ :query_params => query_params,
236
+ :form_params => form_params,
237
+ :body => post_body,
238
+ :auth_names => auth_names,
239
+ :return_type => return_type
240
+ )
241
+
242
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug "API called: FileApi#get_file_handler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
245
+ end
246
+ return data, status_code, headers
247
+ end
248
+
249
+ # upload_file
250
+ # upload_file Upload a file to S3 attached to the server. The file will be converted to HTML with tika and chunked algorithmically, images will be OCR'ed with tesseract. The resulting chunks will be indexed and searchable. Optionally, you can only upload the file and manually create chunks associated to the file after. See docs.trieve.ai and/or contact us for more details and tips. Auth'ed user must be an admin or owner of the dataset's organization to upload a file.
251
+ # @param tr_dataset [String] The dataset id to use for the request
252
+ # @param upload_file_data [UploadFileData] JSON request payload to upload a file
253
+ # @param [Hash] opts the optional parameters
254
+ # @return [UploadFileResult]
255
+ def upload_file_handler(tr_dataset, upload_file_data, opts = {})
256
+ data, _status_code, _headers = upload_file_handler_with_http_info(tr_dataset, upload_file_data, opts)
257
+ data
258
+ end
259
+
260
+ # upload_file
261
+ # upload_file Upload a file to S3 attached to the server. The file will be converted to HTML with tika and chunked algorithmically, images will be OCR&#39;ed with tesseract. The resulting chunks will be indexed and searchable. Optionally, you can only upload the file and manually create chunks associated to the file after. See docs.trieve.ai and/or contact us for more details and tips. Auth&#39;ed user must be an admin or owner of the dataset&#39;s organization to upload a file.
262
+ # @param tr_dataset [String] The dataset id to use for the request
263
+ # @param upload_file_data [UploadFileData] JSON request payload to upload a file
264
+ # @param [Hash] opts the optional parameters
265
+ # @return [Array<(UploadFileResult, Integer, Hash)>] UploadFileResult data, response status code and response headers
266
+ def upload_file_handler_with_http_info(tr_dataset, upload_file_data, opts = {})
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug 'Calling API: FileApi.upload_file_handler ...'
269
+ end
270
+ # verify the required parameter 'tr_dataset' is set
271
+ if @api_client.config.client_side_validation && tr_dataset.nil?
272
+ fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling FileApi.upload_file_handler"
273
+ end
274
+ # verify the required parameter 'upload_file_data' is set
275
+ if @api_client.config.client_side_validation && upload_file_data.nil?
276
+ fail ArgumentError, "Missing the required parameter 'upload_file_data' when calling FileApi.upload_file_handler"
277
+ end
278
+ # resource path
279
+ local_var_path = '/api/file'
280
+
281
+ # query parameters
282
+ query_params = opts[:query_params] || {}
283
+
284
+ # header parameters
285
+ header_params = opts[:header_params] || {}
286
+ # HTTP header 'Accept' (if needed)
287
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
288
+ # HTTP header 'Content-Type'
289
+ content_type = @api_client.select_header_content_type(['application/json'])
290
+ if !content_type.nil?
291
+ header_params['Content-Type'] = content_type
292
+ end
293
+ header_params[:'TR-Dataset'] = tr_dataset
294
+
295
+ # form parameters
296
+ form_params = opts[:form_params] || {}
297
+
298
+ # http body (model)
299
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_file_data)
300
+
301
+ # return_type
302
+ return_type = opts[:debug_return_type] || 'UploadFileResult'
303
+
304
+ # auth_names
305
+ auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
306
+
307
+ new_options = opts.merge(
308
+ :operation => :"FileApi.upload_file_handler",
309
+ :header_params => header_params,
310
+ :query_params => query_params,
311
+ :form_params => form_params,
312
+ :body => post_body,
313
+ :auth_names => auth_names,
314
+ :return_type => return_type
315
+ )
316
+
317
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: FileApi#upload_file_handler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ return data, status_code, headers
322
+ end
323
+ end
324
+ end
@@ -0,0 +1,75 @@
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 'cgi'
14
+
15
+ module TrieveRubyClient
16
+ class HealthApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # @param [Hash] opts the optional parameters
23
+ # @return [nil]
24
+ def health_check(opts = {})
25
+ health_check_with_http_info(opts)
26
+ nil
27
+ end
28
+
29
+ # @param [Hash] opts the optional parameters
30
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
31
+ def health_check_with_http_info(opts = {})
32
+ if @api_client.config.debugging
33
+ @api_client.config.logger.debug 'Calling API: HealthApi.health_check ...'
34
+ end
35
+ # resource path
36
+ local_var_path = '/api/health'
37
+
38
+ # query parameters
39
+ query_params = opts[:query_params] || {}
40
+
41
+ # header parameters
42
+ header_params = opts[:header_params] || {}
43
+ # HTTP header 'Accept' (if needed)
44
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
45
+
46
+ # form parameters
47
+ form_params = opts[:form_params] || {}
48
+
49
+ # http body (model)
50
+ post_body = opts[:debug_body]
51
+
52
+ # return_type
53
+ return_type = opts[:debug_return_type]
54
+
55
+ # auth_names
56
+ auth_names = opts[:debug_auth_names] || []
57
+
58
+ new_options = opts.merge(
59
+ :operation => :"HealthApi.health_check",
60
+ :header_params => header_params,
61
+ :query_params => query_params,
62
+ :form_params => form_params,
63
+ :body => post_body,
64
+ :auth_names => auth_names,
65
+ :return_type => return_type
66
+ )
67
+
68
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
69
+ if @api_client.config.debugging
70
+ @api_client.config.logger.debug "API called: HealthApi#health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
71
+ end
72
+ return data, status_code, headers
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,97 @@
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 'cgi'
14
+
15
+ module TrieveRubyClient
16
+ class InvitationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # send_invitation
23
+ # send_invitation Invitations act as a way to invite users to join an organization. After a user is invited, they will automatically be added to the organization with the role specified in the invitation once they set their.
24
+ # @param tr_organization [String] The organization id to use for the request
25
+ # @param invitation_data [InvitationData] JSON request payload to send an invitation
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [nil]
28
+ def post_invitation(tr_organization, invitation_data, opts = {})
29
+ post_invitation_with_http_info(tr_organization, invitation_data, opts)
30
+ nil
31
+ end
32
+
33
+ # send_invitation
34
+ # send_invitation Invitations act as a way to invite users to join an organization. After a user is invited, they will automatically be added to the organization with the role specified in the invitation once they set their.
35
+ # @param tr_organization [String] The organization id to use for the request
36
+ # @param invitation_data [InvitationData] JSON request payload to send an invitation
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
+ def post_invitation_with_http_info(tr_organization, invitation_data, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: InvitationApi.post_invitation ...'
42
+ end
43
+ # verify the required parameter 'tr_organization' is set
44
+ if @api_client.config.client_side_validation && tr_organization.nil?
45
+ fail ArgumentError, "Missing the required parameter 'tr_organization' when calling InvitationApi.post_invitation"
46
+ end
47
+ # verify the required parameter 'invitation_data' is set
48
+ if @api_client.config.client_side_validation && invitation_data.nil?
49
+ fail ArgumentError, "Missing the required parameter 'invitation_data' when calling InvitationApi.post_invitation"
50
+ end
51
+ # resource path
52
+ local_var_path = '/api/invitation'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+ header_params[:'TR-Organization'] = tr_organization
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(invitation_data)
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type]
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"InvitationApi.post_invitation",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: InvitationApi#post_invitation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+ end
97
+ end