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,85 @@
1
+ # TrieveRubyClient::InvitationApi
2
+
3
+ All URIs are relative to *http://localhost*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**post_invitation**](InvitationApi.md#post_invitation) | **POST** /api/invitation | send_invitation |
8
+
9
+
10
+ ## post_invitation
11
+
12
+ > post_invitation(tr_organization, invitation_data)
13
+
14
+ send_invitation
15
+
16
+ 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.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'trieve_ruby_client'
23
+ # setup authorization
24
+ TrieveRubyClient.configure do |config|
25
+ # Configure API key authorization: Cookie
26
+ config.api_key['Cookie'] = 'YOUR API KEY'
27
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
28
+ # config.api_key_prefix['Cookie'] = 'Bearer'
29
+
30
+ # Configure API key authorization: ApiKey
31
+ config.api_key['ApiKey'] = 'YOUR API KEY'
32
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
33
+ # config.api_key_prefix['ApiKey'] = 'Bearer'
34
+ end
35
+
36
+ api_instance = TrieveRubyClient::InvitationApi.new
37
+ tr_organization = 'tr_organization_example' # String | The organization id to use for the request
38
+ invitation_data = TrieveRubyClient::InvitationData.new({app_url: 'app_url_example', email: 'email_example', organization_id: 'organization_id_example', redirect_uri: 'redirect_uri_example', user_role: 37}) # InvitationData | JSON request payload to send an invitation
39
+
40
+ begin
41
+ # send_invitation
42
+ api_instance.post_invitation(tr_organization, invitation_data)
43
+ rescue TrieveRubyClient::ApiError => e
44
+ puts "Error when calling InvitationApi->post_invitation: #{e}"
45
+ end
46
+ ```
47
+
48
+ #### Using the post_invitation_with_http_info variant
49
+
50
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
51
+
52
+ > <Array(nil, Integer, Hash)> post_invitation_with_http_info(tr_organization, invitation_data)
53
+
54
+ ```ruby
55
+ begin
56
+ # send_invitation
57
+ data, status_code, headers = api_instance.post_invitation_with_http_info(tr_organization, invitation_data)
58
+ p status_code # => 2xx
59
+ p headers # => { ... }
60
+ p data # => nil
61
+ rescue TrieveRubyClient::ApiError => e
62
+ puts "Error when calling InvitationApi->post_invitation_with_http_info: #{e}"
63
+ end
64
+ ```
65
+
66
+ ### Parameters
67
+
68
+ | Name | Type | Description | Notes |
69
+ | ---- | ---- | ----------- | ----- |
70
+ | **tr_organization** | **String** | The organization id to use for the request | |
71
+ | **invitation_data** | [**InvitationData**](InvitationData.md) | JSON request payload to send an invitation | |
72
+
73
+ ### Return type
74
+
75
+ nil (empty response body)
76
+
77
+ ### Authorization
78
+
79
+ [Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
80
+
81
+ ### HTTP request headers
82
+
83
+ - **Content-Type**: application/json
84
+ - **Accept**: application/json
85
+
@@ -0,0 +1,26 @@
1
+ # TrieveRubyClient::InvitationData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **app_url** | **String** | The url of the app that the user will be directed to in order to set their password. Usually admin.trieve.ai, but may differ for local dev or self-hosted setups. | |
8
+ | **email** | **String** | The email of the user to invite. Must be a valid email as they will be sent an email to register. | |
9
+ | **organization_id** | **String** | The id of the organization to invite the user to. | |
10
+ | **redirect_uri** | **String** | The url that the user will be redirected to after setting their password. | |
11
+ | **user_role** | **Integer** | The role the user will have in the organization. 0 &#x3D; User, 1 &#x3D; Admin, 2 &#x3D; Owner. | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'trieve_ruby_client'
17
+
18
+ instance = TrieveRubyClient::InvitationData.new(
19
+ app_url: null,
20
+ email: null,
21
+ organization_id: null,
22
+ redirect_uri: null,
23
+ user_role: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,49 @@
1
+ # TrieveRubyClient::MatchCondition
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'trieve_ruby_client'
13
+
14
+ TrieveRubyClient::MatchCondition.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'Integer',
18
+ # :'String'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'trieve_ruby_client'
30
+
31
+ TrieveRubyClient::MatchCondition.build(data)
32
+ # => #<Integer:0x00007fdd4aab02a0>
33
+
34
+ TrieveRubyClient::MatchCondition.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `Integer`
47
+ - `String`
48
+ - `nil` (if no type matches)
49
+
data/docs/Message.md ADDED
@@ -0,0 +1,38 @@
1
+ # TrieveRubyClient::Message
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **completion_tokens** | **Integer** | | [optional] |
8
+ | **content** | **String** | | |
9
+ | **created_at** | **Time** | | |
10
+ | **dataset_id** | **String** | | |
11
+ | **deleted** | **Boolean** | | |
12
+ | **id** | **String** | | |
13
+ | **prompt_tokens** | **Integer** | | [optional] |
14
+ | **role** | **String** | | |
15
+ | **sort_order** | **Integer** | | |
16
+ | **topic_id** | **String** | | |
17
+ | **updated_at** | **Time** | | |
18
+
19
+ ## Example
20
+
21
+ ```ruby
22
+ require 'trieve_ruby_client'
23
+
24
+ instance = TrieveRubyClient::Message.new(
25
+ completion_tokens: null,
26
+ content: null,
27
+ created_at: null,
28
+ dataset_id: null,
29
+ deleted: null,
30
+ id: null,
31
+ prompt_tokens: null,
32
+ role: null,
33
+ sort_order: null,
34
+ topic_id: null,
35
+ updated_at: null
36
+ )
37
+ ```
38
+
@@ -0,0 +1,322 @@
1
+ # TrieveRubyClient::MessageApi
2
+
3
+ All URIs are relative to *http://localhost*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**create_message_completion_handler**](MessageApi.md#create_message_completion_handler) | **POST** /api/message | create_message |
8
+ | [**edit_message_handler**](MessageApi.md#edit_message_handler) | **PUT** /api/message | edit_message |
9
+ | [**get_all_topic_messages**](MessageApi.md#get_all_topic_messages) | **GET** /api/messages/{messages_topic_id} | get_all_messages |
10
+ | [**regenerate_message_handler**](MessageApi.md#regenerate_message_handler) | **DELETE** /api/message | regenerate_message |
11
+
12
+
13
+ ## create_message_completion_handler
14
+
15
+ > String create_message_completion_handler(tr_dataset, create_message_data)
16
+
17
+ create_message
18
+
19
+ create_message Create a message. Messages are attached to topics in order to coordinate memory of gen-AI chat sessions. We are considering refactoring this resource of the API soon. Currently, you can only send user messages. If the topic is a RAG topic then the response will include Chunks first on the stream. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.
20
+
21
+ ### Examples
22
+
23
+ ```ruby
24
+ require 'time'
25
+ require 'trieve_ruby_client'
26
+ # setup authorization
27
+ TrieveRubyClient.configure do |config|
28
+ # Configure API key authorization: Cookie
29
+ config.api_key['Cookie'] = 'YOUR API KEY'
30
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
31
+ # config.api_key_prefix['Cookie'] = 'Bearer'
32
+
33
+ # Configure API key authorization: ApiKey
34
+ config.api_key['ApiKey'] = 'YOUR API KEY'
35
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
36
+ # config.api_key_prefix['ApiKey'] = 'Bearer'
37
+ end
38
+
39
+ api_instance = TrieveRubyClient::MessageApi.new
40
+ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
41
+ create_message_data = TrieveRubyClient::CreateMessageData.new({new_message_content: 'new_message_content_example', topic_id: 'topic_id_example'}) # CreateMessageData | JSON request payload to create a message completion
42
+
43
+ begin
44
+ # create_message
45
+ result = api_instance.create_message_completion_handler(tr_dataset, create_message_data)
46
+ p result
47
+ rescue TrieveRubyClient::ApiError => e
48
+ puts "Error when calling MessageApi->create_message_completion_handler: #{e}"
49
+ end
50
+ ```
51
+
52
+ #### Using the create_message_completion_handler_with_http_info variant
53
+
54
+ This returns an Array which contains the response data, status code and headers.
55
+
56
+ > <Array(String, Integer, Hash)> create_message_completion_handler_with_http_info(tr_dataset, create_message_data)
57
+
58
+ ```ruby
59
+ begin
60
+ # create_message
61
+ data, status_code, headers = api_instance.create_message_completion_handler_with_http_info(tr_dataset, create_message_data)
62
+ p status_code # => 2xx
63
+ p headers # => { ... }
64
+ p data # => String
65
+ rescue TrieveRubyClient::ApiError => e
66
+ puts "Error when calling MessageApi->create_message_completion_handler_with_http_info: #{e}"
67
+ end
68
+ ```
69
+
70
+ ### Parameters
71
+
72
+ | Name | Type | Description | Notes |
73
+ | ---- | ---- | ----------- | ----- |
74
+ | **tr_dataset** | **String** | The dataset id to use for the request | |
75
+ | **create_message_data** | [**CreateMessageData**](CreateMessageData.md) | JSON request payload to create a message completion | |
76
+
77
+ ### Return type
78
+
79
+ **String**
80
+
81
+ ### Authorization
82
+
83
+ [Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
84
+
85
+ ### HTTP request headers
86
+
87
+ - **Content-Type**: application/json
88
+ - **Accept**: text/plain, application/json
89
+
90
+
91
+ ## edit_message_handler
92
+
93
+ > edit_message_handler(tr_dataset, edit_message_data)
94
+
95
+ edit_message
96
+
97
+ edit_message Edit a message which exists within the topic's chat history. This will delete the message and replace it with a new message. The new message will be generated by the AI based on the new content provided in the request body. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.
98
+
99
+ ### Examples
100
+
101
+ ```ruby
102
+ require 'time'
103
+ require 'trieve_ruby_client'
104
+ # setup authorization
105
+ TrieveRubyClient.configure do |config|
106
+ # Configure API key authorization: Cookie
107
+ config.api_key['Cookie'] = 'YOUR API KEY'
108
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
109
+ # config.api_key_prefix['Cookie'] = 'Bearer'
110
+
111
+ # Configure API key authorization: ApiKey
112
+ config.api_key['ApiKey'] = 'YOUR API KEY'
113
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
114
+ # config.api_key_prefix['ApiKey'] = 'Bearer'
115
+ end
116
+
117
+ api_instance = TrieveRubyClient::MessageApi.new
118
+ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
119
+ edit_message_data = TrieveRubyClient::EditMessageData.new({message_sort_order: 37, new_message_content: 'new_message_content_example', topic_id: 'topic_id_example'}) # EditMessageData | JSON request payload to edit a message and get a new stream
120
+
121
+ begin
122
+ # edit_message
123
+ api_instance.edit_message_handler(tr_dataset, edit_message_data)
124
+ rescue TrieveRubyClient::ApiError => e
125
+ puts "Error when calling MessageApi->edit_message_handler: #{e}"
126
+ end
127
+ ```
128
+
129
+ #### Using the edit_message_handler_with_http_info variant
130
+
131
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
132
+
133
+ > <Array(nil, Integer, Hash)> edit_message_handler_with_http_info(tr_dataset, edit_message_data)
134
+
135
+ ```ruby
136
+ begin
137
+ # edit_message
138
+ data, status_code, headers = api_instance.edit_message_handler_with_http_info(tr_dataset, edit_message_data)
139
+ p status_code # => 2xx
140
+ p headers # => { ... }
141
+ p data # => nil
142
+ rescue TrieveRubyClient::ApiError => e
143
+ puts "Error when calling MessageApi->edit_message_handler_with_http_info: #{e}"
144
+ end
145
+ ```
146
+
147
+ ### Parameters
148
+
149
+ | Name | Type | Description | Notes |
150
+ | ---- | ---- | ----------- | ----- |
151
+ | **tr_dataset** | **String** | The dataset id to use for the request | |
152
+ | **edit_message_data** | [**EditMessageData**](EditMessageData.md) | JSON request payload to edit a message and get a new stream | |
153
+
154
+ ### Return type
155
+
156
+ nil (empty response body)
157
+
158
+ ### Authorization
159
+
160
+ [Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
161
+
162
+ ### HTTP request headers
163
+
164
+ - **Content-Type**: application/json
165
+ - **Accept**: application/json
166
+
167
+
168
+ ## get_all_topic_messages
169
+
170
+ > <Array<Message>> get_all_topic_messages(tr_dataset, messages_topic_id)
171
+
172
+ get_all_messages
173
+
174
+ get_all_messages Get all messages for a given topic. If the topic is a RAG topic then the response will include Chunks first on each message. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.
175
+
176
+ ### Examples
177
+
178
+ ```ruby
179
+ require 'time'
180
+ require 'trieve_ruby_client'
181
+ # setup authorization
182
+ TrieveRubyClient.configure do |config|
183
+ # Configure API key authorization: Cookie
184
+ config.api_key['Cookie'] = 'YOUR API KEY'
185
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
186
+ # config.api_key_prefix['Cookie'] = 'Bearer'
187
+
188
+ # Configure API key authorization: ApiKey
189
+ config.api_key['ApiKey'] = 'YOUR API KEY'
190
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
191
+ # config.api_key_prefix['ApiKey'] = 'Bearer'
192
+ end
193
+
194
+ api_instance = TrieveRubyClient::MessageApi.new
195
+ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
196
+ messages_topic_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The ID of the topic to get messages for.
197
+
198
+ begin
199
+ # get_all_messages
200
+ result = api_instance.get_all_topic_messages(tr_dataset, messages_topic_id)
201
+ p result
202
+ rescue TrieveRubyClient::ApiError => e
203
+ puts "Error when calling MessageApi->get_all_topic_messages: #{e}"
204
+ end
205
+ ```
206
+
207
+ #### Using the get_all_topic_messages_with_http_info variant
208
+
209
+ This returns an Array which contains the response data, status code and headers.
210
+
211
+ > <Array(<Array<Message>>, Integer, Hash)> get_all_topic_messages_with_http_info(tr_dataset, messages_topic_id)
212
+
213
+ ```ruby
214
+ begin
215
+ # get_all_messages
216
+ data, status_code, headers = api_instance.get_all_topic_messages_with_http_info(tr_dataset, messages_topic_id)
217
+ p status_code # => 2xx
218
+ p headers # => { ... }
219
+ p data # => <Array<Message>>
220
+ rescue TrieveRubyClient::ApiError => e
221
+ puts "Error when calling MessageApi->get_all_topic_messages_with_http_info: #{e}"
222
+ end
223
+ ```
224
+
225
+ ### Parameters
226
+
227
+ | Name | Type | Description | Notes |
228
+ | ---- | ---- | ----------- | ----- |
229
+ | **tr_dataset** | **String** | The dataset id to use for the request | |
230
+ | **messages_topic_id** | **String** | The ID of the topic to get messages for. | |
231
+
232
+ ### Return type
233
+
234
+ [**Array&lt;Message&gt;**](Message.md)
235
+
236
+ ### Authorization
237
+
238
+ [Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
239
+
240
+ ### HTTP request headers
241
+
242
+ - **Content-Type**: Not defined
243
+ - **Accept**: application/json
244
+
245
+
246
+ ## regenerate_message_handler
247
+
248
+ > String regenerate_message_handler(tr_dataset, regenerate_message_data)
249
+
250
+ regenerate_message
251
+
252
+ regenerate_message Regenerate the assistant response to the last user message of a topic. This will delete the last message and replace it with a new message. The response will include Chunks first on the stream if the topic is using RAG. The structure will look like `[chunks]||mesage`. See docs.trieve.ai for more information.
253
+
254
+ ### Examples
255
+
256
+ ```ruby
257
+ require 'time'
258
+ require 'trieve_ruby_client'
259
+ # setup authorization
260
+ TrieveRubyClient.configure do |config|
261
+ # Configure API key authorization: Cookie
262
+ config.api_key['Cookie'] = 'YOUR API KEY'
263
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
264
+ # config.api_key_prefix['Cookie'] = 'Bearer'
265
+
266
+ # Configure API key authorization: ApiKey
267
+ config.api_key['ApiKey'] = 'YOUR API KEY'
268
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
269
+ # config.api_key_prefix['ApiKey'] = 'Bearer'
270
+ end
271
+
272
+ api_instance = TrieveRubyClient::MessageApi.new
273
+ tr_dataset = 'tr_dataset_example' # String | The dataset id to use for the request
274
+ regenerate_message_data = TrieveRubyClient::RegenerateMessageData.new({topic_id: 'topic_id_example'}) # RegenerateMessageData | JSON request payload to delete an agent message then regenerate it in a strem
275
+
276
+ begin
277
+ # regenerate_message
278
+ result = api_instance.regenerate_message_handler(tr_dataset, regenerate_message_data)
279
+ p result
280
+ rescue TrieveRubyClient::ApiError => e
281
+ puts "Error when calling MessageApi->regenerate_message_handler: #{e}"
282
+ end
283
+ ```
284
+
285
+ #### Using the regenerate_message_handler_with_http_info variant
286
+
287
+ This returns an Array which contains the response data, status code and headers.
288
+
289
+ > <Array(String, Integer, Hash)> regenerate_message_handler_with_http_info(tr_dataset, regenerate_message_data)
290
+
291
+ ```ruby
292
+ begin
293
+ # regenerate_message
294
+ data, status_code, headers = api_instance.regenerate_message_handler_with_http_info(tr_dataset, regenerate_message_data)
295
+ p status_code # => 2xx
296
+ p headers # => { ... }
297
+ p data # => String
298
+ rescue TrieveRubyClient::ApiError => e
299
+ puts "Error when calling MessageApi->regenerate_message_handler_with_http_info: #{e}"
300
+ end
301
+ ```
302
+
303
+ ### Parameters
304
+
305
+ | Name | Type | Description | Notes |
306
+ | ---- | ---- | ----------- | ----- |
307
+ | **tr_dataset** | **String** | The dataset id to use for the request | |
308
+ | **regenerate_message_data** | [**RegenerateMessageData**](RegenerateMessageData.md) | JSON request payload to delete an agent message then regenerate it in a strem | |
309
+
310
+ ### Return type
311
+
312
+ **String**
313
+
314
+ ### Authorization
315
+
316
+ [Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
317
+
318
+ ### HTTP request headers
319
+
320
+ - **Content-Type**: application/json
321
+ - **Accept**: text/plain, application/json
322
+
@@ -0,0 +1,26 @@
1
+ # TrieveRubyClient::Organization
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **created_at** | **Time** | | |
8
+ | **id** | **String** | | |
9
+ | **name** | **String** | | |
10
+ | **registerable** | **Boolean** | | [optional] |
11
+ | **updated_at** | **Time** | | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'trieve_ruby_client'
17
+
18
+ instance = TrieveRubyClient::Organization.new(
19
+ created_at: null,
20
+ id: null,
21
+ name: null,
22
+ registerable: null,
23
+ updated_at: null
24
+ )
25
+ ```
26
+