trieve_ruby_client 0.8.0 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -30
  3. data/docs/ApiKeyRespBody.md +32 -0
  4. data/docs/AutocompleteData.md +42 -0
  5. data/docs/AutocompleteReqPayload.md +50 -0
  6. data/docs/BoostPhrase.md +20 -0
  7. data/docs/ChunkApi.md +140 -66
  8. data/docs/ChunkData.md +2 -0
  9. data/docs/ChunkFilter.md +3 -3
  10. data/docs/ChunkGroup.md +1 -1
  11. data/docs/ChunkGroupApi.md +35 -33
  12. data/docs/ChunkMetadata.md +5 -3
  13. data/docs/ChunkMetadataStringTagSet.md +46 -0
  14. data/docs/ChunkMetadataTypes.md +51 -0
  15. data/docs/ChunkMetadataWithScore.md +0 -2
  16. data/docs/ChunkReqPayload.md +50 -0
  17. data/docs/ClientDatasetConfiguration.md +0 -2
  18. data/docs/ConditionType.md +49 -0
  19. data/docs/ContentChunkMetadata.md +32 -0
  20. data/docs/CreateChunkGroupReqPayload.md +28 -0
  21. data/docs/CreateChunkReqPayloadEnum.md +49 -0
  22. data/docs/CreateDatasetRequest.md +2 -2
  23. data/docs/CreateMessageData.md +2 -2
  24. data/docs/CreateMessageReqPayload.md +42 -0
  25. data/docs/CreateTopicReqPayload.md +22 -0
  26. data/docs/Dataset.md +2 -0
  27. data/docs/DatasetApi.md +236 -12
  28. data/docs/DateRange.md +24 -0
  29. data/docs/EditMessageReqPayload.md +44 -0
  30. data/docs/FieldCondition.md +2 -0
  31. data/docs/File.md +1 -1
  32. data/docs/FileApi.md +7 -7
  33. data/docs/GenerateChunksRequest.md +2 -0
  34. data/docs/GetDatasetsPagination.md +20 -0
  35. data/docs/GroupScoreSlimChunks.md +4 -0
  36. data/docs/HasIDCondition.md +20 -0
  37. data/docs/InvitationApi.md +1 -1
  38. data/docs/MatchCondition.md +3 -1
  39. data/docs/MessageApi.md +42 -42
  40. data/docs/Organization.md +2 -0
  41. data/docs/OrganizationApi.md +24 -25
  42. data/docs/RangeCondition.md +1 -3
  43. data/docs/RecommendChunksRequest.md +1 -1
  44. data/docs/RecommendGroupChunksRequest.md +1 -1
  45. data/docs/RegenerateMessageReqPayload.md +40 -0
  46. data/docs/RemoveChunkFromGroupReqPayload.md +18 -0
  47. data/docs/ScoreChunkDTO.md +3 -1
  48. data/docs/SearchChunkData.md +12 -6
  49. data/docs/SearchChunksReqPayload.md +54 -0
  50. data/docs/SearchOverGroupsData.md +12 -4
  51. data/docs/SearchWithinGroupData.md +16 -6
  52. data/docs/SetUserApiKeyRequest.md +4 -0
  53. data/docs/SlimChunkMetadata.md +4 -0
  54. data/docs/SuggestedQueriesReqPayload.md +18 -0
  55. data/docs/TopicApi.md +16 -16
  56. data/docs/UpdateChunkData.md +2 -0
  57. data/docs/UpdateChunkReqPayload.md +46 -0
  58. data/docs/UpdateDatasetRequest.md +2 -0
  59. data/docs/UpdateGroupByTrackingIDReqPayload.md +26 -0
  60. data/docs/UpdateTopicReqPayload.md +20 -0
  61. data/docs/UpdateUserOrgRoleData.md +1 -1
  62. data/docs/UploadFileReqPayload.md +40 -0
  63. data/docs/UserApi.md +7 -8
  64. data/lib/trieve_ruby_client/api/auth_api.rb +1 -1
  65. data/lib/trieve_ruby_client/api/chunk_api.rb +158 -83
  66. data/lib/trieve_ruby_client/api/chunk_group_api.rb +58 -51
  67. data/lib/trieve_ruby_client/api/dataset_api.rb +224 -15
  68. data/lib/trieve_ruby_client/api/events_api.rb +1 -1
  69. data/lib/trieve_ruby_client/api/file_api.rb +12 -12
  70. data/lib/trieve_ruby_client/api/health_api.rb +1 -1
  71. data/lib/trieve_ruby_client/api/invitation_api.rb +3 -3
  72. data/lib/trieve_ruby_client/api/message_api.rb +50 -50
  73. data/lib/trieve_ruby_client/api/organization_api.rb +27 -27
  74. data/lib/trieve_ruby_client/api/stripe_api.rb +1 -1
  75. data/lib/trieve_ruby_client/api/topic_api.rb +27 -27
  76. data/lib/trieve_ruby_client/api/user_api.rb +8 -8
  77. data/lib/trieve_ruby_client/api_client.rb +1 -1
  78. data/lib/trieve_ruby_client/api_error.rb +1 -1
  79. data/lib/trieve_ruby_client/configuration.rb +1 -1
  80. data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +1 -1
  81. data/lib/trieve_ruby_client/models/api_key_dto.rb +1 -1
  82. data/lib/trieve_ruby_client/models/api_key_resp_body.rb +325 -0
  83. data/lib/trieve_ruby_client/models/auth_query.rb +1 -1
  84. data/lib/trieve_ruby_client/models/autocomplete_data.rb +378 -0
  85. data/lib/trieve_ruby_client/models/autocomplete_req_payload.rb +467 -0
  86. data/lib/trieve_ruby_client/models/batch_queued_chunk_response.rb +1 -1
  87. data/lib/trieve_ruby_client/models/bookmark_data.rb +1 -1
  88. data/lib/trieve_ruby_client/models/bookmark_group_result.rb +1 -1
  89. data/lib/trieve_ruby_client/models/boost_phrase.rb +240 -0
  90. data/lib/trieve_ruby_client/models/chat_message_proxy.rb +1 -1
  91. data/lib/trieve_ruby_client/models/chunk_data.rb +15 -2
  92. data/lib/trieve_ruby_client/models/chunk_filter.rb +4 -4
  93. data/lib/trieve_ruby_client/models/chunk_group.rb +5 -3
  94. data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +1 -1
  95. data/lib/trieve_ruby_client/models/chunk_metadata.rb +28 -20
  96. data/lib/trieve_ruby_client/models/chunk_metadata_string_tag_set.rb +387 -0
  97. data/lib/trieve_ruby_client/models/chunk_metadata_types.rb +106 -0
  98. data/lib/trieve_ruby_client/models/chunk_metadata_with_score.rb +2 -18
  99. data/lib/trieve_ruby_client/models/chunk_req_payload.rb +400 -0
  100. data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +2 -18
  101. data/lib/trieve_ruby_client/models/condition_type.rb +105 -0
  102. data/lib/trieve_ruby_client/models/content_chunk_metadata.rb +299 -0
  103. data/lib/trieve_ruby_client/models/create_chunk_data.rb +1 -1
  104. data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +1 -1
  105. data/lib/trieve_ruby_client/models/create_chunk_group_req_payload.rb +273 -0
  106. data/lib/trieve_ruby_client/models/create_chunk_req_payload_enum.rb +105 -0
  107. data/lib/trieve_ruby_client/models/create_dataset_request.rb +3 -3
  108. data/lib/trieve_ruby_client/models/create_message_data.rb +13 -13
  109. data/lib/trieve_ruby_client/models/create_message_req_payload.rb +378 -0
  110. data/lib/trieve_ruby_client/models/create_organization_data.rb +1 -1
  111. data/lib/trieve_ruby_client/models/create_topic_data.rb +1 -1
  112. data/lib/trieve_ruby_client/models/create_topic_req_payload.rb +244 -0
  113. data/lib/trieve_ruby_client/models/dataset.rb +18 -2
  114. data/lib/trieve_ruby_client/models/dataset_and_usage.rb +1 -1
  115. data/lib/trieve_ruby_client/models/dataset_dto.rb +1 -1
  116. data/lib/trieve_ruby_client/models/dataset_usage_count.rb +1 -1
  117. data/lib/trieve_ruby_client/models/date_range.rb +245 -0
  118. data/lib/trieve_ruby_client/models/delete_topic_data.rb +1 -1
  119. data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +1 -1
  120. data/lib/trieve_ruby_client/models/edit_message_data.rb +1 -1
  121. data/lib/trieve_ruby_client/models/edit_message_req_payload.rb +395 -0
  122. data/lib/trieve_ruby_client/models/error_response_body.rb +1 -1
  123. data/lib/trieve_ruby_client/models/event.rb +1 -1
  124. data/lib/trieve_ruby_client/models/event_return.rb +1 -1
  125. data/lib/trieve_ruby_client/models/field_condition.rb +12 -2
  126. data/lib/trieve_ruby_client/models/file.rb +5 -3
  127. data/lib/trieve_ruby_client/models/file_dto.rb +1 -1
  128. data/lib/trieve_ruby_client/models/generate_chunks_request.rb +13 -2
  129. data/lib/trieve_ruby_client/models/geo_info.rb +1 -1
  130. data/lib/trieve_ruby_client/models/geo_types.rb +1 -1
  131. data/lib/trieve_ruby_client/models/get_chunks_data.rb +1 -1
  132. data/lib/trieve_ruby_client/models/get_datasets_pagination.rb +225 -0
  133. data/lib/trieve_ruby_client/models/get_events_data.rb +1 -1
  134. data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +1 -1
  135. data/lib/trieve_ruby_client/models/get_tracking_chunks_data.rb +1 -1
  136. data/lib/trieve_ruby_client/models/group_data.rb +1 -1
  137. data/lib/trieve_ruby_client/models/group_score_chunk.rb +1 -1
  138. data/lib/trieve_ruby_client/models/group_score_slim_chunks.rb +22 -2
  139. data/lib/trieve_ruby_client/models/has_id_condition.rb +229 -0
  140. data/lib/trieve_ruby_client/models/invitation_data.rb +1 -1
  141. data/lib/trieve_ruby_client/models/location_bounding_box.rb +1 -1
  142. data/lib/trieve_ruby_client/models/location_polygon.rb +1 -1
  143. data/lib/trieve_ruby_client/models/location_radius.rb +1 -1
  144. data/lib/trieve_ruby_client/models/match_condition.rb +2 -1
  145. data/lib/trieve_ruby_client/models/message.rb +1 -1
  146. data/lib/trieve_ruby_client/models/organization.rb +18 -2
  147. data/lib/trieve_ruby_client/models/organization_usage_count.rb +1 -1
  148. data/lib/trieve_ruby_client/models/range.rb +1 -1
  149. data/lib/trieve_ruby_client/models/range_condition.rb +2 -3
  150. data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +2 -2
  151. data/lib/trieve_ruby_client/models/recommend_group_chunks_request.rb +2 -2
  152. data/lib/trieve_ruby_client/models/regenerate_message_data.rb +1 -1
  153. data/lib/trieve_ruby_client/models/regenerate_message_req_payload.rb +361 -0
  154. data/lib/trieve_ruby_client/models/remove_chunk_from_group_req_payload.rb +222 -0
  155. data/lib/trieve_ruby_client/models/return_queued_chunk.rb +1 -1
  156. data/lib/trieve_ruby_client/models/score_chunk_dto.rb +15 -3
  157. data/lib/trieve_ruby_client/models/score_slim_chunks.rb +1 -1
  158. data/lib/trieve_ruby_client/models/search_chunk_data.rb +49 -14
  159. data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +1 -1
  160. data/lib/trieve_ruby_client/models/search_chunks_req_payload.rb +504 -0
  161. data/lib/trieve_ruby_client/models/search_over_groups_data.rb +95 -6
  162. data/lib/trieve_ruby_client/models/search_over_groups_results.rb +1 -1
  163. data/lib/trieve_ruby_client/models/search_over_groups_slim_results.rb +1 -1
  164. data/lib/trieve_ruby_client/models/search_slim_chunk_query_response_body.rb +1 -1
  165. data/lib/trieve_ruby_client/models/search_within_group_data.rb +119 -17
  166. data/lib/trieve_ruby_client/models/search_within_group_results.rb +1 -1
  167. data/lib/trieve_ruby_client/models/search_within_group_slim_results.rb +1 -1
  168. data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +28 -2
  169. data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +1 -1
  170. data/lib/trieve_ruby_client/models/single_queued_chunk_response.rb +1 -1
  171. data/lib/trieve_ruby_client/models/slim_chunk_metadata.rb +24 -2
  172. data/lib/trieve_ruby_client/models/slim_chunk_metadata_with_score.rb +1 -1
  173. data/lib/trieve_ruby_client/models/slim_group.rb +1 -1
  174. data/lib/trieve_ruby_client/models/slim_user.rb +1 -1
  175. data/lib/trieve_ruby_client/models/stripe_plan.rb +1 -1
  176. data/lib/trieve_ruby_client/models/suggested_queries_req_payload.rb +222 -0
  177. data/lib/trieve_ruby_client/models/suggested_queries_request.rb +1 -1
  178. data/lib/trieve_ruby_client/models/suggested_queries_response.rb +1 -1
  179. data/lib/trieve_ruby_client/models/topic.rb +1 -1
  180. data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +1 -1
  181. data/lib/trieve_ruby_client/models/update_chunk_data.rb +15 -2
  182. data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +1 -1
  183. data/lib/trieve_ruby_client/models/update_chunk_req_payload.rb +376 -0
  184. data/lib/trieve_ruby_client/models/update_dataset_request.rb +13 -2
  185. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +1 -1
  186. data/lib/trieve_ruby_client/models/update_group_by_tracking_id_req_payload.rb +268 -0
  187. data/lib/trieve_ruby_client/models/update_organization_data.rb +1 -1
  188. data/lib/trieve_ruby_client/models/update_topic_data.rb +1 -1
  189. data/lib/trieve_ruby_client/models/update_topic_req_payload.rb +239 -0
  190. data/lib/trieve_ruby_client/models/update_user_org_role_data.rb +2 -2
  191. data/lib/trieve_ruby_client/models/upload_file_data.rb +1 -1
  192. data/lib/trieve_ruby_client/models/upload_file_req_payload.rb +368 -0
  193. data/lib/trieve_ruby_client/models/upload_file_result.rb +1 -1
  194. data/lib/trieve_ruby_client/models/user_organization.rb +1 -1
  195. data/lib/trieve_ruby_client/version.rb +2 -2
  196. data/lib/trieve_ruby_client.rb +25 -20
  197. data/openapi-generator.yaml +1 -1
  198. data/openapi.json +1 -7784
  199. data/spec/models/api_key_resp_body_spec.rb +78 -0
  200. data/spec/models/autocomplete_data_spec.rb +108 -0
  201. data/spec/models/autocomplete_req_payload_spec.rb +132 -0
  202. data/spec/models/boost_phrase_spec.rb +42 -0
  203. data/spec/models/chunk_metadata_string_tag_set_spec.rb +120 -0
  204. data/spec/models/chunk_metadata_types_spec.rb +32 -0
  205. data/spec/models/chunk_req_payload_spec.rb +132 -0
  206. data/spec/models/condition_type_spec.rb +32 -0
  207. data/spec/models/content_chunk_metadata_spec.rb +72 -0
  208. data/spec/models/create_chunk_group_req_payload_spec.rb +66 -0
  209. data/spec/models/create_chunk_req_payload_enum_spec.rb +32 -0
  210. data/spec/models/create_message_req_payload_spec.rb +108 -0
  211. data/spec/models/create_topic_req_payload_spec.rb +48 -0
  212. data/spec/models/date_range_spec.rb +54 -0
  213. data/spec/models/edit_message_req_payload_spec.rb +114 -0
  214. data/spec/models/get_datasets_pagination_spec.rb +42 -0
  215. data/spec/models/has_id_condition_spec.rb +42 -0
  216. data/spec/models/regenerate_message_req_payload_spec.rb +102 -0
  217. data/spec/models/remove_chunk_from_group_req_payload_spec.rb +36 -0
  218. data/spec/models/search_chunks_req_payload_spec.rb +144 -0
  219. data/spec/models/suggested_queries_req_payload_spec.rb +36 -0
  220. data/spec/models/update_chunk_req_payload_spec.rb +120 -0
  221. data/spec/models/update_group_by_tracking_id_req_payload_spec.rb +60 -0
  222. data/spec/models/update_topic_req_payload_spec.rb +42 -0
  223. data/spec/models/upload_file_req_payload_spec.rb +102 -0
  224. data/spec/spec_helper.rb +1 -1
  225. data/trieve_ruby_client-0.8.0.gem +0 -0
  226. data/trieve_ruby_client-0.8.2.gem +0 -0
  227. data/trieve_ruby_client-0.8.5.gem +0 -0
  228. data/trieve_ruby_client.gemspec +1 -1
  229. metadata +105 -2
@@ -0,0 +1,395 @@
1
+ =begin
2
+ #Trieve API
3
+
4
+ #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
+
6
+ The version of the OpenAPI document: 0.10.7
7
+ Contact: developers@trieve.ai
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrieveRubyClient
17
+ class EditMessageReqPayload
18
+ # Completion first decides whether the stream should contain the stream of the completion response or the chunks first. Default is false. Keep in mind that || is used to separate the chunks from the completion response. If || is in the completion then you may want to split on ||{ instead.
19
+ attr_accessor :completion_first
20
+
21
+ attr_accessor :filters
22
+
23
+ # Frequency penalty is a number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Default is 0.7.
24
+ attr_accessor :frequency_penalty
25
+
26
+ # Whether or not to highlight the citations in the response. If this is set to true or not included, the citations will be highlighted. If this is set to false, the citations will not be highlighted. Default is true.
27
+ attr_accessor :highlight_citations
28
+
29
+ # The delimiters to use for highlighting the citations. If this is not included, the default delimiters will be used. Default is `[\".\", \"!\", \"?\", \"\\n\", \"\\t\", \",\"]`.
30
+ attr_accessor :highlight_delimiters
31
+
32
+ # The maximum number of tokens to generate in the chat completion.
33
+ attr_accessor :max_tokens
34
+
35
+ # The sort order of the message to edit.
36
+ attr_accessor :message_sort_order
37
+
38
+ # The new content of the message to replace the old content with.
39
+ attr_accessor :new_message_content
40
+
41
+ # Presence penalty is a number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
42
+ attr_accessor :presence_penalty
43
+
44
+ # Search_type can be either \"semantic\", \"fulltext\", or \"hybrid\". \"hybrid\" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using BAAI/bge-reranker-large. \"semantic\" will pull in one page (10 chunks) of the nearest cosine distant vectors. \"fulltext\" will pull in one page (10 chunks) of full-text results based on SPLADE.
45
+ attr_accessor :search_type
46
+
47
+ # Stop tokens are up to 4 sequences where the API will stop generating further tokens.
48
+ attr_accessor :stop_tokens
49
+
50
+ # Whether or not to stream the response. If this is set to true or not included, the response will be a stream. If this is set to false, the response will be a normal JSON response. Default is true.
51
+ attr_accessor :stream_response
52
+
53
+ # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Default is 0.7.
54
+ attr_accessor :temperature
55
+
56
+ # The id of the topic to edit the message at the given sort order for.
57
+ attr_accessor :topic_id
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'completion_first' => :'completion_first',
63
+ :'filters' => :'filters',
64
+ :'frequency_penalty' => :'frequency_penalty',
65
+ :'highlight_citations' => :'highlight_citations',
66
+ :'highlight_delimiters' => :'highlight_delimiters',
67
+ :'max_tokens' => :'max_tokens',
68
+ :'message_sort_order' => :'message_sort_order',
69
+ :'new_message_content' => :'new_message_content',
70
+ :'presence_penalty' => :'presence_penalty',
71
+ :'search_type' => :'search_type',
72
+ :'stop_tokens' => :'stop_tokens',
73
+ :'stream_response' => :'stream_response',
74
+ :'temperature' => :'temperature',
75
+ :'topic_id' => :'topic_id'
76
+ }
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'completion_first' => :'Boolean',
88
+ :'filters' => :'ChunkFilter',
89
+ :'frequency_penalty' => :'Float',
90
+ :'highlight_citations' => :'Boolean',
91
+ :'highlight_delimiters' => :'Array<String>',
92
+ :'max_tokens' => :'Integer',
93
+ :'message_sort_order' => :'Integer',
94
+ :'new_message_content' => :'String',
95
+ :'presence_penalty' => :'Float',
96
+ :'search_type' => :'String',
97
+ :'stop_tokens' => :'Array<String>',
98
+ :'stream_response' => :'Boolean',
99
+ :'temperature' => :'Float',
100
+ :'topic_id' => :'String'
101
+ }
102
+ end
103
+
104
+ # List of attributes with nullable: true
105
+ def self.openapi_nullable
106
+ Set.new([
107
+ :'completion_first',
108
+ :'filters',
109
+ :'frequency_penalty',
110
+ :'highlight_citations',
111
+ :'highlight_delimiters',
112
+ :'max_tokens',
113
+ :'presence_penalty',
114
+ :'search_type',
115
+ :'stop_tokens',
116
+ :'stream_response',
117
+ :'temperature',
118
+ ])
119
+ end
120
+
121
+ # Initializes the object
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ def initialize(attributes = {})
124
+ if (!attributes.is_a?(Hash))
125
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrieveRubyClient::EditMessageReqPayload` initialize method"
126
+ end
127
+
128
+ # check to see if the attribute exists and convert string to symbol for hash key
129
+ attributes = attributes.each_with_object({}) { |(k, v), h|
130
+ if (!self.class.attribute_map.key?(k.to_sym))
131
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrieveRubyClient::EditMessageReqPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
132
+ end
133
+ h[k.to_sym] = v
134
+ }
135
+
136
+ if attributes.key?(:'completion_first')
137
+ self.completion_first = attributes[:'completion_first']
138
+ end
139
+
140
+ if attributes.key?(:'filters')
141
+ self.filters = attributes[:'filters']
142
+ end
143
+
144
+ if attributes.key?(:'frequency_penalty')
145
+ self.frequency_penalty = attributes[:'frequency_penalty']
146
+ end
147
+
148
+ if attributes.key?(:'highlight_citations')
149
+ self.highlight_citations = attributes[:'highlight_citations']
150
+ end
151
+
152
+ if attributes.key?(:'highlight_delimiters')
153
+ if (value = attributes[:'highlight_delimiters']).is_a?(Array)
154
+ self.highlight_delimiters = value
155
+ end
156
+ end
157
+
158
+ if attributes.key?(:'max_tokens')
159
+ self.max_tokens = attributes[:'max_tokens']
160
+ end
161
+
162
+ if attributes.key?(:'message_sort_order')
163
+ self.message_sort_order = attributes[:'message_sort_order']
164
+ else
165
+ self.message_sort_order = nil
166
+ end
167
+
168
+ if attributes.key?(:'new_message_content')
169
+ self.new_message_content = attributes[:'new_message_content']
170
+ else
171
+ self.new_message_content = nil
172
+ end
173
+
174
+ if attributes.key?(:'presence_penalty')
175
+ self.presence_penalty = attributes[:'presence_penalty']
176
+ end
177
+
178
+ if attributes.key?(:'search_type')
179
+ self.search_type = attributes[:'search_type']
180
+ end
181
+
182
+ if attributes.key?(:'stop_tokens')
183
+ if (value = attributes[:'stop_tokens']).is_a?(Array)
184
+ self.stop_tokens = value
185
+ end
186
+ end
187
+
188
+ if attributes.key?(:'stream_response')
189
+ self.stream_response = attributes[:'stream_response']
190
+ end
191
+
192
+ if attributes.key?(:'temperature')
193
+ self.temperature = attributes[:'temperature']
194
+ end
195
+
196
+ if attributes.key?(:'topic_id')
197
+ self.topic_id = attributes[:'topic_id']
198
+ else
199
+ self.topic_id = nil
200
+ end
201
+ end
202
+
203
+ # Show invalid properties with the reasons. Usually used together with valid?
204
+ # @return Array for valid properties with the reasons
205
+ def list_invalid_properties
206
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
207
+ invalid_properties = Array.new
208
+ if !@max_tokens.nil? && @max_tokens < 0
209
+ invalid_properties.push('invalid value for "max_tokens", must be greater than or equal to 0.')
210
+ end
211
+
212
+ if @message_sort_order.nil?
213
+ invalid_properties.push('invalid value for "message_sort_order", message_sort_order cannot be nil.')
214
+ end
215
+
216
+ if @new_message_content.nil?
217
+ invalid_properties.push('invalid value for "new_message_content", new_message_content cannot be nil.')
218
+ end
219
+
220
+ if @topic_id.nil?
221
+ invalid_properties.push('invalid value for "topic_id", topic_id cannot be nil.')
222
+ end
223
+
224
+ invalid_properties
225
+ end
226
+
227
+ # Check to see if the all the properties in the model are valid
228
+ # @return true if the model is valid
229
+ def valid?
230
+ warn '[DEPRECATED] the `valid?` method is obsolete'
231
+ return false if !@max_tokens.nil? && @max_tokens < 0
232
+ return false if @message_sort_order.nil?
233
+ return false if @new_message_content.nil?
234
+ return false if @topic_id.nil?
235
+ true
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param [Object] max_tokens Value to be assigned
240
+ def max_tokens=(max_tokens)
241
+ if !max_tokens.nil? && max_tokens < 0
242
+ fail ArgumentError, 'invalid value for "max_tokens", must be greater than or equal to 0.'
243
+ end
244
+
245
+ @max_tokens = max_tokens
246
+ end
247
+
248
+ # Checks equality by comparing each attribute.
249
+ # @param [Object] Object to be compared
250
+ def ==(o)
251
+ return true if self.equal?(o)
252
+ self.class == o.class &&
253
+ completion_first == o.completion_first &&
254
+ filters == o.filters &&
255
+ frequency_penalty == o.frequency_penalty &&
256
+ highlight_citations == o.highlight_citations &&
257
+ highlight_delimiters == o.highlight_delimiters &&
258
+ max_tokens == o.max_tokens &&
259
+ message_sort_order == o.message_sort_order &&
260
+ new_message_content == o.new_message_content &&
261
+ presence_penalty == o.presence_penalty &&
262
+ search_type == o.search_type &&
263
+ stop_tokens == o.stop_tokens &&
264
+ stream_response == o.stream_response &&
265
+ temperature == o.temperature &&
266
+ topic_id == o.topic_id
267
+ end
268
+
269
+ # @see the `==` method
270
+ # @param [Object] Object to be compared
271
+ def eql?(o)
272
+ self == o
273
+ end
274
+
275
+ # Calculates hash code according to all attributes.
276
+ # @return [Integer] Hash code
277
+ def hash
278
+ [completion_first, filters, frequency_penalty, highlight_citations, highlight_delimiters, max_tokens, message_sort_order, new_message_content, presence_penalty, search_type, stop_tokens, stream_response, temperature, topic_id].hash
279
+ end
280
+
281
+ # Builds the object from hash
282
+ # @param [Hash] attributes Model attributes in the form of hash
283
+ # @return [Object] Returns the model itself
284
+ def self.build_from_hash(attributes)
285
+ return nil unless attributes.is_a?(Hash)
286
+ attributes = attributes.transform_keys(&:to_sym)
287
+ transformed_hash = {}
288
+ openapi_types.each_pair do |key, type|
289
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
290
+ transformed_hash["#{key}"] = nil
291
+ elsif type =~ /\AArray<(.*)>/i
292
+ # check to ensure the input is an array given that the attribute
293
+ # is documented as an array but the input is not
294
+ if attributes[attribute_map[key]].is_a?(Array)
295
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
296
+ end
297
+ elsif !attributes[attribute_map[key]].nil?
298
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
299
+ end
300
+ end
301
+ new(transformed_hash)
302
+ end
303
+
304
+ # Deserializes the data based on type
305
+ # @param string type Data type
306
+ # @param string value Value to be deserialized
307
+ # @return [Object] Deserialized data
308
+ def self._deserialize(type, value)
309
+ case type.to_sym
310
+ when :Time
311
+ Time.parse(value)
312
+ when :Date
313
+ Date.parse(value)
314
+ when :String
315
+ value.to_s
316
+ when :Integer
317
+ value.to_i
318
+ when :Float
319
+ value.to_f
320
+ when :Boolean
321
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
322
+ true
323
+ else
324
+ false
325
+ end
326
+ when :Object
327
+ # generic object (usually a Hash), return directly
328
+ value
329
+ when /\AArray<(?<inner_type>.+)>\z/
330
+ inner_type = Regexp.last_match[:inner_type]
331
+ value.map { |v| _deserialize(inner_type, v) }
332
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
333
+ k_type = Regexp.last_match[:k_type]
334
+ v_type = Regexp.last_match[:v_type]
335
+ {}.tap do |hash|
336
+ value.each do |k, v|
337
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
338
+ end
339
+ end
340
+ else # model
341
+ # models (e.g. Pet) or oneOf
342
+ klass = TrieveRubyClient.const_get(type)
343
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
344
+ end
345
+ end
346
+
347
+ # Returns the string representation of the object
348
+ # @return [String] String presentation of the object
349
+ def to_s
350
+ to_hash.to_s
351
+ end
352
+
353
+ # to_body is an alias to to_hash (backward compatibility)
354
+ # @return [Hash] Returns the object in the form of hash
355
+ def to_body
356
+ to_hash
357
+ end
358
+
359
+ # Returns the object in the form of hash
360
+ # @return [Hash] Returns the object in the form of hash
361
+ def to_hash
362
+ hash = {}
363
+ self.class.attribute_map.each_pair do |attr, param|
364
+ value = self.send(attr)
365
+ if value.nil?
366
+ is_nullable = self.class.openapi_nullable.include?(attr)
367
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
368
+ end
369
+
370
+ hash[param] = _to_hash(value)
371
+ end
372
+ hash
373
+ end
374
+
375
+ # Outputs non-array value in the form of hash
376
+ # For object, use to_hash. Otherwise, just return the value
377
+ # @param [Object] value Any valid value
378
+ # @return [Hash] Returns the value in the form of hash
379
+ def _to_hash(value)
380
+ if value.is_a?(Array)
381
+ value.compact.map { |v| _to_hash(v) }
382
+ elsif value.is_a?(Hash)
383
+ {}.tap do |hash|
384
+ value.each { |k, v| hash[k] = _to_hash(v) }
385
+ end
386
+ elsif value.respond_to? :to_hash
387
+ value.to_hash
388
+ else
389
+ value
390
+ end
391
+ end
392
+
393
+ end
394
+
395
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module TrieveRubyClient
17
17
  class FieldCondition
18
+ attr_accessor :date_range
19
+
18
20
  # Field is the name of the field to filter on. The field value will be used to check for an exact substring match on the metadata values for each existing chunk. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
19
21
  attr_accessor :field
20
22
 
@@ -32,6 +34,7 @@ module TrieveRubyClient
32
34
  # Attribute mapping from ruby-style variable name to JSON key.
33
35
  def self.attribute_map
34
36
  {
37
+ :'date_range' => :'date_range',
35
38
  :'field' => :'field',
36
39
  :'geo_bounding_box' => :'geo_bounding_box',
37
40
  :'geo_polygon' => :'geo_polygon',
@@ -49,6 +52,7 @@ module TrieveRubyClient
49
52
  # Attribute type mapping.
50
53
  def self.openapi_types
51
54
  {
55
+ :'date_range' => :'DateRange',
52
56
  :'field' => :'String',
53
57
  :'geo_bounding_box' => :'LocationBoundingBox',
54
58
  :'geo_polygon' => :'LocationPolygon',
@@ -61,6 +65,7 @@ module TrieveRubyClient
61
65
  # List of attributes with nullable: true
62
66
  def self.openapi_nullable
63
67
  Set.new([
68
+ :'date_range',
64
69
  :'geo_bounding_box',
65
70
  :'geo_polygon',
66
71
  :'geo_radius',
@@ -84,6 +89,10 @@ module TrieveRubyClient
84
89
  h[k.to_sym] = v
85
90
  }
86
91
 
92
+ if attributes.key?(:'date_range')
93
+ self.date_range = attributes[:'date_range']
94
+ end
95
+
87
96
  if attributes.key?(:'field')
88
97
  self.field = attributes[:'field']
89
98
  else
@@ -138,6 +147,7 @@ module TrieveRubyClient
138
147
  def ==(o)
139
148
  return true if self.equal?(o)
140
149
  self.class == o.class &&
150
+ date_range == o.date_range &&
141
151
  field == o.field &&
142
152
  geo_bounding_box == o.geo_bounding_box &&
143
153
  geo_polygon == o.geo_polygon &&
@@ -155,7 +165,7 @@ module TrieveRubyClient
155
165
  # Calculates hash code according to all attributes.
156
166
  # @return [Integer] Hash code
157
167
  def hash
158
- [field, geo_bounding_box, geo_polygon, geo_radius, match, range].hash
168
+ [date_range, field, geo_bounding_box, geo_polygon, geo_radius, match, range].hash
159
169
  end
160
170
 
161
171
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -66,7 +66,7 @@ module TrieveRubyClient
66
66
  :'link' => :'String',
67
67
  :'metadata' => :'Object',
68
68
  :'size' => :'Integer',
69
- :'tag_set' => :'String',
69
+ :'tag_set' => :'Array<String>',
70
70
  :'time_stamp' => :'Time',
71
71
  :'updated_at' => :'Time'
72
72
  }
@@ -136,7 +136,9 @@ module TrieveRubyClient
136
136
  end
137
137
 
138
138
  if attributes.key?(:'tag_set')
139
- self.tag_set = attributes[:'tag_set']
139
+ if (value = attributes[:'tag_set']).is_a?(Array)
140
+ self.tag_set = value
141
+ end
140
142
  end
141
143
 
142
144
  if attributes.key?(:'time_stamp')
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -18,6 +18,9 @@ module TrieveRubyClient
18
18
  # The ids of the chunks to be retrieved and injected into the context window for RAG.
19
19
  attr_accessor :chunk_ids
20
20
 
21
+ # Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<b><mark>`` tags to the chunk_html of the chunks to highlight matching splits.
22
+ attr_accessor :highlight_results
23
+
21
24
  # The previous messages to be placed into the chat history. The last message in this array will be the prompt for the model to inference on. The length of this array must be at least 1.
22
25
  attr_accessor :prev_messages
23
26
 
@@ -31,6 +34,7 @@ module TrieveRubyClient
31
34
  def self.attribute_map
32
35
  {
33
36
  :'chunk_ids' => :'chunk_ids',
37
+ :'highlight_results' => :'highlight_results',
34
38
  :'prev_messages' => :'prev_messages',
35
39
  :'prompt' => :'prompt',
36
40
  :'stream_response' => :'stream_response'
@@ -46,6 +50,7 @@ module TrieveRubyClient
46
50
  def self.openapi_types
47
51
  {
48
52
  :'chunk_ids' => :'Array<String>',
53
+ :'highlight_results' => :'Boolean',
49
54
  :'prev_messages' => :'Array<ChatMessageProxy>',
50
55
  :'prompt' => :'String',
51
56
  :'stream_response' => :'Boolean'
@@ -55,6 +60,7 @@ module TrieveRubyClient
55
60
  # List of attributes with nullable: true
56
61
  def self.openapi_nullable
57
62
  Set.new([
63
+ :'highlight_results',
58
64
  :'prompt',
59
65
  :'stream_response'
60
66
  ])
@@ -83,6 +89,10 @@ module TrieveRubyClient
83
89
  self.chunk_ids = nil
84
90
  end
85
91
 
92
+ if attributes.key?(:'highlight_results')
93
+ self.highlight_results = attributes[:'highlight_results']
94
+ end
95
+
86
96
  if attributes.key?(:'prev_messages')
87
97
  if (value = attributes[:'prev_messages']).is_a?(Array)
88
98
  self.prev_messages = value
@@ -131,6 +141,7 @@ module TrieveRubyClient
131
141
  return true if self.equal?(o)
132
142
  self.class == o.class &&
133
143
  chunk_ids == o.chunk_ids &&
144
+ highlight_results == o.highlight_results &&
134
145
  prev_messages == o.prev_messages &&
135
146
  prompt == o.prompt &&
136
147
  stream_response == o.stream_response
@@ -145,7 +156,7 @@ module TrieveRubyClient
145
156
  # Calculates hash code according to all attributes.
146
157
  # @return [Integer] Hash code
147
158
  def hash
148
- [chunk_ids, prev_messages, prompt, stream_response].hash
159
+ [chunk_ids, highlight_results, prev_messages, prompt, stream_response].hash
149
160
  end
150
161
 
151
162
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5
5
 
6
- The version of the OpenAPI document: 0.8.0
6
+ The version of the OpenAPI document: 0.10.7
7
7
  Contact: developers@trieve.ai
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.4.0